From 0e4991405ff0e82501f50ca362e03478a2ab01d0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 4 Jun 2026 19:33:18 +0000 Subject: [PATCH] Regenerate client from commit 1a588f4 of spec repo --- .generator/schemas/v2/openapi.yaml | 589 ++++++++++++++ .../CreateGoogleChatTargetAudience.rb | 15 + .../DeleteGoogleChatDelegatedUser.rb | 5 + .../DeleteGoogleChatOrganization.rb | 5 + .../DeleteGoogleChatTargetAudience.rb | 5 + .../GetGoogleChatDelegatedUser.rb | 5 + .../GetGoogleChatOrganization.rb | 5 + .../GetGoogleChatTargetAudience.rb | 5 + .../ListGoogleChatOrganizations.rb | 5 + .../ListGoogleChatTargetAudiences.rb | 5 + .../UpdateGoogleChatTargetAudience.rb | 15 + features/scenarios_model_mapping.rb | 32 + features/v2/given.json | 16 + features/v2/google_chat_integration.feature | 167 ++++ features/v2/undo.json | 72 ++ lib/datadog_api_client/inflector.rb | 23 + .../v2/api/google_chat_integration_api.rb | 758 +++++++++++++++++- .../google_chat_delegated_user_attributes.rb | 127 +++ .../models/google_chat_delegated_user_data.rb | 147 ++++ .../google_chat_delegated_user_response.rb | 123 +++ .../models/google_chat_delegated_user_type.rb | 26 + .../google_chat_organization_attributes.rb | 144 ++++ .../models/google_chat_organization_data.rb | 157 ++++ .../google_chat_organization_relationships.rb | 105 +++ ...ganization_relationships_delegated_user.rb | 105 +++ ...ation_relationships_delegated_user_data.rb | 115 +++ .../google_chat_organization_response.rb | 123 +++ .../models/google_chat_organization_type.rb | 26 + .../google_chat_organizations_response.rb | 125 +++ .../google_chat_target_audience_attributes.rb | 152 ++++ ...gle_chat_target_audience_create_request.rb | 123 +++ ...rget_audience_create_request_attributes.rb | 152 ++++ ...hat_target_audience_create_request_data.rb | 144 ++++ .../google_chat_target_audience_data.rb | 147 ++++ .../google_chat_target_audience_response.rb | 123 +++ .../google_chat_target_audience_type.rb | 26 + ...gle_chat_target_audience_update_request.rb | 123 +++ ...rget_audience_update_request_attributes.rb | 144 ++++ ...hat_target_audience_update_request_data.rb | 144 ++++ .../google_chat_target_audiences_response.rb | 125 +++ 40 files changed, 4411 insertions(+), 42 deletions(-) create mode 100644 examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.rb create mode 100644 examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.rb create mode 100644 examples/v2/google-chat-integration/DeleteGoogleChatOrganization.rb create mode 100644 examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.rb create mode 100644 examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.rb create mode 100644 examples/v2/google-chat-integration/GetGoogleChatOrganization.rb create mode 100644 examples/v2/google-chat-integration/GetGoogleChatTargetAudience.rb create mode 100644 examples/v2/google-chat-integration/ListGoogleChatOrganizations.rb create mode 100644 examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.rb create mode 100644 examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_delegated_user_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_delegated_user_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_delegated_user_response.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_delegated_user_type.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_response.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organization_type.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_organizations_response.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_response.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_type.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/google_chat_target_audiences_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85c263148490..4377babe3079 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -661,6 +661,13 @@ components: required: true schema: type: string + GoogleChatTargetAudienceIdPathParameter: + description: Your target audience ID. + in: path + name: target_audience_id + required: true + schema: + type: string HistoricalJobID: description: The ID of the job. in: path @@ -39055,6 +39062,84 @@ components: required: - attributes type: object + GoogleChatDelegatedUserAttributes: + description: Google Chat delegated user attributes. + properties: + display_name: + description: The delegated user's display name. + example: "fake-display-name" + type: string + email: + description: The delegated user's email address. + example: "user@example.com" + type: string + features: + description: The list of features enabled for the delegated user. + items: + type: string + type: array + type: object + GoogleChatDelegatedUserData: + description: Google Chat delegated user data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatDelegatedUserAttributes" + id: + description: The ID of the delegated user. + example: "2b3c4d5e-6f78-9012-bcde-f23456789012" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/GoogleChatDelegatedUserType" + type: object + GoogleChatDelegatedUserResponse: + description: Response containing a Google Chat delegated user. + properties: + data: + $ref: "#/components/schemas/GoogleChatDelegatedUserData" + required: + - data + type: object + GoogleChatDelegatedUserType: + default: google-chat-delegated-user + description: Google Chat delegated user resource type. + enum: + - google-chat-delegated-user + example: google-chat-delegated-user + type: string + x-enum-varnames: + - GOOGLE_CHAT_DELEGATED_USER_TYPE + GoogleChatOrganizationAttributes: + description: Google Chat organization attributes. + properties: + domain_id: + description: The Google Chat organization domain ID. + example: "fake-domain-id" + maxLength: 255 + type: string + domain_name: + description: The Google Chat organization domain name. + example: "example.com" + maxLength: 255 + type: string + type: object + GoogleChatOrganizationData: + description: Google Chat organization data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatOrganizationAttributes" + id: + description: The ID of the Google Chat organization binding. + example: "5ce87709-a12f-4086-fcc8-147045b73a19" + maxLength: 100 + minLength: 1 + type: string + relationships: + $ref: "#/components/schemas/GoogleChatOrganizationRelationships" + type: + $ref: "#/components/schemas/GoogleChatOrganizationType" + type: object GoogleChatOrganizationHandleResponse: description: Organization handle for monitor notifications to a Google Chat space within a Google organization. properties: @@ -39117,6 +39202,184 @@ components: required: - data type: object + GoogleChatOrganizationRelationships: + description: Google Chat organization relationships. + properties: + delegated_user: + $ref: "#/components/schemas/GoogleChatOrganizationRelationshipsDelegatedUser" + type: object + GoogleChatOrganizationRelationshipsDelegatedUser: + description: The delegated user relationship. + properties: + data: + $ref: "#/components/schemas/GoogleChatOrganizationRelationshipsDelegatedUserData" + type: object + GoogleChatOrganizationRelationshipsDelegatedUserData: + description: Delegated user relationship data. + properties: + id: + description: The ID of the delegated user. + example: "2b3c4d5e-6f78-9012-bcde-f23456789012" + type: string + type: + $ref: "#/components/schemas/GoogleChatDelegatedUserType" + type: object + GoogleChatOrganizationResponse: + description: Response containing a Google Chat organization binding. + properties: + data: + $ref: "#/components/schemas/GoogleChatOrganizationData" + required: + - data + type: object + GoogleChatOrganizationType: + default: google-chat-organization + description: Google Chat organization resource type. + enum: + - google-chat-organization + example: google-chat-organization + type: string + x-enum-varnames: + - GOOGLE_CHAT_ORGANIZATION_TYPE + GoogleChatOrganizationsResponse: + description: Response containing a list of Google Chat organization bindings. + properties: + data: + description: An array of Google Chat organization bindings. + items: + $ref: "#/components/schemas/GoogleChatOrganizationData" + type: array + required: + - data + type: object + GoogleChatTargetAudienceAttributes: + description: Google Chat target audience attributes. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + required: + - audience_name + - audience_id + type: object + GoogleChatTargetAudienceCreateRequest: + description: Create target audience request. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequestData" + required: + - data + type: object + GoogleChatTargetAudienceCreateRequestAttributes: + description: Attributes for creating a Google Chat target audience. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + required: + - audience_name + - audience_id + type: object + GoogleChatTargetAudienceCreateRequestData: + description: Data for a create target audience request. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequestAttributes" + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + required: + - type + - attributes + type: object + GoogleChatTargetAudienceData: + description: Google Chat target audience data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceAttributes" + id: + description: The ID of the target audience. + example: "1f3e5ce6-944a-4075-97ae-105b5920b5cb" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + type: object + GoogleChatTargetAudienceResponse: + description: Response containing a Google Chat target audience. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceData" + required: + - data + type: object + GoogleChatTargetAudienceType: + default: google-chat-target-audience + description: Google Chat target audience resource type. + enum: + - google-chat-target-audience + example: google-chat-target-audience + type: string + x-enum-varnames: + - GOOGLE_CHAT_TARGET_AUDIENCE_TYPE + GoogleChatTargetAudienceUpdateRequest: + description: Update target audience request. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequestData" + required: + - data + type: object + GoogleChatTargetAudienceUpdateRequestAttributes: + description: Attributes for updating a Google Chat target audience. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + type: object + GoogleChatTargetAudienceUpdateRequestData: + description: Data for an update target audience request. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequestAttributes" + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + required: + - type + - attributes + type: object + GoogleChatTargetAudiencesResponse: + description: Response containing a list of Google Chat target audiences. + properties: + data: + description: An array of Google Chat target audiences. + items: + $ref: "#/components/schemas/GoogleChatTargetAudienceData" + type: array + required: + - data + type: object GoogleChatUpdateOrganizationHandleRequest: description: Update organization handle request. properties: @@ -128558,6 +128821,43 @@ paths: operator: OR permissions: - gcp_configuration_edit + /api/v2/integration/google-chat/organizations: + get: + description: Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + operationId: ListGoogleChatOrganizations + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + domain_id: fake-domain-id + domain_name: example.com + id: 00000000-0000-0000-0000-000000000001 + relationships: + delegated_user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + type: google-chat-organization + - attributes: + domain_id: fake-domain-id-2 + domain_name: example2.com + id: 00000000-0000-0000-0000-000000000003 + type: google-chat-organization + schema: + $ref: "#/components/schemas/GoogleChatOrganizationsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Google Chat organization bindings + tags: + - Google Chat Integration /api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}: get: description: Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. @@ -128594,6 +128894,110 @@ paths: summary: Get space information by display name tags: - Google Chat Integration + /api/v2/integration/google-chat/organizations/{organization_binding_id}: + delete: + description: Delete a Google Chat organization binding from the Datadog Google Chat integration. + operationId: DeleteGoogleChatOrganization + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a Google Chat organization binding + tags: + - Google Chat Integration + get: + description: Get a Google Chat organization binding from the Datadog Google Chat integration. + operationId: GetGoogleChatOrganization + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + domain_id: fake-domain-id + domain_name: example.com + id: 00000000-0000-0000-0000-000000000001 + relationships: + delegated_user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + type: google-chat-organization + schema: + $ref: "#/components/schemas/GoogleChatOrganizationResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a Google Chat organization binding + tags: + - Google Chat Integration + /api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user: + delete: + description: Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat integration. + operationId: DeleteGoogleChatDelegatedUser + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete the delegated user + tags: + - Google Chat Integration + get: + description: Get the delegated user for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: GetGoogleChatDelegatedUser + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: fake-display-name + email: user@example.com + features: + - incident-automatic-space-creation + - workflow-space-creation + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + schema: + $ref: "#/components/schemas/GoogleChatDelegatedUserResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the delegated user + tags: + - Google Chat Integration /api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles: get: description: Get a list of all organization handles from the Datadog Google Chat integration. @@ -128794,6 +129198,191 @@ paths: tags: - Google Chat Integration x-codegen-request-body-name: body + /api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences: + get: + description: Get a list of all target audiences for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: ListGoogleChatTargetAudiences + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + - attributes: + audience_id: fake-audience-id-2 + audience_name: fake-audience-name-2 + id: 00000000-0000-0000-0000-000000000005 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudiencesResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all target audiences + tags: + - Google Chat Integration + post: + description: Create a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: CreateGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequest" + description: Target audience payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a target audience + tags: + - Google Chat Integration + x-codegen-request-body-name: body + /api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}: + delete: + description: Delete a target audience from a Google Chat organization binding in the Datadog Google Chat integration. + operationId: DeleteGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a target audience + tags: + - Google Chat Integration + get: + description: Get a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: GetGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a target audience + tags: + - Google Chat Integration + patch: + description: Update a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: UpdateGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: updated-audience-id + audience_name: updated-audience-name + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequest" + description: Target audience payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: updated-audience-id + audience_name: updated-audience-name + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a target audience + tags: + - Google Chat Integration + x-codegen-request-body-name: body /api/v2/integration/jira/accounts: get: description: |- diff --git a/examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.rb b/examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.rb new file mode 100644 index 000000000000..3320d7848598 --- /dev/null +++ b/examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.rb @@ -0,0 +1,15 @@ +# Create a target audience returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new + +body = DatadogAPIClient::V2::GoogleChatTargetAudienceCreateRequest.new({ + data: DatadogAPIClient::V2::GoogleChatTargetAudienceCreateRequestData.new({ + attributes: DatadogAPIClient::V2::GoogleChatTargetAudienceCreateRequestAttributes.new({ + audience_id: "fake-audience-id-1", + audience_name: "fake audience name 1", + }), + type: DatadogAPIClient::V2::GoogleChatTargetAudienceType::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + }), +}) +p api_instance.create_google_chat_target_audience("organization_binding_id", body) diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.rb b/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.rb new file mode 100644 index 000000000000..22ef17504f25 --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.rb @@ -0,0 +1,5 @@ +# Delete the delegated user returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +api_instance.delete_google_chat_delegated_user("organization_binding_id") diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.rb b/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.rb new file mode 100644 index 000000000000..912f3fd38eae --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.rb @@ -0,0 +1,5 @@ +# Delete a Google Chat organization binding returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +api_instance.delete_google_chat_organization("organization_binding_id") diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.rb b/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.rb new file mode 100644 index 000000000000..1c213d4fa8c0 --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.rb @@ -0,0 +1,5 @@ +# Delete a target audience returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +api_instance.delete_google_chat_target_audience("organization_binding_id", "target_audience_id") diff --git a/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.rb b/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.rb new file mode 100644 index 000000000000..c73a869ae90c --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.rb @@ -0,0 +1,5 @@ +# Get the delegated user returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +p api_instance.get_google_chat_delegated_user("organization_binding_id") diff --git a/examples/v2/google-chat-integration/GetGoogleChatOrganization.rb b/examples/v2/google-chat-integration/GetGoogleChatOrganization.rb new file mode 100644 index 000000000000..6a669117c202 --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatOrganization.rb @@ -0,0 +1,5 @@ +# Get a Google Chat organization binding returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +p api_instance.get_google_chat_organization("organization_binding_id") diff --git a/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.rb b/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.rb new file mode 100644 index 000000000000..48054a0c28cf --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.rb @@ -0,0 +1,5 @@ +# Get a target audience returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +p api_instance.get_google_chat_target_audience("organization_binding_id", "target_audience_id") diff --git a/examples/v2/google-chat-integration/ListGoogleChatOrganizations.rb b/examples/v2/google-chat-integration/ListGoogleChatOrganizations.rb new file mode 100644 index 000000000000..d5fcba2a4a89 --- /dev/null +++ b/examples/v2/google-chat-integration/ListGoogleChatOrganizations.rb @@ -0,0 +1,5 @@ +# Get all Google Chat organization bindings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +p api_instance.list_google_chat_organizations() diff --git a/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.rb b/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.rb new file mode 100644 index 000000000000..24f477512609 --- /dev/null +++ b/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.rb @@ -0,0 +1,5 @@ +# Get all target audiences returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new +p api_instance.list_google_chat_target_audiences("organization_binding_id") diff --git a/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.rb b/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.rb new file mode 100644 index 000000000000..a96ba1399803 --- /dev/null +++ b/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.rb @@ -0,0 +1,15 @@ +# Update a target audience returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::GoogleChatIntegrationAPI.new + +body = DatadogAPIClient::V2::GoogleChatTargetAudienceUpdateRequest.new({ + data: DatadogAPIClient::V2::GoogleChatTargetAudienceUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::GoogleChatTargetAudienceUpdateRequestAttributes.new({ + audience_id: "fake-audience-id-1", + audience_name: "fake audience name 1", + }), + type: DatadogAPIClient::V2::GoogleChatTargetAudienceType::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + }), +}) +p api_instance.update_google_chat_target_audience("organization_binding_id", "target_audience_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 403725296b92..a357b4d2518a 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3402,6 +3402,18 @@ "domain_name" => "String", "space_display_name" => "String", }, + "v2.DeleteGoogleChatOrganization" => { + "organization_binding_id" => "String", + }, + "v2.GetGoogleChatOrganization" => { + "organization_binding_id" => "String", + }, + "v2.DeleteGoogleChatDelegatedUser" => { + "organization_binding_id" => "String", + }, + "v2.GetGoogleChatDelegatedUser" => { + "organization_binding_id" => "String", + }, "v2.ListOrganizationHandles" => { "organization_binding_id" => "String", }, @@ -3422,6 +3434,26 @@ "handle_id" => "String", "body" => "GoogleChatUpdateOrganizationHandleRequest", }, + "v2.ListGoogleChatTargetAudiences" => { + "organization_binding_id" => "String", + }, + "v2.CreateGoogleChatTargetAudience" => { + "organization_binding_id" => "String", + "body" => "GoogleChatTargetAudienceCreateRequest", + }, + "v2.DeleteGoogleChatTargetAudience" => { + "organization_binding_id" => "String", + "target_audience_id" => "String", + }, + "v2.GetGoogleChatTargetAudience" => { + "organization_binding_id" => "String", + "target_audience_id" => "String", + }, + "v2.UpdateGoogleChatTargetAudience" => { + "organization_binding_id" => "String", + "target_audience_id" => "String", + "body" => "GoogleChatTargetAudienceUpdateRequest", + }, "v2.DeleteJiraAccount" => { "account_id" => "UUID", }, diff --git a/features/v2/given.json b/features/v2/given.json index 097f6a07d557..4936788356be 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -650,6 +650,22 @@ "tag": "Google Chat Integration", "operationId": "CreateOrganizationHandle" }, + { + "parameters": [ + { + "name": "organization_binding_id", + "value": "\"e54cb570-c674-529c-769d-84b312288ed7\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"google-chat-target-audience\",\n \"attributes\": {\n \"audience_name\": \"{{ unique }}\",\n \"audience_id\": \"{{ unique }}\"\n }\n }\n}" + } + ], + "step": "there is a valid \"google_chat_target_audience\" in the system", + "key": "google_chat_target_audience", + "tag": "Google Chat Integration", + "operationId": "CreateGoogleChatTargetAudience" + }, { "parameters": [ { diff --git a/features/v2/google_chat_integration.feature b/features/v2/google_chat_integration.feature index f722a7ea2088..65c1f264a6b0 100644 --- a/features/v2/google_chat_integration.feature +++ b/features/v2/google_chat_integration.feature @@ -9,6 +9,38 @@ Feature: Google Chat Integration And a valid "appKeyAuth" key in the system And an instance of "GoogleChatIntegration" API + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Bad Request" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "CREATED" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Conflict" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Not Found" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/chat-integrations Scenario: Create organization handle returns "Bad Request" response Given new "CreateOrganizationHandle" request @@ -42,6 +74,36 @@ Feature: Google Chat Integration When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a Google Chat organization binding returns "Bad Request" response + Given new "DeleteGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a Google Chat organization binding returns "OK" response + Given new "DeleteGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a target audience returns "Not Found" response + Given new "DeleteGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a target audience returns "OK" response + Given new "DeleteGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Delete organization handle returns "Bad Request" response Given new "DeleteOrganizationHandle" request @@ -59,6 +121,56 @@ Feature: Google Chat Integration When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete the delegated user returns "Not Found" response + Given new "DeleteGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete the delegated user returns "OK" response + Given new "DeleteGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a Google Chat organization binding returns "Not Found" response + Given new "GetGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a Google Chat organization binding returns "OK" response + Given new "GetGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a target audience returns "Not Found" response + Given new "GetGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a target audience returns "OK" response + Given new "GetGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all Google Chat organization bindings returns "OK" response + Given new "ListGoogleChatOrganizations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Get all organization handles returns "Bad Request" response Given new "ListOrganizationHandles" request @@ -82,6 +194,20 @@ Feature: Google Chat Integration Then the response status is 200 OK And the response "data[0].type" is equal to "google-chat-organization-handle" + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all target audiences returns "Not Found" response + Given new "ListGoogleChatTargetAudiences" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all target audiences returns "OK" response + Given new "ListGoogleChatTargetAudiences" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Get organization handle returns "Bad Request" response Given new "GetOrganizationHandle" request @@ -136,6 +262,47 @@ Feature: Google Chat Integration And the response "data.attributes.resource_name" is equal to "spaces/AAQA-zFIks8" And the response "data.attributes.organization_binding_id" is equal to "e54cb570-c674-529c-769d-84b312288ed7" + @generated @skip @team:DataDog/chat-integrations + Scenario: Get the delegated user returns "Not Found" response + Given new "GetGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get the delegated user returns "OK" response + Given new "GetGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "Bad Request" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "Not Found" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "OK" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Update organization handle returns "Bad Request" response Given new "UpdateOrganizationHandle" request diff --git a/features/v2/undo.json b/features/v2/undo.json index a2ff6ce184cb..56dde3dce0a7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3236,12 +3236,42 @@ "type": "idempotent" } }, + "ListGoogleChatOrganizations": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, "GetSpaceByDisplayName": { "tag": "Google Chat Integration", "undo": { "type": "safe" } }, + "DeleteGoogleChatOrganization": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatOrganization": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "DeleteGoogleChatDelegatedUser": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatDelegatedUser": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, "ListOrganizationHandles": { "tag": "Google Chat Integration", "undo": { @@ -3284,6 +3314,48 @@ "type": "idempotent" } }, + "ListGoogleChatTargetAudiences": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "CreateGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "operationId": "DeleteGoogleChatTargetAudience", + "parameters": [ + { + "name": "organization_binding_id", + "origin": "path", + "source": "organization_binding_id" + }, + { + "name": "target_audience_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "UpdateGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, "ListJiraAccounts": { "tag": "Jira Integration", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c1dbc42206b8..43bc875d81d6 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3396,11 +3396,34 @@ def overrides "v2.google_chat_create_organization_handle_request" => "GoogleChatCreateOrganizationHandleRequest", "v2.google_chat_create_organization_handle_request_attributes" => "GoogleChatCreateOrganizationHandleRequestAttributes", "v2.google_chat_create_organization_handle_request_data" => "GoogleChatCreateOrganizationHandleRequestData", + "v2.google_chat_delegated_user_attributes" => "GoogleChatDelegatedUserAttributes", + "v2.google_chat_delegated_user_data" => "GoogleChatDelegatedUserData", + "v2.google_chat_delegated_user_response" => "GoogleChatDelegatedUserResponse", + "v2.google_chat_delegated_user_type" => "GoogleChatDelegatedUserType", + "v2.google_chat_organization_attributes" => "GoogleChatOrganizationAttributes", + "v2.google_chat_organization_data" => "GoogleChatOrganizationData", "v2.google_chat_organization_handle_response" => "GoogleChatOrganizationHandleResponse", "v2.google_chat_organization_handle_response_attributes" => "GoogleChatOrganizationHandleResponseAttributes", "v2.google_chat_organization_handle_response_data" => "GoogleChatOrganizationHandleResponseData", "v2.google_chat_organization_handles_response" => "GoogleChatOrganizationHandlesResponse", "v2.google_chat_organization_handle_type" => "GoogleChatOrganizationHandleType", + "v2.google_chat_organization_relationships" => "GoogleChatOrganizationRelationships", + "v2.google_chat_organization_relationships_delegated_user" => "GoogleChatOrganizationRelationshipsDelegatedUser", + "v2.google_chat_organization_relationships_delegated_user_data" => "GoogleChatOrganizationRelationshipsDelegatedUserData", + "v2.google_chat_organization_response" => "GoogleChatOrganizationResponse", + "v2.google_chat_organizations_response" => "GoogleChatOrganizationsResponse", + "v2.google_chat_organization_type" => "GoogleChatOrganizationType", + "v2.google_chat_target_audience_attributes" => "GoogleChatTargetAudienceAttributes", + "v2.google_chat_target_audience_create_request" => "GoogleChatTargetAudienceCreateRequest", + "v2.google_chat_target_audience_create_request_attributes" => "GoogleChatTargetAudienceCreateRequestAttributes", + "v2.google_chat_target_audience_create_request_data" => "GoogleChatTargetAudienceCreateRequestData", + "v2.google_chat_target_audience_data" => "GoogleChatTargetAudienceData", + "v2.google_chat_target_audience_response" => "GoogleChatTargetAudienceResponse", + "v2.google_chat_target_audiences_response" => "GoogleChatTargetAudiencesResponse", + "v2.google_chat_target_audience_type" => "GoogleChatTargetAudienceType", + "v2.google_chat_target_audience_update_request" => "GoogleChatTargetAudienceUpdateRequest", + "v2.google_chat_target_audience_update_request_attributes" => "GoogleChatTargetAudienceUpdateRequestAttributes", + "v2.google_chat_target_audience_update_request_data" => "GoogleChatTargetAudienceUpdateRequestData", "v2.google_chat_update_organization_handle_request" => "GoogleChatUpdateOrganizationHandleRequest", "v2.google_chat_update_organization_handle_request_attributes" => "GoogleChatUpdateOrganizationHandleRequestAttributes", "v2.google_chat_update_organization_handle_request_data" => "GoogleChatUpdateOrganizationHandleRequestData", diff --git a/lib/datadog_api_client/v2/api/google_chat_integration_api.rb b/lib/datadog_api_client/v2/api/google_chat_integration_api.rb index 266fbd1d2561..31817185e284 100644 --- a/lib/datadog_api_client/v2/api/google_chat_integration_api.rb +++ b/lib/datadog_api_client/v2/api/google_chat_integration_api.rb @@ -23,37 +23,511 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create a target audience. + # + # @see #create_google_chat_target_audience_with_http_info + def create_google_chat_target_audience(organization_binding_id, body, opts = {}) + data, _status_code, _headers = create_google_chat_target_audience_with_http_info(organization_binding_id, body, opts) + data + end + + # Create a target audience. + # + # Create a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param body [GoogleChatTargetAudienceCreateRequest] Target audience payload. + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatTargetAudienceResponse, Integer, Hash)>] GoogleChatTargetAudienceResponse data, response status code and response headers + def create_google_chat_target_audience_with_http_info(organization_binding_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.create_google_chat_target_audience ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.create_google_chat_target_audience" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling GoogleChatIntegrationAPI.create_google_chat_target_audience" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences'.sub('{organization_binding_id}', CGI.escape(organization_binding_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(body) + + # return_type + return_type = opts[:debug_return_type] || 'GoogleChatTargetAudienceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_google_chat_target_audience, + :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: GoogleChatIntegrationAPI#create_google_chat_target_audience\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create organization handle. # - # @see #create_organization_handle_with_http_info - def create_organization_handle(organization_binding_id, body, opts = {}) - data, _status_code, _headers = create_organization_handle_with_http_info(organization_binding_id, body, opts) + # @see #create_organization_handle_with_http_info + def create_organization_handle(organization_binding_id, body, opts = {}) + data, _status_code, _headers = create_organization_handle_with_http_info(organization_binding_id, body, opts) + data + end + + # Create organization handle. + # + # Create an organization handle in the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param body [GoogleChatCreateOrganizationHandleRequest] Organization handle payload. + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatOrganizationHandleResponse, Integer, Hash)>] GoogleChatOrganizationHandleResponse data, response status code and response headers + def create_organization_handle_with_http_info(organization_binding_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.create_organization_handle ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.create_organization_handle" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling GoogleChatIntegrationAPI.create_organization_handle" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles'.sub('{organization_binding_id}', CGI.escape(organization_binding_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(body) + + # return_type + return_type = opts[:debug_return_type] || 'GoogleChatOrganizationHandleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_organization_handle, + :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: GoogleChatIntegrationAPI#create_organization_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete the delegated user. + # + # @see #delete_google_chat_delegated_user_with_http_info + def delete_google_chat_delegated_user(organization_binding_id, opts = {}) + delete_google_chat_delegated_user_with_http_info(organization_binding_id, opts) + nil + end + + # Delete the delegated user. + # + # Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_google_chat_delegated_user_with_http_info(organization_binding_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.delete_google_chat_delegated_user ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.delete_google_chat_delegated_user" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user'.sub('{organization_binding_id}', CGI.escape(organization_binding_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] + + new_options = opts.merge( + :operation => :delete_google_chat_delegated_user, + :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: GoogleChatIntegrationAPI#delete_google_chat_delegated_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Google Chat organization binding. + # + # @see #delete_google_chat_organization_with_http_info + def delete_google_chat_organization(organization_binding_id, opts = {}) + delete_google_chat_organization_with_http_info(organization_binding_id, opts) + nil + end + + # Delete a Google Chat organization binding. + # + # Delete a Google Chat organization binding from the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_google_chat_organization_with_http_info(organization_binding_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.delete_google_chat_organization ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.delete_google_chat_organization" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_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] + + new_options = opts.merge( + :operation => :delete_google_chat_organization, + :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: GoogleChatIntegrationAPI#delete_google_chat_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a target audience. + # + # @see #delete_google_chat_target_audience_with_http_info + def delete_google_chat_target_audience(organization_binding_id, target_audience_id, opts = {}) + delete_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, opts) + nil + end + + # Delete a target audience. + # + # Delete a target audience from a Google Chat organization binding in the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param target_audience_id [String] Your target audience ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.delete_google_chat_target_audience ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.delete_google_chat_target_audience" + end + # verify the required parameter 'target_audience_id' is set + if @api_client.config.client_side_validation && target_audience_id.nil? + fail ArgumentError, "Missing the required parameter 'target_audience_id' when calling GoogleChatIntegrationAPI.delete_google_chat_target_audience" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')).sub('{target_audience_id}', CGI.escape(target_audience_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] + + new_options = opts.merge( + :operation => :delete_google_chat_target_audience, + :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: GoogleChatIntegrationAPI#delete_google_chat_target_audience\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete organization handle. + # + # @see #delete_organization_handle_with_http_info + def delete_organization_handle(organization_binding_id, handle_id, opts = {}) + delete_organization_handle_with_http_info(organization_binding_id, handle_id, opts) + nil + end + + # Delete organization handle. + # + # Delete an organization handle from the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param handle_id [String] Your organization handle ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_organization_handle_with_http_info(organization_binding_id, handle_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.delete_organization_handle ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.delete_organization_handle" + end + # verify the required parameter 'handle_id' is set + if @api_client.config.client_side_validation && handle_id.nil? + fail ArgumentError, "Missing the required parameter 'handle_id' when calling GoogleChatIntegrationAPI.delete_organization_handle" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')).sub('{handle_id}', CGI.escape(handle_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] + + new_options = opts.merge( + :operation => :delete_organization_handle, + :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: GoogleChatIntegrationAPI#delete_organization_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the delegated user. + # + # @see #get_google_chat_delegated_user_with_http_info + def get_google_chat_delegated_user(organization_binding_id, opts = {}) + data, _status_code, _headers = get_google_chat_delegated_user_with_http_info(organization_binding_id, opts) data end - # Create organization handle. + # Get the delegated user. # - # Create an organization handle in the Datadog Google Chat integration. + # Get the delegated user for a Google Chat organization binding in the Datadog Google Chat integration. # # @param organization_binding_id [String] Your organization binding ID. - # @param body [GoogleChatCreateOrganizationHandleRequest] Organization handle payload. # @param opts [Hash] the optional parameters - # @return [Array<(GoogleChatOrganizationHandleResponse, Integer, Hash)>] GoogleChatOrganizationHandleResponse data, response status code and response headers - def create_organization_handle_with_http_info(organization_binding_id, body, opts = {}) + # @return [Array<(GoogleChatDelegatedUserResponse, Integer, Hash)>] GoogleChatDelegatedUserResponse data, response status code and response headers + def get_google_chat_delegated_user_with_http_info(organization_binding_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.create_organization_handle ...' + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.get_google_chat_delegated_user ...' end # verify the required parameter 'organization_binding_id' is set if @api_client.config.client_side_validation && organization_binding_id.nil? - fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.create_organization_handle" + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.get_google_chat_delegated_user" end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling GoogleChatIntegrationAPI.create_organization_handle" + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user'.sub('{organization_binding_id}', CGI.escape(organization_binding_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] || 'GoogleChatDelegatedUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_google_chat_delegated_user, + :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: GoogleChatIntegrationAPI#get_google_chat_delegated_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a Google Chat organization binding. + # + # @see #get_google_chat_organization_with_http_info + def get_google_chat_organization(organization_binding_id, opts = {}) + data, _status_code, _headers = get_google_chat_organization_with_http_info(organization_binding_id, opts) + data + end + + # Get a Google Chat organization binding. + # + # Get a Google Chat organization binding from the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatOrganizationResponse, Integer, Hash)>] GoogleChatOrganizationResponse data, response status code and response headers + def get_google_chat_organization_with_http_info(organization_binding_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.get_google_chat_organization ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.get_google_chat_organization" end # resource path - local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -62,23 +536,21 @@ def create_organization_handle_with_http_info(organization_binding_id, body, opt 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(body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'GoogleChatOrganizationHandleResponse' + return_type = opts[:debug_return_type] || 'GoogleChatOrganizationResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_organization_handle, + :operation => :get_google_chat_organization, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -88,44 +560,44 @@ def create_organization_handle_with_http_info(organization_binding_id, body, opt :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + 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: GoogleChatIntegrationAPI#create_organization_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GoogleChatIntegrationAPI#get_google_chat_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete organization handle. + # Get a target audience. # - # @see #delete_organization_handle_with_http_info - def delete_organization_handle(organization_binding_id, handle_id, opts = {}) - delete_organization_handle_with_http_info(organization_binding_id, handle_id, opts) - nil + # @see #get_google_chat_target_audience_with_http_info + def get_google_chat_target_audience(organization_binding_id, target_audience_id, opts = {}) + data, _status_code, _headers = get_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, opts) + data end - # Delete organization handle. + # Get a target audience. # - # Delete an organization handle from the Datadog Google Chat integration. + # Get a target audience for a Google Chat organization binding in the Datadog Google Chat integration. # # @param organization_binding_id [String] Your organization binding ID. - # @param handle_id [String] Your organization handle ID. + # @param target_audience_id [String] Your target audience ID. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_organization_handle_with_http_info(organization_binding_id, handle_id, opts = {}) + # @return [Array<(GoogleChatTargetAudienceResponse, Integer, Hash)>] GoogleChatTargetAudienceResponse data, response status code and response headers + def get_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.delete_organization_handle ...' + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.get_google_chat_target_audience ...' end # verify the required parameter 'organization_binding_id' is set if @api_client.config.client_side_validation && organization_binding_id.nil? - fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.delete_organization_handle" + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.get_google_chat_target_audience" end - # verify the required parameter 'handle_id' is set - if @api_client.config.client_side_validation && handle_id.nil? - fail ArgumentError, "Missing the required parameter 'handle_id' when calling GoogleChatIntegrationAPI.delete_organization_handle" + # verify the required parameter 'target_audience_id' is set + if @api_client.config.client_side_validation && target_audience_id.nil? + fail ArgumentError, "Missing the required parameter 'target_audience_id' when calling GoogleChatIntegrationAPI.get_google_chat_target_audience" end # resource path - local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')).sub('{handle_id}', CGI.escape(handle_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')).sub('{target_audience_id}', CGI.escape(target_audience_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -133,7 +605,7 @@ def delete_organization_handle_with_http_info(organization_binding_id, handle_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -142,13 +614,13 @@ def delete_organization_handle_with_http_info(organization_binding_id, handle_id post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'GoogleChatTargetAudienceResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :delete_organization_handle, + :operation => :get_google_chat_target_audience, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -158,9 +630,9 @@ def delete_organization_handle_with_http_info(organization_binding_id, handle_id :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + 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: GoogleChatIntegrationAPI#delete_organization_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: GoogleChatIntegrationAPI#get_google_chat_target_audience\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -305,6 +777,131 @@ def get_space_by_display_name_with_http_info(domain_name, space_display_name, op return data, status_code, headers end + # Get all Google Chat organization bindings. + # + # @see #list_google_chat_organizations_with_http_info + def list_google_chat_organizations(opts = {}) + data, _status_code, _headers = list_google_chat_organizations_with_http_info(opts) + data + end + + # Get all Google Chat organization bindings. + # + # Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + # + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatOrganizationsResponse, Integer, Hash)>] GoogleChatOrganizationsResponse data, response status code and response headers + def list_google_chat_organizations_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.list_google_chat_organizations ...' + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations' + + # 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] || 'GoogleChatOrganizationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_google_chat_organizations, + :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: GoogleChatIntegrationAPI#list_google_chat_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all target audiences. + # + # @see #list_google_chat_target_audiences_with_http_info + def list_google_chat_target_audiences(organization_binding_id, opts = {}) + data, _status_code, _headers = list_google_chat_target_audiences_with_http_info(organization_binding_id, opts) + data + end + + # Get all target audiences. + # + # Get a list of all target audiences for a Google Chat organization binding in the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatTargetAudiencesResponse, Integer, Hash)>] GoogleChatTargetAudiencesResponse data, response status code and response headers + def list_google_chat_target_audiences_with_http_info(organization_binding_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.list_google_chat_target_audiences ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.list_google_chat_target_audiences" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences'.sub('{organization_binding_id}', CGI.escape(organization_binding_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] || 'GoogleChatTargetAudiencesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_google_chat_target_audiences, + :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: GoogleChatIntegrationAPI#list_google_chat_target_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all organization handles. # # @see #list_organization_handles_with_http_info @@ -370,6 +967,83 @@ def list_organization_handles_with_http_info(organization_binding_id, opts = {}) return data, status_code, headers end + # Update a target audience. + # + # @see #update_google_chat_target_audience_with_http_info + def update_google_chat_target_audience(organization_binding_id, target_audience_id, body, opts = {}) + data, _status_code, _headers = update_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, body, opts) + data + end + + # Update a target audience. + # + # Update a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + # + # @param organization_binding_id [String] Your organization binding ID. + # @param target_audience_id [String] Your target audience ID. + # @param body [GoogleChatTargetAudienceUpdateRequest] Target audience payload. + # @param opts [Hash] the optional parameters + # @return [Array<(GoogleChatTargetAudienceResponse, Integer, Hash)>] GoogleChatTargetAudienceResponse data, response status code and response headers + def update_google_chat_target_audience_with_http_info(organization_binding_id, target_audience_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GoogleChatIntegrationAPI.update_google_chat_target_audience ...' + end + # verify the required parameter 'organization_binding_id' is set + if @api_client.config.client_side_validation && organization_binding_id.nil? + fail ArgumentError, "Missing the required parameter 'organization_binding_id' when calling GoogleChatIntegrationAPI.update_google_chat_target_audience" + end + # verify the required parameter 'target_audience_id' is set + if @api_client.config.client_side_validation && target_audience_id.nil? + fail ArgumentError, "Missing the required parameter 'target_audience_id' when calling GoogleChatIntegrationAPI.update_google_chat_target_audience" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling GoogleChatIntegrationAPI.update_google_chat_target_audience" + end + # resource path + local_var_path = '/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}'.sub('{organization_binding_id}', CGI.escape(organization_binding_id.to_s).gsub('%2F', '/')).sub('{target_audience_id}', CGI.escape(target_audience_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(body) + + # return_type + return_type = opts[:debug_return_type] || 'GoogleChatTargetAudienceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_google_chat_target_audience, + :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: GoogleChatIntegrationAPI#update_google_chat_target_audience\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update organization handle. # # @see #update_organization_handle_with_http_info diff --git a/lib/datadog_api_client/v2/models/google_chat_delegated_user_attributes.rb b/lib/datadog_api_client/v2/models/google_chat_delegated_user_attributes.rb new file mode 100644 index 000000000000..58ddcffb8b44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_delegated_user_attributes.rb @@ -0,0 +1,127 @@ +=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 + # Google Chat delegated user attributes. + class GoogleChatDelegatedUserAttributes + include BaseGenericModel + + # The delegated user's display name. + attr_accessor :display_name + + # The delegated user's email address. + attr_accessor :email + + # The list of features enabled for the delegated user. + attr_accessor :features + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'email' => :'email', + :'features' => :'features' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'email' => :'String', + :'features' => :'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::GoogleChatDelegatedUserAttributes` 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?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'features') + if (value = attributes[:'features']).is_a?(Array) + self.features = 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 && + email == o.email && + features == o.features && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, email, features, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_delegated_user_data.rb b/lib/datadog_api_client/v2/models/google_chat_delegated_user_data.rb new file mode 100644 index 000000000000..33f24e6420bd --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_delegated_user_data.rb @@ -0,0 +1,147 @@ +=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 + # Google Chat delegated user data from a response. + class GoogleChatDelegatedUserData + include BaseGenericModel + + # Google Chat delegated user attributes. + attr_accessor :attributes + + # The ID of the delegated user. + attr_reader :id + + # Google Chat delegated user resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GoogleChatDelegatedUserAttributes', + :'id' => :'String', + :'type' => :'GoogleChatDelegatedUserType' + } + 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::GoogleChatDelegatedUserData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 !@id.nil? && @id.to_s.length > 100 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_delegated_user_response.rb b/lib/datadog_api_client/v2/models/google_chat_delegated_user_response.rb new file mode 100644 index 000000000000..9830bdd641e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_delegated_user_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing a Google Chat delegated user. + class GoogleChatDelegatedUserResponse + include BaseGenericModel + + # Google Chat delegated user data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatDelegatedUserData' + } + 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::GoogleChatDelegatedUserResponse` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_delegated_user_type.rb b/lib/datadog_api_client/v2/models/google_chat_delegated_user_type.rb new file mode 100644 index 000000000000..10bcc6bc5408 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_delegated_user_type.rb @@ -0,0 +1,26 @@ +=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 + # Google Chat delegated user resource type. + class GoogleChatDelegatedUserType + include BaseEnumModel + + GOOGLE_CHAT_DELEGATED_USER_TYPE = "google-chat-delegated-user".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_attributes.rb b/lib/datadog_api_client/v2/models/google_chat_organization_attributes.rb new file mode 100644 index 000000000000..24389f37cc41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_attributes.rb @@ -0,0 +1,144 @@ +=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 + # Google Chat organization attributes. + class GoogleChatOrganizationAttributes + include BaseGenericModel + + # The Google Chat organization domain ID. + attr_reader :domain_id + + # The Google Chat organization domain name. + attr_reader :domain_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain_id' => :'domain_id', + :'domain_name' => :'domain_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain_id' => :'String', + :'domain_name' => :'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::GoogleChatOrganizationAttributes` 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?(:'domain_id') + self.domain_id = attributes[:'domain_id'] + end + + if attributes.key?(:'domain_name') + self.domain_name = attributes[:'domain_name'] + 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 !@domain_id.nil? && @domain_id.to_s.length > 255 + return false if !@domain_name.nil? && @domain_name.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param domain_id [Object] Object to be assigned + # @!visibility private + def domain_id=(domain_id) + if !domain_id.nil? && domain_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "domain_id", the character length must be smaller than or equal to 255.' + end + @domain_id = domain_id + end + + # Custom attribute writer method with validation + # @param domain_name [Object] Object to be assigned + # @!visibility private + def domain_name=(domain_name) + if !domain_name.nil? && domain_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "domain_name", the character length must be smaller than or equal to 255.' + end + @domain_name = domain_name + 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 && + domain_id == o.domain_id && + domain_name == o.domain_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain_id, domain_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_data.rb b/lib/datadog_api_client/v2/models/google_chat_organization_data.rb new file mode 100644 index 000000000000..14c08be986c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_data.rb @@ -0,0 +1,157 @@ +=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 + # Google Chat organization data from a response. + class GoogleChatOrganizationData + include BaseGenericModel + + # Google Chat organization attributes. + attr_accessor :attributes + + # The ID of the Google Chat organization binding. + attr_reader :id + + # Google Chat organization relationships. + attr_accessor :relationships + + # Google Chat organization resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GoogleChatOrganizationAttributes', + :'id' => :'String', + :'relationships' => :'GoogleChatOrganizationRelationships', + :'type' => :'GoogleChatOrganizationType' + } + 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::GoogleChatOrganizationData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 !@id.nil? && @id.to_s.length > 100 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + 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 && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_relationships.rb b/lib/datadog_api_client/v2/models/google_chat_organization_relationships.rb new file mode 100644 index 000000000000..a3033f4996f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_relationships.rb @@ -0,0 +1,105 @@ +=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 + # Google Chat organization relationships. + class GoogleChatOrganizationRelationships + include BaseGenericModel + + # The delegated user relationship. + attr_accessor :delegated_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'delegated_user' => :'delegated_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'delegated_user' => :'GoogleChatOrganizationRelationshipsDelegatedUser' + } + 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::GoogleChatOrganizationRelationships` 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?(:'delegated_user') + self.delegated_user = attributes[:'delegated_user'] + 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 && + delegated_user == o.delegated_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [delegated_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user.rb b/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user.rb new file mode 100644 index 000000000000..e250c3a707aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user.rb @@ -0,0 +1,105 @@ +=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 delegated user relationship. + class GoogleChatOrganizationRelationshipsDelegatedUser + include BaseGenericModel + + # Delegated user relationship data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatOrganizationRelationshipsDelegatedUserData' + } + 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::GoogleChatOrganizationRelationshipsDelegatedUser` 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?(:'data') + self.data = attributes[:'data'] + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user_data.rb b/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user_data.rb new file mode 100644 index 000000000000..4e3cf543fbc8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_relationships_delegated_user_data.rb @@ -0,0 +1,115 @@ +=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 + # Delegated user relationship data. + class GoogleChatOrganizationRelationshipsDelegatedUserData + include BaseGenericModel + + # The ID of the delegated user. + attr_accessor :id + + # Google Chat delegated user resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'GoogleChatDelegatedUserType' + } + 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::GoogleChatOrganizationRelationshipsDelegatedUserData` 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?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'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 && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_response.rb b/lib/datadog_api_client/v2/models/google_chat_organization_response.rb new file mode 100644 index 000000000000..7e696d61d34f --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing a Google Chat organization binding. + class GoogleChatOrganizationResponse + include BaseGenericModel + + # Google Chat organization data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatOrganizationData' + } + 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::GoogleChatOrganizationResponse` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organization_type.rb b/lib/datadog_api_client/v2/models/google_chat_organization_type.rb new file mode 100644 index 000000000000..f3ca5e91a3c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organization_type.rb @@ -0,0 +1,26 @@ +=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 + # Google Chat organization resource type. + class GoogleChatOrganizationType + include BaseEnumModel + + GOOGLE_CHAT_ORGANIZATION_TYPE = "google-chat-organization".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_organizations_response.rb b/lib/datadog_api_client/v2/models/google_chat_organizations_response.rb new file mode 100644 index 000000000000..197dc8f57bbf --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_organizations_response.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 + # Response containing a list of Google Chat organization bindings. + class GoogleChatOrganizationsResponse + include BaseGenericModel + + # An array of Google Chat organization bindings. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'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::GoogleChatOrganizationsResponse` 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?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_attributes.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_attributes.rb new file mode 100644 index 000000000000..1d095ecbb34b --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_attributes.rb @@ -0,0 +1,152 @@ +=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 + # Google Chat target audience attributes. + class GoogleChatTargetAudienceAttributes + include BaseGenericModel + + # The audience ID. + attr_reader :audience_id + + # The audience name. + attr_reader :audience_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'audience_id' => :'audience_id', + :'audience_name' => :'audience_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'audience_id' => :'String', + :'audience_name' => :'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::GoogleChatTargetAudienceAttributes` 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?(:'audience_id') + self.audience_id = attributes[:'audience_id'] + end + + if attributes.key?(:'audience_name') + self.audience_name = attributes[:'audience_name'] + 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 @audience_id.nil? + return false if @audience_id.to_s.length > 255 + return false if @audience_name.nil? + return false if @audience_name.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param audience_id [Object] Object to be assigned + # @!visibility private + def audience_id=(audience_id) + if audience_id.nil? + fail ArgumentError, 'invalid value for "audience_id", audience_id cannot be nil.' + end + if audience_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_id", the character length must be smaller than or equal to 255.' + end + @audience_id = audience_id + end + + # Custom attribute writer method with validation + # @param audience_name [Object] Object to be assigned + # @!visibility private + def audience_name=(audience_name) + if audience_name.nil? + fail ArgumentError, 'invalid value for "audience_name", audience_name cannot be nil.' + end + if audience_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_name", the character length must be smaller than or equal to 255.' + end + @audience_name = audience_name + 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 && + audience_id == o.audience_id && + audience_name == o.audience_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [audience_id, audience_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request.rb new file mode 100644 index 000000000000..4e206f010dcd --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request.rb @@ -0,0 +1,123 @@ +=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 + # Create target audience request. + class GoogleChatTargetAudienceCreateRequest + include BaseGenericModel + + # Data for a create target audience request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatTargetAudienceCreateRequestData' + } + 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::GoogleChatTargetAudienceCreateRequest` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_attributes.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_attributes.rb new file mode 100644 index 000000000000..7108d44027a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_attributes.rb @@ -0,0 +1,152 @@ +=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 + # Attributes for creating a Google Chat target audience. + class GoogleChatTargetAudienceCreateRequestAttributes + include BaseGenericModel + + # The audience ID. + attr_reader :audience_id + + # The audience name. + attr_reader :audience_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'audience_id' => :'audience_id', + :'audience_name' => :'audience_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'audience_id' => :'String', + :'audience_name' => :'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::GoogleChatTargetAudienceCreateRequestAttributes` 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?(:'audience_id') + self.audience_id = attributes[:'audience_id'] + end + + if attributes.key?(:'audience_name') + self.audience_name = attributes[:'audience_name'] + 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 @audience_id.nil? + return false if @audience_id.to_s.length > 255 + return false if @audience_name.nil? + return false if @audience_name.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param audience_id [Object] Object to be assigned + # @!visibility private + def audience_id=(audience_id) + if audience_id.nil? + fail ArgumentError, 'invalid value for "audience_id", audience_id cannot be nil.' + end + if audience_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_id", the character length must be smaller than or equal to 255.' + end + @audience_id = audience_id + end + + # Custom attribute writer method with validation + # @param audience_name [Object] Object to be assigned + # @!visibility private + def audience_name=(audience_name) + if audience_name.nil? + fail ArgumentError, 'invalid value for "audience_name", audience_name cannot be nil.' + end + if audience_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_name", the character length must be smaller than or equal to 255.' + end + @audience_name = audience_name + 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 && + audience_id == o.audience_id && + audience_name == o.audience_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [audience_id, audience_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_data.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_data.rb new file mode 100644 index 000000000000..66fde7062e2f --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_create_request_data.rb @@ -0,0 +1,144 @@ +=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 + # Data for a create target audience request. + class GoogleChatTargetAudienceCreateRequestData + include BaseGenericModel + + # Attributes for creating a Google Chat target audience. + attr_reader :attributes + + # Google Chat target audience resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GoogleChatTargetAudienceCreateRequestAttributes', + :'type' => :'GoogleChatTargetAudienceType' + } + 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::GoogleChatTargetAudienceCreateRequestData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_data.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_data.rb new file mode 100644 index 000000000000..6642694183a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_data.rb @@ -0,0 +1,147 @@ +=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 + # Google Chat target audience data from a response. + class GoogleChatTargetAudienceData + include BaseGenericModel + + # Google Chat target audience attributes. + attr_accessor :attributes + + # The ID of the target audience. + attr_reader :id + + # Google Chat target audience resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GoogleChatTargetAudienceAttributes', + :'id' => :'String', + :'type' => :'GoogleChatTargetAudienceType' + } + 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::GoogleChatTargetAudienceData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 !@id.nil? && @id.to_s.length > 100 + return false if !@id.nil? && @id.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if !id.nil? && id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if !id.nil? && id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + @id = id + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_response.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_response.rb new file mode 100644 index 000000000000..77f26c6722af --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing a Google Chat target audience. + class GoogleChatTargetAudienceResponse + include BaseGenericModel + + # Google Chat target audience data from a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatTargetAudienceData' + } + 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::GoogleChatTargetAudienceResponse` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_type.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_type.rb new file mode 100644 index 000000000000..765d50d55ce6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_type.rb @@ -0,0 +1,26 @@ +=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 + # Google Chat target audience resource type. + class GoogleChatTargetAudienceType + include BaseEnumModel + + GOOGLE_CHAT_TARGET_AUDIENCE_TYPE = "google-chat-target-audience".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request.rb new file mode 100644 index 000000000000..89b5c244e58f --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request.rb @@ -0,0 +1,123 @@ +=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 + # Update target audience request. + class GoogleChatTargetAudienceUpdateRequest + include BaseGenericModel + + # Data for an update target audience request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleChatTargetAudienceUpdateRequestData' + } + 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::GoogleChatTargetAudienceUpdateRequest` 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?(:'data') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_attributes.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_attributes.rb new file mode 100644 index 000000000000..51fcf19d76f7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_attributes.rb @@ -0,0 +1,144 @@ +=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 + # Attributes for updating a Google Chat target audience. + class GoogleChatTargetAudienceUpdateRequestAttributes + include BaseGenericModel + + # The audience ID. + attr_reader :audience_id + + # The audience name. + attr_reader :audience_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'audience_id' => :'audience_id', + :'audience_name' => :'audience_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'audience_id' => :'String', + :'audience_name' => :'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::GoogleChatTargetAudienceUpdateRequestAttributes` 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?(:'audience_id') + self.audience_id = attributes[:'audience_id'] + end + + if attributes.key?(:'audience_name') + self.audience_name = attributes[:'audience_name'] + 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 !@audience_id.nil? && @audience_id.to_s.length > 255 + return false if !@audience_name.nil? && @audience_name.to_s.length > 255 + true + end + + # Custom attribute writer method with validation + # @param audience_id [Object] Object to be assigned + # @!visibility private + def audience_id=(audience_id) + if !audience_id.nil? && audience_id.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_id", the character length must be smaller than or equal to 255.' + end + @audience_id = audience_id + end + + # Custom attribute writer method with validation + # @param audience_name [Object] Object to be assigned + # @!visibility private + def audience_name=(audience_name) + if !audience_name.nil? && audience_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "audience_name", the character length must be smaller than or equal to 255.' + end + @audience_name = audience_name + 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 && + audience_id == o.audience_id && + audience_name == o.audience_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [audience_id, audience_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_data.rb b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_data.rb new file mode 100644 index 000000000000..eb83ccc985d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audience_update_request_data.rb @@ -0,0 +1,144 @@ +=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 + # Data for an update target audience request. + class GoogleChatTargetAudienceUpdateRequestData + include BaseGenericModel + + # Attributes for updating a Google Chat target audience. + attr_reader :attributes + + # Google Chat target audience resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GoogleChatTargetAudienceUpdateRequestAttributes', + :'type' => :'GoogleChatTargetAudienceType' + } + 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::GoogleChatTargetAudienceUpdateRequestData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_chat_target_audiences_response.rb b/lib/datadog_api_client/v2/models/google_chat_target_audiences_response.rb new file mode 100644 index 000000000000..74930487eb2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_chat_target_audiences_response.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 + # Response containing a list of Google Chat target audiences. + class GoogleChatTargetAudiencesResponse + include BaseGenericModel + + # An array of Google Chat target audiences. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'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::GoogleChatTargetAudiencesResponse` 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?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end