diff --git a/pkg/config-api-client/.openapi-generator/FILES b/pkg/config-api-client/.openapi-generator/FILES index 71636656..7c60a2f7 100644 --- a/pkg/config-api-client/.openapi-generator/FILES +++ b/pkg/config-api-client/.openapi-generator/FILES @@ -3,6 +3,8 @@ api/openapi.yaml api_configuration.go client.go configuration.go +docs/AgentItem.md +docs/AgentsResponse.md docs/ConfigurationAPI.md docs/ErrorDetail.md docs/ErrorResponse.md @@ -41,6 +43,8 @@ docs/WirelessNetworksItem.md docs/WirelessNetworksResponse.md go.mod go.sum +model_agent_item.go +model_agents_response.go model_error_detail.go model_error_response.go model_group.go diff --git a/pkg/config-api-client/README.md b/pkg/config-api-client/README.md index 86b6339d..7c149aa3 100644 --- a/pkg/config-api-client/README.md +++ b/pkg/config-api-client/README.md @@ -5,7 +5,7 @@ Nice description goes here ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 4.0.0 +- API version: 5.2.0 - Package version: 1.0.0 - Generator version: 7.9.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -79,6 +79,7 @@ All URIs are relative to *https://api.capenetworks.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ConfigurationAPI* | [**AgentsGet**](docs/ConfigurationAPI.md#agentsget) | **Get** /networking-uxi/v1alpha1/agents | Agents Get *ConfigurationAPI* | [**GroupsDelete**](docs/ConfigurationAPI.md#groupsdelete) | **Delete** /networking-uxi/v1alpha1/groups/{group_uid} | Groups Delete *ConfigurationAPI* | [**GroupsGet**](docs/ConfigurationAPI.md#groupsget) | **Get** /networking-uxi/v1alpha1/groups | Groups Get *ConfigurationAPI* | [**GroupsPatch**](docs/ConfigurationAPI.md#groupspatch) | **Patch** /networking-uxi/v1alpha1/groups/{group_uid} | Groups Patch @@ -100,6 +101,8 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AgentItem](docs/AgentItem.md) + - [AgentsResponse](docs/AgentsResponse.md) - [ErrorDetail](docs/ErrorDetail.md) - [ErrorResponse](docs/ErrorResponse.md) - [Group](docs/Group.md) diff --git a/pkg/config-api-client/api/.openapi.source.yaml b/pkg/config-api-client/api/.openapi.source.yaml index 0a409223..82a4cd56 100644 --- a/pkg/config-api-client/api/.openapi.source.yaml +++ b/pkg/config-api-client/api/.openapi.source.yaml @@ -9,11 +9,69 @@ info: email: support@capenetworks.com license: name: No idea, but we need something - version: 4.0.0 + version: 5.2.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io paths: + /networking-uxi/v1alpha1/agents: + get: + operationId: agents_get + summary: Agents Get + description: Get a list of agents + parameters: + - name: id + in: query + required: false + schema: + anyOf: + - type: string + nullable: true + title: Id + - name: next + in: query + required: false + schema: + anyOf: + - type: string + nullable: true + title: Next + - name: limit + in: query + required: false + schema: + type: integer + default: 50 + maximum: 100 + minimum: 0 + title: Limit + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentsResponse' + 4XX: + description: Client Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 5XX: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - HTTPBearer: [] + tags: + - api + - configuration + - v1alpha1 + - agents + x-stability-level: alpha /networking-uxi/v1alpha1/groups/{group_uid}: delete: operationId: groups_delete @@ -815,6 +873,80 @@ paths: x-stability-level: alpha components: schemas: + AgentItem: + type: object + properties: + id: + type: string + title: Id + serial: + type: string + title: Serial + name: + type: string + title: Name + modelNumber: + anyOf: + - type: string + nullable: true + title: Modelnumber + wifiMacAddress: + anyOf: + - type: string + nullable: true + title: Wifimacaddress + ethernetMacAddress: + anyOf: + - type: string + nullable: true + title: Ethernetmacaddress + notes: + anyOf: + - type: string + nullable: true + title: Notes + pcapMode: + anyOf: + - type: string + nullable: true + title: Pcapmode + type: + type: string + enum: + - networking-uxi/agent + title: Type + required: + - id + - serial + - name + - modelNumber + - wifiMacAddress + - ethernetMacAddress + - notes + - pcapMode + - type + title: AgentItem + AgentsResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/AgentItem' + title: Items + count: + type: integer + title: Count + next: + anyOf: + - type: string + nullable: true + title: Next + required: + - items + - count + - next + title: AgentsResponse ErrorDetail: type: object properties: @@ -1200,9 +1332,7 @@ components: type: string title: Name modelNumber: - anyOf: - - type: string - nullable: true + type: string title: Modelnumber wifiMacAddress: anyOf: @@ -1291,9 +1421,7 @@ components: type: string title: Name modelNumber: - anyOf: - - type: string - nullable: true + type: string title: Modelnumber wifiMacAddress: anyOf: @@ -1655,6 +1783,7 @@ tags: - name: v1 - name: v1alpha1 - name: configuration + - name: agents - name: groups - name: health - name: network-group-assignments diff --git a/pkg/config-api-client/api/openapi.yaml b/pkg/config-api-client/api/openapi.yaml index fb549494..dd382adf 100644 --- a/pkg/config-api-client/api/openapi.yaml +++ b/pkg/config-api-client/api/openapi.yaml @@ -9,7 +9,7 @@ info: name: "No idea, but we need something" termsOfService: http://we.dont.care.yet.com/term-of-service title: Configuration Api - version: 4.0.0 + version: 5.2.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -18,6 +18,7 @@ tags: - name: v1 - name: v1alpha1 - name: configuration +- name: agents - name: groups - name: health - name: network-group-assignments @@ -28,6 +29,63 @@ tags: - name: wired-networks - name: wireless-networks paths: + /networking-uxi/v1alpha1/agents: + get: + description: Get a list of agents + operationId: agents_get + parameters: + - explode: true + in: query + name: id + required: false + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: next + required: false + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: limit + required: false + schema: + default: 50 + maximum: 100 + minimum: 0 + title: Limit + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AgentsResponse' + description: Successful Response + "4XX": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Client Error + "5XX": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Server Error + security: + - HTTPBearer: [] + summary: Agents Get + tags: + - configuration + x-stability-level: alpha /networking-uxi/v1alpha1/groups/{group_uid}: delete: description: Delete an existing group. @@ -798,6 +856,100 @@ paths: x-stability-level: alpha components: schemas: + AgentItem: + example: + notes: notes + pcapMode: pcapMode + serial: serial + ethernetMacAddress: ethernetMacAddress + name: name + modelNumber: modelNumber + id: id + type: networking-uxi/agent + wifiMacAddress: wifiMacAddress + properties: + id: + title: Id + type: string + serial: + title: Serial + type: string + name: + title: Name + type: string + modelNumber: + nullable: true + type: string + wifiMacAddress: + nullable: true + type: string + ethernetMacAddress: + nullable: true + type: string + notes: + nullable: true + type: string + pcapMode: + nullable: true + type: string + type: + enum: + - networking-uxi/agent + title: Type + type: string + required: + - ethernetMacAddress + - id + - modelNumber + - name + - notes + - pcapMode + - serial + - type + - wifiMacAddress + title: AgentItem + type: object + AgentsResponse: + example: + next: next + count: 0 + items: + - notes: notes + pcapMode: pcapMode + serial: serial + ethernetMacAddress: ethernetMacAddress + name: name + modelNumber: modelNumber + id: id + type: networking-uxi/agent + wifiMacAddress: wifiMacAddress + - notes: notes + pcapMode: pcapMode + serial: serial + ethernetMacAddress: ethernetMacAddress + name: name + modelNumber: modelNumber + id: id + type: networking-uxi/agent + wifiMacAddress: wifiMacAddress + properties: + items: + items: + $ref: '#/components/schemas/AgentItem' + title: Items + type: array + count: + title: Count + type: integer + next: + nullable: true + type: string + required: + - count + - items + - next + title: AgentsResponse + type: object ErrorDetail: example: type: type @@ -827,7 +979,7 @@ components: errorCode: errorCode debugId: debugId message: message - httpStatusCode: 0 + httpStatusCode: 6 errorDetails: - type: type issues: @@ -1332,7 +1484,7 @@ components: title: Name type: string modelNumber: - nullable: true + title: Modelnumber type: string wifiMacAddress: nullable: true @@ -1421,7 +1573,7 @@ components: title: Name type: string modelNumber: - nullable: true + title: Modelnumber type: string wifiMacAddress: nullable: true diff --git a/pkg/config-api-client/api_configuration.go b/pkg/config-api-client/api_configuration.go index d5fb7dd1..f4240eee 100644 --- a/pkg/config-api-client/api_configuration.go +++ b/pkg/config-api-client/api_configuration.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ @@ -23,6 +23,157 @@ import ( // ConfigurationAPIService ConfigurationAPI service type ConfigurationAPIService service +type ApiAgentsGetRequest struct { + ctx context.Context + ApiService *ConfigurationAPIService + id *string + next *string + limit *int32 +} + +func (r ApiAgentsGetRequest) Id(id string) ApiAgentsGetRequest { + r.id = &id + return r +} + +func (r ApiAgentsGetRequest) Next(next string) ApiAgentsGetRequest { + r.next = &next + return r +} + +func (r ApiAgentsGetRequest) Limit(limit int32) ApiAgentsGetRequest { + r.limit = &limit + return r +} + +func (r ApiAgentsGetRequest) Execute() (*AgentsResponse, *http.Response, error) { + return r.ApiService.AgentsGetExecute(r) +} + +/* +AgentsGet Agents Get + +Get a list of agents + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAgentsGetRequest +*/ +func (a *ConfigurationAPIService) AgentsGet(ctx context.Context) ApiAgentsGetRequest { + return ApiAgentsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentsResponse +func (a *ConfigurationAPIService) AgentsGetExecute(r ApiAgentsGetRequest) (*AgentsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.AgentsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/networking-uxi/v1alpha1/agents" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.id != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") + } + if r.next != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "next", r.next, "form", "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 50 + r.limit = &defaultValue + } + // to determine the Content-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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ErrorResponse + 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 + } + if localVarHTTPResponse.StatusCode >= 500 { + var v ErrorResponse + 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 ApiGroupsDeleteRequest struct { ctx context.Context ApiService *ConfigurationAPIService diff --git a/pkg/config-api-client/client.go b/pkg/config-api-client/client.go index e1785e8f..2d78f019 100644 --- a/pkg/config-api-client/client.go +++ b/pkg/config-api-client/client.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ @@ -41,7 +41,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Configuration Api API v4.0.0 +// APIClient manages communication with the Configuration Api API v5.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/pkg/config-api-client/configuration.go b/pkg/config-api-client/configuration.go index c71928dd..3e321313 100644 --- a/pkg/config-api-client/configuration.go +++ b/pkg/config-api-client/configuration.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/docs/AgentItem.md b/pkg/config-api-client/docs/AgentItem.md new file mode 100644 index 00000000..aac24e61 --- /dev/null +++ b/pkg/config-api-client/docs/AgentItem.md @@ -0,0 +1,269 @@ +# AgentItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Serial** | **string** | | +**Name** | **string** | | +**ModelNumber** | **NullableString** | | +**WifiMacAddress** | **NullableString** | | +**EthernetMacAddress** | **NullableString** | | +**Notes** | **NullableString** | | +**PcapMode** | **NullableString** | | +**Type** | **string** | | + +## Methods + +### NewAgentItem + +`func NewAgentItem(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, notes NullableString, pcapMode NullableString, type_ string, ) *AgentItem` + +NewAgentItem instantiates a new AgentItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAgentItemWithDefaults + +`func NewAgentItemWithDefaults() *AgentItem` + +NewAgentItemWithDefaults instantiates a new AgentItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *AgentItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *AgentItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *AgentItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetSerial + +`func (o *AgentItem) GetSerial() string` + +GetSerial returns the Serial field if non-nil, zero value otherwise. + +### GetSerialOk + +`func (o *AgentItem) GetSerialOk() (*string, bool)` + +GetSerialOk returns a tuple with the Serial field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSerial + +`func (o *AgentItem) SetSerial(v string)` + +SetSerial sets Serial field to given value. + + +### GetName + +`func (o *AgentItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AgentItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AgentItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetModelNumber + +`func (o *AgentItem) GetModelNumber() string` + +GetModelNumber returns the ModelNumber field if non-nil, zero value otherwise. + +### GetModelNumberOk + +`func (o *AgentItem) GetModelNumberOk() (*string, bool)` + +GetModelNumberOk returns a tuple with the ModelNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModelNumber + +`func (o *AgentItem) SetModelNumber(v string)` + +SetModelNumber sets ModelNumber field to given value. + + +### SetModelNumberNil + +`func (o *AgentItem) SetModelNumberNil(b bool)` + + SetModelNumberNil sets the value for ModelNumber to be an explicit nil + +### UnsetModelNumber +`func (o *AgentItem) UnsetModelNumber()` + +UnsetModelNumber ensures that no value is present for ModelNumber, not even an explicit nil +### GetWifiMacAddress + +`func (o *AgentItem) GetWifiMacAddress() string` + +GetWifiMacAddress returns the WifiMacAddress field if non-nil, zero value otherwise. + +### GetWifiMacAddressOk + +`func (o *AgentItem) GetWifiMacAddressOk() (*string, bool)` + +GetWifiMacAddressOk returns a tuple with the WifiMacAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWifiMacAddress + +`func (o *AgentItem) SetWifiMacAddress(v string)` + +SetWifiMacAddress sets WifiMacAddress field to given value. + + +### SetWifiMacAddressNil + +`func (o *AgentItem) SetWifiMacAddressNil(b bool)` + + SetWifiMacAddressNil sets the value for WifiMacAddress to be an explicit nil + +### UnsetWifiMacAddress +`func (o *AgentItem) UnsetWifiMacAddress()` + +UnsetWifiMacAddress ensures that no value is present for WifiMacAddress, not even an explicit nil +### GetEthernetMacAddress + +`func (o *AgentItem) GetEthernetMacAddress() string` + +GetEthernetMacAddress returns the EthernetMacAddress field if non-nil, zero value otherwise. + +### GetEthernetMacAddressOk + +`func (o *AgentItem) GetEthernetMacAddressOk() (*string, bool)` + +GetEthernetMacAddressOk returns a tuple with the EthernetMacAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEthernetMacAddress + +`func (o *AgentItem) SetEthernetMacAddress(v string)` + +SetEthernetMacAddress sets EthernetMacAddress field to given value. + + +### SetEthernetMacAddressNil + +`func (o *AgentItem) SetEthernetMacAddressNil(b bool)` + + SetEthernetMacAddressNil sets the value for EthernetMacAddress to be an explicit nil + +### UnsetEthernetMacAddress +`func (o *AgentItem) UnsetEthernetMacAddress()` + +UnsetEthernetMacAddress ensures that no value is present for EthernetMacAddress, not even an explicit nil +### GetNotes + +`func (o *AgentItem) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *AgentItem) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *AgentItem) SetNotes(v string)` + +SetNotes sets Notes field to given value. + + +### SetNotesNil + +`func (o *AgentItem) SetNotesNil(b bool)` + + SetNotesNil sets the value for Notes to be an explicit nil + +### UnsetNotes +`func (o *AgentItem) UnsetNotes()` + +UnsetNotes ensures that no value is present for Notes, not even an explicit nil +### GetPcapMode + +`func (o *AgentItem) GetPcapMode() string` + +GetPcapMode returns the PcapMode field if non-nil, zero value otherwise. + +### GetPcapModeOk + +`func (o *AgentItem) GetPcapModeOk() (*string, bool)` + +GetPcapModeOk returns a tuple with the PcapMode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPcapMode + +`func (o *AgentItem) SetPcapMode(v string)` + +SetPcapMode sets PcapMode field to given value. + + +### SetPcapModeNil + +`func (o *AgentItem) SetPcapModeNil(b bool)` + + SetPcapModeNil sets the value for PcapMode to be an explicit nil + +### UnsetPcapMode +`func (o *AgentItem) UnsetPcapMode()` + +UnsetPcapMode ensures that no value is present for PcapMode, not even an explicit nil +### GetType + +`func (o *AgentItem) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *AgentItem) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *AgentItem) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/config-api-client/docs/AgentsResponse.md b/pkg/config-api-client/docs/AgentsResponse.md new file mode 100644 index 00000000..d2e9c489 --- /dev/null +++ b/pkg/config-api-client/docs/AgentsResponse.md @@ -0,0 +1,103 @@ +# AgentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | [**[]AgentItem**](AgentItem.md) | | +**Count** | **int32** | | +**Next** | **NullableString** | | + +## Methods + +### NewAgentsResponse + +`func NewAgentsResponse(items []AgentItem, count int32, next NullableString, ) *AgentsResponse` + +NewAgentsResponse instantiates a new AgentsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAgentsResponseWithDefaults + +`func NewAgentsResponseWithDefaults() *AgentsResponse` + +NewAgentsResponseWithDefaults instantiates a new AgentsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItems + +`func (o *AgentsResponse) GetItems() []AgentItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *AgentsResponse) GetItemsOk() (*[]AgentItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *AgentsResponse) SetItems(v []AgentItem)` + +SetItems sets Items field to given value. + + +### GetCount + +`func (o *AgentsResponse) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *AgentsResponse) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *AgentsResponse) SetCount(v int32)` + +SetCount sets Count field to given value. + + +### GetNext + +`func (o *AgentsResponse) GetNext() string` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *AgentsResponse) GetNextOk() (*string, bool)` + +GetNextOk returns a tuple with the Next field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNext + +`func (o *AgentsResponse) SetNext(v string)` + +SetNext sets Next field to given value. + + +### SetNextNil + +`func (o *AgentsResponse) SetNextNil(b bool)` + + SetNextNil sets the value for Next to be an explicit nil + +### UnsetNext +`func (o *AgentsResponse) UnsetNext()` + +UnsetNext ensures that no value is present for Next, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/config-api-client/docs/ConfigurationAPI.md b/pkg/config-api-client/docs/ConfigurationAPI.md index 22727038..a5b12965 100644 --- a/pkg/config-api-client/docs/ConfigurationAPI.md +++ b/pkg/config-api-client/docs/ConfigurationAPI.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.capenetworks.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**AgentsGet**](ConfigurationAPI.md#AgentsGet) | **Get** /networking-uxi/v1alpha1/agents | Agents Get [**GroupsDelete**](ConfigurationAPI.md#GroupsDelete) | **Delete** /networking-uxi/v1alpha1/groups/{group_uid} | Groups Delete [**GroupsGet**](ConfigurationAPI.md#GroupsGet) | **Get** /networking-uxi/v1alpha1/groups | Groups Get [**GroupsPatch**](ConfigurationAPI.md#GroupsPatch) | **Patch** /networking-uxi/v1alpha1/groups/{group_uid} | Groups Patch @@ -24,6 +25,76 @@ Method | HTTP request | Description +## AgentsGet + +> AgentsResponse AgentsGet(ctx).Id(id).Next(next).Limit(limit).Execute() + +Agents Get + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/config-api-client" +) + +func main() { + id := "id_example" // string | (optional) + next := "next_example" // string | (optional) + limit := int32(56) // int32 | (optional) (default to 50) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConfigurationAPI.AgentsGet(context.Background()).Id(id).Next(next).Limit(limit).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.AgentsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AgentsGet`: AgentsResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.AgentsGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAgentsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string** | | + **next** | **string** | | + **limit** | **int32** | | [default to 50] + +### Return type + +[**AgentsResponse**](AgentsResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GroupsDelete > interface{} GroupsDelete(ctx, groupUid).Execute() diff --git a/pkg/config-api-client/docs/SensorItem.md b/pkg/config-api-client/docs/SensorItem.md index b2f85c86..f6c9de51 100644 --- a/pkg/config-api-client/docs/SensorItem.md +++ b/pkg/config-api-client/docs/SensorItem.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Id** | **string** | | **Serial** | **string** | | **Name** | **string** | | -**ModelNumber** | **NullableString** | | +**ModelNumber** | **string** | | **WifiMacAddress** | **NullableString** | | **EthernetMacAddress** | **NullableString** | | **AddressNote** | **NullableString** | | @@ -21,7 +21,7 @@ Name | Type | Description | Notes ### NewSensorItem -`func NewSensorItem(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string, ) *SensorItem` +`func NewSensorItem(id string, serial string, name string, modelNumber string, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string, ) *SensorItem` NewSensorItem instantiates a new SensorItem object This constructor will assign default values to properties that have it defined, @@ -116,16 +116,6 @@ and a boolean to check if the value has been set. SetModelNumber sets ModelNumber field to given value. -### SetModelNumberNil - -`func (o *SensorItem) SetModelNumberNil(b bool)` - - SetModelNumberNil sets the value for ModelNumber to be an explicit nil - -### UnsetModelNumber -`func (o *SensorItem) UnsetModelNumber()` - -UnsetModelNumber ensures that no value is present for ModelNumber, not even an explicit nil ### GetWifiMacAddress `func (o *SensorItem) GetWifiMacAddress() string` diff --git a/pkg/config-api-client/docs/SensorsPatchResponse.md b/pkg/config-api-client/docs/SensorsPatchResponse.md index 140f71c9..e7e4d426 100644 --- a/pkg/config-api-client/docs/SensorsPatchResponse.md +++ b/pkg/config-api-client/docs/SensorsPatchResponse.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Id** | **string** | | **Serial** | **string** | | **Name** | **string** | | -**ModelNumber** | **NullableString** | | +**ModelNumber** | **string** | | **WifiMacAddress** | **NullableString** | | **EthernetMacAddress** | **NullableString** | | **AddressNote** | **NullableString** | | @@ -21,7 +21,7 @@ Name | Type | Description | Notes ### NewSensorsPatchResponse -`func NewSensorsPatchResponse(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string, ) *SensorsPatchResponse` +`func NewSensorsPatchResponse(id string, serial string, name string, modelNumber string, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string, ) *SensorsPatchResponse` NewSensorsPatchResponse instantiates a new SensorsPatchResponse object This constructor will assign default values to properties that have it defined, @@ -116,16 +116,6 @@ and a boolean to check if the value has been set. SetModelNumber sets ModelNumber field to given value. -### SetModelNumberNil - -`func (o *SensorsPatchResponse) SetModelNumberNil(b bool)` - - SetModelNumberNil sets the value for ModelNumber to be an explicit nil - -### UnsetModelNumber -`func (o *SensorsPatchResponse) UnsetModelNumber()` - -UnsetModelNumber ensures that no value is present for ModelNumber, not even an explicit nil ### GetWifiMacAddress `func (o *SensorsPatchResponse) GetWifiMacAddress() string` diff --git a/pkg/config-api-client/model_agent_item.go b/pkg/config-api-client/model_agent_item.go new file mode 100644 index 00000000..c137809c --- /dev/null +++ b/pkg/config-api-client/model_agent_item.go @@ -0,0 +1,391 @@ +/* +Configuration Api + +Nice description goes here + +API version: 5.2.0 +Contact: support@capenetworks.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package config_api_client + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AgentItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentItem{} + +// AgentItem struct for AgentItem +type AgentItem struct { + Id string `json:"id"` + Serial string `json:"serial"` + Name string `json:"name"` + ModelNumber NullableString `json:"modelNumber"` + WifiMacAddress NullableString `json:"wifiMacAddress"` + EthernetMacAddress NullableString `json:"ethernetMacAddress"` + Notes NullableString `json:"notes"` + PcapMode NullableString `json:"pcapMode"` + Type string `json:"type"` +} + +type _AgentItem AgentItem + +// NewAgentItem instantiates a new AgentItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentItem(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, notes NullableString, pcapMode NullableString, type_ string) *AgentItem { + this := AgentItem{} + this.Id = id + this.Serial = serial + this.Name = name + this.ModelNumber = modelNumber + this.WifiMacAddress = wifiMacAddress + this.EthernetMacAddress = ethernetMacAddress + this.Notes = notes + this.PcapMode = pcapMode + this.Type = type_ + return &this +} + +// NewAgentItemWithDefaults instantiates a new AgentItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentItemWithDefaults() *AgentItem { + this := AgentItem{} + return &this +} + +// GetId returns the Id field value +func (o *AgentItem) GetId() string { + if o == nil { + var ret string + 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 *AgentItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *AgentItem) SetId(v string) { + o.Id = v +} + +// GetSerial returns the Serial field value +func (o *AgentItem) GetSerial() string { + if o == nil { + var ret string + return ret + } + + return o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value +// and a boolean to check if the value has been set. +func (o *AgentItem) GetSerialOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Serial, true +} + +// SetSerial sets field value +func (o *AgentItem) SetSerial(v string) { + o.Serial = v +} + +// GetName returns the Name field value +func (o *AgentItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AgentItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AgentItem) SetName(v string) { + o.Name = v +} + +// GetModelNumber returns the ModelNumber field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentItem) GetModelNumber() string { + if o == nil || o.ModelNumber.Get() == nil { + var ret string + return ret + } + + return *o.ModelNumber.Get() +} + +// GetModelNumberOk returns a tuple with the ModelNumber 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 *AgentItem) GetModelNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ModelNumber.Get(), o.ModelNumber.IsSet() +} + +// SetModelNumber sets field value +func (o *AgentItem) SetModelNumber(v string) { + o.ModelNumber.Set(&v) +} + +// GetWifiMacAddress returns the WifiMacAddress field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentItem) GetWifiMacAddress() string { + if o == nil || o.WifiMacAddress.Get() == nil { + var ret string + return ret + } + + return *o.WifiMacAddress.Get() +} + +// GetWifiMacAddressOk returns a tuple with the WifiMacAddress 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 *AgentItem) GetWifiMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WifiMacAddress.Get(), o.WifiMacAddress.IsSet() +} + +// SetWifiMacAddress sets field value +func (o *AgentItem) SetWifiMacAddress(v string) { + o.WifiMacAddress.Set(&v) +} + +// GetEthernetMacAddress returns the EthernetMacAddress field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentItem) GetEthernetMacAddress() string { + if o == nil || o.EthernetMacAddress.Get() == nil { + var ret string + return ret + } + + return *o.EthernetMacAddress.Get() +} + +// GetEthernetMacAddressOk returns a tuple with the EthernetMacAddress 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 *AgentItem) GetEthernetMacAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EthernetMacAddress.Get(), o.EthernetMacAddress.IsSet() +} + +// SetEthernetMacAddress sets field value +func (o *AgentItem) SetEthernetMacAddress(v string) { + o.EthernetMacAddress.Set(&v) +} + +// GetNotes returns the Notes field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentItem) GetNotes() string { + if o == nil || o.Notes.Get() == nil { + var ret string + return ret + } + + return *o.Notes.Get() +} + +// GetNotesOk returns a tuple with the Notes 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 *AgentItem) GetNotesOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Notes.Get(), o.Notes.IsSet() +} + +// SetNotes sets field value +func (o *AgentItem) SetNotes(v string) { + o.Notes.Set(&v) +} + +// GetPcapMode returns the PcapMode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentItem) GetPcapMode() string { + if o == nil || o.PcapMode.Get() == nil { + var ret string + return ret + } + + return *o.PcapMode.Get() +} + +// GetPcapModeOk returns a tuple with the PcapMode 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 *AgentItem) GetPcapModeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PcapMode.Get(), o.PcapMode.IsSet() +} + +// SetPcapMode sets field value +func (o *AgentItem) SetPcapMode(v string) { + o.PcapMode.Set(&v) +} + +// GetType returns the Type field value +func (o *AgentItem) 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 *AgentItem) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AgentItem) SetType(v string) { + o.Type = v +} + +func (o AgentItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["serial"] = o.Serial + toSerialize["name"] = o.Name + toSerialize["modelNumber"] = o.ModelNumber.Get() + toSerialize["wifiMacAddress"] = o.WifiMacAddress.Get() + toSerialize["ethernetMacAddress"] = o.EthernetMacAddress.Get() + toSerialize["notes"] = o.Notes.Get() + toSerialize["pcapMode"] = o.PcapMode.Get() + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *AgentItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "serial", + "name", + "modelNumber", + "wifiMacAddress", + "ethernetMacAddress", + "notes", + "pcapMode", + "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) + } + } + + varAgentItem := _AgentItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAgentItem) + + if err != nil { + return err + } + + *o = AgentItem(varAgentItem) + + return err +} + +type NullableAgentItem struct { + value *AgentItem + isSet bool +} + +func (v NullableAgentItem) Get() *AgentItem { + return v.value +} + +func (v *NullableAgentItem) Set(val *AgentItem) { + v.value = val + v.isSet = true +} + +func (v NullableAgentItem) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentItem(val *AgentItem) *NullableAgentItem { + return &NullableAgentItem{value: val, isSet: true} +} + +func (v NullableAgentItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_agents_response.go b/pkg/config-api-client/model_agents_response.go new file mode 100644 index 00000000..37f76d7d --- /dev/null +++ b/pkg/config-api-client/model_agents_response.go @@ -0,0 +1,215 @@ +/* +Configuration Api + +Nice description goes here + +API version: 5.2.0 +Contact: support@capenetworks.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package config_api_client + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AgentsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentsResponse{} + +// AgentsResponse struct for AgentsResponse +type AgentsResponse struct { + Items []AgentItem `json:"items"` + Count int32 `json:"count"` + Next NullableString `json:"next"` +} + +type _AgentsResponse AgentsResponse + +// NewAgentsResponse instantiates a new AgentsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentsResponse(items []AgentItem, count int32, next NullableString) *AgentsResponse { + this := AgentsResponse{} + this.Items = items + this.Count = count + this.Next = next + return &this +} + +// NewAgentsResponseWithDefaults instantiates a new AgentsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentsResponseWithDefaults() *AgentsResponse { + this := AgentsResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AgentsResponse) GetItems() []AgentItem { + if o == nil { + var ret []AgentItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AgentsResponse) GetItemsOk() ([]AgentItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AgentsResponse) SetItems(v []AgentItem) { + o.Items = v +} + +// GetCount returns the Count field value +func (o *AgentsResponse) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *AgentsResponse) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *AgentsResponse) SetCount(v int32) { + o.Count = v +} + +// GetNext returns the Next field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentsResponse) GetNext() string { + if o == nil || o.Next.Get() == nil { + var ret string + return ret + } + + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next 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 *AgentsResponse) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// SetNext sets field value +func (o *AgentsResponse) SetNext(v string) { + o.Next.Set(&v) +} + +func (o AgentsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + toSerialize["count"] = o.Count + toSerialize["next"] = o.Next.Get() + return toSerialize, nil +} + +func (o *AgentsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + "count", + "next", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentsResponse := _AgentsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAgentsResponse) + + if err != nil { + return err + } + + *o = AgentsResponse(varAgentsResponse) + + return err +} + +type NullableAgentsResponse struct { + value *AgentsResponse + isSet bool +} + +func (v NullableAgentsResponse) Get() *AgentsResponse { + return v.value +} + +func (v *NullableAgentsResponse) Set(val *AgentsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAgentsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentsResponse(val *AgentsResponse) *NullableAgentsResponse { + return &NullableAgentsResponse{value: val, isSet: true} +} + +func (v NullableAgentsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_error_detail.go b/pkg/config-api-client/model_error_detail.go index d8a664c5..5b4befe3 100644 --- a/pkg/config-api-client/model_error_detail.go +++ b/pkg/config-api-client/model_error_detail.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_error_response.go b/pkg/config-api-client/model_error_response.go index 3cbd0853..59fa33bf 100644 --- a/pkg/config-api-client/model_error_response.go +++ b/pkg/config-api-client/model_error_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_group.go b/pkg/config-api-client/model_group.go index 6142d760..3351c017 100644 --- a/pkg/config-api-client/model_group.go +++ b/pkg/config-api-client/model_group.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_get_item.go b/pkg/config-api-client/model_groups_get_item.go index a38218cd..875f3523 100644 --- a/pkg/config-api-client/model_groups_get_item.go +++ b/pkg/config-api-client/model_groups_get_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_get_response.go b/pkg/config-api-client/model_groups_get_response.go index feb80bd6..61f69e0d 100644 --- a/pkg/config-api-client/model_groups_get_response.go +++ b/pkg/config-api-client/model_groups_get_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_patch_request.go b/pkg/config-api-client/model_groups_patch_request.go index 39200791..0acff2f0 100644 --- a/pkg/config-api-client/model_groups_patch_request.go +++ b/pkg/config-api-client/model_groups_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_patch_response.go b/pkg/config-api-client/model_groups_patch_response.go index f0d70a69..f3561513 100644 --- a/pkg/config-api-client/model_groups_patch_response.go +++ b/pkg/config-api-client/model_groups_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_post_request.go b/pkg/config-api-client/model_groups_post_request.go index 3cc0828e..3cafcb93 100644 --- a/pkg/config-api-client/model_groups_post_request.go +++ b/pkg/config-api-client/model_groups_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_post_response.go b/pkg/config-api-client/model_groups_post_response.go index 763e408c..aba0f8c1 100644 --- a/pkg/config-api-client/model_groups_post_response.go +++ b/pkg/config-api-client/model_groups_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue.go b/pkg/config-api-client/model_issue.go index a2c4175b..ad71fc6f 100644 --- a/pkg/config-api-client/model_issue.go +++ b/pkg/config-api-client/model_issue.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue_subject.go b/pkg/config-api-client/model_issue_subject.go index 31ea9b9a..2b9bf4d3 100644 --- a/pkg/config-api-client/model_issue_subject.go +++ b/pkg/config-api-client/model_issue_subject.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network.go b/pkg/config-api-client/model_network.go index 194e0ae2..6b60834f 100644 --- a/pkg/config-api-client/model_network.go +++ b/pkg/config-api-client/model_network.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_item.go b/pkg/config-api-client/model_network_group_assignments_item.go index ccd7187e..d7cddcb2 100644 --- a/pkg/config-api-client/model_network_group_assignments_item.go +++ b/pkg/config-api-client/model_network_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_post_request.go b/pkg/config-api-client/model_network_group_assignments_post_request.go index 70c547ad..c1812f4e 100644 --- a/pkg/config-api-client/model_network_group_assignments_post_request.go +++ b/pkg/config-api-client/model_network_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_post_response.go b/pkg/config-api-client/model_network_group_assignments_post_response.go index 8bb8f1b1..83a835ab 100644 --- a/pkg/config-api-client/model_network_group_assignments_post_response.go +++ b/pkg/config-api-client/model_network_group_assignments_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_response.go b/pkg/config-api-client/model_network_group_assignments_response.go index 7eaa75c2..a5619042 100644 --- a/pkg/config-api-client/model_network_group_assignments_response.go +++ b/pkg/config-api-client/model_network_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_parent.go b/pkg/config-api-client/model_parent.go index 8ae89e37..38539168 100644 --- a/pkg/config-api-client/model_parent.go +++ b/pkg/config-api-client/model_parent.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor.go b/pkg/config-api-client/model_sensor.go index 72b5daa6..4536e648 100644 --- a/pkg/config-api-client/model_sensor.go +++ b/pkg/config-api-client/model_sensor.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignment_response.go b/pkg/config-api-client/model_sensor_group_assignment_response.go index 85023589..6ae7f787 100644 --- a/pkg/config-api-client/model_sensor_group_assignment_response.go +++ b/pkg/config-api-client/model_sensor_group_assignment_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_item.go b/pkg/config-api-client/model_sensor_group_assignments_item.go index 7392d87e..4e93649f 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_item.go +++ b/pkg/config-api-client/model_sensor_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_post_request.go b/pkg/config-api-client/model_sensor_group_assignments_post_request.go index 8675446e..6dc18945 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_post_request.go +++ b/pkg/config-api-client/model_sensor_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_response.go b/pkg/config-api-client/model_sensor_group_assignments_response.go index 4d220ad1..5486c142 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_response.go +++ b/pkg/config-api-client/model_sensor_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_item.go b/pkg/config-api-client/model_sensor_item.go index 6294ab8e..a7da6742 100644 --- a/pkg/config-api-client/model_sensor_item.go +++ b/pkg/config-api-client/model_sensor_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ @@ -25,7 +25,7 @@ type SensorItem struct { Id string `json:"id"` Serial string `json:"serial"` Name string `json:"name"` - ModelNumber NullableString `json:"modelNumber"` + ModelNumber string `json:"modelNumber"` WifiMacAddress NullableString `json:"wifiMacAddress"` EthernetMacAddress NullableString `json:"ethernetMacAddress"` AddressNote NullableString `json:"addressNote"` @@ -42,7 +42,7 @@ type _SensorItem SensorItem // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSensorItem(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string) *SensorItem { +func NewSensorItem(id string, serial string, name string, modelNumber string, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string) *SensorItem { this := SensorItem{} this.Id = id this.Serial = serial @@ -140,29 +140,27 @@ func (o *SensorItem) SetName(v string) { } // GetModelNumber returns the ModelNumber field value -// If the value is explicit nil, the zero value for string will be returned func (o *SensorItem) GetModelNumber() string { - if o == nil || o.ModelNumber.Get() == nil { + if o == nil { var ret string return ret } - return *o.ModelNumber.Get() + return o.ModelNumber } // GetModelNumberOk returns a tuple with the ModelNumber 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 *SensorItem) GetModelNumberOk() (*string, bool) { if o == nil { return nil, false } - return o.ModelNumber.Get(), o.ModelNumber.IsSet() + return &o.ModelNumber, true } // SetModelNumber sets field value func (o *SensorItem) SetModelNumber(v string) { - o.ModelNumber.Set(&v) + o.ModelNumber = v } // GetWifiMacAddress returns the WifiMacAddress field value @@ -384,7 +382,7 @@ func (o SensorItem) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["serial"] = o.Serial toSerialize["name"] = o.Name - toSerialize["modelNumber"] = o.ModelNumber.Get() + toSerialize["modelNumber"] = o.ModelNumber toSerialize["wifiMacAddress"] = o.WifiMacAddress.Get() toSerialize["ethernetMacAddress"] = o.EthernetMacAddress.Get() toSerialize["addressNote"] = o.AddressNote.Get() diff --git a/pkg/config-api-client/model_sensors_patch_request.go b/pkg/config-api-client/model_sensors_patch_request.go index aaf9c96f..ed1991ad 100644 --- a/pkg/config-api-client/model_sensors_patch_request.go +++ b/pkg/config-api-client/model_sensors_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensors_patch_response.go b/pkg/config-api-client/model_sensors_patch_response.go index ed988134..eb8161df 100644 --- a/pkg/config-api-client/model_sensors_patch_response.go +++ b/pkg/config-api-client/model_sensors_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ @@ -25,7 +25,7 @@ type SensorsPatchResponse struct { Id string `json:"id"` Serial string `json:"serial"` Name string `json:"name"` - ModelNumber NullableString `json:"modelNumber"` + ModelNumber string `json:"modelNumber"` WifiMacAddress NullableString `json:"wifiMacAddress"` EthernetMacAddress NullableString `json:"ethernetMacAddress"` AddressNote NullableString `json:"addressNote"` @@ -42,7 +42,7 @@ type _SensorsPatchResponse SensorsPatchResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSensorsPatchResponse(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string) *SensorsPatchResponse { +func NewSensorsPatchResponse(id string, serial string, name string, modelNumber string, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullableString, type_ string) *SensorsPatchResponse { this := SensorsPatchResponse{} this.Id = id this.Serial = serial @@ -140,29 +140,27 @@ func (o *SensorsPatchResponse) SetName(v string) { } // GetModelNumber returns the ModelNumber field value -// If the value is explicit nil, the zero value for string will be returned func (o *SensorsPatchResponse) GetModelNumber() string { - if o == nil || o.ModelNumber.Get() == nil { + if o == nil { var ret string return ret } - return *o.ModelNumber.Get() + return o.ModelNumber } // GetModelNumberOk returns a tuple with the ModelNumber 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 *SensorsPatchResponse) GetModelNumberOk() (*string, bool) { if o == nil { return nil, false } - return o.ModelNumber.Get(), o.ModelNumber.IsSet() + return &o.ModelNumber, true } // SetModelNumber sets field value func (o *SensorsPatchResponse) SetModelNumber(v string) { - o.ModelNumber.Set(&v) + o.ModelNumber = v } // GetWifiMacAddress returns the WifiMacAddress field value @@ -384,7 +382,7 @@ func (o SensorsPatchResponse) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["serial"] = o.Serial toSerialize["name"] = o.Name - toSerialize["modelNumber"] = o.ModelNumber.Get() + toSerialize["modelNumber"] = o.ModelNumber toSerialize["wifiMacAddress"] = o.WifiMacAddress.Get() toSerialize["ethernetMacAddress"] = o.EthernetMacAddress.Get() toSerialize["addressNote"] = o.AddressNote.Get() diff --git a/pkg/config-api-client/model_sensors_response.go b/pkg/config-api-client/model_sensors_response.go index 4c116195..70520162 100644 --- a/pkg/config-api-client/model_sensors_response.go +++ b/pkg/config-api-client/model_sensors_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_.go b/pkg/config-api-client/model_service_test_.go index 32285c22..d2600ff7 100644 --- a/pkg/config-api-client/model_service_test_.go +++ b/pkg/config-api-client/model_service_test_.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_post_request.go b/pkg/config-api-client/model_service_test_group_assignments_post_request.go index a63abf8b..d961bedb 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_post_request.go +++ b/pkg/config-api-client/model_service_test_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_post_response.go b/pkg/config-api-client/model_service_test_group_assignments_post_response.go index 58f75a6a..8785d545 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_post_response.go +++ b/pkg/config-api-client/model_service_test_group_assignments_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_tests_list_item.go b/pkg/config-api-client/model_service_tests_list_item.go index 6d27ca2d..5e23ac0a 100644 --- a/pkg/config-api-client/model_service_tests_list_item.go +++ b/pkg/config-api-client/model_service_tests_list_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_tests_list_response.go b/pkg/config-api-client/model_service_tests_list_response.go index f5073cf0..bfc6c65d 100644 --- a/pkg/config-api-client/model_service_tests_list_response.go +++ b/pkg/config-api-client/model_service_tests_list_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wired_networks_item.go b/pkg/config-api-client/model_wired_networks_item.go index b27932c0..c19d3801 100644 --- a/pkg/config-api-client/model_wired_networks_item.go +++ b/pkg/config-api-client/model_wired_networks_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wired_networks_response.go b/pkg/config-api-client/model_wired_networks_response.go index 14480a47..19b2e81d 100644 --- a/pkg/config-api-client/model_wired_networks_response.go +++ b/pkg/config-api-client/model_wired_networks_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wireless_networks_item.go b/pkg/config-api-client/model_wireless_networks_item.go index b4fca5dc..686f4676 100644 --- a/pkg/config-api-client/model_wireless_networks_item.go +++ b/pkg/config-api-client/model_wireless_networks_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wireless_networks_response.go b/pkg/config-api-client/model_wireless_networks_response.go index 0613b362..97956194 100644 --- a/pkg/config-api-client/model_wireless_networks_response.go +++ b/pkg/config-api-client/model_wireless_networks_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/response.go b/pkg/config-api-client/response.go index ff7c2d2f..ef9637d0 100644 --- a/pkg/config-api-client/response.go +++ b/pkg/config-api-client/response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/test/api_configuration_test.go b/pkg/config-api-client/test/api_configuration_test.go index bcfb39fd..0bb0764c 100644 --- a/pkg/config-api-client/test/api_configuration_test.go +++ b/pkg/config-api-client/test/api_configuration_test.go @@ -20,6 +20,62 @@ func TestConfigurationAPI(t *testing.T) { defer gock.Off() + t.Run("Test ConfigurationAPI AgentsGet", func(t *testing.T) { + gock.New(configuration.Scheme + "://" + configuration.Host). + Get("/networking-uxi/v1alpha1/agents"). + MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}). + Reply(200). + JSON(map[string]interface{}{ + "items": []map[string]interface{}{ + { + "id": "uid", + "serial": "serial", + "name": "name", + "modelNumber": "model_number", + "wifiMacAddress": "wifi_mac_address", + "ethernetMacAddress": "ethernet_mac_address", + "notes": "notes", + "pcapMode": "pcap_mode", + "type": "networking-uxi/sensor", + }, + }, + "next": nil, + "count": 1, + }) + resp, httpRes, err := apiClient.ConfigurationAPI. + AgentsGet(context.Background()). + Id("uid"). + Limit(10). + Next("some-cursor"). + Execute() + + modelNumber := "model_number" + wifiMacAddress := "wifi_mac_address" + ethernetMacAddress := "ethernet_mac_address" + notes := "notes" + pcapMode := "pcap_mode" + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + assert.Equal(t, resp, &openapiclient.AgentsResponse{ + Items: []openapiclient.AgentItem{ + { + Id: "uid", + Serial: "serial", + Name: "name", + ModelNumber: *openapiclient.NewNullableString(&modelNumber), + WifiMacAddress: *openapiclient.NewNullableString(&wifiMacAddress), + EthernetMacAddress: *openapiclient.NewNullableString(ðernetMacAddress), + Notes: *openapiclient.NewNullableString(¬es), + PcapMode: *openapiclient.NewNullableString(&pcapMode), + Type: "networking-uxi/sensor", + }, + }, + Next: *openapiclient.NewNullableString(nil), + Count: 1, + }) + }) + t.Run("Test ConfigurationAPI GroupsGet", func(t *testing.T) { parent_uid := "parent_uid" gock.New(configuration.Scheme + "://" + configuration.Host). @@ -170,7 +226,6 @@ func TestConfigurationAPI(t *testing.T) { Next("some-cursor"). Execute() - ModelNumber := "model_number" WifiMacAddress := "wifi_mac_address" EthernetMacAddress := "ethernet_mac_address" AddressNote := "address_note" @@ -187,7 +242,7 @@ func TestConfigurationAPI(t *testing.T) { Id: "uid", Serial: "serial", Name: "name", - ModelNumber: *openapiclient.NewNullableString(&ModelNumber), + ModelNumber: "model_number", WifiMacAddress: *openapiclient.NewNullableString(&WifiMacAddress), EthernetMacAddress: *openapiclient.NewNullableString(&EthernetMacAddress), AddressNote: *openapiclient.NewNullableString(&AddressNote), @@ -241,14 +296,10 @@ func TestConfigurationAPI(t *testing.T) { SensorsPatchRequest(sensorsPatchRequest). Execute() - ModelNumber := "model_number" - WifiMacAddress := "wifi_mac_address" - EthernetMacAddress := "ethernet_mac_address" - AddressNote := "new_address_note" - var Longitude float32 = 0.0 - var Latitude float32 = 0.0 - Notes := "new_notes" - PcapMode := "off" + wifiMacAddress := "wifi_mac_address" + ethernetMacAddress := "ethernet_mac_address" + var longitude float32 = 0.0 + var latitude float32 = 0.0 require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -256,14 +307,14 @@ func TestConfigurationAPI(t *testing.T) { Id: "uid", Serial: "serial", Name: "new_name", - ModelNumber: *openapiclient.NewNullableString(&ModelNumber), - WifiMacAddress: *openapiclient.NewNullableString(&WifiMacAddress), - EthernetMacAddress: *openapiclient.NewNullableString(&EthernetMacAddress), - AddressNote: *openapiclient.NewNullableString(&AddressNote), - Longitude: *openapiclient.NewNullableFloat32(&Longitude), - Latitude: *openapiclient.NewNullableFloat32(&Latitude), - Notes: *openapiclient.NewNullableString(&Notes), - PcapMode: *openapiclient.NewNullableString(&PcapMode), + ModelNumber: "model_number", + WifiMacAddress: *openapiclient.NewNullableString(&wifiMacAddress), + EthernetMacAddress: *openapiclient.NewNullableString(ðernetMacAddress), + AddressNote: *openapiclient.NewNullableString(&addressNote), + Longitude: *openapiclient.NewNullableFloat32(&longitude), + Latitude: *openapiclient.NewNullableFloat32(&latitude), + Notes: *openapiclient.NewNullableString(¬es), + PcapMode: *openapiclient.NewNullableString(&pcapMode), Type: "networking-uxi/sensor", }) }) diff --git a/pkg/config-api-client/utils.go b/pkg/config-api-client/utils.go index 6f08c5c2..a953b543 100644 --- a/pkg/config-api-client/utils.go +++ b/pkg/config-api-client/utils.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 4.0.0 +API version: 5.2.0 Contact: support@capenetworks.com */