From e1d477c47d694633e6905aeb71c021b7d7990d2a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Dec 2024 14:47:30 +0000 Subject: [PATCH] Regenerate client from commit 7e7481f3 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 449 ++++++++++++++++++ examples/v2/scim/CreateSCIMGroup.rb | 23 + examples/v2/scim/DeleteSCIMGroup.rb | 5 + examples/v2/scim/GetSCIMGroup.rb | 5 + examples/v2/scim/ListSCIMGroups.rb | 5 + examples/v2/scim/PatchSCIMGroup.rb | 28 ++ examples/v2/scim/UpdateSCIMGroup.rb | 23 + features/scenarios_model_mapping.rb | 22 + features/v2/scim.feature | 132 +++++ features/v2/undo.json | 43 ++ lib/datadog_api_client/inflector.rb | 10 + lib/datadog_api_client/v2/api/scim_api.rb | 408 ++++++++++++++++ .../v2/models/external_user_group.rb | 159 +++++++ .../external_user_group_members_items.rb | 135 ++++++ .../v2/models/external_user_group_meta.rb | 135 ++++++ .../external_user_group_patch_request.rb | 119 +++++ ...er_group_patch_request_operations_items.rb | 125 +++++ ...group_patch_request_operations_items_op.rb | 28 ++ .../list_external_user_group_response.rb | 201 ++++++++ ...nal_user_group_response_resources_items.rb | 159 +++++++ ..._response_resources_items_members_items.rb | 135 ++++++ 22 files changed, 2353 insertions(+), 4 deletions(-) create mode 100644 examples/v2/scim/CreateSCIMGroup.rb create mode 100644 examples/v2/scim/DeleteSCIMGroup.rb create mode 100644 examples/v2/scim/GetSCIMGroup.rb create mode 100644 examples/v2/scim/ListSCIMGroups.rb create mode 100644 examples/v2/scim/PatchSCIMGroup.rb create mode 100644 examples/v2/scim/UpdateSCIMGroup.rb create mode 100644 features/v2/scim.feature create mode 100644 lib/datadog_api_client/v2/api/scim_api.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group_members_items.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group_meta.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items.rb create mode 100644 lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items_op.rb create mode 100644 lib/datadog_api_client/v2/models/list_external_user_group_response.rb create mode 100644 lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items.rb create mode 100644 lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items_members_items.rb diff --git a/.apigentools-info b/.apigentools-info index 1c848b3dbfe6..bfe9f28b264f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-03 18:40:55.419242", - "spec_repo_commit": "ce3146c2" + "regenerated": "2024-12-04 14:47:02.371958", + "spec_repo_commit": "7e7481f3" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-03 18:40:55.438438", - "spec_repo_commit": "ce3146c2" + "regenerated": "2024-12-04 14:47:02.391201", + "spec_repo_commit": "7e7481f3" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e87349616205..332cc3315109 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10179,6 +10179,125 @@ components: from the other indexes. type: string type: object + ExternalUserGroup: + description: Definition of a SCIM group. + properties: + displayName: + description: A human-readable name for the group. + type: string + externalId: + description: An identifier for the resource as defined by the provisioning + client. + type: string + id: + description: The identifier of the resource. Not required when creating + a group. + type: string + members: + description: Members of the SCIM group. + items: + $ref: '#/components/schemas/ExternalUserGroupMembersItems' + type: array + meta: + $ref: '#/components/schemas/ExternalUserGroupMeta' + schemas: + description: Input JSON Schemas. + example: + - urn:ietf:params:scim:schemas:core:2.0:Group + items: + type: string + type: array + type: object + ExternalUserGroupMembersItems: + description: The definition of a member belonging to a SCIM group. + properties: + $ref: + description: The URI corresponding to a SCIM resource that is a member of + this group. + example: https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6 + type: string + display: + description: A human-readable name for the group member. + type: string + type: + description: A label indicating the type of resource. + example: User + type: string + value: + description: The identifier of the member of this group. + type: string + type: object + ExternalUserGroupMeta: + description: Metadata associated with a SCIM group. + properties: + created: + description: The date and time the group was created. + format: date-time + type: string + lastModified: + description: The date and time the group was last changed. + format: date-time + type: string + location: + description: URL identifying the resource. + type: string + resourceType: + description: Type of resource. + example: Group + type: string + type: object + ExternalUserGroupPatchRequest: + description: Request object for patching a SCIM group. + example: + Operations: + - op: replace + path: null + value: + displayName: Real new group + id: e43536e9-33fe-43f8-90b8-d3e39a7dd6ad + - op: remove + path: members[value eq "fddf0cf2-9b60-11ef-ad4b-d6754a54a839"] + value: null + schemas: + - urn:ietf:params:scim:api:messages:2.0:PatchOp + properties: + Operations: + description: A list of update operations to be performed on a SCIM group. + items: + $ref: '#/components/schemas/ExternalUserGroupPatchRequestOperationsItems' + type: array + schemas: + description: Input JSON Schemas + example: + - urn:ietf:params:scim:api:messages:2.0:PatchOp + items: + type: string + type: array + type: object + ExternalUserGroupPatchRequestOperationsItems: + description: The definition of an individual patch operation in a patch request. + properties: + op: + $ref: '#/components/schemas/ExternalUserGroupPatchRequestOperationsItemsOp' + path: + description: An attribute path describing the target of the operation. + example: members + type: string + value: + description: JSON element containing the target values required to apply + the patch operation. + type: object + ExternalUserGroupPatchRequestOperationsItemsOp: + description: The operation to be performed. + enum: + - add + - replace + - remove + type: string + x-enum-varnames: + - ADD + - REPLACE + - REMOVE FastlyAccounResponseAttributes: description: Attributes object of a Fastly account. properties: @@ -13983,6 +14102,89 @@ components: description: Current link. type: string type: object + ListExternalUserGroupResponse: + description: List SCIM groups response object. + properties: + Resources: + description: List of SCIM groups matching the request criteria. + items: + $ref: '#/components/schemas/ListExternalUserGroupResponseResourcesItems' + type: array + itemsPerPage: + description: Number of SCIM groups returned per page. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + schemas: + description: List response JSON Schemas. + example: + - urn:ietf:params:scim:api:messages:2.0:ListResponse + items: + type: string + type: array + startIndex: + description: Starting index of the SCIM groups for this page (1-indexed). + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + totalResults: + description: Total number of SCIM groups matching the request criteria. + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + type: object + ListExternalUserGroupResponseResourcesItems: + description: SCIM resources returned in response to a List SCIM groups request. + properties: + displayName: + description: A human-readable name for the group. + type: string + externalId: + description: An identifier for the resource as defined by the provisioning + client. + type: string + id: + description: The identifier of the resource. Not required when creating + a group. + type: string + members: + description: The `items` `members`. + items: + $ref: '#/components/schemas/ListExternalUserGroupResponseResourcesItemsMembersItems' + type: array + meta: + $ref: '#/components/schemas/ExternalUserGroupMeta' + schemas: + description: SCIM group JSON Schemas. + example: + - urn:ietf:params:scim:schemas:core:2.0:Group + items: + type: string + type: array + type: object + ListExternalUserGroupResponseResourcesItemsMembersItems: + description: The definition of a member belonging to a group in the List SCIM + groups response. + properties: + $ref: + description: The URI corresponding to a SCIM resource that is a member of + this group. + example: https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6 + type: string + display: + description: Full name of the user. + type: string + type: + description: A label indicating the type of resource. Only supported value + is "User". + type: string + value: + description: The identifier of the member of this group. + type: string + type: object ListFindingsData: description: Array of findings. items: @@ -38917,6 +39119,251 @@ paths: operator: OR permissions: - org_management + /api/v2/scim/Groups: + get: + description: 'List SCIM groups in the organization. + + Results are paginated by `startIndex` and `count` parameters. + + Results can be narrowed down by the `filter` parameter.' + operationId: ListSCIMGroups + parameters: + - description: Specifies the start index to fetch the results (1-indexed). + in: query + name: startIndex + required: false + schema: + default: 1 + example: 1 + format: int64 + type: integer + - description: Specifies the number of groups to be returned. + in: query + name: count + required: false + schema: + default: 20 + example: 20 + format: int64 + type: integer + - description: 'Specifies the url encoded filter to use to narrow down the results. + + Filters can be in the form of `displayName eq ` or `externalId + eq ` + + or `id eq and members eq ` or `members eq + and id eq `.' + in: query + name: filter + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListExternalUserGroupResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: List SCIM groups + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage + post: + operationId: CreateSCIMGroup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: Create SCIM group + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage + /api/v2/scim/Groups/{group_id}: + delete: + operationId: DeleteSCIMGroup + parameters: + - in: path + name: group_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: Delete SCIM group + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage + get: + operationId: GetSCIMGroup + parameters: + - in: path + name: group_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: Get SCIM group + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage + patch: + operationId: PatchSCIMGroup + parameters: + - in: path + name: group_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroupPatchRequest' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: Patch SCIM group + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage + put: + operationId: UpdateSCIMGroup + parameters: + - in: path + name: group_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalUserGroup' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + - user_access_manage + summary: Update SCIM group + tags: + - Scim + x-permission: + operator: AND + permissions: + - user_access_invite + - user_access_manage /api/v2/scorecard/outcomes: get: description: Fetches all rule outcomes. @@ -44670,6 +45117,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/real_user_monitoring/platform/generate_metrics/ name: Rum Metrics +- description: Provision Datadog teams using SCIM group APIs. + name: Scim - description: Create and manage your security rules, signals, filters, and more. See the [Datadog Security page](https://docs.datadoghq.com/security/) for more information. diff --git a/examples/v2/scim/CreateSCIMGroup.rb b/examples/v2/scim/CreateSCIMGroup.rb new file mode 100644 index 000000000000..3c7c9c3ada80 --- /dev/null +++ b/examples/v2/scim/CreateSCIMGroup.rb @@ -0,0 +1,23 @@ +# Create SCIM group returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new + +body = DatadogAPIClient::V2::ExternalUserGroup.new({ + members: [ + DatadogAPIClient::V2::ExternalUserGroupMembersItems.new({ + _ref: "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", + type: "User", + }), + ], + meta: DatadogAPIClient::V2::ExternalUserGroupMeta.new({ + resource_type: "Group", + }), + schemas: [ + "urn:ietf:params:scim:schemas:core:2.0:Group", + ], +}) +opts = { + body: body, +} +p api_instance.create_scim_group(opts) diff --git a/examples/v2/scim/DeleteSCIMGroup.rb b/examples/v2/scim/DeleteSCIMGroup.rb new file mode 100644 index 000000000000..fc675d716fad --- /dev/null +++ b/examples/v2/scim/DeleteSCIMGroup.rb @@ -0,0 +1,5 @@ +# Delete SCIM group returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new +api_instance.delete_scim_group("group_id") diff --git a/examples/v2/scim/GetSCIMGroup.rb b/examples/v2/scim/GetSCIMGroup.rb new file mode 100644 index 000000000000..960d19daa386 --- /dev/null +++ b/examples/v2/scim/GetSCIMGroup.rb @@ -0,0 +1,5 @@ +# Get SCIM group returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new +p api_instance.get_scim_group("group_id") diff --git a/examples/v2/scim/ListSCIMGroups.rb b/examples/v2/scim/ListSCIMGroups.rb new file mode 100644 index 000000000000..73933dead0fd --- /dev/null +++ b/examples/v2/scim/ListSCIMGroups.rb @@ -0,0 +1,5 @@ +# List SCIM groups returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new +p api_instance.list_scim_groups() diff --git a/examples/v2/scim/PatchSCIMGroup.rb b/examples/v2/scim/PatchSCIMGroup.rb new file mode 100644 index 000000000000..c4b03ef0450e --- /dev/null +++ b/examples/v2/scim/PatchSCIMGroup.rb @@ -0,0 +1,28 @@ +# Patch SCIM group returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new + +body = DatadogAPIClient::V2::ExternalUserGroupPatchRequest.new({ + operations: [ + DatadogAPIClient::V2::ExternalUserGroupPatchRequestOperationsItems.new({ + op: DatadogAPIClient::V2::ExternalUserGroupPatchRequestOperationsItemsOp::REPLACE, + path: None, + value: { + "displayName": "Real new group", "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad", + }, + }), + DatadogAPIClient::V2::ExternalUserGroupPatchRequestOperationsItems.new({ + op: DatadogAPIClient::V2::ExternalUserGroupPatchRequestOperationsItemsOp::REMOVE, + path: 'members[value eq "fddf0cf2-9b60-11ef-ad4b-d6754a54a839"]', + value: None, + }), + ], + schemas: [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp", + ], +}) +opts = { + body: body, +} +p api_instance.patch_scim_group("group_id", opts) diff --git a/examples/v2/scim/UpdateSCIMGroup.rb b/examples/v2/scim/UpdateSCIMGroup.rb new file mode 100644 index 000000000000..9226f6271731 --- /dev/null +++ b/examples/v2/scim/UpdateSCIMGroup.rb @@ -0,0 +1,23 @@ +# Update SCIM group returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ScimAPI.new + +body = DatadogAPIClient::V2::ExternalUserGroup.new({ + members: [ + DatadogAPIClient::V2::ExternalUserGroupMembersItems.new({ + _ref: "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", + type: "User", + }), + ], + meta: DatadogAPIClient::V2::ExternalUserGroupMeta.new({ + resource_type: "Group", + }), + schemas: [ + "urn:ietf:params:scim:schemas:core:2.0:Group", + ], +}) +opts = { + body: body, +} +p api_instance.update_scim_group("group_id", opts) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 52e7dc71b28a..34758a4ff85b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1955,6 +1955,28 @@ "metric_id" => "String", "body" => "RumMetricUpdateRequest", }, + "v2.ListSCIMGroups" => { + "start_index" => "Integer", + "count" => "Integer", + "filter" => "String", + }, + "v2.CreateSCIMGroup" => { + "body" => "ExternalUserGroup", + }, + "v2.DeleteSCIMGroup" => { + "group_id" => "String", + }, + "v2.GetSCIMGroup" => { + "group_id" => "String", + }, + "v2.PatchSCIMGroup" => { + "group_id" => "String", + "body" => "ExternalUserGroupPatchRequest", + }, + "v2.UpdateSCIMGroup" => { + "group_id" => "String", + "body" => "ExternalUserGroup", + }, "v2.ListScorecardOutcomes" => { "page_size" => "Integer", "page_offset" => "Integer", diff --git a/features/v2/scim.feature b/features/v2/scim.feature new file mode 100644 index 000000000000..01a7f83c8de5 --- /dev/null +++ b/features/v2/scim.feature @@ -0,0 +1,132 @@ +@endpoint(scim) @endpoint(scim-v2) +Feature: Scim + Provision Datadog teams using SCIM group APIs. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Scim" API + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create SCIM group returns "Bad Request" response + Given new "CreateSCIMGroup" request + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create SCIM group returns "Created" response + Given new "CreateSCIMGroup" request + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete SCIM group returns "Bad Request" response + Given new "DeleteSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete SCIM group returns "No Content" response + Given new "DeleteSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete SCIM group returns "Not Found" response + Given new "DeleteSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get SCIM group returns "Bad Request" response + Given new "GetSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get SCIM group returns "Not Found" response + Given new "GetSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get SCIM group returns "OK" response + Given new "GetSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg + Scenario: List SCIM groups returns "Bad Request" response + Given new "ListSCIMGroups" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: List SCIM groups returns "OK" response + Given new "ListSCIMGroups" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg + Scenario: Patch SCIM group returns "Bad Request" response + Given new "PatchSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"Operations": [{"op": "replace", "path": null, "value": {"displayName": "Real new group", "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad"}}, {"op": "remove", "path": "members[value eq \"fddf0cf2-9b60-11ef-ad4b-d6754a54a839\"]", "value": null}], "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Patch SCIM group returns "Not Found" response + Given new "PatchSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"Operations": [{"op": "replace", "path": null, "value": {"displayName": "Real new group", "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad"}}, {"op": "remove", "path": "members[value eq \"fddf0cf2-9b60-11ef-ad4b-d6754a54a839\"]", "value": null}], "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: Patch SCIM group returns "OK" response + Given new "PatchSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"Operations": [{"op": "replace", "path": null, "value": {"displayName": "Real new group", "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad"}}, {"op": "remove", "path": "members[value eq \"fddf0cf2-9b60-11ef-ad4b-d6754a54a839\"]", "value": null}], "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update SCIM group returns "Bad Request" response + Given new "UpdateSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update SCIM group returns "Conflict" response + Given new "UpdateSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update SCIM group returns "Not Found" response + Given new "UpdateSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update SCIM group returns "OK" response + Given new "UpdateSCIMGroup" request + And request contains "group_id" parameter from "REPLACE.ME" + And body with value {"members": [{"$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6", "type": "User"}], "meta": {"resourceType": "Group"}, "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"]} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 608035022755..cfbec645ae15 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1890,6 +1890,49 @@ "type": "idempotent" } }, + "ListSCIMGroups": { + "tag": "Scim", + "undo": { + "type": "safe" + } + }, + "CreateSCIMGroup": { + "tag": "Scim", + "undo": { + "operationId": "DeleteSCIMGroup", + "parameters": [ + { + "name": "group_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteSCIMGroup": { + "tag": "Scim", + "undo": { + "type": "idempotent" + } + }, + "GetSCIMGroup": { + "tag": "Scim", + "undo": { + "type": "safe" + } + }, + "PatchSCIMGroup": { + "tag": "Scim", + "undo": { + "type": "idempotent" + } + }, + "UpdateSCIMGroup": { + "tag": "Scim", + "undo": { + "type": "idempotent" + } + }, "ListScorecardOutcomes": { "tag": "Service Scorecards", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cac40f02cd92..ad0472121fbd 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1491,6 +1491,12 @@ def overrides "v2.events_timeseries_query" => "EventsTimeseriesQuery", "v2.events_warning" => "EventsWarning", "v2.event_type" => "EventType", + "v2.external_user_group" => "ExternalUserGroup", + "v2.external_user_group_members_items" => "ExternalUserGroupMembersItems", + "v2.external_user_group_meta" => "ExternalUserGroupMeta", + "v2.external_user_group_patch_request" => "ExternalUserGroupPatchRequest", + "v2.external_user_group_patch_request_operations_items" => "ExternalUserGroupPatchRequestOperationsItems", + "v2.external_user_group_patch_request_operations_items_op" => "ExternalUserGroupPatchRequestOperationsItemsOp", "v2.fastly_accoun_response_attributes" => "FastlyAccounResponseAttributes", "v2.fastly_account_create_request" => "FastlyAccountCreateRequest", "v2.fastly_account_create_request_attributes" => "FastlyAccountCreateRequestAttributes", @@ -1733,6 +1739,9 @@ def overrides "v2.list_entity_catalog_response" => "ListEntityCatalogResponse", "v2.list_entity_catalog_response_included_item" => "ListEntityCatalogResponseIncludedItem", "v2.list_entity_catalog_response_links" => "ListEntityCatalogResponseLinks", + "v2.list_external_user_group_response" => "ListExternalUserGroupResponse", + "v2.list_external_user_group_response_resources_items" => "ListExternalUserGroupResponseResourcesItems", + "v2.list_external_user_group_response_resources_items_members_items" => "ListExternalUserGroupResponseResourcesItemsMembersItems", "v2.list_findings_meta" => "ListFindingsMeta", "v2.list_findings_page" => "ListFindingsPage", "v2.list_findings_response" => "ListFindingsResponse", @@ -2731,6 +2740,7 @@ def overrides "v2.roles_api" => "RolesAPI", "v2.rum_api" => "RUMAPI", "v2.rum_metrics_api" => "RumMetricsAPI", + "v2.scim_api" => "ScimAPI", "v2.security_monitoring_api" => "SecurityMonitoringAPI", "v2.sensitive_data_scanner_api" => "SensitiveDataScannerAPI", "v2.service_accounts_api" => "ServiceAccountsAPI", diff --git a/lib/datadog_api_client/v2/api/scim_api.rb b/lib/datadog_api_client/v2/api/scim_api.rb new file mode 100644 index 000000000000..57eec40608aa --- /dev/null +++ b/lib/datadog_api_client/v2/api/scim_api.rb @@ -0,0 +1,408 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class ScimAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create SCIM group. + # + # @see #create_scim_group_with_http_info + def create_scim_group(opts = {}) + data, _status_code, _headers = create_scim_group_with_http_info(opts) + data + end + + # Create SCIM group. + # @param opts [Hash] the optional parameters + # @option opts [ExternalUserGroup] :body + # @return [Array<(ExternalUserGroup, Integer, Hash)>] ExternalUserGroup data, response status code and response headers + def create_scim_group_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.create_scim_group ...' + end + # resource path + local_var_path = '/api/v2/scim/Groups' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:debug_return_type] || 'ExternalUserGroup' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_scim_group, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#create_scim_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete SCIM group. + # + # @see #delete_scim_group_with_http_info + def delete_scim_group(group_id, opts = {}) + delete_scim_group_with_http_info(group_id, opts) + nil + end + + # Delete SCIM group. + # @param group_id [String] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_scim_group_with_http_info(group_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.delete_scim_group ...' + end + # verify the required parameter 'group_id' is set + if @api_client.config.client_side_validation && group_id.nil? + fail ArgumentError, "Missing the required parameter 'group_id' when calling ScimAPI.delete_scim_group" + end + # resource path + local_var_path = '/api/v2/scim/Groups/{group_id}'.sub('{group_id}', CGI.escape(group_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_scim_group, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#delete_scim_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get SCIM group. + # + # @see #get_scim_group_with_http_info + def get_scim_group(group_id, opts = {}) + data, _status_code, _headers = get_scim_group_with_http_info(group_id, opts) + data + end + + # Get SCIM group. + # @param group_id [String] + # @param opts [Hash] the optional parameters + # @return [Array<(ExternalUserGroup, Integer, Hash)>] ExternalUserGroup data, response status code and response headers + def get_scim_group_with_http_info(group_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.get_scim_group ...' + end + # verify the required parameter 'group_id' is set + if @api_client.config.client_side_validation && group_id.nil? + fail ArgumentError, "Missing the required parameter 'group_id' when calling ScimAPI.get_scim_group" + end + # resource path + local_var_path = '/api/v2/scim/Groups/{group_id}'.sub('{group_id}', CGI.escape(group_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ExternalUserGroup' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_scim_group, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#get_scim_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List SCIM groups. + # + # @see #list_scim_groups_with_http_info + def list_scim_groups(opts = {}) + data, _status_code, _headers = list_scim_groups_with_http_info(opts) + data + end + + # List SCIM groups. + # + # List SCIM groups in the organization. + # Results are paginated by `startIndex` and `count` parameters. + # Results can be narrowed down by the `filter` parameter. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :start_index Specifies the start index to fetch the results (1-indexed). + # @option opts [Integer] :count Specifies the number of groups to be returned. + # @option opts [String] :filter Specifies the url encoded filter to use to narrow down the results. Filters can be in the form of `displayName eq ` or `externalId eq ` or `id eq and members eq ` or `members eq and id eq `. + # @return [Array<(ListExternalUserGroupResponse, Integer, Hash)>] ListExternalUserGroupResponse data, response status code and response headers + def list_scim_groups_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.list_scim_groups ...' + end + # resource path + local_var_path = '/api/v2/scim/Groups' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'startIndex'] = opts[:'start_index'] if !opts[:'start_index'].nil? + query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListExternalUserGroupResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scim_groups, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#list_scim_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Patch SCIM group. + # + # @see #patch_scim_group_with_http_info + def patch_scim_group(group_id, opts = {}) + data, _status_code, _headers = patch_scim_group_with_http_info(group_id, opts) + data + end + + # Patch SCIM group. + # @param group_id [String] + # @param opts [Hash] the optional parameters + # @option opts [ExternalUserGroupPatchRequest] :body + # @return [Array<(ExternalUserGroup, Integer, Hash)>] ExternalUserGroup data, response status code and response headers + def patch_scim_group_with_http_info(group_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.patch_scim_group ...' + end + # verify the required parameter 'group_id' is set + if @api_client.config.client_side_validation && group_id.nil? + fail ArgumentError, "Missing the required parameter 'group_id' when calling ScimAPI.patch_scim_group" + end + # resource path + local_var_path = '/api/v2/scim/Groups/{group_id}'.sub('{group_id}', CGI.escape(group_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:debug_return_type] || 'ExternalUserGroup' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_scim_group, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#patch_scim_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update SCIM group. + # + # @see #update_scim_group_with_http_info + def update_scim_group(group_id, opts = {}) + data, _status_code, _headers = update_scim_group_with_http_info(group_id, opts) + data + end + + # Update SCIM group. + # @param group_id [String] + # @param opts [Hash] the optional parameters + # @option opts [ExternalUserGroup] :body + # @return [Array<(ExternalUserGroup, Integer, Hash)>] ExternalUserGroup data, response status code and response headers + def update_scim_group_with_http_info(group_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ScimAPI.update_scim_group ...' + end + # verify the required parameter 'group_id' is set + if @api_client.config.client_side_validation && group_id.nil? + fail ArgumentError, "Missing the required parameter 'group_id' when calling ScimAPI.update_scim_group" + end + # resource path + local_var_path = '/api/v2/scim/Groups/{group_id}'.sub('{group_id}', CGI.escape(group_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:debug_return_type] || 'ExternalUserGroup' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_scim_group, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ScimAPI#update_scim_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group.rb b/lib/datadog_api_client/v2/models/external_user_group.rb new file mode 100644 index 000000000000..7967d340cb15 --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group.rb @@ -0,0 +1,159 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Definition of a SCIM group. + class ExternalUserGroup + include BaseGenericModel + + # A human-readable name for the group. + attr_accessor :display_name + + # An identifier for the resource as defined by the provisioning client. + attr_accessor :external_id + + # The identifier of the resource. Not required when creating a group. + attr_accessor :id + + # Members of the SCIM group. + attr_accessor :members + + # Metadata associated with a SCIM group. + attr_accessor :meta + + # Input JSON Schemas. + attr_accessor :schemas + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'displayName', + :'external_id' => :'externalId', + :'id' => :'id', + :'members' => :'members', + :'meta' => :'meta', + :'schemas' => :'schemas' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'external_id' => :'String', + :'id' => :'String', + :'members' => :'Array', + :'meta' => :'ExternalUserGroupMeta', + :'schemas' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ExternalUserGroup` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'members') + if (value = attributes[:'members']).is_a?(Array) + self.members = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'schemas') + if (value = attributes[:'schemas']).is_a?(Array) + self.schemas = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + external_id == o.external_id && + id == o.id && + members == o.members && + meta == o.meta && + schemas == o.schemas + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, external_id, id, members, meta, schemas].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group_members_items.rb b/lib/datadog_api_client/v2/models/external_user_group_members_items.rb new file mode 100644 index 000000000000..1c479aceabf0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group_members_items.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of a member belonging to a SCIM group. + class ExternalUserGroupMembersItems + include BaseGenericModel + + # The URI corresponding to a SCIM resource that is a member of this group. + attr_accessor :_ref + + # A human-readable name for the group member. + attr_accessor :display + + # A label indicating the type of resource. + attr_accessor :type + + # The identifier of the member of this group. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_ref' => :'$ref', + :'display' => :'display', + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_ref' => :'String', + :'display' => :'String', + :'type' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ExternalUserGroupMembersItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_ref') + self._ref = attributes[:'_ref'] + end + + if attributes.key?(:'display') + self.display = attributes[:'display'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _ref == o._ref && + display == o.display && + type == o.type && + value == o.value + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_ref, display, type, value].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group_meta.rb b/lib/datadog_api_client/v2/models/external_user_group_meta.rb new file mode 100644 index 000000000000..0e0c1a2c322c --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group_meta.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata associated with a SCIM group. + class ExternalUserGroupMeta + include BaseGenericModel + + # The date and time the group was created. + attr_accessor :created + + # The date and time the group was last changed. + attr_accessor :last_modified + + # URL identifying the resource. + attr_accessor :location + + # Type of resource. + attr_accessor :resource_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'last_modified' => :'lastModified', + :'location' => :'location', + :'resource_type' => :'resourceType' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'last_modified' => :'Time', + :'location' => :'String', + :'resource_type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ExternalUserGroupMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'last_modified') + self.last_modified = attributes[:'last_modified'] + end + + if attributes.key?(:'location') + self.location = attributes[:'location'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + last_modified == o.last_modified && + location == o.location && + resource_type == o.resource_type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, last_modified, location, resource_type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group_patch_request.rb b/lib/datadog_api_client/v2/models/external_user_group_patch_request.rb new file mode 100644 index 000000000000..5e93d8b07c4d --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group_patch_request.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request object for patching a SCIM group. + class ExternalUserGroupPatchRequest + include BaseGenericModel + + # A list of update operations to be performed on a SCIM group. + attr_accessor :operations + + # Input JSON Schemas + attr_accessor :schemas + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'operations' => :'Operations', + :'schemas' => :'schemas' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'operations' => :'Array', + :'schemas' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ExternalUserGroupPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'operations') + if (value = attributes[:'operations']).is_a?(Array) + self.operations = value + end + end + + if attributes.key?(:'schemas') + if (value = attributes[:'schemas']).is_a?(Array) + self.schemas = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + operations == o.operations && + schemas == o.schemas + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [operations, schemas].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items.rb b/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items.rb new file mode 100644 index 000000000000..e3c756ac8e20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of an individual patch operation in a patch request. + class ExternalUserGroupPatchRequestOperationsItems + include BaseGenericModel + + # The operation to be performed. + attr_accessor :op + + # An attribute path describing the target of the operation. + attr_accessor :path + + # JSON element containing the target values required to apply the patch operation. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'op' => :'op', + :'path' => :'path', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'op' => :'ExternalUserGroupPatchRequestOperationsItemsOp', + :'path' => :'String', + :'value' => :'Object' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ExternalUserGroupPatchRequestOperationsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'op') + self.op = attributes[:'op'] + end + + if attributes.key?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + op == o.op && + path == o.path && + value == o.value + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [op, path, value].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items_op.rb b/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items_op.rb new file mode 100644 index 000000000000..fc580216c146 --- /dev/null +++ b/lib/datadog_api_client/v2/models/external_user_group_patch_request_operations_items_op.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The operation to be performed. + class ExternalUserGroupPatchRequestOperationsItemsOp + include BaseEnumModel + + ADD = "add".freeze + REPLACE = "replace".freeze + REMOVE = "remove".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_external_user_group_response.rb b/lib/datadog_api_client/v2/models/list_external_user_group_response.rb new file mode 100644 index 000000000000..5ecb513a4921 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_external_user_group_response.rb @@ -0,0 +1,201 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List SCIM groups response object. + class ListExternalUserGroupResponse + include BaseGenericModel + + # List of SCIM groups matching the request criteria. + attr_accessor :resources + + # Number of SCIM groups returned per page. + attr_reader :items_per_page + + # List response JSON Schemas. + attr_accessor :schemas + + # Starting index of the SCIM groups for this page (1-indexed). + attr_reader :start_index + + # Total number of SCIM groups matching the request criteria. + attr_reader :total_results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'resources' => :'Resources', + :'items_per_page' => :'itemsPerPage', + :'schemas' => :'schemas', + :'start_index' => :'startIndex', + :'total_results' => :'totalResults' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'resources' => :'Array', + :'items_per_page' => :'Integer', + :'schemas' => :'Array', + :'start_index' => :'Integer', + :'total_results' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListExternalUserGroupResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'resources') + if (value = attributes[:'resources']).is_a?(Array) + self.resources = value + end + end + + if attributes.key?(:'items_per_page') + self.items_per_page = attributes[:'items_per_page'] + end + + if attributes.key?(:'schemas') + if (value = attributes[:'schemas']).is_a?(Array) + self.schemas = value + end + end + + if attributes.key?(:'start_index') + self.start_index = attributes[:'start_index'] + end + + if attributes.key?(:'total_results') + self.total_results = attributes[:'total_results'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@items_per_page.nil? && @items_per_page > 4294967295 + return false if !@items_per_page.nil? && @items_per_page < 0 + return false if !@start_index.nil? && @start_index > 4294967295 + return false if !@start_index.nil? && @start_index < 0 + return false if !@total_results.nil? && @total_results > 4294967295 + return false if !@total_results.nil? && @total_results < 0 + true + end + + # Custom attribute writer method with validation + # @param items_per_page [Object] Object to be assigned + # @!visibility private + def items_per_page=(items_per_page) + if !items_per_page.nil? && items_per_page > 4294967295 + fail ArgumentError, 'invalid value for "items_per_page", must be smaller than or equal to 4294967295.' + end + if !items_per_page.nil? && items_per_page < 0 + fail ArgumentError, 'invalid value for "items_per_page", must be greater than or equal to 0.' + end + @items_per_page = items_per_page + end + + # Custom attribute writer method with validation + # @param start_index [Object] Object to be assigned + # @!visibility private + def start_index=(start_index) + if !start_index.nil? && start_index > 4294967295 + fail ArgumentError, 'invalid value for "start_index", must be smaller than or equal to 4294967295.' + end + if !start_index.nil? && start_index < 0 + fail ArgumentError, 'invalid value for "start_index", must be greater than or equal to 0.' + end + @start_index = start_index + end + + # Custom attribute writer method with validation + # @param total_results [Object] Object to be assigned + # @!visibility private + def total_results=(total_results) + if !total_results.nil? && total_results > 4294967295 + fail ArgumentError, 'invalid value for "total_results", must be smaller than or equal to 4294967295.' + end + if !total_results.nil? && total_results < 0 + fail ArgumentError, 'invalid value for "total_results", must be greater than or equal to 0.' + end + @total_results = total_results + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resources == o.resources && + items_per_page == o.items_per_page && + schemas == o.schemas && + start_index == o.start_index && + total_results == o.total_results + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [resources, items_per_page, schemas, start_index, total_results].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items.rb b/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items.rb new file mode 100644 index 000000000000..589b4315cbc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items.rb @@ -0,0 +1,159 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # SCIM resources returned in response to a List SCIM groups request. + class ListExternalUserGroupResponseResourcesItems + include BaseGenericModel + + # A human-readable name for the group. + attr_accessor :display_name + + # An identifier for the resource as defined by the provisioning client. + attr_accessor :external_id + + # The identifier of the resource. Not required when creating a group. + attr_accessor :id + + # The `items` `members`. + attr_accessor :members + + # Metadata associated with a SCIM group. + attr_accessor :meta + + # SCIM group JSON Schemas. + attr_accessor :schemas + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'displayName', + :'external_id' => :'externalId', + :'id' => :'id', + :'members' => :'members', + :'meta' => :'meta', + :'schemas' => :'schemas' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'external_id' => :'String', + :'id' => :'String', + :'members' => :'Array', + :'meta' => :'ExternalUserGroupMeta', + :'schemas' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListExternalUserGroupResponseResourcesItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'members') + if (value = attributes[:'members']).is_a?(Array) + self.members = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'schemas') + if (value = attributes[:'schemas']).is_a?(Array) + self.schemas = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + external_id == o.external_id && + id == o.id && + members == o.members && + meta == o.meta && + schemas == o.schemas + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, external_id, id, members, meta, schemas].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items_members_items.rb b/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items_members_items.rb new file mode 100644 index 000000000000..89addf9304da --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_external_user_group_response_resources_items_members_items.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of a member belonging to a group in the List SCIM groups response. + class ListExternalUserGroupResponseResourcesItemsMembersItems + include BaseGenericModel + + # The URI corresponding to a SCIM resource that is a member of this group. + attr_accessor :_ref + + # Full name of the user. + attr_accessor :display + + # A label indicating the type of resource. Only supported value is "User". + attr_accessor :type + + # The identifier of the member of this group. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_ref' => :'$ref', + :'display' => :'display', + :'type' => :'type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_ref' => :'String', + :'display' => :'String', + :'type' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListExternalUserGroupResponseResourcesItemsMembersItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_ref') + self._ref = attributes[:'_ref'] + end + + if attributes.key?(:'display') + self.display = attributes[:'display'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _ref == o._ref && + display == o.display && + type == o.type && + value == o.value + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_ref, display, type, value].hash + end + end +end