diff --git a/internal/provider/resources/agent.go b/internal/provider/resources/agent.go index 06ffa2ff..b487aa48 100644 --- a/internal/provider/resources/agent.go +++ b/internal/provider/resources/agent.go @@ -167,13 +167,20 @@ func (r *agentResource) Update( return } + errorSummary := util.GenerateErrorSummary("update", "uxi_agent") patchRequest := config_api_client.NewAgentsPatchRequest() patchRequest.Name = plan.Name.ValueStringPointer() if !plan.Notes.IsUnknown() { patchRequest.Notes = plan.Notes.ValueStringPointer() } - if !plan.PCapMode.IsUnknown() { - patchRequest.PcapMode = plan.PCapMode.ValueStringPointer() + plannedPcapMode := plan.PCapMode.ValueStringPointer() + if !plan.PCapMode.IsUnknown() && plannedPcapMode != nil { + pcapMode, err := config_api_client.NewPcapModeFromValue(*plannedPcapMode) + if err != nil { + resp.Diagnostics.AddError(errorSummary, err.Error()) + return + } + patchRequest.PcapMode = pcapMode } request := r.client.ConfigurationAPI. AgentsPatch(ctx, plan.ID.ValueString()). @@ -183,7 +190,7 @@ func (r *agentResource) Update( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { - resp.Diagnostics.AddError(util.GenerateErrorSummary("update", "uxi_agent"), errorDetail) + resp.Diagnostics.AddError(errorSummary, errorDetail) return } @@ -194,7 +201,7 @@ func (r *agentResource) Update( plan.Notes = types.StringValue(*agent.Notes.Get()) } if agent.PcapMode.Get() != nil { - plan.PCapMode = types.StringValue(*agent.PcapMode.Get()) + plan.PCapMode = types.StringValue(string(*agent.PcapMode.Get())) } // Set state to fully populated data diff --git a/internal/provider/resources/sensor.go b/internal/provider/resources/sensor.go index 95077a86..40406aac 100644 --- a/internal/provider/resources/sensor.go +++ b/internal/provider/resources/sensor.go @@ -169,11 +169,20 @@ func (r *sensorResource) Update( return } + errorSummary := util.GenerateErrorSummary("update", "uxi_sensor") patchRequest := config_api_client.NewSensorsPatchRequest() patchRequest.Name = plan.Name.ValueStringPointer() patchRequest.AddressNote = plan.AddressNote.ValueStringPointer() patchRequest.Notes = plan.Notes.ValueStringPointer() - patchRequest.PcapMode = plan.PCapMode.ValueStringPointer() + plannedPcapMode := plan.PCapMode.ValueStringPointer() + if !plan.PCapMode.IsUnknown() && plannedPcapMode != nil { + pcapMode, err := config_api_client.NewPcapModeFromValue(*plannedPcapMode) + if err != nil { + resp.Diagnostics.AddError(errorSummary, err.Error()) + return + } + patchRequest.PcapMode = pcapMode + } request := r.client.ConfigurationAPI. SensorsPatch(ctx, plan.ID.ValueString()). @@ -183,7 +192,7 @@ func (r *sensorResource) Update( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { - resp.Diagnostics.AddError(util.GenerateErrorSummary("update", "uxi_sensor"), errorDetail) + resp.Diagnostics.AddError(errorSummary, errorDetail) return } @@ -191,7 +200,9 @@ func (r *sensorResource) Update( plan.Name = types.StringValue(sensor.Name) plan.AddressNote = types.StringPointerValue(sensor.AddressNote.Get()) plan.Notes = types.StringPointerValue(sensor.Notes.Get()) - plan.PCapMode = types.StringPointerValue(sensor.PcapMode.Get()) + if sensor.PcapMode.Get() != nil { + plan.PCapMode = types.StringValue(string(*sensor.PcapMode.Get())) + } diags = resp.State.Set(ctx, plan) resp.Diagnostics.Append(diags...) diff --git a/pkg/config-api-client/.openapi-generator/FILES b/pkg/config-api-client/.openapi-generator/FILES index 7cb7dd7c..55c439c6 100644 --- a/pkg/config-api-client/.openapi-generator/FILES +++ b/pkg/config-api-client/.openapi-generator/FILES @@ -30,6 +30,7 @@ docs/NetworkGroupAssignmentsPostRequest.md docs/NetworkGroupAssignmentsPostResponse.md docs/NetworkGroupAssignmentsResponse.md docs/Parent.md +docs/PcapMode.md docs/Sensor.md docs/SensorGroupAssignmentResponse.md docs/SensorGroupAssignmentsItem.md @@ -78,6 +79,7 @@ model_network_group_assignments_post_request.go model_network_group_assignments_post_response.go model_network_group_assignments_response.go model_parent.go +model_pcap_mode.go model_sensor.go model_sensor_group_assignment_response.go model_sensor_group_assignments_item.go diff --git a/pkg/config-api-client/README.md b/pkg/config-api-client/README.md index 448bcc59..895e7754 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: 5.10.0 +- API version: 5.13.0 - Package version: 1.0.0 - Generator version: 7.9.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -133,6 +133,7 @@ Class | Method | HTTP request | Description - [NetworkGroupAssignmentsPostResponse](docs/NetworkGroupAssignmentsPostResponse.md) - [NetworkGroupAssignmentsResponse](docs/NetworkGroupAssignmentsResponse.md) - [Parent](docs/Parent.md) + - [PcapMode](docs/PcapMode.md) - [Sensor](docs/Sensor.md) - [SensorGroupAssignmentResponse](docs/SensorGroupAssignmentResponse.md) - [SensorGroupAssignmentsItem](docs/SensorGroupAssignmentsItem.md) diff --git a/pkg/config-api-client/api/.openapi.source.yaml b/pkg/config-api-client/api/.openapi.source.yaml index a87530b1..6e260cc6 100644 --- a/pkg/config-api-client/api/.openapi.source.yaml +++ b/pkg/config-api-client/api/.openapi.source.yaml @@ -9,7 +9,7 @@ info: email: support@capenetworks.com license: name: No idea, but we need something - version: 5.10.0 + version: 5.13.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -636,6 +636,8 @@ paths: schema: type: integer default: 50 + maximum: 100 + minimum: 0 title: Limit responses: '200': @@ -1121,6 +1123,8 @@ paths: schema: type: integer default: 50 + maximum: 100 + minimum: 0 title: Limit responses: '200': @@ -1296,18 +1300,18 @@ components: Fields: name: Optional string notes: Optional string - pcap_mode: Optional string + pcap_mode: Optional PcapMode type: object properties: name: type: string + maxLength: 100 title: Name notes: type: string title: Notes pcapMode: - type: string - title: Pcapmode + $ref: '#/components/schemas/PcapMode' title: AgentsPatchRequest AgentsPatchResponse: type: object @@ -1343,9 +1347,8 @@ components: title: Notes pcapMode: anyOf: - - type: string + - $ref: '#/components/schemas/PcapMode' nullable: true - title: Pcapmode type: type: string enum: @@ -1670,6 +1673,13 @@ components: required: - id title: Parent + PcapMode: + type: string + enum: + - light + - full + - 'off' + title: PcapMode Sensor: type: object properties: @@ -1832,11 +1842,12 @@ components: name: Optional string address_note: Optional string notes: Optional string - pcap_mode: Optional string + pcap_mode: Optional PcapMode type: object properties: name: type: string + maxLength: 100 title: Name addressNote: type: string @@ -1845,8 +1856,7 @@ components: type: string title: Notes pcapMode: - type: string - title: Pcapmode + $ref: '#/components/schemas/PcapMode' title: SensorsPatchRequest SensorsPatchResponse: type: object @@ -1895,9 +1905,8 @@ components: title: Notes pcapMode: anyOf: - - type: string + - $ref: '#/components/schemas/PcapMode' nullable: true - title: Pcapmode type: type: string enum: diff --git a/pkg/config-api-client/api/openapi.yaml b/pkg/config-api-client/api/openapi.yaml index df14a1e1..d059e3f7 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: 5.10.0 + version: 5.13.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -626,6 +626,8 @@ paths: required: false schema: default: 50 + maximum: 100 + minimum: 0 title: Limit type: integer style: form @@ -1097,6 +1099,8 @@ paths: required: false schema: default: 50 + maximum: 100 + minimum: 0 title: Limit type: integer style: form @@ -1305,23 +1309,23 @@ components: Fields: name: Optional string notes: Optional string - pcap_mode: Optional string + pcap_mode: Optional PcapMode properties: name: + maxLength: 100 title: Name type: string notes: title: Notes type: string pcapMode: - title: Pcapmode - type: string + $ref: '#/components/schemas/PcapMode' title: AgentsPatchRequest type: object AgentsPatchResponse: example: notes: notes - pcapMode: pcapMode + pcapMode: light serial: serial ethernetMacAddress: ethernetMacAddress name: name @@ -1352,8 +1356,7 @@ components: nullable: true type: string pcapMode: - nullable: true - type: string + $ref: '#/components/schemas/PcapMode' type: enum: - networking-uxi/agent @@ -1803,6 +1806,13 @@ components: - id title: Parent type: object + PcapMode: + enum: + - light + - full + - "off" + title: PcapMode + type: string Sensor: example: id: id @@ -1997,9 +2007,10 @@ components: name: Optional string address_note: Optional string notes: Optional string - pcap_mode: Optional string + pcap_mode: Optional PcapMode properties: name: + maxLength: 100 title: Name type: string addressNote: @@ -2009,15 +2020,14 @@ components: title: Notes type: string pcapMode: - title: Pcapmode - type: string + $ref: '#/components/schemas/PcapMode' title: SensorsPatchRequest type: object SensorsPatchResponse: example: addressNote: addressNote notes: notes - pcapMode: pcapMode + pcapMode: light serial: serial ethernetMacAddress: ethernetMacAddress latitude: 6.027456183070403 @@ -2059,8 +2069,7 @@ components: nullable: true type: string pcapMode: - nullable: true - type: string + $ref: '#/components/schemas/PcapMode' type: enum: - networking-uxi/sensor diff --git a/pkg/config-api-client/api_configuration.go b/pkg/config-api-client/api_configuration.go index 7ec5630f..4d8c9f2e 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/client.go b/pkg/config-api-client/client.go index dd1a33eb..71ed79d3 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ @@ -41,7 +41,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Configuration Api API v5.10.0 +// APIClient manages communication with the Configuration Api API v5.13.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 2217c2e4..b0c94a7f 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/docs/AgentsPatchRequest.md b/pkg/config-api-client/docs/AgentsPatchRequest.md index e8482958..03621d80 100644 --- a/pkg/config-api-client/docs/AgentsPatchRequest.md +++ b/pkg/config-api-client/docs/AgentsPatchRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | Pointer to **string** | | [optional] **Notes** | Pointer to **string** | | [optional] -**PcapMode** | Pointer to **string** | | [optional] +**PcapMode** | Pointer to [**PcapMode**](PcapMode.md) | | [optional] ## Methods @@ -79,20 +79,20 @@ HasNotes returns a boolean if a field has been set. ### GetPcapMode -`func (o *AgentsPatchRequest) GetPcapMode() string` +`func (o *AgentsPatchRequest) GetPcapMode() PcapMode` GetPcapMode returns the PcapMode field if non-nil, zero value otherwise. ### GetPcapModeOk -`func (o *AgentsPatchRequest) GetPcapModeOk() (*string, bool)` +`func (o *AgentsPatchRequest) GetPcapModeOk() (*PcapMode, 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 *AgentsPatchRequest) SetPcapMode(v string)` +`func (o *AgentsPatchRequest) SetPcapMode(v PcapMode)` SetPcapMode sets PcapMode field to given value. diff --git a/pkg/config-api-client/docs/AgentsPatchResponse.md b/pkg/config-api-client/docs/AgentsPatchResponse.md index b7653579..bff238b4 100644 --- a/pkg/config-api-client/docs/AgentsPatchResponse.md +++ b/pkg/config-api-client/docs/AgentsPatchResponse.md @@ -11,14 +11,14 @@ Name | Type | Description | Notes **WifiMacAddress** | **NullableString** | | **EthernetMacAddress** | **NullableString** | | **Notes** | **NullableString** | | -**PcapMode** | **NullableString** | | +**PcapMode** | [**NullablePcapMode**](PcapMode.md) | | **Type** | **string** | | ## Methods ### NewAgentsPatchResponse -`func NewAgentsPatchResponse(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, notes NullableString, pcapMode NullableString, type_ string, ) *AgentsPatchResponse` +`func NewAgentsPatchResponse(id string, serial string, name string, modelNumber NullableString, wifiMacAddress NullableString, ethernetMacAddress NullableString, notes NullableString, pcapMode NullablePcapMode, type_ string, ) *AgentsPatchResponse` NewAgentsPatchResponse instantiates a new AgentsPatchResponse object This constructor will assign default values to properties that have it defined, @@ -215,20 +215,20 @@ SetNotes sets Notes field to given value. UnsetNotes ensures that no value is present for Notes, not even an explicit nil ### GetPcapMode -`func (o *AgentsPatchResponse) GetPcapMode() string` +`func (o *AgentsPatchResponse) GetPcapMode() PcapMode` GetPcapMode returns the PcapMode field if non-nil, zero value otherwise. ### GetPcapModeOk -`func (o *AgentsPatchResponse) GetPcapModeOk() (*string, bool)` +`func (o *AgentsPatchResponse) GetPcapModeOk() (*PcapMode, 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 *AgentsPatchResponse) SetPcapMode(v string)` +`func (o *AgentsPatchResponse) SetPcapMode(v PcapMode)` SetPcapMode sets PcapMode field to given value. diff --git a/pkg/config-api-client/docs/PcapMode.md b/pkg/config-api-client/docs/PcapMode.md new file mode 100644 index 00000000..a1dd0cee --- /dev/null +++ b/pkg/config-api-client/docs/PcapMode.md @@ -0,0 +1,15 @@ +# PcapMode + +## Enum + + +* `LIGHT` (value: `"light"`) + +* `FULL` (value: `"full"`) + +* `OFF` (value: `"off"`) + + +[[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/SensorsPatchRequest.md b/pkg/config-api-client/docs/SensorsPatchRequest.md index 90c6220a..2c177862 100644 --- a/pkg/config-api-client/docs/SensorsPatchRequest.md +++ b/pkg/config-api-client/docs/SensorsPatchRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Name** | Pointer to **string** | | [optional] **AddressNote** | Pointer to **string** | | [optional] **Notes** | Pointer to **string** | | [optional] -**PcapMode** | Pointer to **string** | | [optional] +**PcapMode** | Pointer to [**PcapMode**](PcapMode.md) | | [optional] ## Methods @@ -105,20 +105,20 @@ HasNotes returns a boolean if a field has been set. ### GetPcapMode -`func (o *SensorsPatchRequest) GetPcapMode() string` +`func (o *SensorsPatchRequest) GetPcapMode() PcapMode` GetPcapMode returns the PcapMode field if non-nil, zero value otherwise. ### GetPcapModeOk -`func (o *SensorsPatchRequest) GetPcapModeOk() (*string, bool)` +`func (o *SensorsPatchRequest) GetPcapModeOk() (*PcapMode, 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 *SensorsPatchRequest) SetPcapMode(v string)` +`func (o *SensorsPatchRequest) SetPcapMode(v PcapMode)` SetPcapMode sets PcapMode field to given value. diff --git a/pkg/config-api-client/docs/SensorsPatchResponse.md b/pkg/config-api-client/docs/SensorsPatchResponse.md index e7e4d426..d77ac940 100644 --- a/pkg/config-api-client/docs/SensorsPatchResponse.md +++ b/pkg/config-api-client/docs/SensorsPatchResponse.md @@ -14,14 +14,14 @@ Name | Type | Description | Notes **Longitude** | **NullableFloat32** | | **Latitude** | **NullableFloat32** | | **Notes** | **NullableString** | | -**PcapMode** | **NullableString** | | +**PcapMode** | [**NullablePcapMode**](PcapMode.md) | | **Type** | **string** | | ## Methods ### NewSensorsPatchResponse -`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` +`func NewSensorsPatchResponse(id string, serial string, name string, modelNumber string, wifiMacAddress NullableString, ethernetMacAddress NullableString, addressNote NullableString, longitude NullableFloat32, latitude NullableFloat32, notes NullableString, pcapMode NullablePcapMode, type_ string, ) *SensorsPatchResponse` NewSensorsPatchResponse instantiates a new SensorsPatchResponse object This constructor will assign default values to properties that have it defined, @@ -298,20 +298,20 @@ SetNotes sets Notes field to given value. UnsetNotes ensures that no value is present for Notes, not even an explicit nil ### GetPcapMode -`func (o *SensorsPatchResponse) GetPcapMode() string` +`func (o *SensorsPatchResponse) GetPcapMode() PcapMode` GetPcapMode returns the PcapMode field if non-nil, zero value otherwise. ### GetPcapModeOk -`func (o *SensorsPatchResponse) GetPcapModeOk() (*string, bool)` +`func (o *SensorsPatchResponse) GetPcapModeOk() (*PcapMode, 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 *SensorsPatchResponse) SetPcapMode(v string)` +`func (o *SensorsPatchResponse) SetPcapMode(v PcapMode)` SetPcapMode sets PcapMode field to given value. diff --git a/pkg/config-api-client/model_agent.go b/pkg/config-api-client/model_agent.go index 095f8736..cab96512 100644 --- a/pkg/config-api-client/model_agent.go +++ b/pkg/config-api-client/model_agent.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignment_response.go b/pkg/config-api-client/model_agent_group_assignment_response.go index 7fc7850b..b8379bab 100644 --- a/pkg/config-api-client/model_agent_group_assignment_response.go +++ b/pkg/config-api-client/model_agent_group_assignment_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_item.go b/pkg/config-api-client/model_agent_group_assignments_item.go index 5b67360b..219a8a02 100644 --- a/pkg/config-api-client/model_agent_group_assignments_item.go +++ b/pkg/config-api-client/model_agent_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_post_request.go b/pkg/config-api-client/model_agent_group_assignments_post_request.go index 27bc83c1..c8a4a840 100644 --- a/pkg/config-api-client/model_agent_group_assignments_post_request.go +++ b/pkg/config-api-client/model_agent_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_response.go b/pkg/config-api-client/model_agent_group_assignments_response.go index e726c89c..9adc1313 100644 --- a/pkg/config-api-client/model_agent_group_assignments_response.go +++ b/pkg/config-api-client/model_agent_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_item.go b/pkg/config-api-client/model_agent_item.go index 3677cd4e..9d8ae71c 100644 --- a/pkg/config-api-client/model_agent_item.go +++ b/pkg/config-api-client/model_agent_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agents_patch_request.go b/pkg/config-api-client/model_agents_patch_request.go index 44d16bad..1984e580 100644 --- a/pkg/config-api-client/model_agents_patch_request.go +++ b/pkg/config-api-client/model_agents_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ @@ -18,11 +18,11 @@ import ( // checks if the AgentsPatchRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AgentsPatchRequest{} -// AgentsPatchRequest Request body for patching an agent. Fields: name: Optional string notes: Optional string pcap_mode: Optional string +// AgentsPatchRequest Request body for patching an agent. Fields: name: Optional string notes: Optional string pcap_mode: Optional PcapMode type AgentsPatchRequest struct { - Name *string `json:"name,omitempty"` - Notes *string `json:"notes,omitempty"` - PcapMode *string `json:"pcapMode,omitempty"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + PcapMode *PcapMode `json:"pcapMode,omitempty"` } // NewAgentsPatchRequest instantiates a new AgentsPatchRequest object @@ -107,9 +107,9 @@ func (o *AgentsPatchRequest) SetNotes(v string) { } // GetPcapMode returns the PcapMode field value if set, zero value otherwise. -func (o *AgentsPatchRequest) GetPcapMode() string { +func (o *AgentsPatchRequest) GetPcapMode() PcapMode { if o == nil || IsNil(o.PcapMode) { - var ret string + var ret PcapMode return ret } return *o.PcapMode @@ -117,7 +117,7 @@ func (o *AgentsPatchRequest) GetPcapMode() string { // GetPcapModeOk returns a tuple with the PcapMode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AgentsPatchRequest) GetPcapModeOk() (*string, bool) { +func (o *AgentsPatchRequest) GetPcapModeOk() (*PcapMode, bool) { if o == nil || IsNil(o.PcapMode) { return nil, false } @@ -133,8 +133,8 @@ func (o *AgentsPatchRequest) HasPcapMode() bool { return false } -// SetPcapMode gets a reference to the given string and assigns it to the PcapMode field. -func (o *AgentsPatchRequest) SetPcapMode(v string) { +// SetPcapMode gets a reference to the given PcapMode and assigns it to the PcapMode field. +func (o *AgentsPatchRequest) SetPcapMode(v PcapMode) { o.PcapMode = &v } diff --git a/pkg/config-api-client/model_agents_patch_response.go b/pkg/config-api-client/model_agents_patch_response.go index dab8c5c5..a8d45675 100644 --- a/pkg/config-api-client/model_agents_patch_response.go +++ b/pkg/config-api-client/model_agents_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ @@ -22,15 +22,15 @@ var _ MappedNullable = &AgentsPatchResponse{} // AgentsPatchResponse struct for AgentsPatchResponse type AgentsPatchResponse 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"` + 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 NullablePcapMode `json:"pcapMode"` + Type string `json:"type"` } type _AgentsPatchResponse AgentsPatchResponse @@ -47,7 +47,7 @@ func NewAgentsPatchResponse( wifiMacAddress NullableString, ethernetMacAddress NullableString, notes NullableString, - pcapMode NullableString, + pcapMode NullablePcapMode, type_ string, ) *AgentsPatchResponse { this := AgentsPatchResponse{} @@ -248,10 +248,10 @@ func (o *AgentsPatchResponse) SetNotes(v string) { } // GetPcapMode returns the PcapMode field value -// If the value is explicit nil, the zero value for string will be returned -func (o *AgentsPatchResponse) GetPcapMode() string { +// If the value is explicit nil, the zero value for PcapMode will be returned +func (o *AgentsPatchResponse) GetPcapMode() PcapMode { if o == nil || o.PcapMode.Get() == nil { - var ret string + var ret PcapMode return ret } @@ -261,7 +261,7 @@ func (o *AgentsPatchResponse) GetPcapMode() string { // 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 *AgentsPatchResponse) GetPcapModeOk() (*string, bool) { +func (o *AgentsPatchResponse) GetPcapModeOk() (*PcapMode, bool) { if o == nil { return nil, false } @@ -269,7 +269,7 @@ func (o *AgentsPatchResponse) GetPcapModeOk() (*string, bool) { } // SetPcapMode sets field value -func (o *AgentsPatchResponse) SetPcapMode(v string) { +func (o *AgentsPatchResponse) SetPcapMode(v PcapMode) { o.PcapMode.Set(&v) } diff --git a/pkg/config-api-client/model_agents_response.go b/pkg/config-api-client/model_agents_response.go index daa5bc9c..35ce478b 100644 --- a/pkg/config-api-client/model_agents_response.go +++ b/pkg/config-api-client/model_agents_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_error_detail.go b/pkg/config-api-client/model_error_detail.go index 51ee835e..920e84ef 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: 5.10.0 +API version: 5.13.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 448deb4c..d6ac34ab 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_group.go b/pkg/config-api-client/model_group.go index 7c291c9a..56558d18 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: 5.10.0 +API version: 5.13.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 9db3ce95..f1ece743 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: 5.10.0 +API version: 5.13.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 bb1fd03e..c2d4ecab 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: 5.10.0 +API version: 5.13.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 c22206af..316a3de5 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: 5.10.0 +API version: 5.13.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 cb572f4b..a859778e 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: 5.10.0 +API version: 5.13.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 298a52ff..06f28bab 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: 5.10.0 +API version: 5.13.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 2ddcc319..b3f5b985 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue.go b/pkg/config-api-client/model_issue.go index 1d53863a..1f116c0d 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: 5.10.0 +API version: 5.13.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 6ed7ed7a..2bddf170 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network.go b/pkg/config-api-client/model_network.go index 68498dfb..c99f197a 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: 5.10.0 +API version: 5.13.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 016e4813..832f5707 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: 5.10.0 +API version: 5.13.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 a366d142..2935fe77 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: 5.10.0 +API version: 5.13.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 48b96639..11478972 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: 5.10.0 +API version: 5.13.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 cbd49033..901efd66 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_parent.go b/pkg/config-api-client/model_parent.go index f7e3072f..acabb135 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_pcap_mode.go b/pkg/config-api-client/model_pcap_mode.go new file mode 100644 index 00000000..2909acc2 --- /dev/null +++ b/pkg/config-api-client/model_pcap_mode.go @@ -0,0 +1,113 @@ +/* +Configuration Api + +Nice description goes here + +API version: 5.13.0 +Contact: support@capenetworks.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package config_api_client + +import ( + "encoding/json" + "fmt" +) + +// PcapMode the model 'PcapMode' +type PcapMode string + +// List of PcapMode +const ( + LIGHT PcapMode = "light" + FULL PcapMode = "full" + OFF PcapMode = "off" +) + +// All allowed values of PcapMode enum +var AllowedPcapModeEnumValues = []PcapMode{ + "light", + "full", + "off", +} + +func (v *PcapMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PcapMode(value) + for _, existing := range AllowedPcapModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PcapMode", value) +} + +// NewPcapModeFromValue returns a pointer to a valid PcapMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPcapModeFromValue(v string) (*PcapMode, error) { + ev := PcapMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PcapMode: valid values are %v", v, AllowedPcapModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PcapMode) IsValid() bool { + for _, existing := range AllowedPcapModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PcapMode value +func (v PcapMode) Ptr() *PcapMode { + return &v +} + +type NullablePcapMode struct { + value *PcapMode + isSet bool +} + +func (v NullablePcapMode) Get() *PcapMode { + return v.value +} + +func (v *NullablePcapMode) Set(val *PcapMode) { + v.value = val + v.isSet = true +} + +func (v NullablePcapMode) IsSet() bool { + return v.isSet +} + +func (v *NullablePcapMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePcapMode(val *PcapMode) *NullablePcapMode { + return &NullablePcapMode{value: val, isSet: true} +} + +func (v NullablePcapMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePcapMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_sensor.go b/pkg/config-api-client/model_sensor.go index 028b1352..c7dc91cb 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: 5.10.0 +API version: 5.13.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 b7df55a3..348d6b87 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: 5.10.0 +API version: 5.13.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 6f4f278f..cf295e21 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: 5.10.0 +API version: 5.13.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 83ddd32b..b47a26cb 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: 5.10.0 +API version: 5.13.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 86c55e4f..36acd9d3 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: 5.10.0 +API version: 5.13.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 838cade2..854da109 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensors_patch_request.go b/pkg/config-api-client/model_sensors_patch_request.go index 15512305..50383394 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ @@ -18,12 +18,12 @@ import ( // checks if the SensorsPatchRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SensorsPatchRequest{} -// SensorsPatchRequest Request body for patching a sensor. Fields: name: Optional string address_note: Optional string notes: Optional string pcap_mode: Optional string +// SensorsPatchRequest Request body for patching a sensor. Fields: name: Optional string address_note: Optional string notes: Optional string pcap_mode: Optional PcapMode type SensorsPatchRequest struct { - Name *string `json:"name,omitempty"` - AddressNote *string `json:"addressNote,omitempty"` - Notes *string `json:"notes,omitempty"` - PcapMode *string `json:"pcapMode,omitempty"` + Name *string `json:"name,omitempty"` + AddressNote *string `json:"addressNote,omitempty"` + Notes *string `json:"notes,omitempty"` + PcapMode *PcapMode `json:"pcapMode,omitempty"` } // NewSensorsPatchRequest instantiates a new SensorsPatchRequest object @@ -140,9 +140,9 @@ func (o *SensorsPatchRequest) SetNotes(v string) { } // GetPcapMode returns the PcapMode field value if set, zero value otherwise. -func (o *SensorsPatchRequest) GetPcapMode() string { +func (o *SensorsPatchRequest) GetPcapMode() PcapMode { if o == nil || IsNil(o.PcapMode) { - var ret string + var ret PcapMode return ret } return *o.PcapMode @@ -150,7 +150,7 @@ func (o *SensorsPatchRequest) GetPcapMode() string { // GetPcapModeOk returns a tuple with the PcapMode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SensorsPatchRequest) GetPcapModeOk() (*string, bool) { +func (o *SensorsPatchRequest) GetPcapModeOk() (*PcapMode, bool) { if o == nil || IsNil(o.PcapMode) { return nil, false } @@ -166,8 +166,8 @@ func (o *SensorsPatchRequest) HasPcapMode() bool { return false } -// SetPcapMode gets a reference to the given string and assigns it to the PcapMode field. -func (o *SensorsPatchRequest) SetPcapMode(v string) { +// SetPcapMode gets a reference to the given PcapMode and assigns it to the PcapMode field. +func (o *SensorsPatchRequest) SetPcapMode(v PcapMode) { o.PcapMode = &v } diff --git a/pkg/config-api-client/model_sensors_patch_response.go b/pkg/config-api-client/model_sensors_patch_response.go index 27d0b853..92edb296 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ @@ -22,18 +22,18 @@ var _ MappedNullable = &SensorsPatchResponse{} // SensorsPatchResponse struct for SensorsPatchResponse type SensorsPatchResponse struct { - Id string `json:"id"` - Serial string `json:"serial"` - Name string `json:"name"` - ModelNumber string `json:"modelNumber"` - WifiMacAddress NullableString `json:"wifiMacAddress"` - EthernetMacAddress NullableString `json:"ethernetMacAddress"` - AddressNote NullableString `json:"addressNote"` - Longitude NullableFloat32 `json:"longitude"` - Latitude NullableFloat32 `json:"latitude"` - Notes NullableString `json:"notes"` - PcapMode NullableString `json:"pcapMode"` - Type string `json:"type"` + Id string `json:"id"` + Serial string `json:"serial"` + Name string `json:"name"` + ModelNumber string `json:"modelNumber"` + WifiMacAddress NullableString `json:"wifiMacAddress"` + EthernetMacAddress NullableString `json:"ethernetMacAddress"` + AddressNote NullableString `json:"addressNote"` + Longitude NullableFloat32 `json:"longitude"` + Latitude NullableFloat32 `json:"latitude"` + Notes NullableString `json:"notes"` + PcapMode NullablePcapMode `json:"pcapMode"` + Type string `json:"type"` } type _SensorsPatchResponse SensorsPatchResponse @@ -53,7 +53,7 @@ func NewSensorsPatchResponse( longitude NullableFloat32, latitude NullableFloat32, notes NullableString, - pcapMode NullableString, + pcapMode NullablePcapMode, type_ string, ) *SensorsPatchResponse { this := SensorsPatchResponse{} @@ -333,10 +333,10 @@ func (o *SensorsPatchResponse) SetNotes(v string) { } // GetPcapMode returns the PcapMode field value -// If the value is explicit nil, the zero value for string will be returned -func (o *SensorsPatchResponse) GetPcapMode() string { +// If the value is explicit nil, the zero value for PcapMode will be returned +func (o *SensorsPatchResponse) GetPcapMode() PcapMode { if o == nil || o.PcapMode.Get() == nil { - var ret string + var ret PcapMode return ret } @@ -346,7 +346,7 @@ func (o *SensorsPatchResponse) GetPcapMode() string { // 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 *SensorsPatchResponse) GetPcapModeOk() (*string, bool) { +func (o *SensorsPatchResponse) GetPcapModeOk() (*PcapMode, bool) { if o == nil { return nil, false } @@ -354,7 +354,7 @@ func (o *SensorsPatchResponse) GetPcapModeOk() (*string, bool) { } // SetPcapMode sets field value -func (o *SensorsPatchResponse) SetPcapMode(v string) { +func (o *SensorsPatchResponse) SetPcapMode(v PcapMode) { o.PcapMode.Set(&v) } diff --git a/pkg/config-api-client/model_sensors_response.go b/pkg/config-api-client/model_sensors_response.go index 2b626e61..ff5a8b9f 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: 5.10.0 +API version: 5.13.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 44f0572f..e1512692 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_item.go b/pkg/config-api-client/model_service_test_group_assignments_item.go index 9cf0fef2..3bfc7ddb 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_item.go +++ b/pkg/config-api-client/model_service_test_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.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 462e66a9..82c9b72b 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: 5.10.0 +API version: 5.13.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 a8f2c406..133bd5c7 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_response.go b/pkg/config-api-client/model_service_test_group_assignments_response.go index 03f0b6d9..b2f8b234 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_response.go +++ b/pkg/config-api-client/model_service_test_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.10.0 +API version: 5.13.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 62375918..ad4d7a5c 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: 5.10.0 +API version: 5.13.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 213e2b0c..27cbd0bb 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: 5.10.0 +API version: 5.13.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 73a219a8..c77ccf5e 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: 5.10.0 +API version: 5.13.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 8f4e171b..6833ea3e 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: 5.10.0 +API version: 5.13.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 c05f2e4d..902f637b 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: 5.10.0 +API version: 5.13.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 0edde116..990aa01a 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/response.go b/pkg/config-api-client/response.go index 2c309448..4aa6e576 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: 5.10.0 +API version: 5.13.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 0d9bd3fd..2dd40ff3 100644 --- a/pkg/config-api-client/test/api_configuration_test.go +++ b/pkg/config-api-client/test/api_configuration_test.go @@ -97,7 +97,7 @@ func TestConfigurationAPI(t *testing.T) { ) name := "new_name" notes := "new_notes" - pcapMode := "off" + pcapMode := config_api_client.OFF agentsPatchRequest := config_api_client.AgentsPatchRequest{ Name: &name, Notes: ¬es, @@ -122,7 +122,7 @@ func TestConfigurationAPI(t *testing.T) { WifiMacAddress: *config_api_client.NewNullableString(&wifiMacAddress), EthernetMacAddress: *config_api_client.NewNullableString(ðernetMacAddress), Notes: *config_api_client.NewNullableString(¬es), - PcapMode: *config_api_client.NewNullableString(&pcapMode), + PcapMode: *config_api_client.NewNullablePcapMode(&pcapMode), Type: "networking-uxi/agent", }) }) @@ -275,7 +275,7 @@ func TestConfigurationAPI(t *testing.T) { "longitude": 0.0, "latitude": 0.0, "notes": "notes", - "pcapMode": "pcap_mode", + "pcapMode": "light", "type": "networking-uxi/sensor", }, }, @@ -296,7 +296,7 @@ func TestConfigurationAPI(t *testing.T) { var Longitude float32 = 0.0 var Latitude float32 = 0.0 Notes := "notes" - PcapMode := "pcap_mode" + pcapMode := "light" require.Nil(t, err) assert.Equal(t, http.StatusOK, httpRes.StatusCode) @@ -313,7 +313,7 @@ func TestConfigurationAPI(t *testing.T) { Longitude: *config_api_client.NewNullableFloat32(&Longitude), Latitude: *config_api_client.NewNullableFloat32(&Latitude), Notes: *config_api_client.NewNullableString(&Notes), - PcapMode: *config_api_client.NewNullableString(&PcapMode), + PcapMode: *config_api_client.NewNullableString(&pcapMode), Type: "networking-uxi/sensor", }, }, @@ -346,7 +346,7 @@ func TestConfigurationAPI(t *testing.T) { name := "new_name" addressNote := "new_address_note" notes := "new_notes" - pcapMode := "off" + pcapMode := config_api_client.OFF sensorsPatchRequest := config_api_client.SensorsPatchRequest{ Name: &name, AddressNote: &addressNote, @@ -376,7 +376,7 @@ func TestConfigurationAPI(t *testing.T) { Longitude: *config_api_client.NewNullableFloat32(&longitude), Latitude: *config_api_client.NewNullableFloat32(&latitude), Notes: *config_api_client.NewNullableString(¬es), - PcapMode: *config_api_client.NewNullableString(&pcapMode), + PcapMode: *config_api_client.NewNullablePcapMode(&pcapMode), Type: "networking-uxi/sensor", }) }) diff --git a/pkg/config-api-client/utils.go b/pkg/config-api-client/utils.go index 12f75903..2cc5b592 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: 5.10.0 +API version: 5.13.0 Contact: support@capenetworks.com */ diff --git a/test/mocked/resources/agent_group_assignment_test.go b/test/mocked/resources/agent_group_assignment_test.go index 12b7914d..5033288a 100644 --- a/test/mocked/resources/agent_group_assignment_test.go +++ b/test/mocked/resources/agent_group_assignment_test.go @@ -245,7 +245,7 @@ func TestAgentGroupAssignmentResource(t *testing.T) { resource "uxi_agent" "my_agent_2" { name = "name_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" } import { diff --git a/test/mocked/resources/agent_test.go b/test/mocked/resources/agent_test.go index 638095de..3f3bbcfc 100644 --- a/test/mocked/resources/agent_test.go +++ b/test/mocked/resources/agent_test.go @@ -109,12 +109,12 @@ func TestAgentResource(t *testing.T) { resource "uxi_agent" "my_agent" { name = "name_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("uxi_agent.my_agent", "name", "name_2"), resource.TestCheckResourceAttr("uxi_agent.my_agent", "notes", "notes_2"), - resource.TestCheckResourceAttr("uxi_agent.my_agent", "pcap_mode", "light_2"), + resource.TestCheckResourceAttr("uxi_agent.my_agent", "pcap_mode", "light"), ), }, // Delete testing @@ -212,7 +212,7 @@ func TestAgentResourceTooManyRequestsHandling(t *testing.T) { resource "uxi_agent" "my_agent" { name = "name_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("uxi_agent.my_agent", "name", "name_2"), @@ -366,7 +366,7 @@ func TestAgentResourceHttpErrorHandling(t *testing.T) { resource "uxi_agent" "my_agent" { name = "name_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, ExpectError: regexp.MustCompile( `(?s)Unable to update agent - pcap_mode must be one the following \['light',\s*'full', 'off'\].\s*DebugID: 12312-123123-123123-1231212`, diff --git a/test/mocked/resources/sensor_group_assignment_test.go b/test/mocked/resources/sensor_group_assignment_test.go index 53969ef7..d650e2d9 100644 --- a/test/mocked/resources/sensor_group_assignment_test.go +++ b/test/mocked/resources/sensor_group_assignment_test.go @@ -250,7 +250,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { name = "name_2" address_note = "address_note_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" } import { diff --git a/test/mocked/resources/sensor_test.go b/test/mocked/resources/sensor_test.go index 17990635..ebff8ecd 100644 --- a/test/mocked/resources/sensor_test.go +++ b/test/mocked/resources/sensor_test.go @@ -110,7 +110,7 @@ func TestSensorResource(t *testing.T) { name = "name_2" address_note = "address_note_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "name", "name_2"), @@ -120,7 +120,7 @@ func TestSensorResource(t *testing.T) { "address_note_2", ), resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "notes", "notes_2"), - resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "pcap_mode", "light_2"), + resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "pcap_mode", "light"), resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "id", "id"), ), }, @@ -228,7 +228,7 @@ func TestSensorResourceTooManyRequestsHandling(t *testing.T) { name = "name_2" address_note = "address_note_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("uxi_sensor.my_sensor", "name", "name_2"), @@ -378,7 +378,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { name = "name_2" address_note = "address_note_2" notes = "notes_2" - pcap_mode = "light_2" + pcap_mode = "light" }`, ExpectError: regexp.MustCompile( `(?s)Unable to update sensor - pcap_mode must be one the following \['light',\s*'full', 'off'\].\s*DebugID: 12312-123123-123123-1231212`, diff --git a/test/mocked/util/utils.go b/test/mocked/util/utils.go index 9e2b1eff..ecebb849 100644 --- a/test/mocked/util/utils.go +++ b/test/mocked/util/utils.go @@ -19,7 +19,7 @@ func GenerateSensorResponseModel(id string, postfix string) map[string]interface "longitude": 0.0, "latitude": 0.0, "notes": "notes" + postfix, - "pcapMode": "light" + postfix, + "pcapMode": "light", "type": "networking-uxi/sensor", } } @@ -29,7 +29,7 @@ func GenerateSensorRequestUpdateModel(postfix string) map[string]interface{} { "name": "name" + postfix, "addressNote": "address_note" + postfix, "notes": "notes" + postfix, - "pcapMode": "light" + postfix, + "pcapMode": "light", } } @@ -37,7 +37,7 @@ func GenerateAgentRequestUpdateModel(postfix string) map[string]interface{} { return map[string]interface{}{ "name": "name" + postfix, "notes": "notes" + postfix, - "pcapMode": "light" + postfix, + "pcapMode": "light", } } @@ -50,7 +50,7 @@ func GenerateAgentResponseModel(id string, postfix string) map[string]interface{ "wifiMacAddress": "wifi_mac_address" + postfix, "ethernetMacAddress": "ethernet_mac_address" + postfix, "notes": "notes" + postfix, - "pcapMode": "light" + postfix, + "pcapMode": "light", "type": "networking-uxi/sensor", } }