diff --git a/pkg/config-api-client/.openapi-generator/FILES b/pkg/config-api-client/.openapi-generator/FILES index d9e01127..a9d471a3 100644 --- a/pkg/config-api-client/.openapi-generator/FILES +++ b/pkg/config-api-client/.openapi-generator/FILES @@ -6,14 +6,21 @@ configuration.go docs/ConfigurationAPI.md docs/ErrorDetail.md docs/ErrorResponse.md +docs/Group.md docs/GroupsGetItem.md docs/GroupsGetResponse.md docs/GroupsPostRequest.md docs/GroupsPostResponse.md +docs/Issue.md +docs/IssueSubject.md docs/NetworkGroupAssignmentsItem.md docs/NetworkGroupAssignmentsResponse.md docs/PaginationDetails.md +docs/Parent.md +docs/Sensor.md +docs/SensorGroupAssignmentResponse.md docs/SensorGroupAssignmentsItem.md +docs/SensorGroupAssignmentsPostRequest.md docs/SensorGroupAssignmentsResponse.md docs/WiredNetworksItem.md docs/WiredNetworksResponse.md @@ -23,14 +30,21 @@ go.mod go.sum model_error_detail.go model_error_response.go +model_group.go model_groups_get_item.go model_groups_get_response.go model_groups_post_request.go model_groups_post_response.go +model_issue.go +model_issue_subject.go model_network_group_assignments_item.go model_network_group_assignments_response.go model_pagination_details.go +model_parent.go +model_sensor.go +model_sensor_group_assignment_response.go model_sensor_group_assignments_item.go +model_sensor_group_assignments_post_request.go model_sensor_group_assignments_response.go model_wired_networks_item.go model_wired_networks_response.go diff --git a/pkg/config-api-client/.openapi-generator/VERSION b/pkg/config-api-client/.openapi-generator/VERSION index 6116b14d..17f2442f 100644 --- a/pkg/config-api-client/.openapi-generator/VERSION +++ b/pkg/config-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.8.0-SNAPSHOT +7.9.0-SNAPSHOT diff --git a/pkg/config-api-client/README.md b/pkg/config-api-client/README.md index 6e3ae619..04282baa 100644 --- a/pkg/config-api-client/README.md +++ b/pkg/config-api-client/README.md @@ -5,9 +5,9 @@ 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: 1.11.0 +- API version: 1.14.0 - Package version: 1.0.0 -- Generator version: 7.8.0-SNAPSHOT +- Generator version: 7.9.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit [http://we.dont.care.yet.com/contact](http://we.dont.care.yet.com/contact) @@ -79,26 +79,34 @@ All URIs are relative to *https://api.capenetworks.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ConfigurationAPI* | [**GetConfigurationAppV1NetworkGroupAssignmentsGet**](docs/ConfigurationAPI.md#getconfigurationappv1networkgroupassignmentsget) | **Get** /configuration/app/v1/network-group-assignments | Get -*ConfigurationAPI* | [**GetConfigurationAppV1SensorGroupAssignmentsGet**](docs/ConfigurationAPI.md#getconfigurationappv1sensorgroupassignmentsget) | **Get** /configuration/app/v1/sensor-group-assignments | Get -*ConfigurationAPI* | [**GetConfigurationAppV1WiredNetworksGet**](docs/ConfigurationAPI.md#getconfigurationappv1wirednetworksget) | **Get** /configuration/app/v1/wired-networks | Get -*ConfigurationAPI* | [**GetConfigurationAppV1WirelessNetworksGet**](docs/ConfigurationAPI.md#getconfigurationappv1wirelessnetworksget) | **Get** /configuration/app/v1/wireless-networks | Get -*ConfigurationAPI* | [**GroupsGetConfigurationAppV1GroupsGet**](docs/ConfigurationAPI.md#groupsgetconfigurationappv1groupsget) | **Get** /configuration/app/v1/groups | Groups Get -*ConfigurationAPI* | [**GroupsPostConfigurationAppV1GroupsPost**](docs/ConfigurationAPI.md#groupspostconfigurationappv1groupspost) | **Post** /configuration/app/v1/groups | Groups Post +*ConfigurationAPI* | [**GetUxiV1alpha1NetworkGroupAssignmentsGet**](docs/ConfigurationAPI.md#getuxiv1alpha1networkgroupassignmentsget) | **Get** /uxi/v1alpha1/network-group-assignments | Get +*ConfigurationAPI* | [**GetUxiV1alpha1SensorGroupAssignmentsGet**](docs/ConfigurationAPI.md#getuxiv1alpha1sensorgroupassignmentsget) | **Get** /uxi/v1alpha1/sensor-group-assignments | Get +*ConfigurationAPI* | [**GetUxiV1alpha1WiredNetworksGet**](docs/ConfigurationAPI.md#getuxiv1alpha1wirednetworksget) | **Get** /uxi/v1alpha1/wired-networks | Get +*ConfigurationAPI* | [**GetUxiV1alpha1WirelessNetworksGet**](docs/ConfigurationAPI.md#getuxiv1alpha1wirelessnetworksget) | **Get** /uxi/v1alpha1/wireless-networks | Get +*ConfigurationAPI* | [**GroupsGetUxiV1alpha1GroupsGet**](docs/ConfigurationAPI.md#groupsgetuxiv1alpha1groupsget) | **Get** /uxi/v1alpha1/groups | Groups Get +*ConfigurationAPI* | [**GroupsPostUxiV1alpha1GroupsPost**](docs/ConfigurationAPI.md#groupspostuxiv1alpha1groupspost) | **Post** /uxi/v1alpha1/groups | Groups Post +*ConfigurationAPI* | [**PostUxiV1alpha1SensorGroupAssignmentsPost**](docs/ConfigurationAPI.md#postuxiv1alpha1sensorgroupassignmentspost) | **Post** /uxi/v1alpha1/sensor-group-assignments | Post ## Documentation For Models - [ErrorDetail](docs/ErrorDetail.md) - [ErrorResponse](docs/ErrorResponse.md) + - [Group](docs/Group.md) - [GroupsGetItem](docs/GroupsGetItem.md) - [GroupsGetResponse](docs/GroupsGetResponse.md) - [GroupsPostRequest](docs/GroupsPostRequest.md) - [GroupsPostResponse](docs/GroupsPostResponse.md) + - [Issue](docs/Issue.md) + - [IssueSubject](docs/IssueSubject.md) - [NetworkGroupAssignmentsItem](docs/NetworkGroupAssignmentsItem.md) - [NetworkGroupAssignmentsResponse](docs/NetworkGroupAssignmentsResponse.md) - [PaginationDetails](docs/PaginationDetails.md) + - [Parent](docs/Parent.md) + - [Sensor](docs/Sensor.md) + - [SensorGroupAssignmentResponse](docs/SensorGroupAssignmentResponse.md) - [SensorGroupAssignmentsItem](docs/SensorGroupAssignmentsItem.md) + - [SensorGroupAssignmentsPostRequest](docs/SensorGroupAssignmentsPostRequest.md) - [SensorGroupAssignmentsResponse](docs/SensorGroupAssignmentsResponse.md) - [WiredNetworksItem](docs/WiredNetworksItem.md) - [WiredNetworksResponse](docs/WiredNetworksResponse.md) diff --git a/pkg/config-api-client/api/.openapi.source.yaml b/pkg/config-api-client/api/.openapi.source.yaml index b40f24ed..efb154aa 100644 --- a/pkg/config-api-client/api/.openapi.source.yaml +++ b/pkg/config-api-client/api/.openapi.source.yaml @@ -9,14 +9,14 @@ info: email: support@capenetworks.com license: name: No idea, but we need something - version: 1.11.0 + version: 1.14.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io paths: - /configuration/app/v1/groups: + /uxi/v1alpha1/groups: get: - operationId: groups_get_configuration_app_v1_groups_get + operationId: groups_get_uxi_v1alpha1_groups_get summary: Groups Get description: Lists groups matching provided criteria parameters: @@ -67,11 +67,11 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - groups x-stability-level: alpha post: - operationId: groups_post_configuration_app_v1_groups_post + 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 @@ -105,11 +105,12 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - groups - /configuration/app/v1/network-group-assignments: + x-stability-level: alpha + /uxi/v1alpha1/network-group-assignments: get: - operationId: get_configuration_app_v1_network_group_assignments_get + operationId: get_uxi_v1alpha1_network_group_assignments_get summary: Get description: Get a list of network group assignments parameters: @@ -160,12 +161,12 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - network-group-assignments x-stability-level: alpha - /configuration/app/v1/sensor-group-assignments: + /uxi/v1alpha1/sensor-group-assignments: get: - operationId: get_configuration_app_v1_sensor_group_assignments_get + operationId: get_uxi_v1alpha1_sensor_group_assignments_get summary: Get description: Get a list of sensor group assignments parameters: @@ -216,12 +217,49 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - sensor-group-assignments x-stability-level: alpha - /configuration/app/v1/wired-networks: + post: + operationId: post_uxi_v1alpha1_sensor_group_assignments_post + summary: Post + description: Create sensor group assignment + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SensorGroupAssignmentsPostRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/SensorGroupAssignmentResponse' + 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 + - sensor-group-assignments + x-stability-level: alpha + /uxi/v1alpha1/wired-networks: get: - operationId: get_configuration_app_v1_wired_networks_get + operationId: get_uxi_v1alpha1_wired_networks_get summary: Get description: Get a list of wired networks parameters: @@ -272,12 +310,12 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - wired-networks x-stability-level: alpha - /configuration/app/v1/wireless-networks: + /uxi/v1alpha1/wireless-networks: get: - operationId: get_configuration_app_v1_wireless_networks_get + operationId: get_uxi_v1alpha1_wireless_networks_get summary: Get description: Get a list of wireless networks parameters: @@ -328,7 +366,7 @@ paths: tags: - api - configuration - - v1 + - v1alpha1 - wireless-networks x-stability-level: alpha components: @@ -336,94 +374,160 @@ components: ErrorDetail: type: object properties: - message: + issues: + type: array + items: + $ref: '#/components/schemas/Issue' + title: Issues + type: type: string - title: Message + title: Type required: - - message + - issues + - type title: ErrorDetail ErrorResponse: type: object properties: - detail: - type: array - items: - $ref: '#/components/schemas/ErrorDetail' - title: Detail + debugId: + type: string + title: Debugid + errorCode: + type: string + title: Errorcode + httpStatusCode: + type: integer + title: Httpstatuscode + message: + type: string + title: Message + errorDetails: + anyOf: + - items: + $ref: '#/components/schemas/ErrorDetail' + type: array + nullable: true + title: Errordetails required: - - detail + - debugId + - errorCode + - httpStatusCode + - message + - errorDetails title: ErrorResponse + Group: + type: object + properties: + id: + type: string + title: Id + required: + - id + title: Group GroupsGetItem: type: object properties: - uid: + id: type: string - title: Uid + title: Id name: type: string title: Name + parent: + anyOf: + - $ref: '#/components/schemas/Parent' + nullable: true path: type: string title: Path - parent_uid: - anyOf: - - type: string - nullable: true - title: Parent Uid + type: + type: string + default: uxi/group + title: Type required: - - uid + - id - name + - parent - path - - parent_uid title: GroupsGetItem GroupsGetResponse: type: object properties: - pagination: - $ref: '#/components/schemas/PaginationDetails' - groups: + items: type: array items: $ref: '#/components/schemas/GroupsGetItem' - title: Groups + title: Items + count: + type: integer + title: Count + next: + anyOf: + - type: string + nullable: true + title: Next required: - - pagination - - groups + - items + - count + - next title: GroupsGetResponse GroupsPostRequest: type: object properties: - parent_uid: + parentId: type: string - title: Parent Uid + title: Parentid name: type: string title: Name required: - - parent_uid + - parentId - name title: GroupsPostRequest GroupsPostResponse: type: object properties: - parent_uid: - type: string - title: Parent Uid name: type: string title: Name - uid: - type: string - title: Uid path: type: string title: Path + parent_uid: + type: string + title: Parent Uid + uid: + type: string + title: Uid required: - - parent_uid - name - - uid - path + - parent_uid + - uid title: GroupsPostResponse + Issue: + type: object + properties: + description: + type: string + title: Description + subject: + $ref: '#/components/schemas/IssueSubject' + source: + type: string + title: Source + required: + - description + - subject + - source + title: Issue + IssueSubject: + type: string + enum: + - field + - header + - query.parameter + title: IssueSubject NetworkGroupAssignmentsItem: type: object properties: @@ -488,6 +592,43 @@ components: - first - last title: PaginationDetails + Parent: + type: object + properties: + id: + type: string + title: Id + required: + - id + title: Parent + Sensor: + type: object + properties: + id: + type: string + title: Id + required: + - id + title: Sensor + SensorGroupAssignmentResponse: + type: object + properties: + id: + type: string + title: Id + group: + $ref: '#/components/schemas/Group' + sensor: + $ref: '#/components/schemas/Sensor' + type: + type: string + default: uxi/sensor-group-assignment + title: Type + required: + - id + - group + - sensor + title: SensorGroupAssignmentResponse SensorGroupAssignmentsItem: type: object properties: @@ -505,6 +646,19 @@ components: - group_uid - sensor_uid title: SensorGroupAssignmentsItem + SensorGroupAssignmentsPostRequest: + type: object + properties: + groupId: + type: string + title: Groupid + sensorId: + type: string + title: Sensorid + required: + - groupId + - sensorId + title: SensorGroupAssignmentsPostRequest SensorGroupAssignmentsResponse: type: object properties: @@ -674,6 +828,7 @@ components: tags: - name: api - name: v1 + - name: v1alpha1 - name: configuration - name: groups - name: health diff --git a/pkg/config-api-client/api/openapi.yaml b/pkg/config-api-client/api/openapi.yaml index b1327b28..0b17ec02 100644 --- a/pkg/config-api-client/api/openapi.yaml +++ b/pkg/config-api-client/api/openapi.yaml @@ -9,13 +9,14 @@ info: name: "No idea, but we need something" termsOfService: http://we.dont.care.yet.com/term-of-service title: Configuration Api - version: 1.11.0 + version: 1.14.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io tags: - name: api - name: v1 +- name: v1alpha1 - name: configuration - name: groups - name: health @@ -24,10 +25,10 @@ tags: - name: wired-networks - name: wireless-networks paths: - /configuration/app/v1/groups: + /uxi/v1alpha1/groups: get: description: Lists groups matching provided criteria - operationId: groups_get_configuration_app_v1_groups_get + operationId: groups_get_uxi_v1alpha1_groups_get parameters: - explode: true in: query @@ -82,7 +83,7 @@ paths: post: description: Create a new group with the group identified in `parent_uid` as its parent - operationId: groups_post_configuration_app_v1_groups_post + operationId: groups_post_uxi_v1alpha1_groups_post requestBody: content: application/json: @@ -113,10 +114,11 @@ paths: summary: Groups Post tags: - configuration - /configuration/app/v1/network-group-assignments: + x-stability-level: alpha + /uxi/v1alpha1/network-group-assignments: get: description: Get a list of network group assignments - operationId: get_configuration_app_v1_network_group_assignments_get + operationId: get_uxi_v1alpha1_network_group_assignments_get parameters: - explode: true in: query @@ -168,10 +170,10 @@ paths: tags: - configuration x-stability-level: alpha - /configuration/app/v1/sensor-group-assignments: + /uxi/v1alpha1/sensor-group-assignments: get: description: Get a list of sensor group assignments - operationId: get_configuration_app_v1_sensor_group_assignments_get + operationId: get_uxi_v1alpha1_sensor_group_assignments_get parameters: - explode: true in: query @@ -223,10 +225,44 @@ paths: tags: - configuration x-stability-level: alpha - /configuration/app/v1/wired-networks: + post: + description: Create sensor group assignment + operationId: post_uxi_v1alpha1_sensor_group_assignments_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SensorGroupAssignmentsPostRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SensorGroupAssignmentResponse' + 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: Post + tags: + - configuration + x-stability-level: alpha + /uxi/v1alpha1/wired-networks: get: description: Get a list of wired networks - operationId: get_configuration_app_v1_wired_networks_get + operationId: get_uxi_v1alpha1_wired_networks_get parameters: - explode: true in: query @@ -278,10 +314,10 @@ paths: tags: - configuration x-stability-level: alpha - /configuration/app/v1/wireless-networks: + /uxi/v1alpha1/wireless-networks: get: description: Get a list of wireless networks - operationId: get_configuration_app_v1_wireless_networks_get + operationId: get_uxi_v1alpha1_wireless_networks_get parameters: - explode: true in: query @@ -337,121 +373,189 @@ components: schemas: ErrorDetail: example: - message: message + type: type + issues: + - subject: field + description: description + source: source + - subject: field + description: description + source: source properties: - message: - title: Message + issues: + items: + $ref: '#/components/schemas/Issue' + title: Issues + type: array + type: + title: Type type: string required: - - message + - issues + - type title: ErrorDetail type: object ErrorResponse: example: - detail: - - message: message - - message: message + errorCode: errorCode + debugId: debugId + message: message + httpStatusCode: 6 + errorDetails: + - type: type + issues: + - subject: field + description: description + source: source + - subject: field + description: description + source: source + - type: type + issues: + - subject: field + description: description + source: source + - subject: field + description: description + source: source properties: - detail: + debugId: + title: Debugid + type: string + errorCode: + title: Errorcode + type: string + httpStatusCode: + title: Httpstatuscode + type: integer + message: + title: Message + type: string + errorDetails: items: $ref: '#/components/schemas/ErrorDetail' - title: Detail + nullable: true type: array required: - - detail + - debugId + - errorCode + - errorDetails + - httpStatusCode + - message title: ErrorResponse type: object + Group: + example: + id: id + properties: + id: + title: Id + type: string + required: + - id + title: Group + type: object GroupsGetItem: example: - uid: uid + parent: + id: id path: path - parent_uid: parent_uid name: name + id: id + type: uxi/group properties: - uid: - title: Uid + id: + title: Id type: string name: title: Name type: string + parent: + $ref: '#/components/schemas/Parent' path: title: Path type: string - parent_uid: - nullable: true + type: + default: uxi/group + title: Type type: string required: + - id - name - - parent_uid + - parent - path - - uid title: GroupsGetItem type: object GroupsGetResponse: example: - pagination: - next: next - previous: previous - last: last - limit: 0 - first: first - groups: - - uid: uid + next: next + count: 0 + items: + - parent: + id: id path: path - parent_uid: parent_uid name: name - - uid: uid + id: id + type: uxi/group + - parent: + id: id path: path - parent_uid: parent_uid name: name + id: id + type: uxi/group properties: - pagination: - $ref: '#/components/schemas/PaginationDetails' - groups: + items: items: $ref: '#/components/schemas/GroupsGetItem' - title: Groups + title: Items type: array + count: + title: Count + type: integer + next: + nullable: true + type: string required: - - groups - - pagination + - count + - items + - next title: GroupsGetResponse type: object GroupsPostRequest: example: - parent_uid: parent_uid name: name + parentId: parentId properties: - parent_uid: - title: Parent Uid + parentId: + title: Parentid type: string name: title: Name type: string required: - name - - parent_uid + - parentId title: GroupsPostRequest type: object GroupsPostResponse: example: - uid: uid path: path + uid: uid parent_uid: parent_uid name: name properties: - parent_uid: - title: Parent Uid - type: string name: title: Name type: string - uid: - title: Uid - type: string path: title: Path type: string + parent_uid: + title: Parent Uid + type: string + uid: + title: Uid + type: string required: - name - parent_uid @@ -459,6 +563,33 @@ components: - uid title: GroupsPostResponse type: object + Issue: + example: + subject: field + description: description + source: source + properties: + description: + title: Description + type: string + subject: + $ref: '#/components/schemas/IssueSubject' + source: + title: Source + type: string + required: + - description + - source + - subject + title: Issue + type: object + IssueSubject: + enum: + - field + - header + - query.parameter + title: IssueSubject + type: string NetworkGroupAssignmentsItem: example: group_uid: group_uid @@ -539,6 +670,54 @@ components: - previous title: PaginationDetails type: object + Parent: + example: + id: id + properties: + id: + title: Id + type: string + required: + - id + title: Parent + type: object + Sensor: + example: + id: id + properties: + id: + title: Id + type: string + required: + - id + title: Sensor + type: object + SensorGroupAssignmentResponse: + example: + sensor: + id: id + id: id + type: uxi/sensor-group-assignment + group: + id: id + properties: + id: + title: Id + type: string + group: + $ref: '#/components/schemas/Group' + sensor: + $ref: '#/components/schemas/Sensor' + type: + default: uxi/sensor-group-assignment + title: Type + type: string + required: + - group + - id + - sensor + title: SensorGroupAssignmentResponse + type: object SensorGroupAssignmentsItem: example: group_uid: group_uid @@ -560,6 +739,22 @@ components: - uid title: SensorGroupAssignmentsItem type: object + SensorGroupAssignmentsPostRequest: + example: + groupId: groupId + sensorId: sensorId + properties: + groupId: + title: Groupid + type: string + sensorId: + title: Sensorid + type: string + required: + - groupId + - sensorId + title: SensorGroupAssignmentsPostRequest + type: object SensorGroupAssignmentsResponse: example: sensor_group_assignments: diff --git a/pkg/config-api-client/api_configuration.go b/pkg/config-api-client/api_configuration.go index 93735952..f8f60503 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,7 +22,7 @@ import ( // ConfigurationAPIService ConfigurationAPI service type ConfigurationAPIService service -type ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest struct { +type ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService uid *string @@ -30,35 +30,35 @@ type ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest struct { limit *int32 } -func (r ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest) Uid(uid string) ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest) Uid(uid string) ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest { r.uid = &uid return r } -func (r ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest) Cursor(cursor string) ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest) Cursor(cursor string) ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest { r.cursor = &cursor return r } -func (r ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest) Limit(limit int32) ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest) Limit(limit int32) ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest { r.limit = &limit return r } -func (r ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest) Execute() (*NetworkGroupAssignmentsResponse, *http.Response, error) { - return r.ApiService.GetConfigurationAppV1NetworkGroupAssignmentsGetExecute(r) +func (r ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest) Execute() (*NetworkGroupAssignmentsResponse, *http.Response, error) { + return r.ApiService.GetUxiV1alpha1NetworkGroupAssignmentsGetExecute(r) } /* -GetConfigurationAppV1NetworkGroupAssignmentsGet Get +GetUxiV1alpha1NetworkGroupAssignmentsGet Get Get a list of network group assignments @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest + @return ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest */ -func (a *ConfigurationAPIService) GetConfigurationAppV1NetworkGroupAssignmentsGet(ctx context.Context) ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest { - return ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest{ +func (a *ConfigurationAPIService) GetUxiV1alpha1NetworkGroupAssignmentsGet(ctx context.Context) ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest { + return ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest{ ApiService: a, ctx: ctx, } @@ -67,7 +67,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1NetworkGroupAssignmentsGe // Execute executes the request // // @return NetworkGroupAssignmentsResponse -func (a *ConfigurationAPIService) GetConfigurationAppV1NetworkGroupAssignmentsGetExecute(r ApiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest) (*NetworkGroupAssignmentsResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GetUxiV1alpha1NetworkGroupAssignmentsGetExecute(r ApiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest) (*NetworkGroupAssignmentsResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -75,25 +75,25 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1NetworkGroupAssignmentsGe localVarReturnValue *NetworkGroupAssignmentsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetConfigurationAppV1NetworkGroupAssignmentsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetUxiV1alpha1NetworkGroupAssignmentsGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/network-group-assignments" + localVarPath := localBasePath + "/uxi/v1alpha1/network-group-assignments" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.uid != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "form", "") } if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") } if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } else { var defaultValue int32 = 50 r.limit = &defaultValue @@ -173,7 +173,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1NetworkGroupAssignmentsGe return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest struct { +type ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService uid *string @@ -181,35 +181,35 @@ type ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest struct { limit *int32 } -func (r ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest) Uid(uid string) ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest) Uid(uid string) ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest { r.uid = &uid return r } -func (r ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest) Cursor(cursor string) ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest) Cursor(cursor string) ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest { r.cursor = &cursor return r } -func (r ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest) Limit(limit int32) ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest { +func (r ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest) Limit(limit int32) ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest { r.limit = &limit return r } -func (r ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest) Execute() (*SensorGroupAssignmentsResponse, *http.Response, error) { - return r.ApiService.GetConfigurationAppV1SensorGroupAssignmentsGetExecute(r) +func (r ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest) Execute() (*SensorGroupAssignmentsResponse, *http.Response, error) { + return r.ApiService.GetUxiV1alpha1SensorGroupAssignmentsGetExecute(r) } /* -GetConfigurationAppV1SensorGroupAssignmentsGet Get +GetUxiV1alpha1SensorGroupAssignmentsGet Get Get a list of sensor group assignments @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest + @return ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest */ -func (a *ConfigurationAPIService) GetConfigurationAppV1SensorGroupAssignmentsGet(ctx context.Context) ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest { - return ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest{ +func (a *ConfigurationAPIService) GetUxiV1alpha1SensorGroupAssignmentsGet(ctx context.Context) ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest { + return ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest{ ApiService: a, ctx: ctx, } @@ -218,7 +218,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1SensorGroupAssignmentsGet // Execute executes the request // // @return SensorGroupAssignmentsResponse -func (a *ConfigurationAPIService) GetConfigurationAppV1SensorGroupAssignmentsGetExecute(r ApiGetConfigurationAppV1SensorGroupAssignmentsGetRequest) (*SensorGroupAssignmentsResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GetUxiV1alpha1SensorGroupAssignmentsGetExecute(r ApiGetUxiV1alpha1SensorGroupAssignmentsGetRequest) (*SensorGroupAssignmentsResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -226,25 +226,25 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1SensorGroupAssignmentsGet localVarReturnValue *SensorGroupAssignmentsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetConfigurationAppV1SensorGroupAssignmentsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetUxiV1alpha1SensorGroupAssignmentsGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/sensor-group-assignments" + localVarPath := localBasePath + "/uxi/v1alpha1/sensor-group-assignments" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.uid != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "form", "") } if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") } if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } else { var defaultValue int32 = 50 r.limit = &defaultValue @@ -324,7 +324,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1SensorGroupAssignmentsGet return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConfigurationAppV1WiredNetworksGetRequest struct { +type ApiGetUxiV1alpha1WiredNetworksGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService uid *string @@ -332,35 +332,35 @@ type ApiGetConfigurationAppV1WiredNetworksGetRequest struct { limit *int32 } -func (r ApiGetConfigurationAppV1WiredNetworksGetRequest) Uid(uid string) ApiGetConfigurationAppV1WiredNetworksGetRequest { +func (r ApiGetUxiV1alpha1WiredNetworksGetRequest) Uid(uid string) ApiGetUxiV1alpha1WiredNetworksGetRequest { r.uid = &uid return r } -func (r ApiGetConfigurationAppV1WiredNetworksGetRequest) Cursor(cursor string) ApiGetConfigurationAppV1WiredNetworksGetRequest { +func (r ApiGetUxiV1alpha1WiredNetworksGetRequest) Cursor(cursor string) ApiGetUxiV1alpha1WiredNetworksGetRequest { r.cursor = &cursor return r } -func (r ApiGetConfigurationAppV1WiredNetworksGetRequest) Limit(limit int32) ApiGetConfigurationAppV1WiredNetworksGetRequest { +func (r ApiGetUxiV1alpha1WiredNetworksGetRequest) Limit(limit int32) ApiGetUxiV1alpha1WiredNetworksGetRequest { r.limit = &limit return r } -func (r ApiGetConfigurationAppV1WiredNetworksGetRequest) Execute() (*WiredNetworksResponse, *http.Response, error) { - return r.ApiService.GetConfigurationAppV1WiredNetworksGetExecute(r) +func (r ApiGetUxiV1alpha1WiredNetworksGetRequest) Execute() (*WiredNetworksResponse, *http.Response, error) { + return r.ApiService.GetUxiV1alpha1WiredNetworksGetExecute(r) } /* -GetConfigurationAppV1WiredNetworksGet Get +GetUxiV1alpha1WiredNetworksGet Get Get a list of wired networks @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetConfigurationAppV1WiredNetworksGetRequest + @return ApiGetUxiV1alpha1WiredNetworksGetRequest */ -func (a *ConfigurationAPIService) GetConfigurationAppV1WiredNetworksGet(ctx context.Context) ApiGetConfigurationAppV1WiredNetworksGetRequest { - return ApiGetConfigurationAppV1WiredNetworksGetRequest{ +func (a *ConfigurationAPIService) GetUxiV1alpha1WiredNetworksGet(ctx context.Context) ApiGetUxiV1alpha1WiredNetworksGetRequest { + return ApiGetUxiV1alpha1WiredNetworksGetRequest{ ApiService: a, ctx: ctx, } @@ -369,7 +369,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WiredNetworksGet(ctx cont // Execute executes the request // // @return WiredNetworksResponse -func (a *ConfigurationAPIService) GetConfigurationAppV1WiredNetworksGetExecute(r ApiGetConfigurationAppV1WiredNetworksGetRequest) (*WiredNetworksResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GetUxiV1alpha1WiredNetworksGetExecute(r ApiGetUxiV1alpha1WiredNetworksGetRequest) (*WiredNetworksResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -377,25 +377,25 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WiredNetworksGetExecute(r localVarReturnValue *WiredNetworksResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetConfigurationAppV1WiredNetworksGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetUxiV1alpha1WiredNetworksGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/wired-networks" + localVarPath := localBasePath + "/uxi/v1alpha1/wired-networks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.uid != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "form", "") } if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") } if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } else { var defaultValue int32 = 50 r.limit = &defaultValue @@ -475,7 +475,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WiredNetworksGetExecute(r return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConfigurationAppV1WirelessNetworksGetRequest struct { +type ApiGetUxiV1alpha1WirelessNetworksGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService uid *string @@ -483,35 +483,35 @@ type ApiGetConfigurationAppV1WirelessNetworksGetRequest struct { limit *int32 } -func (r ApiGetConfigurationAppV1WirelessNetworksGetRequest) Uid(uid string) ApiGetConfigurationAppV1WirelessNetworksGetRequest { +func (r ApiGetUxiV1alpha1WirelessNetworksGetRequest) Uid(uid string) ApiGetUxiV1alpha1WirelessNetworksGetRequest { r.uid = &uid return r } -func (r ApiGetConfigurationAppV1WirelessNetworksGetRequest) Cursor(cursor string) ApiGetConfigurationAppV1WirelessNetworksGetRequest { +func (r ApiGetUxiV1alpha1WirelessNetworksGetRequest) Cursor(cursor string) ApiGetUxiV1alpha1WirelessNetworksGetRequest { r.cursor = &cursor return r } -func (r ApiGetConfigurationAppV1WirelessNetworksGetRequest) Limit(limit int32) ApiGetConfigurationAppV1WirelessNetworksGetRequest { +func (r ApiGetUxiV1alpha1WirelessNetworksGetRequest) Limit(limit int32) ApiGetUxiV1alpha1WirelessNetworksGetRequest { r.limit = &limit return r } -func (r ApiGetConfigurationAppV1WirelessNetworksGetRequest) Execute() (*WirelessNetworksResponse, *http.Response, error) { - return r.ApiService.GetConfigurationAppV1WirelessNetworksGetExecute(r) +func (r ApiGetUxiV1alpha1WirelessNetworksGetRequest) Execute() (*WirelessNetworksResponse, *http.Response, error) { + return r.ApiService.GetUxiV1alpha1WirelessNetworksGetExecute(r) } /* -GetConfigurationAppV1WirelessNetworksGet Get +GetUxiV1alpha1WirelessNetworksGet Get Get a list of wireless networks @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetConfigurationAppV1WirelessNetworksGetRequest + @return ApiGetUxiV1alpha1WirelessNetworksGetRequest */ -func (a *ConfigurationAPIService) GetConfigurationAppV1WirelessNetworksGet(ctx context.Context) ApiGetConfigurationAppV1WirelessNetworksGetRequest { - return ApiGetConfigurationAppV1WirelessNetworksGetRequest{ +func (a *ConfigurationAPIService) GetUxiV1alpha1WirelessNetworksGet(ctx context.Context) ApiGetUxiV1alpha1WirelessNetworksGetRequest { + return ApiGetUxiV1alpha1WirelessNetworksGetRequest{ ApiService: a, ctx: ctx, } @@ -520,7 +520,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WirelessNetworksGet(ctx c // Execute executes the request // // @return WirelessNetworksResponse -func (a *ConfigurationAPIService) GetConfigurationAppV1WirelessNetworksGetExecute(r ApiGetConfigurationAppV1WirelessNetworksGetRequest) (*WirelessNetworksResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GetUxiV1alpha1WirelessNetworksGetExecute(r ApiGetUxiV1alpha1WirelessNetworksGetRequest) (*WirelessNetworksResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -528,25 +528,25 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WirelessNetworksGetExecut localVarReturnValue *WirelessNetworksResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetConfigurationAppV1WirelessNetworksGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GetUxiV1alpha1WirelessNetworksGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/wireless-networks" + localVarPath := localBasePath + "/uxi/v1alpha1/wireless-networks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.uid != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "form", "") } if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") } if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } else { var defaultValue int32 = 50 r.limit = &defaultValue @@ -626,7 +626,7 @@ func (a *ConfigurationAPIService) GetConfigurationAppV1WirelessNetworksGetExecut return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGroupsGetConfigurationAppV1GroupsGetRequest struct { +type ApiGroupsGetUxiV1alpha1GroupsGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService uid *string @@ -634,35 +634,35 @@ type ApiGroupsGetConfigurationAppV1GroupsGetRequest struct { limit *int32 } -func (r ApiGroupsGetConfigurationAppV1GroupsGetRequest) Uid(uid string) ApiGroupsGetConfigurationAppV1GroupsGetRequest { +func (r ApiGroupsGetUxiV1alpha1GroupsGetRequest) Uid(uid string) ApiGroupsGetUxiV1alpha1GroupsGetRequest { r.uid = &uid return r } -func (r ApiGroupsGetConfigurationAppV1GroupsGetRequest) Cursor(cursor string) ApiGroupsGetConfigurationAppV1GroupsGetRequest { +func (r ApiGroupsGetUxiV1alpha1GroupsGetRequest) Cursor(cursor string) ApiGroupsGetUxiV1alpha1GroupsGetRequest { r.cursor = &cursor return r } -func (r ApiGroupsGetConfigurationAppV1GroupsGetRequest) Limit(limit int32) ApiGroupsGetConfigurationAppV1GroupsGetRequest { +func (r ApiGroupsGetUxiV1alpha1GroupsGetRequest) Limit(limit int32) ApiGroupsGetUxiV1alpha1GroupsGetRequest { r.limit = &limit return r } -func (r ApiGroupsGetConfigurationAppV1GroupsGetRequest) Execute() (*GroupsGetResponse, *http.Response, error) { - return r.ApiService.GroupsGetConfigurationAppV1GroupsGetExecute(r) +func (r ApiGroupsGetUxiV1alpha1GroupsGetRequest) Execute() (*GroupsGetResponse, *http.Response, error) { + return r.ApiService.GroupsGetUxiV1alpha1GroupsGetExecute(r) } /* -GroupsGetConfigurationAppV1GroupsGet Groups Get +GroupsGetUxiV1alpha1GroupsGet Groups Get Lists groups matching provided criteria @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGroupsGetConfigurationAppV1GroupsGetRequest + @return ApiGroupsGetUxiV1alpha1GroupsGetRequest */ -func (a *ConfigurationAPIService) GroupsGetConfigurationAppV1GroupsGet(ctx context.Context) ApiGroupsGetConfigurationAppV1GroupsGetRequest { - return ApiGroupsGetConfigurationAppV1GroupsGetRequest{ +func (a *ConfigurationAPIService) GroupsGetUxiV1alpha1GroupsGet(ctx context.Context) ApiGroupsGetUxiV1alpha1GroupsGetRequest { + return ApiGroupsGetUxiV1alpha1GroupsGetRequest{ ApiService: a, ctx: ctx, } @@ -671,7 +671,7 @@ func (a *ConfigurationAPIService) GroupsGetConfigurationAppV1GroupsGet(ctx conte // Execute executes the request // // @return GroupsGetResponse -func (a *ConfigurationAPIService) GroupsGetConfigurationAppV1GroupsGetExecute(r ApiGroupsGetConfigurationAppV1GroupsGetRequest) (*GroupsGetResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GroupsGetUxiV1alpha1GroupsGetExecute(r ApiGroupsGetUxiV1alpha1GroupsGetRequest) (*GroupsGetResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -679,25 +679,25 @@ func (a *ConfigurationAPIService) GroupsGetConfigurationAppV1GroupsGetExecute(r localVarReturnValue *GroupsGetResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GroupsGetConfigurationAppV1GroupsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GroupsGetUxiV1alpha1GroupsGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/groups" + localVarPath := localBasePath + "/uxi/v1alpha1/groups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.uid != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "uid", r.uid, "form", "") } if r.cursor != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") } if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } else { var defaultValue int32 = 50 r.limit = &defaultValue @@ -777,31 +777,31 @@ func (a *ConfigurationAPIService) GroupsGetConfigurationAppV1GroupsGetExecute(r return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGroupsPostConfigurationAppV1GroupsPostRequest struct { +type ApiGroupsPostUxiV1alpha1GroupsPostRequest struct { ctx context.Context ApiService *ConfigurationAPIService groupsPostRequest *GroupsPostRequest } -func (r ApiGroupsPostConfigurationAppV1GroupsPostRequest) GroupsPostRequest(groupsPostRequest GroupsPostRequest) ApiGroupsPostConfigurationAppV1GroupsPostRequest { +func (r ApiGroupsPostUxiV1alpha1GroupsPostRequest) GroupsPostRequest(groupsPostRequest GroupsPostRequest) ApiGroupsPostUxiV1alpha1GroupsPostRequest { r.groupsPostRequest = &groupsPostRequest return r } -func (r ApiGroupsPostConfigurationAppV1GroupsPostRequest) Execute() (*GroupsPostResponse, *http.Response, error) { - return r.ApiService.GroupsPostConfigurationAppV1GroupsPostExecute(r) +func (r ApiGroupsPostUxiV1alpha1GroupsPostRequest) Execute() (*GroupsPostResponse, *http.Response, error) { + return r.ApiService.GroupsPostUxiV1alpha1GroupsPostExecute(r) } /* -GroupsPostConfigurationAppV1GroupsPost Groups Post +GroupsPostUxiV1alpha1GroupsPost Groups Post Create a new group with the group identified in `parent_uid` as its parent @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGroupsPostConfigurationAppV1GroupsPostRequest + @return ApiGroupsPostUxiV1alpha1GroupsPostRequest */ -func (a *ConfigurationAPIService) GroupsPostConfigurationAppV1GroupsPost(ctx context.Context) ApiGroupsPostConfigurationAppV1GroupsPostRequest { - return ApiGroupsPostConfigurationAppV1GroupsPostRequest{ +func (a *ConfigurationAPIService) GroupsPostUxiV1alpha1GroupsPost(ctx context.Context) ApiGroupsPostUxiV1alpha1GroupsPostRequest { + return ApiGroupsPostUxiV1alpha1GroupsPostRequest{ ApiService: a, ctx: ctx, } @@ -810,7 +810,7 @@ func (a *ConfigurationAPIService) GroupsPostConfigurationAppV1GroupsPost(ctx con // Execute executes the request // // @return GroupsPostResponse -func (a *ConfigurationAPIService) GroupsPostConfigurationAppV1GroupsPostExecute(r ApiGroupsPostConfigurationAppV1GroupsPostRequest) (*GroupsPostResponse, *http.Response, error) { +func (a *ConfigurationAPIService) GroupsPostUxiV1alpha1GroupsPostExecute(r ApiGroupsPostUxiV1alpha1GroupsPostRequest) (*GroupsPostResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -818,12 +818,12 @@ func (a *ConfigurationAPIService) GroupsPostConfigurationAppV1GroupsPostExecute( localVarReturnValue *GroupsPostResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GroupsPostConfigurationAppV1GroupsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.GroupsPostUxiV1alpha1GroupsPost") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/configuration/app/v1/groups" + localVarPath := localBasePath + "/uxi/v1alpha1/groups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -908,3 +908,135 @@ func (a *ConfigurationAPIService) GroupsPostConfigurationAppV1GroupsPostExecute( return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest struct { + ctx context.Context + ApiService *ConfigurationAPIService + sensorGroupAssignmentsPostRequest *SensorGroupAssignmentsPostRequest +} + +func (r ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest) SensorGroupAssignmentsPostRequest(sensorGroupAssignmentsPostRequest SensorGroupAssignmentsPostRequest) ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest { + r.sensorGroupAssignmentsPostRequest = &sensorGroupAssignmentsPostRequest + return r +} + +func (r ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest) Execute() (*SensorGroupAssignmentResponse, *http.Response, error) { + return r.ApiService.PostUxiV1alpha1SensorGroupAssignmentsPostExecute(r) +} + +/* +PostUxiV1alpha1SensorGroupAssignmentsPost Post + +Create sensor group assignment + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest +*/ +func (a *ConfigurationAPIService) PostUxiV1alpha1SensorGroupAssignmentsPost(ctx context.Context) ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest { + return ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SensorGroupAssignmentResponse +func (a *ConfigurationAPIService) PostUxiV1alpha1SensorGroupAssignmentsPostExecute(r ApiPostUxiV1alpha1SensorGroupAssignmentsPostRequest) (*SensorGroupAssignmentResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SensorGroupAssignmentResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigurationAPIService.PostUxiV1alpha1SensorGroupAssignmentsPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/uxi/v1alpha1/sensor-group-assignments" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sensorGroupAssignmentsPostRequest == nil { + return localVarReturnValue, nil, reportError("sensorGroupAssignmentsPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sensorGroupAssignmentsPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.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 +} diff --git a/pkg/config-api-client/client.go b/pkg/config-api-client/client.go index 2aa71a00..5086d84e 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -41,7 +41,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Configuration Api API v1.11.0 +// APIClient manages communication with the Configuration Api API v1.14.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -142,7 +142,7 @@ func parameterValueToString(obj interface{}, key string) string { // parameterAddToHeaderOrQuery adds the provided object to the request header or url query // supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { var v = reflect.ValueOf(obj) var value = "" if v == reflect.ValueOf(nil) { @@ -158,11 +158,11 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri if err != nil { return } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) return } value = v.Type().String() + " value" @@ -174,7 +174,11 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri var lenIndValue = indValue.Len() for i := 0; i < lenIndValue; i++ { var arrayValue = indValue.Index(i) - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) } return @@ -186,14 +190,14 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri iter := indValue.MapRange() for iter.Next() { k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) } return case reflect.Interface: fallthrough case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) return case reflect.Int, reflect.Int8, reflect.Int16, diff --git a/pkg/config-api-client/configuration.go b/pkg/config-api-client/configuration.go index f0fb372a..2265e5d4 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/docs/ConfigurationAPI.md b/pkg/config-api-client/docs/ConfigurationAPI.md index d921116b..225215ca 100644 --- a/pkg/config-api-client/docs/ConfigurationAPI.md +++ b/pkg/config-api-client/docs/ConfigurationAPI.md @@ -4,18 +4,19 @@ All URIs are relative to *https://api.capenetworks.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetConfigurationAppV1NetworkGroupAssignmentsGet**](ConfigurationAPI.md#GetConfigurationAppV1NetworkGroupAssignmentsGet) | **Get** /configuration/app/v1/network-group-assignments | Get -[**GetConfigurationAppV1SensorGroupAssignmentsGet**](ConfigurationAPI.md#GetConfigurationAppV1SensorGroupAssignmentsGet) | **Get** /configuration/app/v1/sensor-group-assignments | Get -[**GetConfigurationAppV1WiredNetworksGet**](ConfigurationAPI.md#GetConfigurationAppV1WiredNetworksGet) | **Get** /configuration/app/v1/wired-networks | Get -[**GetConfigurationAppV1WirelessNetworksGet**](ConfigurationAPI.md#GetConfigurationAppV1WirelessNetworksGet) | **Get** /configuration/app/v1/wireless-networks | Get -[**GroupsGetConfigurationAppV1GroupsGet**](ConfigurationAPI.md#GroupsGetConfigurationAppV1GroupsGet) | **Get** /configuration/app/v1/groups | Groups Get -[**GroupsPostConfigurationAppV1GroupsPost**](ConfigurationAPI.md#GroupsPostConfigurationAppV1GroupsPost) | **Post** /configuration/app/v1/groups | Groups Post +[**GetUxiV1alpha1NetworkGroupAssignmentsGet**](ConfigurationAPI.md#GetUxiV1alpha1NetworkGroupAssignmentsGet) | **Get** /uxi/v1alpha1/network-group-assignments | Get +[**GetUxiV1alpha1SensorGroupAssignmentsGet**](ConfigurationAPI.md#GetUxiV1alpha1SensorGroupAssignmentsGet) | **Get** /uxi/v1alpha1/sensor-group-assignments | Get +[**GetUxiV1alpha1WiredNetworksGet**](ConfigurationAPI.md#GetUxiV1alpha1WiredNetworksGet) | **Get** /uxi/v1alpha1/wired-networks | Get +[**GetUxiV1alpha1WirelessNetworksGet**](ConfigurationAPI.md#GetUxiV1alpha1WirelessNetworksGet) | **Get** /uxi/v1alpha1/wireless-networks | Get +[**GroupsGetUxiV1alpha1GroupsGet**](ConfigurationAPI.md#GroupsGetUxiV1alpha1GroupsGet) | **Get** /uxi/v1alpha1/groups | Groups Get +[**GroupsPostUxiV1alpha1GroupsPost**](ConfigurationAPI.md#GroupsPostUxiV1alpha1GroupsPost) | **Post** /uxi/v1alpha1/groups | Groups Post +[**PostUxiV1alpha1SensorGroupAssignmentsPost**](ConfigurationAPI.md#PostUxiV1alpha1SensorGroupAssignmentsPost) | **Post** /uxi/v1alpha1/sensor-group-assignments | Post -## GetConfigurationAppV1NetworkGroupAssignmentsGet +## GetUxiV1alpha1NetworkGroupAssignmentsGet -> NetworkGroupAssignmentsResponse GetConfigurationAppV1NetworkGroupAssignmentsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() +> NetworkGroupAssignmentsResponse GetUxiV1alpha1NetworkGroupAssignmentsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() Get @@ -40,13 +41,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GetConfigurationAppV1NetworkGroupAssignmentsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() + resp, r, err := apiClient.ConfigurationAPI.GetUxiV1alpha1NetworkGroupAssignmentsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetConfigurationAppV1NetworkGroupAssignmentsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetUxiV1alpha1NetworkGroupAssignmentsGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetConfigurationAppV1NetworkGroupAssignmentsGet`: NetworkGroupAssignmentsResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetConfigurationAppV1NetworkGroupAssignmentsGet`: %v\n", resp) + // response from `GetUxiV1alpha1NetworkGroupAssignmentsGet`: NetworkGroupAssignmentsResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetUxiV1alpha1NetworkGroupAssignmentsGet`: %v\n", resp) } ``` @@ -56,7 +57,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGetConfigurationAppV1NetworkGroupAssignmentsGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetUxiV1alpha1NetworkGroupAssignmentsGetRequest struct via the builder pattern Name | Type | Description | Notes @@ -83,9 +84,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetConfigurationAppV1SensorGroupAssignmentsGet +## GetUxiV1alpha1SensorGroupAssignmentsGet -> SensorGroupAssignmentsResponse GetConfigurationAppV1SensorGroupAssignmentsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() +> SensorGroupAssignmentsResponse GetUxiV1alpha1SensorGroupAssignmentsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() Get @@ -110,13 +111,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GetConfigurationAppV1SensorGroupAssignmentsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() + resp, r, err := apiClient.ConfigurationAPI.GetUxiV1alpha1SensorGroupAssignmentsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetConfigurationAppV1SensorGroupAssignmentsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetUxiV1alpha1SensorGroupAssignmentsGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetConfigurationAppV1SensorGroupAssignmentsGet`: SensorGroupAssignmentsResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetConfigurationAppV1SensorGroupAssignmentsGet`: %v\n", resp) + // response from `GetUxiV1alpha1SensorGroupAssignmentsGet`: SensorGroupAssignmentsResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetUxiV1alpha1SensorGroupAssignmentsGet`: %v\n", resp) } ``` @@ -126,7 +127,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGetConfigurationAppV1SensorGroupAssignmentsGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetUxiV1alpha1SensorGroupAssignmentsGetRequest struct via the builder pattern Name | Type | Description | Notes @@ -153,9 +154,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetConfigurationAppV1WiredNetworksGet +## GetUxiV1alpha1WiredNetworksGet -> WiredNetworksResponse GetConfigurationAppV1WiredNetworksGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() +> WiredNetworksResponse GetUxiV1alpha1WiredNetworksGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() Get @@ -180,13 +181,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GetConfigurationAppV1WiredNetworksGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() + resp, r, err := apiClient.ConfigurationAPI.GetUxiV1alpha1WiredNetworksGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetConfigurationAppV1WiredNetworksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetUxiV1alpha1WiredNetworksGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetConfigurationAppV1WiredNetworksGet`: WiredNetworksResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetConfigurationAppV1WiredNetworksGet`: %v\n", resp) + // response from `GetUxiV1alpha1WiredNetworksGet`: WiredNetworksResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetUxiV1alpha1WiredNetworksGet`: %v\n", resp) } ``` @@ -196,7 +197,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGetConfigurationAppV1WiredNetworksGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetUxiV1alpha1WiredNetworksGetRequest struct via the builder pattern Name | Type | Description | Notes @@ -223,9 +224,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetConfigurationAppV1WirelessNetworksGet +## GetUxiV1alpha1WirelessNetworksGet -> WirelessNetworksResponse GetConfigurationAppV1WirelessNetworksGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() +> WirelessNetworksResponse GetUxiV1alpha1WirelessNetworksGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() Get @@ -250,13 +251,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GetConfigurationAppV1WirelessNetworksGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() + resp, r, err := apiClient.ConfigurationAPI.GetUxiV1alpha1WirelessNetworksGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetConfigurationAppV1WirelessNetworksGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GetUxiV1alpha1WirelessNetworksGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetConfigurationAppV1WirelessNetworksGet`: WirelessNetworksResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetConfigurationAppV1WirelessNetworksGet`: %v\n", resp) + // response from `GetUxiV1alpha1WirelessNetworksGet`: WirelessNetworksResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GetUxiV1alpha1WirelessNetworksGet`: %v\n", resp) } ``` @@ -266,7 +267,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGetConfigurationAppV1WirelessNetworksGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetUxiV1alpha1WirelessNetworksGetRequest struct via the builder pattern Name | Type | Description | Notes @@ -293,9 +294,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GroupsGetConfigurationAppV1GroupsGet +## GroupsGetUxiV1alpha1GroupsGet -> GroupsGetResponse GroupsGetConfigurationAppV1GroupsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() +> GroupsGetResponse GroupsGetUxiV1alpha1GroupsGet(ctx).Uid(uid).Cursor(cursor).Limit(limit).Execute() Groups Get @@ -320,13 +321,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GroupsGetConfigurationAppV1GroupsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() + resp, r, err := apiClient.ConfigurationAPI.GroupsGetUxiV1alpha1GroupsGet(context.Background()).Uid(uid).Cursor(cursor).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GroupsGetConfigurationAppV1GroupsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GroupsGetUxiV1alpha1GroupsGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GroupsGetConfigurationAppV1GroupsGet`: GroupsGetResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GroupsGetConfigurationAppV1GroupsGet`: %v\n", resp) + // response from `GroupsGetUxiV1alpha1GroupsGet`: GroupsGetResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GroupsGetUxiV1alpha1GroupsGet`: %v\n", resp) } ``` @@ -336,7 +337,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGroupsGetConfigurationAppV1GroupsGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGroupsGetUxiV1alpha1GroupsGetRequest struct via the builder pattern Name | Type | Description | Notes @@ -363,9 +364,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GroupsPostConfigurationAppV1GroupsPost +## GroupsPostUxiV1alpha1GroupsPost -> GroupsPostResponse GroupsPostConfigurationAppV1GroupsPost(ctx).GroupsPostRequest(groupsPostRequest).Execute() +> GroupsPostResponse GroupsPostUxiV1alpha1GroupsPost(ctx).GroupsPostRequest(groupsPostRequest).Execute() Groups Post @@ -384,17 +385,17 @@ import ( ) func main() { - groupsPostRequest := *openapiclient.NewGroupsPostRequest("ParentUid_example", "Name_example") // GroupsPostRequest | + groupsPostRequest := *openapiclient.NewGroupsPostRequest("ParentId_example", "Name_example") // GroupsPostRequest | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ConfigurationAPI.GroupsPostConfigurationAppV1GroupsPost(context.Background()).GroupsPostRequest(groupsPostRequest).Execute() + resp, r, err := apiClient.ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost(context.Background()).GroupsPostRequest(groupsPostRequest).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GroupsPostConfigurationAppV1GroupsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GroupsPostConfigurationAppV1GroupsPost`: GroupsPostResponse - fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GroupsPostConfigurationAppV1GroupsPost`: %v\n", resp) + // response from `GroupsPostUxiV1alpha1GroupsPost`: GroupsPostResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost`: %v\n", resp) } ``` @@ -404,7 +405,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiGroupsPostConfigurationAppV1GroupsPostRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGroupsPostUxiV1alpha1GroupsPostRequest struct via the builder pattern Name | Type | Description | Notes @@ -428,3 +429,69 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## PostUxiV1alpha1SensorGroupAssignmentsPost + +> SensorGroupAssignmentResponse PostUxiV1alpha1SensorGroupAssignmentsPost(ctx).SensorGroupAssignmentsPostRequest(sensorGroupAssignmentsPostRequest).Execute() + +Post + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/config-api-client" +) + +func main() { + sensorGroupAssignmentsPostRequest := *openapiclient.NewSensorGroupAssignmentsPostRequest("GroupId_example", "SensorId_example") // SensorGroupAssignmentsPostRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConfigurationAPI.PostUxiV1alpha1SensorGroupAssignmentsPost(context.Background()).SensorGroupAssignmentsPostRequest(sensorGroupAssignmentsPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.PostUxiV1alpha1SensorGroupAssignmentsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostUxiV1alpha1SensorGroupAssignmentsPost`: SensorGroupAssignmentResponse + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.PostUxiV1alpha1SensorGroupAssignmentsPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostUxiV1alpha1SensorGroupAssignmentsPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sensorGroupAssignmentsPostRequest** | [**SensorGroupAssignmentsPostRequest**](SensorGroupAssignmentsPostRequest.md) | | + +### Return type + +[**SensorGroupAssignmentResponse**](SensorGroupAssignmentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + diff --git a/pkg/config-api-client/docs/ErrorDetail.md b/pkg/config-api-client/docs/ErrorDetail.md index 93bcb469..8bfc78d5 100644 --- a/pkg/config-api-client/docs/ErrorDetail.md +++ b/pkg/config-api-client/docs/ErrorDetail.md @@ -4,13 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Message** | **string** | | +**Issues** | [**[]Issue**](Issue.md) | | +**Type** | **string** | | ## Methods ### NewErrorDetail -`func NewErrorDetail(message string, ) *ErrorDetail` +`func NewErrorDetail(issues []Issue, type_ string, ) *ErrorDetail` NewErrorDetail instantiates a new ErrorDetail object This constructor will assign default values to properties that have it defined, @@ -25,24 +26,44 @@ NewErrorDetailWithDefaults instantiates a new ErrorDetail object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetMessage +### GetIssues -`func (o *ErrorDetail) GetMessage() string` +`func (o *ErrorDetail) GetIssues() []Issue` -GetMessage returns the Message field if non-nil, zero value otherwise. +GetIssues returns the Issues field if non-nil, zero value otherwise. -### GetMessageOk +### GetIssuesOk -`func (o *ErrorDetail) GetMessageOk() (*string, bool)` +`func (o *ErrorDetail) GetIssuesOk() (*[]Issue, bool)` -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +GetIssuesOk returns a tuple with the Issues field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMessage +### SetIssues -`func (o *ErrorDetail) SetMessage(v string)` +`func (o *ErrorDetail) SetIssues(v []Issue)` -SetMessage sets Message field to given value. +SetIssues sets Issues field to given value. + + +### GetType + +`func (o *ErrorDetail) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ErrorDetail) 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 *ErrorDetail) SetType(v string)` + +SetType sets Type field to given value. diff --git a/pkg/config-api-client/docs/ErrorResponse.md b/pkg/config-api-client/docs/ErrorResponse.md index 28b4b120..e3049174 100644 --- a/pkg/config-api-client/docs/ErrorResponse.md +++ b/pkg/config-api-client/docs/ErrorResponse.md @@ -4,13 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Detail** | [**[]ErrorDetail**](ErrorDetail.md) | | +**DebugId** | **string** | | +**ErrorCode** | **string** | | +**HttpStatusCode** | **int32** | | +**Message** | **string** | | +**ErrorDetails** | [**[]ErrorDetail**](ErrorDetail.md) | | ## Methods ### NewErrorResponse -`func NewErrorResponse(detail []ErrorDetail, ) *ErrorResponse` +`func NewErrorResponse(debugId string, errorCode string, httpStatusCode int32, message string, errorDetails []ErrorDetail, ) *ErrorResponse` NewErrorResponse instantiates a new ErrorResponse object This constructor will assign default values to properties that have it defined, @@ -25,26 +29,116 @@ NewErrorResponseWithDefaults instantiates a new ErrorResponse object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDetail +### GetDebugId -`func (o *ErrorResponse) GetDetail() []ErrorDetail` +`func (o *ErrorResponse) GetDebugId() string` -GetDetail returns the Detail field if non-nil, zero value otherwise. +GetDebugId returns the DebugId field if non-nil, zero value otherwise. -### GetDetailOk +### GetDebugIdOk -`func (o *ErrorResponse) GetDetailOk() (*[]ErrorDetail, bool)` +`func (o *ErrorResponse) GetDebugIdOk() (*string, bool)` -GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise +GetDebugIdOk returns a tuple with the DebugId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDetail +### SetDebugId -`func (o *ErrorResponse) SetDetail(v []ErrorDetail)` +`func (o *ErrorResponse) SetDebugId(v string)` -SetDetail sets Detail field to given value. +SetDebugId sets DebugId field to given value. +### GetErrorCode + +`func (o *ErrorResponse) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *ErrorResponse) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *ErrorResponse) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetHttpStatusCode + +`func (o *ErrorResponse) GetHttpStatusCode() int32` + +GetHttpStatusCode returns the HttpStatusCode field if non-nil, zero value otherwise. + +### GetHttpStatusCodeOk + +`func (o *ErrorResponse) GetHttpStatusCodeOk() (*int32, bool)` + +GetHttpStatusCodeOk returns a tuple with the HttpStatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHttpStatusCode + +`func (o *ErrorResponse) SetHttpStatusCode(v int32)` + +SetHttpStatusCode sets HttpStatusCode field to given value. + + +### GetMessage + +`func (o *ErrorResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ErrorResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ErrorResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetErrorDetails + +`func (o *ErrorResponse) GetErrorDetails() []ErrorDetail` + +GetErrorDetails returns the ErrorDetails field if non-nil, zero value otherwise. + +### GetErrorDetailsOk + +`func (o *ErrorResponse) GetErrorDetailsOk() (*[]ErrorDetail, bool)` + +GetErrorDetailsOk returns a tuple with the ErrorDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorDetails + +`func (o *ErrorResponse) SetErrorDetails(v []ErrorDetail)` + +SetErrorDetails sets ErrorDetails field to given value. + + +### SetErrorDetailsNil + +`func (o *ErrorResponse) SetErrorDetailsNil(b bool)` + + SetErrorDetailsNil sets the value for ErrorDetails to be an explicit nil + +### UnsetErrorDetails +`func (o *ErrorResponse) UnsetErrorDetails()` + +UnsetErrorDetails ensures that no value is present for ErrorDetails, 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/Group.md b/pkg/config-api-client/docs/Group.md new file mode 100644 index 00000000..0febf0fe --- /dev/null +++ b/pkg/config-api-client/docs/Group.md @@ -0,0 +1,51 @@ +# Group + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | + +## Methods + +### NewGroup + +`func NewGroup(id string, ) *Group` + +NewGroup instantiates a new Group object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupWithDefaults + +`func NewGroupWithDefaults() *Group` + +NewGroupWithDefaults instantiates a new Group object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Group) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Group) 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 *Group) SetId(v string)` + +SetId sets Id 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/GroupsGetItem.md b/pkg/config-api-client/docs/GroupsGetItem.md index bd8cd050..7a2acb9f 100644 --- a/pkg/config-api-client/docs/GroupsGetItem.md +++ b/pkg/config-api-client/docs/GroupsGetItem.md @@ -4,16 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uid** | **string** | | +**Id** | **string** | | **Name** | **string** | | +**Parent** | [**NullableParent**](Parent.md) | | **Path** | **string** | | -**ParentUid** | **NullableString** | | +**Type** | Pointer to **string** | | [optional] [default to "uxi/group"] ## Methods ### NewGroupsGetItem -`func NewGroupsGetItem(uid string, name string, path string, parentUid NullableString, ) *GroupsGetItem` +`func NewGroupsGetItem(id string, name string, parent NullableParent, path string, ) *GroupsGetItem` NewGroupsGetItem instantiates a new GroupsGetItem object This constructor will assign default values to properties that have it defined, @@ -28,24 +29,24 @@ NewGroupsGetItemWithDefaults instantiates a new GroupsGetItem object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetUid +### GetId -`func (o *GroupsGetItem) GetUid() string` +`func (o *GroupsGetItem) GetId() string` -GetUid returns the Uid field if non-nil, zero value otherwise. +GetId returns the Id field if non-nil, zero value otherwise. -### GetUidOk +### GetIdOk -`func (o *GroupsGetItem) GetUidOk() (*string, bool)` +`func (o *GroupsGetItem) GetIdOk() (*string, bool)` -GetUidOk returns a tuple with the Uid field if it's non-nil, zero value otherwise +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. -### SetUid +### SetId -`func (o *GroupsGetItem) SetUid(v string)` +`func (o *GroupsGetItem) SetId(v string)` -SetUid sets Uid field to given value. +SetId sets Id field to given value. ### GetName @@ -68,6 +69,36 @@ and a boolean to check if the value has been set. SetName sets Name field to given value. +### GetParent + +`func (o *GroupsGetItem) GetParent() Parent` + +GetParent returns the Parent field if non-nil, zero value otherwise. + +### GetParentOk + +`func (o *GroupsGetItem) GetParentOk() (*Parent, bool)` + +GetParentOk returns a tuple with the Parent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParent + +`func (o *GroupsGetItem) SetParent(v Parent)` + +SetParent sets Parent field to given value. + + +### SetParentNil + +`func (o *GroupsGetItem) SetParentNil(b bool)` + + SetParentNil sets the value for Parent to be an explicit nil + +### UnsetParent +`func (o *GroupsGetItem) UnsetParent()` + +UnsetParent ensures that no value is present for Parent, not even an explicit nil ### GetPath `func (o *GroupsGetItem) GetPath() string` @@ -88,36 +119,31 @@ and a boolean to check if the value has been set. SetPath sets Path field to given value. -### GetParentUid +### GetType -`func (o *GroupsGetItem) GetParentUid() string` +`func (o *GroupsGetItem) GetType() string` -GetParentUid returns the ParentUid field if non-nil, zero value otherwise. +GetType returns the Type field if non-nil, zero value otherwise. -### GetParentUidOk +### GetTypeOk -`func (o *GroupsGetItem) GetParentUidOk() (*string, bool)` +`func (o *GroupsGetItem) GetTypeOk() (*string, bool)` -GetParentUidOk returns a tuple with the ParentUid field if it's non-nil, zero value otherwise +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. -### SetParentUid - -`func (o *GroupsGetItem) SetParentUid(v string)` - -SetParentUid sets ParentUid field to given value. +### SetType +`func (o *GroupsGetItem) SetType(v string)` -### SetParentUidNil +SetType sets Type field to given value. -`func (o *GroupsGetItem) SetParentUidNil(b bool)` +### HasType - SetParentUidNil sets the value for ParentUid to be an explicit nil +`func (o *GroupsGetItem) HasType() bool` -### UnsetParentUid -`func (o *GroupsGetItem) UnsetParentUid()` +HasType returns a boolean if a field has been set. -UnsetParentUid ensures that no value is present for ParentUid, 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/GroupsGetResponse.md b/pkg/config-api-client/docs/GroupsGetResponse.md index c1707ba2..f37051db 100644 --- a/pkg/config-api-client/docs/GroupsGetResponse.md +++ b/pkg/config-api-client/docs/GroupsGetResponse.md @@ -4,14 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Pagination** | [**PaginationDetails**](PaginationDetails.md) | | -**Groups** | [**[]GroupsGetItem**](GroupsGetItem.md) | | +**Items** | [**[]GroupsGetItem**](GroupsGetItem.md) | | +**Count** | **int32** | | +**Next** | **NullableString** | | ## Methods ### NewGroupsGetResponse -`func NewGroupsGetResponse(pagination PaginationDetails, groups []GroupsGetItem, ) *GroupsGetResponse` +`func NewGroupsGetResponse(items []GroupsGetItem, count int32, next NullableString, ) *GroupsGetResponse` NewGroupsGetResponse instantiates a new GroupsGetResponse object This constructor will assign default values to properties that have it defined, @@ -26,46 +27,76 @@ NewGroupsGetResponseWithDefaults instantiates a new GroupsGetResponse object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetPagination +### GetItems -`func (o *GroupsGetResponse) GetPagination() PaginationDetails` +`func (o *GroupsGetResponse) GetItems() []GroupsGetItem` -GetPagination returns the Pagination field if non-nil, zero value otherwise. +GetItems returns the Items field if non-nil, zero value otherwise. -### GetPaginationOk +### GetItemsOk -`func (o *GroupsGetResponse) GetPaginationOk() (*PaginationDetails, bool)` +`func (o *GroupsGetResponse) GetItemsOk() (*[]GroupsGetItem, bool)` -GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +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. -### SetPagination +### SetItems -`func (o *GroupsGetResponse) SetPagination(v PaginationDetails)` +`func (o *GroupsGetResponse) SetItems(v []GroupsGetItem)` -SetPagination sets Pagination field to given value. +SetItems sets Items field to given value. -### GetGroups +### GetCount -`func (o *GroupsGetResponse) GetGroups() []GroupsGetItem` +`func (o *GroupsGetResponse) GetCount() int32` -GetGroups returns the Groups field if non-nil, zero value otherwise. +GetCount returns the Count field if non-nil, zero value otherwise. -### GetGroupsOk +### GetCountOk -`func (o *GroupsGetResponse) GetGroupsOk() (*[]GroupsGetItem, bool)` +`func (o *GroupsGetResponse) GetCountOk() (*int32, bool)` -GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +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. -### SetGroups +### SetCount -`func (o *GroupsGetResponse) SetGroups(v []GroupsGetItem)` +`func (o *GroupsGetResponse) SetCount(v int32)` -SetGroups sets Groups field to given value. +SetCount sets Count field to given value. +### GetNext + +`func (o *GroupsGetResponse) GetNext() string` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *GroupsGetResponse) 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 *GroupsGetResponse) SetNext(v string)` + +SetNext sets Next field to given value. + + +### SetNextNil + +`func (o *GroupsGetResponse) SetNextNil(b bool)` + + SetNextNil sets the value for Next to be an explicit nil + +### UnsetNext +`func (o *GroupsGetResponse) 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/GroupsPostRequest.md b/pkg/config-api-client/docs/GroupsPostRequest.md index e54dd1e8..4a28f6a1 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 ------------ | ------------- | ------------- | ------------- -**ParentUid** | **string** | | +**ParentId** | **string** | | **Name** | **string** | | ## Methods ### NewGroupsPostRequest -`func NewGroupsPostRequest(parentUid string, name string, ) *GroupsPostRequest` +`func NewGroupsPostRequest(parentId string, name string, ) *GroupsPostRequest` NewGroupsPostRequest instantiates a new GroupsPostRequest object This constructor will assign default values to properties that have it defined, @@ -26,24 +26,24 @@ NewGroupsPostRequestWithDefaults instantiates a new GroupsPostRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetParentUid +### GetParentId -`func (o *GroupsPostRequest) GetParentUid() string` +`func (o *GroupsPostRequest) GetParentId() string` -GetParentUid returns the ParentUid field if non-nil, zero value otherwise. +GetParentId returns the ParentId field if non-nil, zero value otherwise. -### GetParentUidOk +### GetParentIdOk -`func (o *GroupsPostRequest) GetParentUidOk() (*string, bool)` +`func (o *GroupsPostRequest) GetParentIdOk() (*string, bool)` -GetParentUidOk returns a tuple with the ParentUid field if it's non-nil, zero value otherwise +GetParentIdOk returns a tuple with the ParentId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetParentUid +### SetParentId -`func (o *GroupsPostRequest) SetParentUid(v string)` +`func (o *GroupsPostRequest) SetParentId(v string)` -SetParentUid sets ParentUid field to given value. +SetParentId sets ParentId field to given value. ### GetName diff --git a/pkg/config-api-client/docs/GroupsPostResponse.md b/pkg/config-api-client/docs/GroupsPostResponse.md index 33875307..3e0522b4 100644 --- a/pkg/config-api-client/docs/GroupsPostResponse.md +++ b/pkg/config-api-client/docs/GroupsPostResponse.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ParentUid** | **string** | | **Name** | **string** | | -**Uid** | **string** | | **Path** | **string** | | +**ParentUid** | **string** | | +**Uid** | **string** | | ## Methods ### NewGroupsPostResponse -`func NewGroupsPostResponse(parentUid string, name string, uid string, path string, ) *GroupsPostResponse` +`func NewGroupsPostResponse(name string, path string, parentUid string, uid string, ) *GroupsPostResponse` NewGroupsPostResponse instantiates a new GroupsPostResponse object This constructor will assign default values to properties that have it defined, @@ -28,84 +28,84 @@ NewGroupsPostResponseWithDefaults instantiates a new GroupsPostResponse object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetParentUid +### GetName -`func (o *GroupsPostResponse) GetParentUid() string` +`func (o *GroupsPostResponse) GetName() string` -GetParentUid returns the ParentUid field if non-nil, zero value otherwise. +GetName returns the Name field if non-nil, zero value otherwise. -### GetParentUidOk +### GetNameOk -`func (o *GroupsPostResponse) GetParentUidOk() (*string, bool)` +`func (o *GroupsPostResponse) GetNameOk() (*string, bool)` -GetParentUidOk returns a tuple with the ParentUid field if it's non-nil, zero value otherwise +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. -### SetParentUid +### SetName -`func (o *GroupsPostResponse) SetParentUid(v string)` +`func (o *GroupsPostResponse) SetName(v string)` -SetParentUid sets ParentUid field to given value. +SetName sets Name field to given value. -### GetName +### GetPath -`func (o *GroupsPostResponse) GetName() string` +`func (o *GroupsPostResponse) GetPath() string` -GetName returns the Name field if non-nil, zero value otherwise. +GetPath returns the Path field if non-nil, zero value otherwise. -### GetNameOk +### GetPathOk -`func (o *GroupsPostResponse) GetNameOk() (*string, bool)` +`func (o *GroupsPostResponse) GetPathOk() (*string, bool)` -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetName +### SetPath -`func (o *GroupsPostResponse) SetName(v string)` +`func (o *GroupsPostResponse) SetPath(v string)` -SetName sets Name field to given value. +SetPath sets Path field to given value. -### GetUid +### GetParentUid -`func (o *GroupsPostResponse) GetUid() string` +`func (o *GroupsPostResponse) GetParentUid() string` -GetUid returns the Uid field if non-nil, zero value otherwise. +GetParentUid returns the ParentUid field if non-nil, zero value otherwise. -### GetUidOk +### GetParentUidOk -`func (o *GroupsPostResponse) GetUidOk() (*string, bool)` +`func (o *GroupsPostResponse) GetParentUidOk() (*string, bool)` -GetUidOk returns a tuple with the Uid field if it's non-nil, zero value otherwise +GetParentUidOk returns a tuple with the ParentUid field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUid +### SetParentUid -`func (o *GroupsPostResponse) SetUid(v string)` +`func (o *GroupsPostResponse) SetParentUid(v string)` -SetUid sets Uid field to given value. +SetParentUid sets ParentUid field to given value. -### GetPath +### GetUid -`func (o *GroupsPostResponse) GetPath() string` +`func (o *GroupsPostResponse) GetUid() string` -GetPath returns the Path field if non-nil, zero value otherwise. +GetUid returns the Uid field if non-nil, zero value otherwise. -### GetPathOk +### GetUidOk -`func (o *GroupsPostResponse) GetPathOk() (*string, bool)` +`func (o *GroupsPostResponse) GetUidOk() (*string, bool)` -GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise +GetUidOk returns a tuple with the Uid field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPath +### SetUid -`func (o *GroupsPostResponse) SetPath(v string)` +`func (o *GroupsPostResponse) SetUid(v string)` -SetPath sets Path field to given value. +SetUid sets Uid field to given value. diff --git a/pkg/config-api-client/docs/Issue.md b/pkg/config-api-client/docs/Issue.md new file mode 100644 index 00000000..269b2e41 --- /dev/null +++ b/pkg/config-api-client/docs/Issue.md @@ -0,0 +1,93 @@ +# Issue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**Subject** | [**IssueSubject**](IssueSubject.md) | | +**Source** | **string** | | + +## Methods + +### NewIssue + +`func NewIssue(description string, subject IssueSubject, source string, ) *Issue` + +NewIssue instantiates a new Issue object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIssueWithDefaults + +`func NewIssueWithDefaults() *Issue` + +NewIssueWithDefaults instantiates a new Issue object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *Issue) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Issue) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Issue) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetSubject + +`func (o *Issue) GetSubject() IssueSubject` + +GetSubject returns the Subject field if non-nil, zero value otherwise. + +### GetSubjectOk + +`func (o *Issue) GetSubjectOk() (*IssueSubject, bool)` + +GetSubjectOk returns a tuple with the Subject field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubject + +`func (o *Issue) SetSubject(v IssueSubject)` + +SetSubject sets Subject field to given value. + + +### GetSource + +`func (o *Issue) GetSource() string` + +GetSource returns the Source field if non-nil, zero value otherwise. + +### GetSourceOk + +`func (o *Issue) GetSourceOk() (*string, bool)` + +GetSourceOk returns a tuple with the Source field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSource + +`func (o *Issue) SetSource(v string)` + +SetSource sets Source 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/IssueSubject.md b/pkg/config-api-client/docs/IssueSubject.md new file mode 100644 index 00000000..9dd26902 --- /dev/null +++ b/pkg/config-api-client/docs/IssueSubject.md @@ -0,0 +1,15 @@ +# IssueSubject + +## Enum + + +* `FIELD` (value: `"field"`) + +* `HEADER` (value: `"header"`) + +* `QUERY_PARAMETER` (value: `"query.parameter"`) + + +[[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/Parent.md b/pkg/config-api-client/docs/Parent.md new file mode 100644 index 00000000..ff27679a --- /dev/null +++ b/pkg/config-api-client/docs/Parent.md @@ -0,0 +1,51 @@ +# Parent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | + +## Methods + +### NewParent + +`func NewParent(id string, ) *Parent` + +NewParent instantiates a new Parent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewParentWithDefaults + +`func NewParentWithDefaults() *Parent` + +NewParentWithDefaults instantiates a new Parent object +This 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 *Parent) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Parent) 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 *Parent) SetId(v string)` + +SetId sets Id 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/Sensor.md b/pkg/config-api-client/docs/Sensor.md new file mode 100644 index 00000000..07aada5f --- /dev/null +++ b/pkg/config-api-client/docs/Sensor.md @@ -0,0 +1,51 @@ +# Sensor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | + +## Methods + +### NewSensor + +`func NewSensor(id string, ) *Sensor` + +NewSensor instantiates a new Sensor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSensorWithDefaults + +`func NewSensorWithDefaults() *Sensor` + +NewSensorWithDefaults instantiates a new Sensor object +This 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 *Sensor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Sensor) 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 *Sensor) SetId(v string)` + +SetId sets Id 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/SensorGroupAssignmentResponse.md b/pkg/config-api-client/docs/SensorGroupAssignmentResponse.md new file mode 100644 index 00000000..e7898212 --- /dev/null +++ b/pkg/config-api-client/docs/SensorGroupAssignmentResponse.md @@ -0,0 +1,119 @@ +# SensorGroupAssignmentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Group** | [**Group**](Group.md) | | +**Sensor** | [**Sensor**](Sensor.md) | | +**Type** | Pointer to **string** | | [optional] [default to "uxi/sensor-group-assignment"] + +## Methods + +### NewSensorGroupAssignmentResponse + +`func NewSensorGroupAssignmentResponse(id string, group Group, sensor Sensor, ) *SensorGroupAssignmentResponse` + +NewSensorGroupAssignmentResponse instantiates a new SensorGroupAssignmentResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSensorGroupAssignmentResponseWithDefaults + +`func NewSensorGroupAssignmentResponseWithDefaults() *SensorGroupAssignmentResponse` + +NewSensorGroupAssignmentResponseWithDefaults instantiates a new SensorGroupAssignmentResponse object +This 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 *SensorGroupAssignmentResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SensorGroupAssignmentResponse) 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 *SensorGroupAssignmentResponse) SetId(v string)` + +SetId sets Id field to given value. + + +### GetGroup + +`func (o *SensorGroupAssignmentResponse) GetGroup() Group` + +GetGroup returns the Group field if non-nil, zero value otherwise. + +### GetGroupOk + +`func (o *SensorGroupAssignmentResponse) GetGroupOk() (*Group, bool)` + +GetGroupOk returns a tuple with the Group field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroup + +`func (o *SensorGroupAssignmentResponse) SetGroup(v Group)` + +SetGroup sets Group field to given value. + + +### GetSensor + +`func (o *SensorGroupAssignmentResponse) GetSensor() Sensor` + +GetSensor returns the Sensor field if non-nil, zero value otherwise. + +### GetSensorOk + +`func (o *SensorGroupAssignmentResponse) GetSensorOk() (*Sensor, bool)` + +GetSensorOk returns a tuple with the Sensor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSensor + +`func (o *SensorGroupAssignmentResponse) SetSensor(v Sensor)` + +SetSensor sets Sensor field to given value. + + +### GetType + +`func (o *SensorGroupAssignmentResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SensorGroupAssignmentResponse) 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 *SensorGroupAssignmentResponse) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SensorGroupAssignmentResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[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/SensorGroupAssignmentsPostRequest.md b/pkg/config-api-client/docs/SensorGroupAssignmentsPostRequest.md new file mode 100644 index 00000000..2ca6c622 --- /dev/null +++ b/pkg/config-api-client/docs/SensorGroupAssignmentsPostRequest.md @@ -0,0 +1,72 @@ +# SensorGroupAssignmentsPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupId** | **string** | | +**SensorId** | **string** | | + +## Methods + +### NewSensorGroupAssignmentsPostRequest + +`func NewSensorGroupAssignmentsPostRequest(groupId string, sensorId string, ) *SensorGroupAssignmentsPostRequest` + +NewSensorGroupAssignmentsPostRequest instantiates a new SensorGroupAssignmentsPostRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSensorGroupAssignmentsPostRequestWithDefaults + +`func NewSensorGroupAssignmentsPostRequestWithDefaults() *SensorGroupAssignmentsPostRequest` + +NewSensorGroupAssignmentsPostRequestWithDefaults instantiates a new SensorGroupAssignmentsPostRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGroupId + +`func (o *SensorGroupAssignmentsPostRequest) GetGroupId() string` + +GetGroupId returns the GroupId field if non-nil, zero value otherwise. + +### GetGroupIdOk + +`func (o *SensorGroupAssignmentsPostRequest) GetGroupIdOk() (*string, bool)` + +GetGroupIdOk returns a tuple with the GroupId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupId + +`func (o *SensorGroupAssignmentsPostRequest) SetGroupId(v string)` + +SetGroupId sets GroupId field to given value. + + +### GetSensorId + +`func (o *SensorGroupAssignmentsPostRequest) GetSensorId() string` + +GetSensorId returns the SensorId field if non-nil, zero value otherwise. + +### GetSensorIdOk + +`func (o *SensorGroupAssignmentsPostRequest) GetSensorIdOk() (*string, bool)` + +GetSensorIdOk returns a tuple with the SensorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSensorId + +`func (o *SensorGroupAssignmentsPostRequest) SetSensorId(v string)` + +SetSensorId sets SensorId 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/model_error_detail.go b/pkg/config-api-client/model_error_detail.go index dd302b68..b0b0cae8 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,7 +22,8 @@ var _ MappedNullable = &ErrorDetail{} // ErrorDetail struct for ErrorDetail type ErrorDetail struct { - Message string `json:"message"` + Issues []Issue `json:"issues"` + Type string `json:"type"` } type _ErrorDetail ErrorDetail @@ -31,9 +32,10 @@ type _ErrorDetail ErrorDetail // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewErrorDetail(message string) *ErrorDetail { +func NewErrorDetail(issues []Issue, type_ string) *ErrorDetail { this := ErrorDetail{} - this.Message = message + this.Issues = issues + this.Type = type_ return &this } @@ -45,28 +47,52 @@ func NewErrorDetailWithDefaults() *ErrorDetail { return &this } -// GetMessage returns the Message field value -func (o *ErrorDetail) GetMessage() string { +// GetIssues returns the Issues field value +func (o *ErrorDetail) GetIssues() []Issue { + if o == nil { + var ret []Issue + return ret + } + + return o.Issues +} + +// GetIssuesOk returns a tuple with the Issues field value +// and a boolean to check if the value has been set. +func (o *ErrorDetail) GetIssuesOk() ([]Issue, bool) { + if o == nil { + return nil, false + } + return o.Issues, true +} + +// SetIssues sets field value +func (o *ErrorDetail) SetIssues(v []Issue) { + o.Issues = v +} + +// GetType returns the Type field value +func (o *ErrorDetail) GetType() string { if o == nil { var ret string return ret } - return o.Message + return o.Type } -// GetMessageOk returns a tuple with the Message field value +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ErrorDetail) GetMessageOk() (*string, bool) { +func (o *ErrorDetail) GetTypeOk() (*string, bool) { if o == nil { return nil, false } - return &o.Message, true + return &o.Type, true } -// SetMessage sets field value -func (o *ErrorDetail) SetMessage(v string) { - o.Message = v +// SetType sets field value +func (o *ErrorDetail) SetType(v string) { + o.Type = v } func (o ErrorDetail) MarshalJSON() ([]byte, error) { @@ -79,7 +105,8 @@ func (o ErrorDetail) MarshalJSON() ([]byte, error) { func (o ErrorDetail) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["message"] = o.Message + toSerialize["issues"] = o.Issues + toSerialize["type"] = o.Type return toSerialize, nil } @@ -88,7 +115,8 @@ func (o *ErrorDetail) 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{ - "message", + "issues", + "type", } allProperties := make(map[string]interface{}) diff --git a/pkg/config-api-client/model_error_response.go b/pkg/config-api-client/model_error_response.go index cddf5af5..6db9c928 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,7 +22,11 @@ var _ MappedNullable = &ErrorResponse{} // ErrorResponse struct for ErrorResponse type ErrorResponse struct { - Detail []ErrorDetail `json:"detail"` + DebugId string `json:"debugId"` + ErrorCode string `json:"errorCode"` + HttpStatusCode int32 `json:"httpStatusCode"` + Message string `json:"message"` + ErrorDetails []ErrorDetail `json:"errorDetails"` } type _ErrorResponse ErrorResponse @@ -31,9 +35,13 @@ type _ErrorResponse ErrorResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewErrorResponse(detail []ErrorDetail) *ErrorResponse { +func NewErrorResponse(debugId string, errorCode string, httpStatusCode int32, message string, errorDetails []ErrorDetail) *ErrorResponse { this := ErrorResponse{} - this.Detail = detail + this.DebugId = debugId + this.ErrorCode = errorCode + this.HttpStatusCode = httpStatusCode + this.Message = message + this.ErrorDetails = errorDetails return &this } @@ -45,28 +53,126 @@ func NewErrorResponseWithDefaults() *ErrorResponse { return &this } -// GetDetail returns the Detail field value -func (o *ErrorResponse) GetDetail() []ErrorDetail { +// GetDebugId returns the DebugId field value +func (o *ErrorResponse) GetDebugId() string { if o == nil { - var ret []ErrorDetail + var ret string + return ret + } + + return o.DebugId +} + +// GetDebugIdOk returns a tuple with the DebugId field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetDebugIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DebugId, true +} + +// SetDebugId sets field value +func (o *ErrorResponse) SetDebugId(v string) { + o.DebugId = v +} + +// GetErrorCode returns the ErrorCode field value +func (o *ErrorResponse) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *ErrorResponse) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetHttpStatusCode returns the HttpStatusCode field value +func (o *ErrorResponse) GetHttpStatusCode() int32 { + if o == nil { + var ret int32 return ret } - return o.Detail + return o.HttpStatusCode } -// GetDetailOk returns a tuple with the Detail field value +// GetHttpStatusCodeOk returns a tuple with the HttpStatusCode field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetDetailOk() ([]ErrorDetail, bool) { +func (o *ErrorResponse) GetHttpStatusCodeOk() (*int32, bool) { if o == nil { return nil, false } - return o.Detail, true + return &o.HttpStatusCode, true } -// SetDetail sets field value -func (o *ErrorResponse) SetDetail(v []ErrorDetail) { - o.Detail = v +// SetHttpStatusCode sets field value +func (o *ErrorResponse) SetHttpStatusCode(v int32) { + o.HttpStatusCode = v +} + +// GetMessage returns the Message field value +func (o *ErrorResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorResponse) SetMessage(v string) { + o.Message = v +} + +// GetErrorDetails returns the ErrorDetails field value +// If the value is explicit nil, the zero value for []ErrorDetail will be returned +func (o *ErrorResponse) GetErrorDetails() []ErrorDetail { + if o == nil { + var ret []ErrorDetail + return ret + } + + return o.ErrorDetails +} + +// GetErrorDetailsOk returns a tuple with the ErrorDetails field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ErrorResponse) GetErrorDetailsOk() ([]ErrorDetail, bool) { + if o == nil || IsNil(o.ErrorDetails) { + return nil, false + } + return o.ErrorDetails, true +} + +// SetErrorDetails sets field value +func (o *ErrorResponse) SetErrorDetails(v []ErrorDetail) { + o.ErrorDetails = v } func (o ErrorResponse) MarshalJSON() ([]byte, error) { @@ -79,7 +185,13 @@ func (o ErrorResponse) MarshalJSON() ([]byte, error) { func (o ErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["detail"] = o.Detail + toSerialize["debugId"] = o.DebugId + toSerialize["errorCode"] = o.ErrorCode + toSerialize["httpStatusCode"] = o.HttpStatusCode + toSerialize["message"] = o.Message + if o.ErrorDetails != nil { + toSerialize["errorDetails"] = o.ErrorDetails + } return toSerialize, nil } @@ -88,7 +200,11 @@ func (o *ErrorResponse) 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{ - "detail", + "debugId", + "errorCode", + "httpStatusCode", + "message", + "errorDetails", } allProperties := make(map[string]interface{}) diff --git a/pkg/config-api-client/model_group.go b/pkg/config-api-client/model_group.go new file mode 100644 index 00000000..7e87529d --- /dev/null +++ b/pkg/config-api-client/model_group.go @@ -0,0 +1,157 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 Group type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Group{} + +// Group struct for Group +type Group struct { + Id string `json:"id"` +} + +type _Group Group + +// NewGroup instantiates a new Group object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroup(id string) *Group { + this := Group{} + this.Id = id + return &this +} + +// NewGroupWithDefaults instantiates a new Group object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupWithDefaults() *Group { + this := Group{} + return &this +} + +// GetId returns the Id field value +func (o *Group) GetId() 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 *Group) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Group) SetId(v string) { + o.Id = v +} + +func (o Group) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Group) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *Group) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroup := _Group{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGroup) + + if err != nil { + return err + } + + *o = Group(varGroup) + + return err +} + +type NullableGroup struct { + value *Group + isSet bool +} + +func (v NullableGroup) Get() *Group { + return v.value +} + +func (v *NullableGroup) Set(val *Group) { + v.value = val + v.isSet = true +} + +func (v NullableGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroup(val *Group) *NullableGroup { + return &NullableGroup{value: val, isSet: true} +} + +func (v NullableGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_groups_get_item.go b/pkg/config-api-client/model_groups_get_item.go index 90c5e4e5..c0abfc87 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,10 +22,11 @@ var _ MappedNullable = &GroupsGetItem{} // GroupsGetItem struct for GroupsGetItem type GroupsGetItem struct { - Uid string `json:"uid"` - Name string `json:"name"` - Path string `json:"path"` - ParentUid NullableString `json:"parent_uid"` + Id string `json:"id"` + Name string `json:"name"` + Parent NullableParent `json:"parent"` + Path string `json:"path"` + Type *string `json:"type,omitempty"` } type _GroupsGetItem GroupsGetItem @@ -34,12 +35,14 @@ type _GroupsGetItem GroupsGetItem // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGroupsGetItem(uid string, name string, path string, parentUid NullableString) *GroupsGetItem { +func NewGroupsGetItem(id string, name string, parent NullableParent, path string) *GroupsGetItem { this := GroupsGetItem{} - this.Uid = uid + this.Id = id this.Name = name + this.Parent = parent this.Path = path - this.ParentUid = parentUid + var type_ string = "uxi/group" + this.Type = &type_ return &this } @@ -48,31 +51,33 @@ func NewGroupsGetItem(uid string, name string, path string, parentUid NullableSt // but it doesn't guarantee that properties required by API are set func NewGroupsGetItemWithDefaults() *GroupsGetItem { this := GroupsGetItem{} + var type_ string = "uxi/group" + this.Type = &type_ return &this } -// GetUid returns the Uid field value -func (o *GroupsGetItem) GetUid() string { +// GetId returns the Id field value +func (o *GroupsGetItem) GetId() string { if o == nil { var ret string return ret } - return o.Uid + return o.Id } -// GetUidOk returns a tuple with the Uid field value +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *GroupsGetItem) GetUidOk() (*string, bool) { +func (o *GroupsGetItem) GetIdOk() (*string, bool) { if o == nil { return nil, false } - return &o.Uid, true + return &o.Id, true } -// SetUid sets field value -func (o *GroupsGetItem) SetUid(v string) { - o.Uid = v +// SetId sets field value +func (o *GroupsGetItem) SetId(v string) { + o.Id = v } // GetName returns the Name field value @@ -99,6 +104,32 @@ func (o *GroupsGetItem) SetName(v string) { o.Name = v } +// GetParent returns the Parent field value +// If the value is explicit nil, the zero value for Parent will be returned +func (o *GroupsGetItem) GetParent() Parent { + if o == nil || o.Parent.Get() == nil { + var ret Parent + return ret + } + + return *o.Parent.Get() +} + +// GetParentOk returns a tuple with the Parent field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GroupsGetItem) GetParentOk() (*Parent, bool) { + if o == nil { + return nil, false + } + return o.Parent.Get(), o.Parent.IsSet() +} + +// SetParent sets field value +func (o *GroupsGetItem) SetParent(v Parent) { + o.Parent.Set(&v) +} + // GetPath returns the Path field value func (o *GroupsGetItem) GetPath() string { if o == nil { @@ -123,30 +154,36 @@ func (o *GroupsGetItem) SetPath(v string) { o.Path = v } -// GetParentUid returns the ParentUid field value -// If the value is explicit nil, the zero value for string will be returned -func (o *GroupsGetItem) GetParentUid() string { - if o == nil || o.ParentUid.Get() == nil { +// GetType returns the Type field value if set, zero value otherwise. +func (o *GroupsGetItem) GetType() string { + if o == nil || IsNil(o.Type) { var ret string return ret } - - return *o.ParentUid.Get() + return *o.Type } -// GetParentUidOk returns a tuple with the ParentUid field value +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *GroupsGetItem) GetParentUidOk() (*string, bool) { - if o == nil { +func (o *GroupsGetItem) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { return nil, false } - return o.ParentUid.Get(), o.ParentUid.IsSet() + return o.Type, true } -// SetParentUid sets field value -func (o *GroupsGetItem) SetParentUid(v string) { - o.ParentUid.Set(&v) +// HasType returns a boolean if a field has been set. +func (o *GroupsGetItem) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GroupsGetItem) SetType(v string) { + o.Type = &v } func (o GroupsGetItem) MarshalJSON() ([]byte, error) { @@ -159,10 +196,13 @@ func (o GroupsGetItem) MarshalJSON() ([]byte, error) { func (o GroupsGetItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["uid"] = o.Uid + toSerialize["id"] = o.Id toSerialize["name"] = o.Name + toSerialize["parent"] = o.Parent.Get() toSerialize["path"] = o.Path - toSerialize["parent_uid"] = o.ParentUid.Get() + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } return toSerialize, nil } @@ -171,10 +211,10 @@ func (o *GroupsGetItem) 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{ - "uid", + "id", "name", + "parent", "path", - "parent_uid", } allProperties := make(map[string]interface{}) diff --git a/pkg/config-api-client/model_groups_get_response.go b/pkg/config-api-client/model_groups_get_response.go index e3977175..f9880e4c 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,8 +22,9 @@ var _ MappedNullable = &GroupsGetResponse{} // GroupsGetResponse struct for GroupsGetResponse type GroupsGetResponse struct { - Pagination PaginationDetails `json:"pagination"` - Groups []GroupsGetItem `json:"groups"` + Items []GroupsGetItem `json:"items"` + Count int32 `json:"count"` + Next NullableString `json:"next"` } type _GroupsGetResponse GroupsGetResponse @@ -32,10 +33,11 @@ type _GroupsGetResponse GroupsGetResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGroupsGetResponse(pagination PaginationDetails, groups []GroupsGetItem) *GroupsGetResponse { +func NewGroupsGetResponse(items []GroupsGetItem, count int32, next NullableString) *GroupsGetResponse { this := GroupsGetResponse{} - this.Pagination = pagination - this.Groups = groups + this.Items = items + this.Count = count + this.Next = next return &this } @@ -47,52 +49,78 @@ func NewGroupsGetResponseWithDefaults() *GroupsGetResponse { return &this } -// GetPagination returns the Pagination field value -func (o *GroupsGetResponse) GetPagination() PaginationDetails { +// GetItems returns the Items field value +func (o *GroupsGetResponse) GetItems() []GroupsGetItem { if o == nil { - var ret PaginationDetails + var ret []GroupsGetItem return ret } - return o.Pagination + return o.Items } -// GetPaginationOk returns a tuple with the Pagination field value +// GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *GroupsGetResponse) GetPaginationOk() (*PaginationDetails, bool) { +func (o *GroupsGetResponse) GetItemsOk() ([]GroupsGetItem, bool) { if o == nil { return nil, false } - return &o.Pagination, true + return o.Items, true } -// SetPagination sets field value -func (o *GroupsGetResponse) SetPagination(v PaginationDetails) { - o.Pagination = v +// SetItems sets field value +func (o *GroupsGetResponse) SetItems(v []GroupsGetItem) { + o.Items = v } -// GetGroups returns the Groups field value -func (o *GroupsGetResponse) GetGroups() []GroupsGetItem { +// GetCount returns the Count field value +func (o *GroupsGetResponse) GetCount() int32 { if o == nil { - var ret []GroupsGetItem + 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 *GroupsGetResponse) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *GroupsGetResponse) 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 *GroupsGetResponse) GetNext() string { + if o == nil || o.Next.Get() == nil { + var ret string return ret } - return o.Groups + return *o.Next.Get() } -// GetGroupsOk returns a tuple with the Groups field value +// GetNextOk returns a tuple with the Next field value // and a boolean to check if the value has been set. -func (o *GroupsGetResponse) GetGroupsOk() ([]GroupsGetItem, bool) { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GroupsGetResponse) GetNextOk() (*string, bool) { if o == nil { return nil, false } - return o.Groups, true + return o.Next.Get(), o.Next.IsSet() } -// SetGroups sets field value -func (o *GroupsGetResponse) SetGroups(v []GroupsGetItem) { - o.Groups = v +// SetNext sets field value +func (o *GroupsGetResponse) SetNext(v string) { + o.Next.Set(&v) } func (o GroupsGetResponse) MarshalJSON() ([]byte, error) { @@ -105,8 +133,9 @@ func (o GroupsGetResponse) MarshalJSON() ([]byte, error) { func (o GroupsGetResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["pagination"] = o.Pagination - toSerialize["groups"] = o.Groups + toSerialize["items"] = o.Items + toSerialize["count"] = o.Count + toSerialize["next"] = o.Next.Get() return toSerialize, nil } @@ -115,8 +144,9 @@ func (o *GroupsGetResponse) 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{ - "pagination", - "groups", + "items", + "count", + "next", } allProperties := make(map[string]interface{}) diff --git a/pkg/config-api-client/model_groups_post_request.go b/pkg/config-api-client/model_groups_post_request.go index 0571a24f..8d23c724 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,8 +22,8 @@ var _ MappedNullable = &GroupsPostRequest{} // GroupsPostRequest struct for GroupsPostRequest type GroupsPostRequest struct { - ParentUid string `json:"parent_uid"` - Name string `json:"name"` + ParentId string `json:"parentId"` + Name string `json:"name"` } type _GroupsPostRequest GroupsPostRequest @@ -32,9 +32,9 @@ 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(parentUid string, name string) *GroupsPostRequest { +func NewGroupsPostRequest(parentId string, name string) *GroupsPostRequest { this := GroupsPostRequest{} - this.ParentUid = parentUid + this.ParentId = parentId this.Name = name return &this } @@ -47,28 +47,28 @@ func NewGroupsPostRequestWithDefaults() *GroupsPostRequest { return &this } -// GetParentUid returns the ParentUid field value -func (o *GroupsPostRequest) GetParentUid() string { +// GetParentId returns the ParentId field value +func (o *GroupsPostRequest) GetParentId() string { if o == nil { var ret string return ret } - return o.ParentUid + return o.ParentId } -// GetParentUidOk returns a tuple with the ParentUid field value +// GetParentIdOk returns a tuple with the ParentId field value // and a boolean to check if the value has been set. -func (o *GroupsPostRequest) GetParentUidOk() (*string, bool) { +func (o *GroupsPostRequest) GetParentIdOk() (*string, bool) { if o == nil { return nil, false } - return &o.ParentUid, true + return &o.ParentId, true } -// SetParentUid sets field value -func (o *GroupsPostRequest) SetParentUid(v string) { - o.ParentUid = v +// SetParentId sets field value +func (o *GroupsPostRequest) SetParentId(v string) { + o.ParentId = v } // GetName returns the Name field value @@ -105,7 +105,7 @@ func (o GroupsPostRequest) MarshalJSON() ([]byte, error) { func (o GroupsPostRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["parent_uid"] = o.ParentUid + toSerialize["parentId"] = o.ParentId toSerialize["name"] = o.Name return toSerialize, nil } @@ -115,7 +115,7 @@ 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{ - "parent_uid", + "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 4066a5aa..4e5b2ae9 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ @@ -22,10 +22,10 @@ var _ MappedNullable = &GroupsPostResponse{} // GroupsPostResponse struct for GroupsPostResponse type GroupsPostResponse struct { - ParentUid string `json:"parent_uid"` Name string `json:"name"` - Uid string `json:"uid"` Path string `json:"path"` + ParentUid string `json:"parent_uid"` + Uid string `json:"uid"` } type _GroupsPostResponse GroupsPostResponse @@ -34,12 +34,12 @@ type _GroupsPostResponse GroupsPostResponse // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGroupsPostResponse(parentUid string, name string, uid string, path string) *GroupsPostResponse { +func NewGroupsPostResponse(name string, path string, parentUid string, uid string) *GroupsPostResponse { this := GroupsPostResponse{} - this.ParentUid = parentUid this.Name = name - this.Uid = uid this.Path = path + this.ParentUid = parentUid + this.Uid = uid return &this } @@ -51,100 +51,100 @@ func NewGroupsPostResponseWithDefaults() *GroupsPostResponse { return &this } -// GetParentUid returns the ParentUid field value -func (o *GroupsPostResponse) GetParentUid() string { +// GetName returns the Name field value +func (o *GroupsPostResponse) GetName() string { if o == nil { var ret string return ret } - return o.ParentUid + return o.Name } -// GetParentUidOk returns a tuple with the ParentUid field value +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *GroupsPostResponse) GetParentUidOk() (*string, bool) { +func (o *GroupsPostResponse) GetNameOk() (*string, bool) { if o == nil { return nil, false } - return &o.ParentUid, true + return &o.Name, true } -// SetParentUid sets field value -func (o *GroupsPostResponse) SetParentUid(v string) { - o.ParentUid = v +// SetName sets field value +func (o *GroupsPostResponse) SetName(v string) { + o.Name = v } -// GetName returns the Name field value -func (o *GroupsPostResponse) GetName() string { +// GetPath returns the Path field value +func (o *GroupsPostResponse) GetPath() string { if o == nil { var ret string return ret } - return o.Name + return o.Path } -// GetNameOk returns a tuple with the Name field value +// GetPathOk returns a tuple with the Path field value // and a boolean to check if the value has been set. -func (o *GroupsPostResponse) GetNameOk() (*string, bool) { +func (o *GroupsPostResponse) GetPathOk() (*string, bool) { if o == nil { return nil, false } - return &o.Name, true + return &o.Path, true } -// SetName sets field value -func (o *GroupsPostResponse) SetName(v string) { - o.Name = v +// SetPath sets field value +func (o *GroupsPostResponse) SetPath(v string) { + o.Path = v } -// GetUid returns the Uid field value -func (o *GroupsPostResponse) GetUid() string { +// GetParentUid returns the ParentUid field value +func (o *GroupsPostResponse) GetParentUid() string { if o == nil { var ret string return ret } - return o.Uid + return o.ParentUid } -// GetUidOk returns a tuple with the Uid field value +// GetParentUidOk returns a tuple with the ParentUid field value // and a boolean to check if the value has been set. -func (o *GroupsPostResponse) GetUidOk() (*string, bool) { +func (o *GroupsPostResponse) GetParentUidOk() (*string, bool) { if o == nil { return nil, false } - return &o.Uid, true + return &o.ParentUid, true } -// SetUid sets field value -func (o *GroupsPostResponse) SetUid(v string) { - o.Uid = v +// SetParentUid sets field value +func (o *GroupsPostResponse) SetParentUid(v string) { + o.ParentUid = v } -// GetPath returns the Path field value -func (o *GroupsPostResponse) GetPath() string { +// GetUid returns the Uid field value +func (o *GroupsPostResponse) GetUid() string { if o == nil { var ret string return ret } - return o.Path + return o.Uid } -// GetPathOk returns a tuple with the Path field value +// GetUidOk returns a tuple with the Uid field value // and a boolean to check if the value has been set. -func (o *GroupsPostResponse) GetPathOk() (*string, bool) { +func (o *GroupsPostResponse) GetUidOk() (*string, bool) { if o == nil { return nil, false } - return &o.Path, true + return &o.Uid, true } -// SetPath sets field value -func (o *GroupsPostResponse) SetPath(v string) { - o.Path = v +// SetUid sets field value +func (o *GroupsPostResponse) SetUid(v string) { + o.Uid = v } func (o GroupsPostResponse) MarshalJSON() ([]byte, error) { @@ -157,10 +157,10 @@ func (o GroupsPostResponse) MarshalJSON() ([]byte, error) { func (o GroupsPostResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["parent_uid"] = o.ParentUid toSerialize["name"] = o.Name - toSerialize["uid"] = o.Uid toSerialize["path"] = o.Path + toSerialize["parent_uid"] = o.ParentUid + toSerialize["uid"] = o.Uid return toSerialize, nil } @@ -169,10 +169,10 @@ func (o *GroupsPostResponse) 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{ - "parent_uid", "name", - "uid", "path", + "parent_uid", + "uid", } allProperties := make(map[string]interface{}) diff --git a/pkg/config-api-client/model_issue.go b/pkg/config-api-client/model_issue.go new file mode 100644 index 00000000..af7c40ef --- /dev/null +++ b/pkg/config-api-client/model_issue.go @@ -0,0 +1,213 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 Issue type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Issue{} + +// Issue struct for Issue +type Issue struct { + Description string `json:"description"` + Subject IssueSubject `json:"subject"` + Source string `json:"source"` +} + +type _Issue Issue + +// NewIssue instantiates a new Issue object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIssue(description string, subject IssueSubject, source string) *Issue { + this := Issue{} + this.Description = description + this.Subject = subject + this.Source = source + return &this +} + +// NewIssueWithDefaults instantiates a new Issue object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIssueWithDefaults() *Issue { + this := Issue{} + return &this +} + +// GetDescription returns the Description field value +func (o *Issue) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Issue) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Issue) SetDescription(v string) { + o.Description = v +} + +// GetSubject returns the Subject field value +func (o *Issue) GetSubject() IssueSubject { + if o == nil { + var ret IssueSubject + return ret + } + + return o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value +// and a boolean to check if the value has been set. +func (o *Issue) GetSubjectOk() (*IssueSubject, bool) { + if o == nil { + return nil, false + } + return &o.Subject, true +} + +// SetSubject sets field value +func (o *Issue) SetSubject(v IssueSubject) { + o.Subject = v +} + +// GetSource returns the Source field value +func (o *Issue) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *Issue) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *Issue) SetSource(v string) { + o.Source = v +} + +func (o Issue) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Issue) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["subject"] = o.Subject + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *Issue) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "subject", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIssue := _Issue{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIssue) + + if err != nil { + return err + } + + *o = Issue(varIssue) + + return err +} + +type NullableIssue struct { + value *Issue + isSet bool +} + +func (v NullableIssue) Get() *Issue { + return v.value +} + +func (v *NullableIssue) Set(val *Issue) { + v.value = val + v.isSet = true +} + +func (v NullableIssue) IsSet() bool { + return v.isSet +} + +func (v *NullableIssue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIssue(val *Issue) *NullableIssue { + return &NullableIssue{value: val, isSet: true} +} + +func (v NullableIssue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIssue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_issue_subject.go b/pkg/config-api-client/model_issue_subject.go new file mode 100644 index 00000000..61af6d23 --- /dev/null +++ b/pkg/config-api-client/model_issue_subject.go @@ -0,0 +1,113 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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" +) + +// IssueSubject the model 'IssueSubject' +type IssueSubject string + +// List of IssueSubject +const ( + FIELD IssueSubject = "field" + HEADER IssueSubject = "header" + QUERY_PARAMETER IssueSubject = "query.parameter" +) + +// All allowed values of IssueSubject enum +var AllowedIssueSubjectEnumValues = []IssueSubject{ + "field", + "header", + "query.parameter", +} + +func (v *IssueSubject) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IssueSubject(value) + for _, existing := range AllowedIssueSubjectEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IssueSubject", value) +} + +// NewIssueSubjectFromValue returns a pointer to a valid IssueSubject +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIssueSubjectFromValue(v string) (*IssueSubject, error) { + ev := IssueSubject(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IssueSubject: valid values are %v", v, AllowedIssueSubjectEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IssueSubject) IsValid() bool { + for _, existing := range AllowedIssueSubjectEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IssueSubject value +func (v IssueSubject) Ptr() *IssueSubject { + return &v +} + +type NullableIssueSubject struct { + value *IssueSubject + isSet bool +} + +func (v NullableIssueSubject) Get() *IssueSubject { + return v.value +} + +func (v *NullableIssueSubject) Set(val *IssueSubject) { + v.value = val + v.isSet = true +} + +func (v NullableIssueSubject) IsSet() bool { + return v.isSet +} + +func (v *NullableIssueSubject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIssueSubject(val *IssueSubject) *NullableIssueSubject { + return &NullableIssueSubject{value: val, isSet: true} +} + +func (v NullableIssueSubject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIssueSubject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} 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 f87e6d97..6e0cc985 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: 1.11.0 +API version: 1.14.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 aad4ff10..6c22d3cb 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_pagination_details.go b/pkg/config-api-client/model_pagination_details.go index 92ecf07a..84a58aa4 100644 --- a/pkg/config-api-client/model_pagination_details.go +++ b/pkg/config-api-client/model_pagination_details.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_parent.go b/pkg/config-api-client/model_parent.go new file mode 100644 index 00000000..b52fd24a --- /dev/null +++ b/pkg/config-api-client/model_parent.go @@ -0,0 +1,157 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 Parent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Parent{} + +// Parent struct for Parent +type Parent struct { + Id string `json:"id"` +} + +type _Parent Parent + +// NewParent instantiates a new Parent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewParent(id string) *Parent { + this := Parent{} + this.Id = id + return &this +} + +// NewParentWithDefaults instantiates a new Parent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewParentWithDefaults() *Parent { + this := Parent{} + return &this +} + +// GetId returns the Id field value +func (o *Parent) 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 *Parent) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Parent) SetId(v string) { + o.Id = v +} + +func (o Parent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Parent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *Parent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varParent := _Parent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varParent) + + if err != nil { + return err + } + + *o = Parent(varParent) + + return err +} + +type NullableParent struct { + value *Parent + isSet bool +} + +func (v NullableParent) Get() *Parent { + return v.value +} + +func (v *NullableParent) Set(val *Parent) { + v.value = val + v.isSet = true +} + +func (v NullableParent) IsSet() bool { + return v.isSet +} + +func (v *NullableParent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParent(val *Parent) *NullableParent { + return &NullableParent{value: val, isSet: true} +} + +func (v NullableParent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParent) 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 new file mode 100644 index 00000000..300e26f6 --- /dev/null +++ b/pkg/config-api-client/model_sensor.go @@ -0,0 +1,157 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 Sensor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Sensor{} + +// Sensor struct for Sensor +type Sensor struct { + Id string `json:"id"` +} + +type _Sensor Sensor + +// NewSensor instantiates a new Sensor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSensor(id string) *Sensor { + this := Sensor{} + this.Id = id + return &this +} + +// NewSensorWithDefaults instantiates a new Sensor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSensorWithDefaults() *Sensor { + this := Sensor{} + return &this +} + +// GetId returns the Id field value +func (o *Sensor) 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 *Sensor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Sensor) SetId(v string) { + o.Id = v +} + +func (o Sensor) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Sensor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *Sensor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSensor := _Sensor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSensor) + + if err != nil { + return err + } + + *o = Sensor(varSensor) + + return err +} + +type NullableSensor struct { + value *Sensor + isSet bool +} + +func (v NullableSensor) Get() *Sensor { + return v.value +} + +func (v *NullableSensor) Set(val *Sensor) { + v.value = val + v.isSet = true +} + +func (v NullableSensor) IsSet() bool { + return v.isSet +} + +func (v *NullableSensor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSensor(val *Sensor) *NullableSensor { + return &NullableSensor{value: val, isSet: true} +} + +func (v NullableSensor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSensor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/config-api-client/model_sensor_group_assignment_response.go b/pkg/config-api-client/model_sensor_group_assignment_response.go new file mode 100644 index 00000000..92086ce5 --- /dev/null +++ b/pkg/config-api-client/model_sensor_group_assignment_response.go @@ -0,0 +1,253 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 SensorGroupAssignmentResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SensorGroupAssignmentResponse{} + +// SensorGroupAssignmentResponse struct for SensorGroupAssignmentResponse +type SensorGroupAssignmentResponse struct { + Id string `json:"id"` + Group Group `json:"group"` + Sensor Sensor `json:"sensor"` + Type *string `json:"type,omitempty"` +} + +type _SensorGroupAssignmentResponse SensorGroupAssignmentResponse + +// NewSensorGroupAssignmentResponse instantiates a new SensorGroupAssignmentResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSensorGroupAssignmentResponse(id string, group Group, sensor Sensor) *SensorGroupAssignmentResponse { + this := SensorGroupAssignmentResponse{} + this.Id = id + this.Group = group + this.Sensor = sensor + var type_ string = "uxi/sensor-group-assignment" + this.Type = &type_ + return &this +} + +// NewSensorGroupAssignmentResponseWithDefaults instantiates a new SensorGroupAssignmentResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSensorGroupAssignmentResponseWithDefaults() *SensorGroupAssignmentResponse { + this := SensorGroupAssignmentResponse{} + var type_ string = "uxi/sensor-group-assignment" + this.Type = &type_ + return &this +} + +// GetId returns the Id field value +func (o *SensorGroupAssignmentResponse) 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 *SensorGroupAssignmentResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SensorGroupAssignmentResponse) SetId(v string) { + o.Id = v +} + +// GetGroup returns the Group field value +func (o *SensorGroupAssignmentResponse) GetGroup() Group { + if o == nil { + var ret Group + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *SensorGroupAssignmentResponse) GetGroupOk() (*Group, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *SensorGroupAssignmentResponse) SetGroup(v Group) { + o.Group = v +} + +// GetSensor returns the Sensor field value +func (o *SensorGroupAssignmentResponse) GetSensor() Sensor { + if o == nil { + var ret Sensor + return ret + } + + return o.Sensor +} + +// GetSensorOk returns a tuple with the Sensor field value +// and a boolean to check if the value has been set. +func (o *SensorGroupAssignmentResponse) GetSensorOk() (*Sensor, bool) { + if o == nil { + return nil, false + } + return &o.Sensor, true +} + +// SetSensor sets field value +func (o *SensorGroupAssignmentResponse) SetSensor(v Sensor) { + o.Sensor = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SensorGroupAssignmentResponse) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SensorGroupAssignmentResponse) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SensorGroupAssignmentResponse) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SensorGroupAssignmentResponse) SetType(v string) { + o.Type = &v +} + +func (o SensorGroupAssignmentResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SensorGroupAssignmentResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["group"] = o.Group + toSerialize["sensor"] = o.Sensor + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +func (o *SensorGroupAssignmentResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the 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", + "group", + "sensor", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSensorGroupAssignmentResponse := _SensorGroupAssignmentResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSensorGroupAssignmentResponse) + + if err != nil { + return err + } + + *o = SensorGroupAssignmentResponse(varSensorGroupAssignmentResponse) + + return err +} + +type NullableSensorGroupAssignmentResponse struct { + value *SensorGroupAssignmentResponse + isSet bool +} + +func (v NullableSensorGroupAssignmentResponse) Get() *SensorGroupAssignmentResponse { + return v.value +} + +func (v *NullableSensorGroupAssignmentResponse) Set(val *SensorGroupAssignmentResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSensorGroupAssignmentResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSensorGroupAssignmentResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSensorGroupAssignmentResponse(val *SensorGroupAssignmentResponse) *NullableSensorGroupAssignmentResponse { + return &NullableSensorGroupAssignmentResponse{value: val, isSet: true} +} + +func (v NullableSensorGroupAssignmentResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSensorGroupAssignmentResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} 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 abcf98e1..2e862212 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: 1.11.0 +API version: 1.14.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 new file mode 100644 index 00000000..00a0cb78 --- /dev/null +++ b/pkg/config-api-client/model_sensor_group_assignments_post_request.go @@ -0,0 +1,185 @@ +/* +Configuration Api + +Nice description goes here + +API version: 1.14.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 SensorGroupAssignmentsPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SensorGroupAssignmentsPostRequest{} + +// SensorGroupAssignmentsPostRequest struct for SensorGroupAssignmentsPostRequest +type SensorGroupAssignmentsPostRequest struct { + GroupId string `json:"groupId"` + SensorId string `json:"sensorId"` +} + +type _SensorGroupAssignmentsPostRequest SensorGroupAssignmentsPostRequest + +// NewSensorGroupAssignmentsPostRequest instantiates a new SensorGroupAssignmentsPostRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSensorGroupAssignmentsPostRequest(groupId string, sensorId string) *SensorGroupAssignmentsPostRequest { + this := SensorGroupAssignmentsPostRequest{} + this.GroupId = groupId + this.SensorId = sensorId + return &this +} + +// NewSensorGroupAssignmentsPostRequestWithDefaults instantiates a new SensorGroupAssignmentsPostRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSensorGroupAssignmentsPostRequestWithDefaults() *SensorGroupAssignmentsPostRequest { + this := SensorGroupAssignmentsPostRequest{} + return &this +} + +// GetGroupId returns the GroupId field value +func (o *SensorGroupAssignmentsPostRequest) GetGroupId() string { + if o == nil { + var ret string + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *SensorGroupAssignmentsPostRequest) GetGroupIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *SensorGroupAssignmentsPostRequest) SetGroupId(v string) { + o.GroupId = v +} + +// GetSensorId returns the SensorId field value +func (o *SensorGroupAssignmentsPostRequest) GetSensorId() string { + if o == nil { + var ret string + return ret + } + + return o.SensorId +} + +// GetSensorIdOk returns a tuple with the SensorId field value +// and a boolean to check if the value has been set. +func (o *SensorGroupAssignmentsPostRequest) GetSensorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SensorId, true +} + +// SetSensorId sets field value +func (o *SensorGroupAssignmentsPostRequest) SetSensorId(v string) { + o.SensorId = v +} + +func (o SensorGroupAssignmentsPostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SensorGroupAssignmentsPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groupId"] = o.GroupId + toSerialize["sensorId"] = o.SensorId + return toSerialize, nil +} + +func (o *SensorGroupAssignmentsPostRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groupId", + "sensorId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSensorGroupAssignmentsPostRequest := _SensorGroupAssignmentsPostRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSensorGroupAssignmentsPostRequest) + + if err != nil { + return err + } + + *o = SensorGroupAssignmentsPostRequest(varSensorGroupAssignmentsPostRequest) + + return err +} + +type NullableSensorGroupAssignmentsPostRequest struct { + value *SensorGroupAssignmentsPostRequest + isSet bool +} + +func (v NullableSensorGroupAssignmentsPostRequest) Get() *SensorGroupAssignmentsPostRequest { + return v.value +} + +func (v *NullableSensorGroupAssignmentsPostRequest) Set(val *SensorGroupAssignmentsPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSensorGroupAssignmentsPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSensorGroupAssignmentsPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSensorGroupAssignmentsPostRequest(val *SensorGroupAssignmentsPostRequest) *NullableSensorGroupAssignmentsPostRequest { + return &NullableSensorGroupAssignmentsPostRequest{value: val, isSet: true} +} + +func (v NullableSensorGroupAssignmentsPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSensorGroupAssignmentsPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} 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 f2620180..4eee9288 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: 1.11.0 +API version: 1.14.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 ae23eb0f..e340f6b0 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: 1.11.0 +API version: 1.14.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 bf1f3796..002e3964 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: 1.11.0 +API version: 1.14.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 5d969455..e4e327d2 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: 1.11.0 +API version: 1.14.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 d03d6e8e..cbef5dc7 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/response.go b/pkg/config-api-client/response.go index f88d0e22..270b9f7d 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: 1.11.0 +API version: 1.14.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 6253c6d5..38294199 100644 --- a/pkg/config-api-client/test/api_configuration_test.go +++ b/pkg/config-api-client/test/api_configuration_test.go @@ -20,21 +20,21 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { defer gock.Off() - t.Run("Test ConfigurationAPIService GroupsPostConfigurationAppV1GroupsPost", func(t *testing.T) { + t.Run("Test ConfigurationAPIService GroupsPostUxiV1alpha1GroupsPost", func(t *testing.T) { - gock.New(configuration.Scheme + "://" + configuration.Host).Post("/configuration/app/v1/groups").Reply(200).JSON(map[string]string{"parent_uid": "parent.uid", "name": "name", "uid": "node", "path": "parent.uid.node"}) - groups_post_request := openapiclient.NewGroupsPostRequest("parent_uid", "name") - resp, httpRes, err := apiClient.ConfigurationAPI.GroupsPostConfigurationAppV1GroupsPost(context.Background()).GroupsPostRequest(*groups_post_request).Execute() + gock.New(configuration.Scheme + "://" + configuration.Host).Post("/uxi/v1alpha1/groups").Reply(200).JSON(map[string]string{"parent_uid": "parent.uid", "name": "name", "uid": "node", "path": "parent.uid.node"}) + groupsPostRequest := openapiclient.NewGroupsPostRequest("parent_uid", "name") + resp, httpRes, err := apiClient.ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost(context.Background()).GroupsPostRequest(*groupsPostRequest).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) assert.Equal(t, resp, &openapiclient.GroupsPostResponse{ParentUid: "parent.uid", Name: "name", Uid: "node", Path: "parent.uid.node"}) }) - t.Run("Test ConfigurationAPIService GetConfigurationAppV1SensorGroupAssignmentsGet", func(t *testing.T) { + t.Run("Test ConfigurationAPIService GetUxiV1alpha1SensorGroupAssignmentsGet", func(t *testing.T) { gock.New(configuration.Scheme + "://" + configuration.Host). - Get("/configuration/app/v1/sensor-group-assignments"). + Get("/uxi/v1alpha1/sensor-group-assignments"). MatchParams(map[string]string{"uid": "uid", "limit": "10", "cursor": "some-cursor"}). Reply(200). JSON(map[string]interface{}{ @@ -54,7 +54,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { }, }) resp, httpRes, err := apiClient.ConfigurationAPI. - GetConfigurationAppV1SensorGroupAssignmentsGet(context.Background()). + GetUxiV1alpha1SensorGroupAssignmentsGet(context.Background()). Uid("uid"). Limit(10). Cursor("some-cursor"). @@ -80,31 +80,55 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { }) }) - t.Run("Test ConfigurationAPIService GetConfigurationAppV1SensorGroupAssignmentsGet", func(t *testing.T) { + t.Run("Test ConfigurationAPIService PostUxiV1alpha1SensorGroupAssignmentsGet", func(t *testing.T) { + + gock.New(configuration.Scheme + "://" + configuration.Host). + Post("/uxi/v1alpha1/sensor-group-assignments"). + Reply(200). + JSON(map[string]interface{}{ + "id": "uid", + "group": map[string]string{"id": "group_uid"}, + "sensor": map[string]string{"id": "sensor_uid"}, + "type": "uxi/sensor_group_assignment", + }) + + postRequest := openapiclient.NewSensorGroupAssignmentsPostRequest("group_uid", "sensor_uid") + resp, httpRes, err := apiClient.ConfigurationAPI. + PostUxiV1alpha1SensorGroupAssignmentsPost(context.Background()). + SensorGroupAssignmentsPostRequest(*postRequest). + Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + resourceType := "uxi/sensor_group_assignment" + assert.Equal(t, resp, &openapiclient.SensorGroupAssignmentResponse{ + Id: "uid", + Group: *openapiclient.NewGroup("group_uid"), + Sensor: *openapiclient.NewSensor("sensor_uid"), + Type: &resourceType, + }) + }) + + t.Run("Test ConfigurationAPIService GroupsGetUxiV1alpha1GroupsGet", func(t *testing.T) { parent_uid := "parent_uid" gock.New(configuration.Scheme + "://" + configuration.Host). - Get("/configuration/app/v1/groups"). + Get("/uxi/v1alpha1/groups"). MatchParams(map[string]string{"uid": "uid", "limit": "10", "cursor": "some-cursor"}). Reply(200). JSON(map[string]interface{}{ - "groups": []map[string]string{ + "items": []map[string]interface{}{ { - "uid": "uid", - "name": "name", - "parent_uid": parent_uid, - "path": "root_uid.parent_uid.uid", + "id": "uid", + "name": "name", + "parent": map[string]string{"id": parent_uid}, + "path": "root_uid.parent_uid.uid", }, }, - "pagination": map[string]interface{}{ - "limit": 10, - "first": nil, - "next": nil, - "previous": nil, - "last": nil, - }, + "next": nil, + "count": 1, }) resp, httpRes, err := apiClient.ConfigurationAPI. - GroupsGetConfigurationAppV1GroupsGet(context.Background()). + GroupsGetUxiV1alpha1GroupsGet(context.Background()). Uid("uid"). Limit(10). Cursor("some-cursor"). @@ -113,28 +137,23 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) assert.Equal(t, resp, &openapiclient.GroupsGetResponse{ - Groups: []openapiclient.GroupsGetItem{ + Items: []openapiclient.GroupsGetItem{ { - Uid: "uid", - Name: "name", - ParentUid: *openapiclient.NewNullableString(&parent_uid), - Path: "root_uid.parent_uid.uid", + Id: "uid", + Name: "name", + Parent: *openapiclient.NewNullableParent(openapiclient.NewParent("parent_uid")), + Path: "root_uid.parent_uid.uid", }, }, - Pagination: openapiclient.PaginationDetails{ - Limit: 10, - Next: *openapiclient.NewNullableString(nil), - Previous: *openapiclient.NewNullableString(nil), - First: *openapiclient.NewNullableString(nil), - Last: *openapiclient.NewNullableString(nil), - }, + Next: *openapiclient.NewNullableString(nil), + Count: 1, }) }) t.Run("Test ConfigurationAPIService GetConfigurationAppV1WiredNetworksGet", func(t *testing.T) { gock.New(configuration.Scheme + "://" + configuration.Host). - Get("/configuration/app/v1/wired-networks"). + Get("/uxi/v1alpha1/wired-networks"). MatchParams(map[string]string{"uid": "uid", "limit": "10", "cursor": "some-cursor"}). Reply(200). JSON(map[string]interface{}{ @@ -162,7 +181,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { }, }) resp, httpRes, err := apiClient.ConfigurationAPI. - GetConfigurationAppV1WiredNetworksGet(context.Background()). + GetUxiV1alpha1WiredNetworksGet(context.Background()). Uid("uid"). Limit(10). Cursor("some-cursor"). @@ -203,7 +222,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { t.Run("Test ConfigurationAPIService GetConfigurationAppV1WiredNetworksGet", func(t *testing.T) { gock.New(configuration.Scheme + "://" + configuration.Host). - Get("/configuration/app/v1/wireless-networks"). + Get("/uxi/v1alpha1/wireless-networks"). MatchParams(map[string]string{"uid": "uid", "limit": "10", "cursor": "some-cursor"}). Reply(200). JSON(map[string]interface{}{ @@ -233,7 +252,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) { }, }) resp, httpRes, err := apiClient.ConfigurationAPI. - GetConfigurationAppV1WirelessNetworksGet(context.Background()). + GetUxiV1alpha1WirelessNetworksGet(context.Background()). Uid("uid"). Limit(10). Cursor("some-cursor"). diff --git a/pkg/config-api-client/utils.go b/pkg/config-api-client/utils.go index 8259cdf1..6cd0dedc 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: 1.11.0 +API version: 1.14.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-provider/provider/data-sources/group.go b/pkg/config-api-provider/provider/data-sources/group.go index ddc699da..0a83b85a 100644 --- a/pkg/config-api-provider/provider/data-sources/group.go +++ b/pkg/config-api-provider/provider/data-sources/group.go @@ -84,7 +84,7 @@ func (d *groupDataSource) Read(ctx context.Context, req datasource.ReadRequest, return } - request := d.client.ConfigurationAPI.GroupsGetConfigurationAppV1GroupsGet(context.Background()) + request := d.client.ConfigurationAPI.GroupsGetUxiV1alpha1GroupsGet(context.Background()) if state.Filter.IsRoot != nil && *state.Filter.IsRoot { request = request.Uid(*state.Filter.GroupID) // TODO: use root group filter here @@ -94,7 +94,7 @@ func (d *groupDataSource) Read(ctx context.Context, req datasource.ReadRequest, groupResponse, _, err := util.RetryFor429(request.Execute) - if err != nil || len(groupResponse.Groups) != 1 { + if err != nil || len(groupResponse.Items) != 1 { resp.Diagnostics.AddError( "Error reading Group", "Could not retrieve Group, unexpected error: "+err.Error(), @@ -102,12 +102,12 @@ func (d *groupDataSource) Read(ctx context.Context, req datasource.ReadRequest, return } - group := groupResponse.Groups[0] - state.ID = types.StringValue(group.Uid) + group := groupResponse.Items[0] + state.ID = types.StringValue(group.Id) state.Name = types.StringValue(group.Name) state.Path = types.StringValue(group.Path) - if group.ParentUid.IsSet() { - state.ParentGroupID = types.StringValue(*group.ParentUid.Get()) + if group.Parent.IsSet() { + state.ParentGroupID = types.StringValue(group.Parent.Get().Id) } // Set state diff --git a/pkg/config-api-provider/provider/data-sources/sensor_group_assignment.go b/pkg/config-api-provider/provider/data-sources/sensor_group_assignment.go index 13fa2772..80877deb 100644 --- a/pkg/config-api-provider/provider/data-sources/sensor_group_assignment.go +++ b/pkg/config-api-provider/provider/data-sources/sensor_group_assignment.go @@ -72,7 +72,7 @@ func (d *sensorGroupAssignmentDataSource) Read(ctx context.Context, req datasour } request := d.client.ConfigurationAPI. - GetConfigurationAppV1SensorGroupAssignmentsGet(context.Background()). + GetUxiV1alpha1SensorGroupAssignmentsGet(context.Background()). Uid(state.Filter.SensorGroupAssignmentID) sensorGroupAssignmentResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/provider/data-sources/wired_network.go b/pkg/config-api-provider/provider/data-sources/wired_network.go index 8c0e898d..d4c9cb1a 100644 --- a/pkg/config-api-provider/provider/data-sources/wired_network.go +++ b/pkg/config-api-provider/provider/data-sources/wired_network.go @@ -97,7 +97,7 @@ func (d *wiredNetworkDataSource) Read(ctx context.Context, req datasource.ReadRe } request := d.client.ConfigurationAPI. - GetConfigurationAppV1WiredNetworksGet(context.Background()). + GetUxiV1alpha1WiredNetworksGet(context.Background()). Uid(state.Filter.WiredNetworkID) networkResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/provider/data-sources/wireless_network.go b/pkg/config-api-provider/provider/data-sources/wireless_network.go index 4223ec4a..827a25b5 100644 --- a/pkg/config-api-provider/provider/data-sources/wireless_network.go +++ b/pkg/config-api-provider/provider/data-sources/wireless_network.go @@ -105,7 +105,7 @@ func (d *wirelessNetworkDataSource) Read(ctx context.Context, req datasource.Rea } request := d.client.ConfigurationAPI. - GetConfigurationAppV1WirelessNetworksGet(context.Background()). + GetUxiV1alpha1WirelessNetworksGet(context.Background()). Uid(state.Filter.WirelessNetworkID) networkResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/provider/resources/group.go b/pkg/config-api-provider/provider/resources/group.go index e75fec96..4078044e 100644 --- a/pkg/config-api-provider/provider/resources/group.go +++ b/pkg/config-api-provider/provider/resources/group.go @@ -27,12 +27,6 @@ type groupResourceModel struct { } // TODO: Remove this once we rely fully on client for groups -type GroupResponseModel struct { - UID string `json:"uid"` - Name string `json:"name"` - ParentUid *string `json:"parent_uid"` - Path string `json:"path"` -} // TODO: Remove this once we rely fully on client for groups type GroupUpdateRequestModel struct { @@ -64,7 +58,7 @@ func (r *groupResource) Schema(_ context.Context, _ resource.SchemaRequest, resp Required: true, }, "parent_group_id": schema.StringAttribute{ - Required: true, + Optional: true, PlanModifiers: []planmodifier.String{ // UXI business logic does not permit moving of groups stringplanmodifier.RequiresReplace(), @@ -104,7 +98,7 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest, } groups_post_request := config_api_client.NewGroupsPostRequest(plan.ParentGroupId.ValueString(), plan.Name.ValueString()) - request := r.client.ConfigurationAPI.GroupsPostConfigurationAppV1GroupsPost(context.Background()).GroupsPostRequest(*groups_post_request) + request := r.client.ConfigurationAPI.GroupsPostUxiV1alpha1GroupsPost(context.Background()).GroupsPostRequest(*groups_post_request) group, _, err := util.RetryFor429(request.Execute) if err != nil { resp.Diagnostics.AddError( @@ -140,12 +134,12 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp } request := r.client.ConfigurationAPI. - GroupsGetConfigurationAppV1GroupsGet(context.Background()). + GroupsGetUxiV1alpha1GroupsGet(context.Background()). Uid(state.ID.ValueString()) groupResponse, _, err := util.RetryFor429(request.Execute) - if err != nil || len(groupResponse.Groups) != 1 { + if err != nil || len(groupResponse.Items) != 1 { resp.Diagnostics.AddError( "Error reading Group", "Could not retrieve Group, unexpected error: "+err.Error(), @@ -153,11 +147,11 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp return } - group := groupResponse.Groups[0] + group := groupResponse.Items[0] // Update state from client response state.Name = types.StringValue(group.Name) - state.ParentGroupId = types.StringValue(*group.ParentUid.Get()) + state.ParentGroupId = types.StringValue(group.Parent.Get().Id) // Set refreshed state diags = resp.State.Set(ctx, &state) @@ -183,7 +177,7 @@ func (r *groupResource) Update(ctx context.Context, req resource.UpdateRequest, // Update the state to match the plan (replace with response from client) plan.Name = types.StringValue(group.Name) - plan.ParentGroupId = types.StringValue(*group.ParentUid) + plan.ParentGroupId = types.StringValue(group.ParentUid) // Set state to fully populated data diags = resp.State.Set(ctx, plan) @@ -209,15 +203,15 @@ func (r *groupResource) ImportState(ctx context.Context, req resource.ImportStat resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } -var UpdateGroup = func(request GroupUpdateRequestModel) GroupResponseModel { +var UpdateGroup = func(request GroupUpdateRequestModel) config_api_client.GroupsPostResponse { // TODO: Query the group using the client parent_uid := "mock_parent_uid" - return GroupResponseModel{ - UID: "mock_uid", + return config_api_client.GroupsPostResponse{ + Uid: "mock_uid", Name: "mock_name", - ParentUid: &parent_uid, + ParentUid: parent_uid, Path: "mock_path", } } diff --git a/pkg/config-api-provider/provider/resources/sensor_group_assignment.go b/pkg/config-api-provider/provider/resources/sensor_group_assignment.go index 5833bb11..a686773e 100644 --- a/pkg/config-api-provider/provider/resources/sensor_group_assignment.go +++ b/pkg/config-api-provider/provider/resources/sensor_group_assignment.go @@ -132,7 +132,7 @@ func (r *sensorGroupAssignmentResource) Read(ctx context.Context, req resource.R } request := r.client.ConfigurationAPI. - GetConfigurationAppV1SensorGroupAssignmentsGet(context.Background()). + GetUxiV1alpha1SensorGroupAssignmentsGet(context.Background()). Uid(state.ID.ValueString()) sensorGroupAssignmentResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/provider/resources/wired_network.go b/pkg/config-api-provider/provider/resources/wired_network.go index 3e31d7cc..a7c9bf78 100644 --- a/pkg/config-api-provider/provider/resources/wired_network.go +++ b/pkg/config-api-provider/provider/resources/wired_network.go @@ -90,7 +90,7 @@ func (r *wiredNetworkResource) Read(ctx context.Context, req resource.ReadReques } request := r.client.ConfigurationAPI. - GetConfigurationAppV1WiredNetworksGet(context.Background()). + GetUxiV1alpha1WiredNetworksGet(context.Background()). Uid(state.ID.ValueString()) networkResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/provider/resources/wireless_network.go b/pkg/config-api-provider/provider/resources/wireless_network.go index b456f018..d4b789f3 100644 --- a/pkg/config-api-provider/provider/resources/wireless_network.go +++ b/pkg/config-api-provider/provider/resources/wireless_network.go @@ -90,7 +90,7 @@ func (r *wirelessNetworkResource) Read(ctx context.Context, req resource.ReadReq } request := r.client.ConfigurationAPI. - GetConfigurationAppV1WirelessNetworksGet(context.Background()). + GetUxiV1alpha1WirelessNetworksGet(context.Background()). Uid(state.ID.ValueString()) networkResponse, _, err := util.RetryFor429(request.Execute) diff --git a/pkg/config-api-provider/test/data-sources/group_test.go b/pkg/config-api-provider/test/data-sources/group_test.go index b1237111..11f08b27 100644 --- a/pkg/config-api-provider/test/data-sources/group_test.go +++ b/pkg/config-api-provider/test/data-sources/group_test.go @@ -48,7 +48,7 @@ func TestGroupDataSource(t *testing.T) { PreConfig: func() { util.MockGetGroup( "uid", - util.GenerateGroupPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseModel("uid", "", ""))}), + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 3, ) }, @@ -68,7 +68,7 @@ func TestGroupDataSource(t *testing.T) { PreConfig: func() { util.MockGetGroup( "uid", - util.GenerateGroupPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseModel("uid", "", ""))}), + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 3, ) }, @@ -104,7 +104,7 @@ func TestGroupDataSource429Handling(t *testing.T) { { PreConfig: func() { mock429 = gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/groups"). + Get("/uxi/v1alpha1/groups"). Reply(429). SetHeaders(map[string]string{ "X-RateLimit-Limit": "100", @@ -113,7 +113,7 @@ func TestGroupDataSource429Handling(t *testing.T) { }) util.MockGetGroup( "uid", - util.GenerateGroupPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseModel("uid", "", ""))}), + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 3, ) }, diff --git a/pkg/config-api-provider/test/data-sources/sensor_group_assignment_test.go b/pkg/config-api-provider/test/data-sources/sensor_group_assignment_test.go index 05606641..0a30630a 100644 --- a/pkg/config-api-provider/test/data-sources/sensor_group_assignment_test.go +++ b/pkg/config-api-provider/test/data-sources/sensor_group_assignment_test.go @@ -23,9 +23,7 @@ func TestSensorGroupAssignmentDataSource(t *testing.T) { PreConfig: func() { util.MockGetSensorGroupAssignment( "uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("uid", ""))}), 3, ) }, @@ -60,7 +58,7 @@ func TestSensorGroupAssignmentSource429Handling(t *testing.T) { { PreConfig: func() { mock429 = gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/sensor-group-assignments"). + Get("/uxi/v1alpha1/sensor-group-assignments"). Reply(429). SetHeaders(map[string]string{ "X-RateLimit-Limit": "100", @@ -69,9 +67,7 @@ func TestSensorGroupAssignmentSource429Handling(t *testing.T) { }) util.MockGetSensorGroupAssignment( "uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("uid", ""))}), 3, ) }, diff --git a/pkg/config-api-provider/test/data-sources/wired_group_test.go b/pkg/config-api-provider/test/data-sources/wired_group_test.go index b92fccab..0de3cb92 100644 --- a/pkg/config-api-provider/test/data-sources/wired_group_test.go +++ b/pkg/config-api-provider/test/data-sources/wired_group_test.go @@ -65,7 +65,7 @@ func TestWiredNetworkDataSource429Handling(t *testing.T) { { PreConfig: func() { mock429 = gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/wired-networks"). + Get("/uxi/v1alpha1/wired-networks"). Reply(429). SetHeaders(map[string]string{ "X-RateLimit-Limit": "100", diff --git a/pkg/config-api-provider/test/data-sources/wireless_group_test.go b/pkg/config-api-provider/test/data-sources/wireless_group_test.go index 3ad8d544..4170b338 100644 --- a/pkg/config-api-provider/test/data-sources/wireless_group_test.go +++ b/pkg/config-api-provider/test/data-sources/wireless_group_test.go @@ -67,7 +67,7 @@ func TestWirelessNetworkDataSource429Handling(t *testing.T) { { PreConfig: func() { mock429 = gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/wireless-networks"). + Get("/uxi/v1alpha1/wireless-networks"). Reply(429). SetHeaders(map[string]string{ "X-RateLimit-Limit": "100", diff --git a/pkg/config-api-provider/test/resources/agent_group_assignment_test.go b/pkg/config-api-provider/test/resources/agent_group_assignment_test.go index ec28af1b..0779fbb0 100644 --- a/pkg/config-api-provider/test/resources/agent_group_assignment_test.go +++ b/pkg/config-api-provider/test/resources/agent_group_assignment_test.go @@ -26,10 +26,10 @@ func TestAgentGroupAssignmentResource(t *testing.T) { } // required for group create - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), 1) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid", "", "")), 1) + util.MockGetGroup("group_uid", util.GeneratePaginatedResponse( []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), + util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", "")), }), 1, ) @@ -87,21 +87,21 @@ func TestAgentGroupAssignmentResource(t *testing.T) { return util.GenerateAgentResponseModel(uid, "_2") } } - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( + util.MockGetGroup("group_uid_2", util.GeneratePaginatedResponse( []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), + util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2")), }), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( + util.MockGetGroup("group_uid", util.GeneratePaginatedResponse( []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), + util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", "")), }), 2, ) // required for creating another group - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), 1) + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid_2", "_2", "_2")), 1) // required for agent group assignment create resources.GetAgentGroupAssignment = func(uid string) resources.AgentGroupAssignmentResponseModel { diff --git a/pkg/config-api-provider/test/resources/group_test.go b/pkg/config-api-provider/test/resources/group_test.go index 70a0a62e..235c6fae 100644 --- a/pkg/config-api-provider/test/resources/group_test.go +++ b/pkg/config-api-provider/test/resources/group_test.go @@ -1,6 +1,10 @@ package resource_test import ( + "regexp" + "testing" + + config_api_client "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/config-api-client" "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/terraform-provider-configuration/provider/resources" "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/terraform-provider-configuration/test/provider" "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/terraform-provider-configuration/test/util" @@ -8,8 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/nbio/st" - "regexp" - "testing" ) type Fetcher interface { @@ -26,11 +28,9 @@ func TestGroupResource(t *testing.T) { // Create and Read testing { PreConfig: func() { - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), 1) - util.MockGetGroup("uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("uid", "", "")), 1) + util.MockGetGroup("uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 1, ) }, @@ -48,10 +48,8 @@ func TestGroupResource(t *testing.T) { // ImportState testing { PreConfig: func() { - util.MockGetGroup("uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), - }), + util.MockGetGroup("uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 1, ) }, @@ -62,13 +60,11 @@ func TestGroupResource(t *testing.T) { // Update that does not trigger a recreate { PreConfig: func() { - resources.UpdateGroup = func(request resources.GroupUpdateRequestModel) resources.GroupResponseModel { - return util.GenerateGroupResponseModel("uid", "_2", "") + resources.UpdateGroup = func(request resources.GroupUpdateRequestModel) config_api_client.GroupsPostResponse { + return util.GenerateGroupResponsePostModel("uid", "_2", "") } - util.MockGetGroup("uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("uid", "_2", "")), - }), + util.MockGetGroup("uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "_2", ""))}), 2, ) }, @@ -88,18 +84,14 @@ func TestGroupResource(t *testing.T) { { PreConfig: func() { // existing group - util.MockGetGroup("uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), - }), + util.MockGetGroup("uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 1, ) // new group (replacement) - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("new_uid", "", "_2")), 1) - util.MockGetGroup("new_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("new_uid", "", "_2")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("new_uid", "", "_2")), 1) + util.MockGetGroup("new_uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("new_uid", "", "_2"))}), 1, ) }, @@ -159,18 +151,17 @@ func TestGroupResource429Handling(t *testing.T) { { PreConfig: func() { create429 = gock.New("https://test.api.capenetworks.com"). - Post("/configuration/app/v1/groups"). + Post("/uxi/v1alpha1/groups"). Reply(429). SetHeaders(map[string]string{ "X-RateLimit-Limit": "100", "X-RateLimit-Remaining": "0", "X-RateLimit-Reset": "1", }) - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), 1) - util.MockGetGroup("uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("uid", "", "")), 1) + util.MockGetGroup( + "uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("uid", "", ""))}), 1, ) }, diff --git a/pkg/config-api-provider/test/resources/network_group_assignment_test.go b/pkg/config-api-provider/test/resources/network_group_assignment_test.go index ebaeaaf5..07cad397 100644 --- a/pkg/config-api-provider/test/resources/network_group_assignment_test.go +++ b/pkg/config-api-provider/test/resources/network_group_assignment_test.go @@ -28,11 +28,9 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { ) // required for group create - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), 1) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid", "", "")), 1) + util.MockGetGroup("group_uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 2, ) @@ -89,21 +87,19 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("network_uid", "")}), 2, ) - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 3, ) // required for creating another group - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), 1) + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid_2", "_2", "_2")), 1) // required for network group assignment create resources.CreateNetworkGroupAssignment = func(request resources.NetworkGroupAssignmentRequestModel) resources.NetworkGroupAssignmentResponseModel { @@ -172,16 +168,12 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("network_uid", "")}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup("group_uid", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 2, ) - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup("group_uid_2", util.GeneratePaginatedResponse( + []map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) }, @@ -220,11 +212,10 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { 2, ) // required for group create - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), 1) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid", "", "")), 1) + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 1, ) @@ -283,18 +274,16 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { ) // required for creating another group - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), 1) - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid_2", "_2", "_2")), 1) + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 3, ) @@ -365,16 +354,14 @@ func TestNetworkGroupAssignmentResource(t *testing.T) { util.GenerateWirelessNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWirelessNetworkResponse("network_uid", "")}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 2, ) - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) }, diff --git a/pkg/config-api-provider/test/resources/sensor_group_assignment_test.go b/pkg/config-api-provider/test/resources/sensor_group_assignment_test.go index 84e45813..9682cab0 100644 --- a/pkg/config-api-provider/test/resources/sensor_group_assignment_test.go +++ b/pkg/config-api-provider/test/resources/sensor_group_assignment_test.go @@ -26,11 +26,10 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } // required for group create - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), 1) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid", "", "")), 1) + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 1, ) @@ -40,9 +39,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } util.MockGetSensorGroupAssignment( "sensor_group_assignment_uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", ""))}), 1, ) }, @@ -80,9 +77,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { PreConfig: func() { util.MockGetSensorGroupAssignment( "sensor_group_assignment_uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", ""))}), 1, ) }, @@ -100,35 +95,29 @@ func TestSensorGroupAssignmentResource(t *testing.T) { return util.GenerateSensorResponseModel("sensor_uid", "_2") } } - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 2, ) // required for creating another group - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), 1) + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid_2", "_2", "_2")), 1) // required for sensor group assignment create util.MockGetSensorGroupAssignment( "sensor_group_assignment_uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", ""))}), 1, ) util.MockGetSensorGroupAssignment( "sensor_group_assignment_uid_2", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid_2", "_2")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid_2", "_2"))}), 1, ) @@ -187,23 +176,19 @@ func TestSensorGroupAssignmentResource(t *testing.T) { // Remove sensors from state { PreConfig: func() { - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 1, ) util.MockGetSensorGroupAssignment( "sensor_group_assignment_uid", - util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{ - util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", "")), - }), + util.GenerateSensorGroupAssignmentPaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateSensorGroupAssignmentResponse("sensor_group_assignment_uid", ""))}), 1, ) }, diff --git a/pkg/config-api-provider/test/resources/service_test_group_assignment_test.go b/pkg/config-api-provider/test/resources/service_test_group_assignment_test.go index ba66d461..311f6c60 100644 --- a/pkg/config-api-provider/test/resources/service_test_group_assignment_test.go +++ b/pkg/config-api-provider/test/resources/service_test_group_assignment_test.go @@ -26,11 +26,10 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { } // required for group create - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), 1) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid", "", "")), 1) + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 1, ) @@ -85,21 +84,19 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { return util.GenerateServiceTestResponseModel("service_test_uid", "_2") } } - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 3, ) // required for creating another group - util.MockPostGroup(util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), 1) + util.MockPostGroup(util.StructToMap(util.GenerateGroupResponsePostModel("group_uid_2", "_2", "_2")), 1) // required for serviceTest group assignment create resources.GetServiceTestGroupAssignment = func(uid string) resources.ServiceTestGroupAssignmentResponseModel { @@ -158,16 +155,14 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { // Remove serviceTests from state { PreConfig: func() { - util.MockGetGroup("group_uid", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid", "", "")), - }), + util.MockGetGroup( + "group_uid", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid", "", ""))}), 1, ) - util.MockGetGroup("group_uid_2", util.GenerateGroupPaginatedResponse( - []map[string]interface{}{ - util.StructToMap(util.GenerateGroupResponseModel("group_uid_2", "_2", "_2")), - }), + util.MockGetGroup( + "group_uid_2", + util.GeneratePaginatedResponse([]map[string]interface{}{util.StructToMap(util.GenerateGroupResponseGetModel("group_uid_2", "_2", "_2"))}), 1, ) }, diff --git a/pkg/config-api-provider/test/resources/wired_network_test.go b/pkg/config-api-provider/test/resources/wired_network_test.go index aa3b7498..ccbe481f 100644 --- a/pkg/config-api-provider/test/resources/wired_network_test.go +++ b/pkg/config-api-provider/test/resources/wired_network_test.go @@ -36,9 +36,7 @@ func TestWiredNetworkResource(t *testing.T) { PreConfig: func() { util.MockGetWiredNetwork( "uid", - util.GenerateWiredNetworkPaginatedResponse( - []map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}, - ), + util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}), 2, ) }, @@ -62,9 +60,7 @@ func TestWiredNetworkResource(t *testing.T) { PreConfig: func() { util.MockGetWiredNetwork( "uid", - util.GenerateWiredNetworkPaginatedResponse( - []map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}, - ), + util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}), 1, ) }, @@ -77,9 +73,7 @@ func TestWiredNetworkResource(t *testing.T) { PreConfig: func() { util.MockGetWiredNetwork( "uid", - util.GenerateWiredNetworkPaginatedResponse( - []map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}, - ), + util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}), 1, ) }, @@ -94,9 +88,7 @@ func TestWiredNetworkResource(t *testing.T) { PreConfig: func() { util.MockGetWiredNetwork( "uid", - util.GenerateWiredNetworkPaginatedResponse( - []map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}, - ), + util.GenerateWiredNetworkPaginatedResponse([]map[string]interface{}{util.GenerateWiredNetworkResponse("uid", "")}), 2, ) }, diff --git a/pkg/config-api-provider/test/util/utils.go b/pkg/config-api-provider/test/util/utils.go index 6bf8a822..2d79978c 100644 --- a/pkg/config-api-provider/test/util/utils.go +++ b/pkg/config-api-provider/test/util/utils.go @@ -2,6 +2,7 @@ package util import ( "encoding/json" + "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/config-api-client" "github.com/aruba-uxi/configuration-api-terraform-provider/pkg/terraform-provider-configuration/provider/resources" "github.com/h2non/gock" @@ -44,29 +45,33 @@ func GenerateAgentResponseModel(uid string, postfix string) resources.AgentRespo } } -func GenerateGroupResponseModel(uid string, nonReplacementFieldPostfix string, replacementFieldPostfix string) resources.GroupResponseModel { - parent_uid := "parent_uid" + replacementFieldPostfix - return resources.GroupResponseModel{ - UID: uid, - Name: "name" + nonReplacementFieldPostfix, - ParentUid: &parent_uid, - Path: parent_uid + "." + uid, +func GenerateGroupResponseGetModel(uid string, nonReplacementFieldPostfix string, replacementFieldPostfix string) config_api_client.GroupsGetItem { + parentId := "parent_uid" + replacementFieldPostfix + + return config_api_client.GroupsGetItem{ + Id: uid, + Name: "name" + nonReplacementFieldPostfix, + Parent: *config_api_client.NewNullableParent(&config_api_client.Parent{Id: parentId}), + Path: parentId + "." + uid, } } -func GenerateGroupPaginatedResponse(groups []map[string]interface{}) map[string]interface{} { - return map[string]interface{}{ - "groups": groups, - "pagination": mockPaginationResponse, +func GenerateGroupResponsePostModel(uid string, nonReplacementFieldPostfix string, replacementFieldPostfix string) config_api_client.GroupsPostResponse { + parentId := "parent_uid" + replacementFieldPostfix + + return config_api_client.GroupsPostResponse{ + Uid: uid, + Name: "name" + nonReplacementFieldPostfix, + ParentUid: parentId, + Path: parentId + "." + uid, } } -func GenerateRootGroupResponseModel(uid string) resources.GroupResponseModel { - return resources.GroupResponseModel{ - UID: uid, - Name: "root", - ParentUid: nil, - Path: uid, +func GeneratePaginatedResponse(items []map[string]interface{}) map[string]interface{} { + return map[string]interface{}{ + "items": items, + "next": nil, + "count": len(items), } } @@ -194,7 +199,7 @@ func MockOAuth() *gock.Response { func MockPostGroup(response map[string]interface{}, times int) { gock.New("https://test.api.capenetworks.com"). - Post("/configuration/app/v1/groups"). + Post("/uxi/v1alpha1/groups"). MatchHeader("Content-Type", "application/json"). MatchHeader("Authorization", "mock_token"). Times(times). @@ -204,7 +209,7 @@ func MockPostGroup(response map[string]interface{}, times int) { func MockGetGroup(uid string, response map[string]interface{}, times int) { gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/groups"). + Get("/uxi/v1alpha1/groups"). MatchHeader("Authorization", "mock_token"). MatchParam("uid", uid). Times(times). @@ -214,7 +219,7 @@ func MockGetGroup(uid string, response map[string]interface{}, times int) { func MockGetWiredNetwork(uid string, response map[string]interface{}, times int) { gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/wired-networks"). + Get("/uxi/v1alpha1/wired-networks"). MatchHeader("Authorization", "mock_token"). MatchParam("uid", uid). Times(times). @@ -224,7 +229,7 @@ func MockGetWiredNetwork(uid string, response map[string]interface{}, times int) func MockGetWirelessNetwork(uid string, response map[string]interface{}, times int) { gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/wireless-networks"). + Get("/uxi/v1alpha1/wireless-networks"). MatchHeader("Authorization", "mock_token"). MatchParam("uid", uid). Times(times). @@ -234,7 +239,7 @@ func MockGetWirelessNetwork(uid string, response map[string]interface{}, times i func MockGetSensorGroupAssignment(uid string, response map[string]interface{}, times int) { gock.New("https://test.api.capenetworks.com"). - Get("/configuration/app/v1/sensor-group-assignments"). + Get("/uxi/v1alpha1/sensor-group-assignments"). MatchHeader("Authorization", "mock_token"). MatchParam("uid", uid). Times(times).