From 6120f3143f1473d57fac2e90e11964f3d9c741dd Mon Sep 17 00:00:00 2001 From: 1riatsila1 Date: Fri, 11 Oct 2024 12:53:51 +0200 Subject: [PATCH] fix: update latest client with nullable parent-uid --- Justfile | 6 ++- pkg/config-api-client/README.md | 2 +- .../api/.openapi.source.yaml | 10 ++-- pkg/config-api-client/api/openapi.yaml | 5 +- pkg/config-api-client/api_configuration.go | 2 +- pkg/config-api-client/client.go | 4 +- pkg/config-api-client/configuration.go | 2 +- .../docs/ConfigurationAPI.md | 2 +- .../docs/GroupsPostRequest.md | 19 ++++++- pkg/config-api-client/model_error_detail.go | 2 +- pkg/config-api-client/model_error_response.go | 2 +- pkg/config-api-client/model_group.go | 2 +- .../model_groups_get_item.go | 2 +- .../model_groups_get_response.go | 2 +- .../model_groups_patch_request.go | 2 +- .../model_groups_patch_response.go | 2 +- .../model_groups_post_request.go | 49 +++++++++++++------ .../model_groups_post_response.go | 2 +- pkg/config-api-client/model_issue.go | 2 +- pkg/config-api-client/model_issue_subject.go | 2 +- pkg/config-api-client/model_network.go | 2 +- .../model_network_group_assignments_item.go | 2 +- ..._network_group_assignments_post_request.go | 2 +- ...network_group_assignments_post_response.go | 2 +- ...odel_network_group_assignments_response.go | 2 +- pkg/config-api-client/model_parent.go | 2 +- pkg/config-api-client/model_sensor.go | 2 +- .../model_sensor_group_assignment_response.go | 2 +- .../model_sensor_group_assignments_item.go | 2 +- ...l_sensor_group_assignments_post_request.go | 2 +- ...model_sensor_group_assignments_response.go | 2 +- pkg/config-api-client/model_service_test_.go | 2 +- ...ice_test_group_assignments_post_request.go | 2 +- ...ce_test_group_assignments_post_response.go | 2 +- .../model_wired_networks_item.go | 2 +- .../model_wired_networks_response.go | 2 +- .../model_wireless_networks_item.go | 2 +- .../model_wireless_networks_response.go | 2 +- pkg/config-api-client/response.go | 2 +- .../test/api_configuration_test.go | 3 +- pkg/config-api-client/utils.go | 2 +- .../provider/resources/group.go | 5 +- 42 files changed, 106 insertions(+), 63 deletions(-) diff --git a/Justfile b/Justfile index 5d40dfb9..61c080a1 100644 --- a/Justfile +++ b/Justfile @@ -11,7 +11,11 @@ retrieve-config-api-openapi-spec: cp {{ TMP_DIR }}/oas/openapi.yaml {{ OPENAPI_SPEC }}/{{ SOURCE_OPEN_API_SPEC_FILE }} rm -rf {{ TMP_DIR }} +cleanup-old-files: + cd {{ CONFIG_API_CLIENT_DIR }} && cat .openapi-generator/FILES | xargs -n 1 rm -f + generate-config-api-client: retrieve-config-api-openapi-spec + just cleanup-old-files docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \ --input-spec /local/{{ OPENAPI_SPEC }}/{{ SOURCE_OPEN_API_SPEC_FILE }} \ --generator-name go \ @@ -20,7 +24,7 @@ generate-config-api-client: retrieve-config-api-openapi-spec --git-user-id aruba-uxi \ --git-repo-id configuration-api-terraform-provider/{{ CONFIG_API_CLIENT_DIR }} \ --openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=configuration - cd {{ CONFIG_API_CLIENT_DIR }} && go mod tidy + just tidy-client just fmt-client setup-dev: diff --git a/pkg/config-api-client/README.md b/pkg/config-api-client/README.md index 2f50da34..d3763639 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: 2.0.0 +- API version: 2.1.0 - Package version: 1.0.0 - Generator version: 7.9.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.GoClientCodegen diff --git a/pkg/config-api-client/api/.openapi.source.yaml b/pkg/config-api-client/api/.openapi.source.yaml index 2471230e..e45f1876 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: 2.0.0 + version: 2.1.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -74,7 +74,8 @@ paths: operationId: groups_post_uxi_v1alpha1_groups_post summary: Groups Post description: >- - Create a new group with the group identified in `parent_uid` as its parent + Create a new group with the group identified in `parent_uid` as its + parent requestBody: required: true content: @@ -708,13 +709,14 @@ components: type: object properties: parentId: - type: string + anyOf: + - type: string + nullable: true title: Parentid name: type: string title: Name required: - - parentId - name title: GroupsPostRequest GroupsPostResponse: diff --git a/pkg/config-api-client/api/openapi.yaml b/pkg/config-api-client/api/openapi.yaml index 313e96d4..7706698b 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: 2.0.0 + version: 2.1.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -759,14 +759,13 @@ components: parentId: parentId properties: parentId: - title: Parentid + nullable: true type: string name: title: Name type: string required: - name - - parentId title: GroupsPostRequest type: object GroupsPostResponse: diff --git a/pkg/config-api-client/api_configuration.go b/pkg/config-api-client/api_configuration.go index df06b18b..f5948c3f 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/client.go b/pkg/config-api-client/client.go index c08ab032..96cb8295 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ @@ -41,7 +41,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Configuration Api API v2.0.0 +// APIClient manages communication with the Configuration Api API v2.1.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 e40e8f9d..820437f4 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/docs/ConfigurationAPI.md b/pkg/config-api-client/docs/ConfigurationAPI.md index d860d7c3..a96cfa4d 100644 --- a/pkg/config-api-client/docs/ConfigurationAPI.md +++ b/pkg/config-api-client/docs/ConfigurationAPI.md @@ -602,7 +602,7 @@ import ( ) func main() { - groupsPostRequest := *openapiclient.NewGroupsPostRequest("ParentId_example", "Name_example") // GroupsPostRequest | + groupsPostRequest := *openapiclient.NewGroupsPostRequest("Name_example") // GroupsPostRequest | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/pkg/config-api-client/docs/GroupsPostRequest.md b/pkg/config-api-client/docs/GroupsPostRequest.md index 4a28f6a1..d4e3aa9f 100644 --- a/pkg/config-api-client/docs/GroupsPostRequest.md +++ b/pkg/config-api-client/docs/GroupsPostRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ParentId** | **string** | | +**ParentId** | Pointer to **NullableString** | | [optional] **Name** | **string** | | ## Methods ### NewGroupsPostRequest -`func NewGroupsPostRequest(parentId string, name string, ) *GroupsPostRequest` +`func NewGroupsPostRequest(name string, ) *GroupsPostRequest` NewGroupsPostRequest instantiates a new GroupsPostRequest object This constructor will assign default values to properties that have it defined, @@ -45,7 +45,22 @@ and a boolean to check if the value has been set. SetParentId sets ParentId field to given value. +### HasParentId +`func (o *GroupsPostRequest) HasParentId() bool` + +HasParentId returns a boolean if a field has been set. + +### SetParentIdNil + +`func (o *GroupsPostRequest) SetParentIdNil(b bool)` + + SetParentIdNil sets the value for ParentId to be an explicit nil + +### UnsetParentId +`func (o *GroupsPostRequest) UnsetParentId()` + +UnsetParentId ensures that no value is present for ParentId, not even an explicit nil ### GetName `func (o *GroupsPostRequest) GetName() string` diff --git a/pkg/config-api-client/model_error_detail.go b/pkg/config-api-client/model_error_detail.go index 09160c14..5468174c 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: 2.0.0 +API version: 2.1.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 eaeac545..fc0821b0 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_group.go b/pkg/config-api-client/model_group.go index 933e5726..012336d1 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: 2.0.0 +API version: 2.1.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 27e56535..96a29e69 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: 2.0.0 +API version: 2.1.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 5e643cdb..2608c3ab 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: 2.0.0 +API version: 2.1.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 32ffa4d2..d5a41641 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: 2.0.0 +API version: 2.1.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 04dcf149..08352ad6 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: 2.0.0 +API version: 2.1.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 17c0c009..d9cc5c68 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ @@ -22,8 +22,8 @@ var _ MappedNullable = &GroupsPostRequest{} // GroupsPostRequest struct for GroupsPostRequest type GroupsPostRequest struct { - ParentId string `json:"parentId"` - Name string `json:"name"` + ParentId NullableString `json:"parentId,omitempty"` + Name string `json:"name"` } type _GroupsPostRequest GroupsPostRequest @@ -32,9 +32,8 @@ type _GroupsPostRequest GroupsPostRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGroupsPostRequest(parentId string, name string) *GroupsPostRequest { +func NewGroupsPostRequest(name string) *GroupsPostRequest { this := GroupsPostRequest{} - this.ParentId = parentId this.Name = name return &this } @@ -47,28 +46,47 @@ func NewGroupsPostRequestWithDefaults() *GroupsPostRequest { return &this } -// GetParentId returns the ParentId field value +// GetParentId returns the ParentId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GroupsPostRequest) GetParentId() string { - if o == nil { + if o == nil || IsNil(o.ParentId.Get()) { var ret string return ret } - - return o.ParentId + return *o.ParentId.Get() } -// GetParentIdOk returns a tuple with the ParentId field value +// GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GroupsPostRequest) GetParentIdOk() (*string, bool) { if o == nil { return nil, false } - return &o.ParentId, true + return o.ParentId.Get(), o.ParentId.IsSet() +} + +// HasParentId returns a boolean if a field has been set. +func (o *GroupsPostRequest) HasParentId() bool { + if o != nil && o.ParentId.IsSet() { + return true + } + + return false } -// SetParentId sets field value +// SetParentId gets a reference to the given NullableString and assigns it to the ParentId field. func (o *GroupsPostRequest) SetParentId(v string) { - o.ParentId = v + o.ParentId.Set(&v) +} + +// SetParentIdNil sets the value for ParentId to be an explicit nil +func (o *GroupsPostRequest) SetParentIdNil() { + o.ParentId.Set(nil) +} + +// UnsetParentId ensures that no value is present for ParentId, not even an explicit nil +func (o *GroupsPostRequest) UnsetParentId() { + o.ParentId.Unset() } // GetName returns the Name field value @@ -105,7 +123,9 @@ func (o GroupsPostRequest) MarshalJSON() ([]byte, error) { func (o GroupsPostRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["parentId"] = o.ParentId + if o.ParentId.IsSet() { + toSerialize["parentId"] = o.ParentId.Get() + } toSerialize["name"] = o.Name return toSerialize, nil } @@ -115,7 +135,6 @@ func (o *GroupsPostRequest) UnmarshalJSON(data []byte) (err error) { // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ - "parentId", "name", } diff --git a/pkg/config-api-client/model_groups_post_response.go b/pkg/config-api-client/model_groups_post_response.go index 8f65472d..c955a725 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue.go b/pkg/config-api-client/model_issue.go index f63cbc05..5c962687 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: 2.0.0 +API version: 2.1.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 7a35c647..29ef3bee 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network.go b/pkg/config-api-client/model_network.go index 20cd86dd..90e3dc19 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: 2.0.0 +API version: 2.1.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 6ca81e7f..a94fc8c4 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: 2.0.0 +API version: 2.1.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 bfbdcf98..8899c683 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: 2.0.0 +API version: 2.1.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 ac1566b9..314d0e40 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: 2.0.0 +API version: 2.1.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 11df0f9d..19880cdd 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_parent.go b/pkg/config-api-client/model_parent.go index 3db71373..bb8ecda5 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor.go b/pkg/config-api-client/model_sensor.go index c2d1b0a1..eda79f71 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: 2.0.0 +API version: 2.1.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 aa0aa4cd..40bfca9e 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: 2.0.0 +API version: 2.1.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 c4e6d83c..cbfc7d6f 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: 2.0.0 +API version: 2.1.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 9ba82db7..2929d955 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: 2.0.0 +API version: 2.1.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 4096fe09..87c80bad 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: 2.0.0 +API version: 2.1.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 59f1bfda..723192a1 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: 2.0.0 +API version: 2.1.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 c2aade1a..627f8dcd 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: 2.0.0 +API version: 2.1.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 bfea8636..2c73ac9b 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: 2.0.0 +API version: 2.1.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 f3457e41..020efd68 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: 2.0.0 +API version: 2.1.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 7e138e65..1d9b72db 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: 2.0.0 +API version: 2.1.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 104d4264..331d4953 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: 2.0.0 +API version: 2.1.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 8eb839ba..784ac6d4 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/response.go b/pkg/config-api-client/response.go index e1f9b8a7..ef072486 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: 2.0.0 +API version: 2.1.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 fe2c75db..745135d0 100644 --- a/pkg/config-api-client/test/api_configuration_test.go +++ b/pkg/config-api-client/test/api_configuration_test.go @@ -79,7 +79,8 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { "path": "parent.uid.node", "type": "uxi/group", }) - groupsPostRequest := openapiclient.NewGroupsPostRequest("parent.uid", "name") + groupsPostRequest := openapiclient.NewGroupsPostRequest("name") + groupsPostRequest.SetParentId("parent.uid") resp, httpRes, err := apiClient.ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost(context.Background()).GroupsPostRequest(*groupsPostRequest).Execute() resourceType := "uxi/group" diff --git a/pkg/config-api-client/utils.go b/pkg/config-api-client/utils.go index dfd4cc1d..a083ff60 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: 2.0.0 +API version: 2.1.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-provider/provider/resources/group.go b/pkg/config-api-provider/provider/resources/group.go index 635d05e6..ab70a766 100644 --- a/pkg/config-api-provider/provider/resources/group.go +++ b/pkg/config-api-provider/provider/resources/group.go @@ -97,7 +97,10 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest, return } - groups_post_request := config_api_client.NewGroupsPostRequest(plan.ParentGroupId.ValueString(), plan.Name.ValueString()) + groups_post_request := config_api_client.NewGroupsPostRequest(plan.Name.ValueString()) + if !plan.ParentGroupId.IsUnknown() { + groups_post_request.SetParentId(plan.ParentGroupId.ValueString()) + } request := r.client.ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost(ctx).GroupsPostRequest(*groups_post_request) group, _, err := util.RetryFor429(request.Execute) if err != nil {