diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85c26314849..4377babe307 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.java b/examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.java new file mode 100644 index 00000000000..c332b8e7cae --- /dev/null +++ b/examples/v2/google-chat-integration/CreateGoogleChatTargetAudience.java @@ -0,0 +1,40 @@ +// Create a target audience returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceCreateRequest; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceCreateRequestAttributes; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceCreateRequestData; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceResponse; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + GoogleChatTargetAudienceCreateRequest body = + new GoogleChatTargetAudienceCreateRequest() + .data( + new GoogleChatTargetAudienceCreateRequestData() + .attributes( + new GoogleChatTargetAudienceCreateRequestAttributes() + .audienceId("fake-audience-id-1") + .audienceName("fake audience name 1")) + .type(GoogleChatTargetAudienceType.GOOGLE_CHAT_TARGET_AUDIENCE_TYPE)); + + try { + GoogleChatTargetAudienceResponse result = + apiInstance.createGoogleChatTargetAudience("organization_binding_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#createGoogleChatTargetAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.java b/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.java new file mode 100644 index 00000000000..0f034ed34e0 --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatDelegatedUser.java @@ -0,0 +1,23 @@ +// Delete the delegated user returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + apiInstance.deleteGoogleChatDelegatedUser("organization_binding_id"); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#deleteGoogleChatDelegatedUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.java b/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.java new file mode 100644 index 00000000000..30308296bc5 --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatOrganization.java @@ -0,0 +1,23 @@ +// Delete a Google Chat organization binding returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + apiInstance.deleteGoogleChatOrganization("organization_binding_id"); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#deleteGoogleChatOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.java b/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.java new file mode 100644 index 00000000000..7fccf9817db --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteGoogleChatTargetAudience.java @@ -0,0 +1,23 @@ +// Delete a target audience returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + apiInstance.deleteGoogleChatTargetAudience("organization_binding_id", "target_audience_id"); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#deleteGoogleChatTargetAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.java b/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.java new file mode 100644 index 00000000000..53fe13e449c --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatDelegatedUser.java @@ -0,0 +1,26 @@ +// Get the delegated user returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatDelegatedUserResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + GoogleChatDelegatedUserResponse result = + apiInstance.getGoogleChatDelegatedUser("organization_binding_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#getGoogleChatDelegatedUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/GetGoogleChatOrganization.java b/examples/v2/google-chat-integration/GetGoogleChatOrganization.java new file mode 100644 index 00000000000..98535e1b035 --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatOrganization.java @@ -0,0 +1,26 @@ +// Get a Google Chat organization binding returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatOrganizationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + GoogleChatOrganizationResponse result = + apiInstance.getGoogleChatOrganization("organization_binding_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#getGoogleChatOrganization"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.java b/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.java new file mode 100644 index 00000000000..16aaea85d57 --- /dev/null +++ b/examples/v2/google-chat-integration/GetGoogleChatTargetAudience.java @@ -0,0 +1,26 @@ +// Get a target audience returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + GoogleChatTargetAudienceResponse result = + apiInstance.getGoogleChatTargetAudience("organization_binding_id", "target_audience_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#getGoogleChatTargetAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/ListGoogleChatOrganizations.java b/examples/v2/google-chat-integration/ListGoogleChatOrganizations.java new file mode 100644 index 00000000000..2c808b522a4 --- /dev/null +++ b/examples/v2/google-chat-integration/ListGoogleChatOrganizations.java @@ -0,0 +1,25 @@ +// Get all Google Chat organization bindings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatOrganizationsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + GoogleChatOrganizationsResponse result = apiInstance.listGoogleChatOrganizations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#listGoogleChatOrganizations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.java b/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.java new file mode 100644 index 00000000000..31904f15504 --- /dev/null +++ b/examples/v2/google-chat-integration/ListGoogleChatTargetAudiences.java @@ -0,0 +1,26 @@ +// Get all target audiences returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatTargetAudiencesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + try { + GoogleChatTargetAudiencesResponse result = + apiInstance.listGoogleChatTargetAudiences("organization_binding_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#listGoogleChatTargetAudiences"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.java b/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.java new file mode 100644 index 00000000000..b0f75da654b --- /dev/null +++ b/examples/v2/google-chat-integration/UpdateGoogleChatTargetAudience.java @@ -0,0 +1,41 @@ +// Update a target audience returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.GoogleChatIntegrationApi; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceResponse; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceType; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceUpdateRequest; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceUpdateRequestAttributes; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceUpdateRequestData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + GoogleChatIntegrationApi apiInstance = new GoogleChatIntegrationApi(defaultClient); + + GoogleChatTargetAudienceUpdateRequest body = + new GoogleChatTargetAudienceUpdateRequest() + .data( + new GoogleChatTargetAudienceUpdateRequestData() + .attributes( + new GoogleChatTargetAudienceUpdateRequestAttributes() + .audienceId("fake-audience-id-1") + .audienceName("fake audience name 1")) + .type(GoogleChatTargetAudienceType.GOOGLE_CHAT_TARGET_AUDIENCE_TYPE)); + + try { + GoogleChatTargetAudienceResponse result = + apiInstance.updateGoogleChatTargetAudience( + "organization_binding_id", "target_audience_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling GoogleChatIntegrationApi#updateGoogleChatTargetAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/GoogleChatIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/GoogleChatIntegrationApi.java index 61e1c6a403f..bf437a0155a 100644 --- a/src/main/java/com/datadog/api/client/v2/api/GoogleChatIntegrationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/GoogleChatIntegrationApi.java @@ -6,8 +6,15 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.GoogleChatAppNamedSpaceResponse; import com.datadog.api.client.v2.model.GoogleChatCreateOrganizationHandleRequest; +import com.datadog.api.client.v2.model.GoogleChatDelegatedUserResponse; import com.datadog.api.client.v2.model.GoogleChatOrganizationHandleResponse; import com.datadog.api.client.v2.model.GoogleChatOrganizationHandlesResponse; +import com.datadog.api.client.v2.model.GoogleChatOrganizationResponse; +import com.datadog.api.client.v2.model.GoogleChatOrganizationsResponse; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceCreateRequest; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceResponse; +import com.datadog.api.client.v2.model.GoogleChatTargetAudienceUpdateRequest; +import com.datadog.api.client.v2.model.GoogleChatTargetAudiencesResponse; import com.datadog.api.client.v2.model.GoogleChatUpdateOrganizationHandleRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -47,6 +54,180 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Create a target audience. + * + *

See {@link #createGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param body Target audience payload. (required) + * @return GoogleChatTargetAudienceResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatTargetAudienceResponse createGoogleChatTargetAudience( + String organizationBindingId, GoogleChatTargetAudienceCreateRequest body) + throws ApiException { + return createGoogleChatTargetAudienceWithHttpInfo(organizationBindingId, body).getData(); + } + + /** + * Create a target audience. + * + *

See {@link #createGoogleChatTargetAudienceWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param body Target audience payload. (required) + * @return CompletableFuture<GoogleChatTargetAudienceResponse> + */ + public CompletableFuture createGoogleChatTargetAudienceAsync( + String organizationBindingId, GoogleChatTargetAudienceCreateRequest body) { + return createGoogleChatTargetAudienceWithHttpInfoAsync(organizationBindingId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a target audience for a Google Chat organization binding in the Datadog Google Chat + * integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param body Target audience payload. (required) + * @return ApiResponse<GoogleChatTargetAudienceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse createGoogleChatTargetAudienceWithHttpInfo( + String organizationBindingId, GoogleChatTargetAudienceCreateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " createGoogleChatTargetAudience"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createGoogleChatTargetAudience"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.createGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a target audience. + * + *

See {@link #createGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param body Target audience payload. (required) + * @return CompletableFuture<ApiResponse<GoogleChatTargetAudienceResponse>> + */ + public CompletableFuture> + createGoogleChatTargetAudienceWithHttpInfoAsync( + String organizationBindingId, GoogleChatTargetAudienceCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " createGoogleChatTargetAudience")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createGoogleChatTargetAudience")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.createGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create organization handle. * @@ -220,31 +401,27 @@ public ApiResponse createOrganizationHandl } /** - * Delete organization handle. + * Delete the delegated user. * - *

See {@link #deleteOrganizationHandleWithHttpInfo}. + *

See {@link #deleteGoogleChatDelegatedUserWithHttpInfo}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) * @throws ApiException if fails to make API call */ - public void deleteOrganizationHandle(String organizationBindingId, String handleId) - throws ApiException { - deleteOrganizationHandleWithHttpInfo(organizationBindingId, handleId); + public void deleteGoogleChatDelegatedUser(String organizationBindingId) throws ApiException { + deleteGoogleChatDelegatedUserWithHttpInfo(organizationBindingId); } /** - * Delete organization handle. + * Delete the delegated user. * - *

See {@link #deleteOrganizationHandleWithHttpInfoAsync}. + *

See {@link #deleteGoogleChatDelegatedUserWithHttpInfoAsync}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) * @return CompletableFuture */ - public CompletableFuture deleteOrganizationHandleAsync( - String organizationBindingId, String handleId) { - return deleteOrganizationHandleWithHttpInfoAsync(organizationBindingId, handleId) + public CompletableFuture deleteGoogleChatDelegatedUserAsync(String organizationBindingId) { + return deleteGoogleChatDelegatedUserWithHttpInfoAsync(organizationBindingId) .thenApply( response -> { return response.getData(); @@ -252,10 +429,10 @@ public CompletableFuture deleteOrganizationHandleAsync( } /** - * Delete an organization handle from the Datadog Google Chat integration. + * Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat + * integration. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -263,13 +440,13 @@ public CompletableFuture deleteOrganizationHandleAsync( * Response details * Status Code Description Response Headers * 204 OK - - * 400 Bad Request - * 403 Forbidden - + * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse deleteOrganizationHandleWithHttpInfo( - String organizationBindingId, String handleId) throws ApiException { + public ApiResponse deleteGoogleChatDelegatedUserWithHttpInfo(String organizationBindingId) + throws ApiException { Object localVarPostBody = null; // verify the required parameter 'organizationBindingId' is set @@ -277,27 +454,20 @@ public ApiResponse deleteOrganizationHandleWithHttpInfo( throw new ApiException( 400, "Missing the required parameter 'organizationBindingId' when calling" - + " deleteOrganizationHandle"); - } - - // verify the required parameter 'handleId' is set - if (handleId == null) { - throw new ApiException( - 400, "Missing the required parameter 'handleId' when calling deleteOrganizationHandle"); + + " deleteGoogleChatDelegatedUser"); } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user" .replaceAll( "\\{" + "organization_binding_id" + "\\}", - apiClient.escapeString(organizationBindingId.toString())) - .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + apiClient.escapeString(organizationBindingId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.deleteOrganizationHandle", + "v2.GoogleChatIntegrationApi.deleteGoogleChatDelegatedUser", localVarPath, new ArrayList(), localVarHeaderParams, @@ -316,16 +486,15 @@ public ApiResponse deleteOrganizationHandleWithHttpInfo( } /** - * Delete organization handle. + * Delete the delegated user. * - *

See {@link #deleteOrganizationHandleWithHttpInfo}. + *

See {@link #deleteGoogleChatDelegatedUserWithHttpInfo}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteOrganizationHandleWithHttpInfoAsync( - String organizationBindingId, String handleId) { + public CompletableFuture> deleteGoogleChatDelegatedUserWithHttpInfoAsync( + String organizationBindingId) { Object localVarPostBody = null; // verify the required parameter 'organizationBindingId' is set @@ -335,26 +504,15 @@ public CompletableFuture> deleteOrganizationHandleWithHttpInfo new ApiException( 400, "Missing the required parameter 'organizationBindingId' when calling" - + " deleteOrganizationHandle")); - return result; - } - - // verify the required parameter 'handleId' is set - if (handleId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'handleId' when calling deleteOrganizationHandle")); + + " deleteGoogleChatDelegatedUser")); return result; } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user" .replaceAll( "\\{" + "organization_binding_id" + "\\}", - apiClient.escapeString(organizationBindingId.toString())) - .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + apiClient.escapeString(organizationBindingId.toString())); Map localVarHeaderParams = new HashMap(); @@ -362,7 +520,7 @@ public CompletableFuture> deleteOrganizationHandleWithHttpInfo try { builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.deleteOrganizationHandle", + "v2.GoogleChatIntegrationApi.deleteGoogleChatDelegatedUser", localVarPath, new ArrayList(), localVarHeaderParams, @@ -386,32 +544,27 @@ public CompletableFuture> deleteOrganizationHandleWithHttpInfo } /** - * Get organization handle. + * Delete a Google Chat organization binding. * - *

See {@link #getOrganizationHandleWithHttpInfo}. + *

See {@link #deleteGoogleChatOrganizationWithHttpInfo}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) - * @return GoogleChatOrganizationHandleResponse * @throws ApiException if fails to make API call */ - public GoogleChatOrganizationHandleResponse getOrganizationHandle( - String organizationBindingId, String handleId) throws ApiException { - return getOrganizationHandleWithHttpInfo(organizationBindingId, handleId).getData(); + public void deleteGoogleChatOrganization(String organizationBindingId) throws ApiException { + deleteGoogleChatOrganizationWithHttpInfo(organizationBindingId); } /** - * Get organization handle. + * Delete a Google Chat organization binding. * - *

See {@link #getOrganizationHandleWithHttpInfoAsync}. + *

See {@link #deleteGoogleChatOrganizationWithHttpInfoAsync}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) - * @return CompletableFuture<GoogleChatOrganizationHandleResponse> + * @return CompletableFuture */ - public CompletableFuture getOrganizationHandleAsync( - String organizationBindingId, String handleId) { - return getOrganizationHandleWithHttpInfoAsync(organizationBindingId, handleId) + public CompletableFuture deleteGoogleChatOrganizationAsync(String organizationBindingId) { + return deleteGoogleChatOrganizationWithHttpInfoAsync(organizationBindingId) .thenApply( response -> { return response.getData(); @@ -419,25 +572,23 @@ public CompletableFuture getOrganizationHa } /** - * Get an organization handle from the Datadog Google Chat integration. + * Delete a Google Chat organization binding from the Datadog Google Chat integration. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) - * @return ApiResponse<GoogleChatOrganizationHandleResponse> + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * - * * *
Response details
Status Code Description Response Headers
200 OK -
204 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getOrganizationHandleWithHttpInfo( - String organizationBindingId, String handleId) throws ApiException { + public ApiResponse deleteGoogleChatOrganizationWithHttpInfo(String organizationBindingId) + throws ApiException { Object localVarPostBody = null; // verify the required parameter 'organizationBindingId' is set @@ -445,84 +596,1048 @@ public ApiResponse getOrganizationHandleWi throw new ApiException( 400, "Missing the required parameter 'organizationBindingId' when calling" - + " getOrganizationHandle"); - } - - // verify the required parameter 'handleId' is set - if (handleId == null) { - throw new ApiException( - 400, "Missing the required parameter 'handleId' when calling getOrganizationHandle"); + + " deleteGoogleChatOrganization"); } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}" .replaceAll( "\\{" + "organization_binding_id" + "\\}", - apiClient.escapeString(organizationBindingId.toString())) - .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + apiClient.escapeString(organizationBindingId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.getOrganizationHandle", + "v2.GoogleChatIntegrationApi.deleteGoogleChatOrganization", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get organization handle. + * Delete a Google Chat organization binding. * - *

See {@link #getOrganizationHandleWithHttpInfo}. + *

See {@link #deleteGoogleChatOrganizationWithHttpInfo}. * * @param organizationBindingId Your organization binding ID. (required) - * @param handleId Your organization handle ID. (required) - * @return CompletableFuture<ApiResponse<GoogleChatOrganizationHandleResponse>> + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - getOrganizationHandleWithHttpInfoAsync(String organizationBindingId, String handleId) { + public CompletableFuture> deleteGoogleChatOrganizationWithHttpInfoAsync( + String organizationBindingId) { Object localVarPostBody = null; // verify the required parameter 'organizationBindingId' is set if (organizationBindingId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'organizationBindingId' when calling" - + " getOrganizationHandle")); - return result; - } - - // verify the required parameter 'handleId' is set - if (handleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'handleId' when calling getOrganizationHandle")); + + " deleteGoogleChatOrganization")); return result; } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}" .replaceAll( "\\{" + "organization_binding_id" + "\\}", - apiClient.escapeString(organizationBindingId.toString())) + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.deleteGoogleChatOrganization", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a target audience. + * + *

See {@link #deleteGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @throws ApiException if fails to make API call + */ + public void deleteGoogleChatTargetAudience(String organizationBindingId, String targetAudienceId) + throws ApiException { + deleteGoogleChatTargetAudienceWithHttpInfo(organizationBindingId, targetAudienceId); + } + + /** + * Delete a target audience. + * + *

See {@link #deleteGoogleChatTargetAudienceWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteGoogleChatTargetAudienceAsync( + String organizationBindingId, String targetAudienceId) { + return deleteGoogleChatTargetAudienceWithHttpInfoAsync(organizationBindingId, targetAudienceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a target audience from a Google Chat organization binding in the Datadog Google Chat + * integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteGoogleChatTargetAudienceWithHttpInfo( + String organizationBindingId, String targetAudienceId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " deleteGoogleChatTargetAudience"); + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " deleteGoogleChatTargetAudience"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.deleteGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a target audience. + * + *

See {@link #deleteGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteGoogleChatTargetAudienceWithHttpInfoAsync( + String organizationBindingId, String targetAudienceId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " deleteGoogleChatTargetAudience")); + return result; + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " deleteGoogleChatTargetAudience")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.deleteGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete organization handle. + * + *

See {@link #deleteOrganizationHandleWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @throws ApiException if fails to make API call + */ + public void deleteOrganizationHandle(String organizationBindingId, String handleId) + throws ApiException { + deleteOrganizationHandleWithHttpInfo(organizationBindingId, handleId); + } + + /** + * Delete organization handle. + * + *

See {@link #deleteOrganizationHandleWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteOrganizationHandleAsync( + String organizationBindingId, String handleId) { + return deleteOrganizationHandleWithHttpInfoAsync(organizationBindingId, handleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete an organization handle from the Datadog Google Chat integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse deleteOrganizationHandleWithHttpInfo( + String organizationBindingId, String handleId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " deleteOrganizationHandle"); + } + + // verify the required parameter 'handleId' is set + if (handleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'handleId' when calling deleteOrganizationHandle"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.deleteOrganizationHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete organization handle. + * + *

See {@link #deleteOrganizationHandleWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteOrganizationHandleWithHttpInfoAsync( + String organizationBindingId, String handleId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " deleteOrganizationHandle")); + return result; + } + + // verify the required parameter 'handleId' is set + if (handleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'handleId' when calling deleteOrganizationHandle")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.deleteOrganizationHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get the delegated user. + * + *

See {@link #getGoogleChatDelegatedUserWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return GoogleChatDelegatedUserResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatDelegatedUserResponse getGoogleChatDelegatedUser(String organizationBindingId) + throws ApiException { + return getGoogleChatDelegatedUserWithHttpInfo(organizationBindingId).getData(); + } + + /** + * Get the delegated user. + * + *

See {@link #getGoogleChatDelegatedUserWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<GoogleChatDelegatedUserResponse> + */ + public CompletableFuture getGoogleChatDelegatedUserAsync( + String organizationBindingId) { + return getGoogleChatDelegatedUserWithHttpInfoAsync(organizationBindingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the delegated user for a Google Chat organization binding in the Datadog Google Chat + * integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return ApiResponse<GoogleChatDelegatedUserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getGoogleChatDelegatedUserWithHttpInfo( + String organizationBindingId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatDelegatedUser"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatDelegatedUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the delegated user. + * + *

See {@link #getGoogleChatDelegatedUserWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<ApiResponse<GoogleChatDelegatedUserResponse>> + */ + public CompletableFuture> + getGoogleChatDelegatedUserWithHttpInfoAsync(String organizationBindingId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatDelegatedUser")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatDelegatedUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a Google Chat organization binding. + * + *

See {@link #getGoogleChatOrganizationWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return GoogleChatOrganizationResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatOrganizationResponse getGoogleChatOrganization(String organizationBindingId) + throws ApiException { + return getGoogleChatOrganizationWithHttpInfo(organizationBindingId).getData(); + } + + /** + * Get a Google Chat organization binding. + * + *

See {@link #getGoogleChatOrganizationWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<GoogleChatOrganizationResponse> + */ + public CompletableFuture getGoogleChatOrganizationAsync( + String organizationBindingId) { + return getGoogleChatOrganizationWithHttpInfoAsync(organizationBindingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a Google Chat organization binding from the Datadog Google Chat integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return ApiResponse<GoogleChatOrganizationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getGoogleChatOrganizationWithHttpInfo( + String organizationBindingId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatOrganization"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatOrganization", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a Google Chat organization binding. + * + *

See {@link #getGoogleChatOrganizationWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<ApiResponse<GoogleChatOrganizationResponse>> + */ + public CompletableFuture> + getGoogleChatOrganizationWithHttpInfoAsync(String organizationBindingId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatOrganization")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatOrganization", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a target audience. + * + *

See {@link #getGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return GoogleChatTargetAudienceResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatTargetAudienceResponse getGoogleChatTargetAudience( + String organizationBindingId, String targetAudienceId) throws ApiException { + return getGoogleChatTargetAudienceWithHttpInfo(organizationBindingId, targetAudienceId) + .getData(); + } + + /** + * Get a target audience. + * + *

See {@link #getGoogleChatTargetAudienceWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return CompletableFuture<GoogleChatTargetAudienceResponse> + */ + public CompletableFuture getGoogleChatTargetAudienceAsync( + String organizationBindingId, String targetAudienceId) { + return getGoogleChatTargetAudienceWithHttpInfoAsync(organizationBindingId, targetAudienceId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a target audience for a Google Chat organization binding in the Datadog Google Chat + * integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return ApiResponse<GoogleChatTargetAudienceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getGoogleChatTargetAudienceWithHttpInfo( + String organizationBindingId, String targetAudienceId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatTargetAudience"); + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " getGoogleChatTargetAudience"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a target audience. + * + *

See {@link #getGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @return CompletableFuture<ApiResponse<GoogleChatTargetAudienceResponse>> + */ + public CompletableFuture> + getGoogleChatTargetAudienceWithHttpInfoAsync( + String organizationBindingId, String targetAudienceId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getGoogleChatTargetAudience")); + return result; + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " getGoogleChatTargetAudience")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get organization handle. + * + *

See {@link #getOrganizationHandleWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return GoogleChatOrganizationHandleResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatOrganizationHandleResponse getOrganizationHandle( + String organizationBindingId, String handleId) throws ApiException { + return getOrganizationHandleWithHttpInfo(organizationBindingId, handleId).getData(); + } + + /** + * Get organization handle. + * + *

See {@link #getOrganizationHandleWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return CompletableFuture<GoogleChatOrganizationHandleResponse> + */ + public CompletableFuture getOrganizationHandleAsync( + String organizationBindingId, String handleId) { + return getOrganizationHandleWithHttpInfoAsync(organizationBindingId, handleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an organization handle from the Datadog Google Chat integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return ApiResponse<GoogleChatOrganizationHandleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getOrganizationHandleWithHttpInfo( + String organizationBindingId, String handleId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getOrganizationHandle"); + } + + // verify the required parameter 'handleId' is set + if (handleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'handleId' when calling getOrganizationHandle"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getOrganizationHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get organization handle. + * + *

See {@link #getOrganizationHandleWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param handleId Your organization handle ID. (required) + * @return CompletableFuture<ApiResponse<GoogleChatOrganizationHandleResponse>> + */ + public CompletableFuture> + getOrganizationHandleWithHttpInfoAsync(String organizationBindingId, String handleId) { + Object localVarPostBody = null; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " getOrganizationHandle")); + return result; + } + + // verify the required parameter 'handleId' is set + if (handleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'handleId' when calling getOrganizationHandle")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) .replaceAll("\\{" + "handle_id" + "\\}", apiClient.escapeString(handleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -531,7 +1646,292 @@ public ApiResponse getOrganizationHandleWi try { builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.getOrganizationHandle", + "v2.GoogleChatIntegrationApi.getOrganizationHandle", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get space information by display name. + * + *

See {@link #getSpaceByDisplayNameWithHttpInfo}. + * + * @param domainName The Google Chat domain name. (required) + * @param spaceDisplayName The Google Chat space display name. (required) + * @return GoogleChatAppNamedSpaceResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatAppNamedSpaceResponse getSpaceByDisplayName( + String domainName, String spaceDisplayName) throws ApiException { + return getSpaceByDisplayNameWithHttpInfo(domainName, spaceDisplayName).getData(); + } + + /** + * Get space information by display name. + * + *

See {@link #getSpaceByDisplayNameWithHttpInfoAsync}. + * + * @param domainName The Google Chat domain name. (required) + * @param spaceDisplayName The Google Chat space display name. (required) + * @return CompletableFuture<GoogleChatAppNamedSpaceResponse> + */ + public CompletableFuture getSpaceByDisplayNameAsync( + String domainName, String spaceDisplayName) { + return getSpaceByDisplayNameWithHttpInfoAsync(domainName, spaceDisplayName) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the resource name and organization binding ID of a space in the Datadog Google Chat + * integration. + * + * @param domainName The Google Chat domain name. (required) + * @param spaceDisplayName The Google Chat space display name. (required) + * @return ApiResponse<GoogleChatAppNamedSpaceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getSpaceByDisplayNameWithHttpInfo( + String domainName, String spaceDisplayName) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'domainName' is set + if (domainName == null) { + throw new ApiException( + 400, "Missing the required parameter 'domainName' when calling getSpaceByDisplayName"); + } + + // verify the required parameter 'spaceDisplayName' is set + if (spaceDisplayName == null) { + throw new ApiException( + 400, + "Missing the required parameter 'spaceDisplayName' when calling getSpaceByDisplayName"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}" + .replaceAll( + "\\{" + "domain_name" + "\\}", apiClient.escapeString(domainName.toString())) + .replaceAll( + "\\{" + "space_display_name" + "\\}", + apiClient.escapeString(spaceDisplayName.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getSpaceByDisplayName", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get space information by display name. + * + *

See {@link #getSpaceByDisplayNameWithHttpInfo}. + * + * @param domainName The Google Chat domain name. (required) + * @param spaceDisplayName The Google Chat space display name. (required) + * @return CompletableFuture<ApiResponse<GoogleChatAppNamedSpaceResponse>> + */ + public CompletableFuture> + getSpaceByDisplayNameWithHttpInfoAsync(String domainName, String spaceDisplayName) { + Object localVarPostBody = null; + + // verify the required parameter 'domainName' is set + if (domainName == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'domainName' when calling getSpaceByDisplayName")); + return result; + } + + // verify the required parameter 'spaceDisplayName' is set + if (spaceDisplayName == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'spaceDisplayName' when calling" + + " getSpaceByDisplayName")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}" + .replaceAll( + "\\{" + "domain_name" + "\\}", apiClient.escapeString(domainName.toString())) + .replaceAll( + "\\{" + "space_display_name" + "\\}", + apiClient.escapeString(spaceDisplayName.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.getSpaceByDisplayName", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all Google Chat organization bindings. + * + *

See {@link #listGoogleChatOrganizationsWithHttpInfo}. + * + * @return GoogleChatOrganizationsResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatOrganizationsResponse listGoogleChatOrganizations() throws ApiException { + return listGoogleChatOrganizationsWithHttpInfo().getData(); + } + + /** + * Get all Google Chat organization bindings. + * + *

See {@link #listGoogleChatOrganizationsWithHttpInfoAsync}. + * + * @return CompletableFuture<GoogleChatOrganizationsResponse> + */ + public CompletableFuture listGoogleChatOrganizationsAsync() { + return listGoogleChatOrganizationsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + * + * @return ApiResponse<GoogleChatOrganizationsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listGoogleChatOrganizationsWithHttpInfo() + throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/google-chat/organizations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.listGoogleChatOrganizations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all Google Chat organization bindings. + * + *

See {@link #listGoogleChatOrganizationsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<GoogleChatOrganizationsResponse>> + */ + public CompletableFuture> + listGoogleChatOrganizationsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/google-chat/organizations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.listGoogleChatOrganizations", localVarPath, new ArrayList(), localVarHeaderParams, @@ -539,7 +1939,7 @@ public ApiResponse getOrganizationHandleWi new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -552,36 +1952,34 @@ public ApiResponse getOrganizationHandleWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get space information by display name. + * Get all target audiences. * - *

See {@link #getSpaceByDisplayNameWithHttpInfo}. + *

See {@link #listGoogleChatTargetAudiencesWithHttpInfo}. * - * @param domainName The Google Chat domain name. (required) - * @param spaceDisplayName The Google Chat space display name. (required) - * @return GoogleChatAppNamedSpaceResponse + * @param organizationBindingId Your organization binding ID. (required) + * @return GoogleChatTargetAudiencesResponse * @throws ApiException if fails to make API call */ - public GoogleChatAppNamedSpaceResponse getSpaceByDisplayName( - String domainName, String spaceDisplayName) throws ApiException { - return getSpaceByDisplayNameWithHttpInfo(domainName, spaceDisplayName).getData(); + public GoogleChatTargetAudiencesResponse listGoogleChatTargetAudiences( + String organizationBindingId) throws ApiException { + return listGoogleChatTargetAudiencesWithHttpInfo(organizationBindingId).getData(); } /** - * Get space information by display name. + * Get all target audiences. * - *

See {@link #getSpaceByDisplayNameWithHttpInfoAsync}. + *

See {@link #listGoogleChatTargetAudiencesWithHttpInfoAsync}. * - * @param domainName The Google Chat domain name. (required) - * @param spaceDisplayName The Google Chat space display name. (required) - * @return CompletableFuture<GoogleChatAppNamedSpaceResponse> + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<GoogleChatTargetAudiencesResponse> */ - public CompletableFuture getSpaceByDisplayNameAsync( - String domainName, String spaceDisplayName) { - return getSpaceByDisplayNameWithHttpInfoAsync(domainName, spaceDisplayName) + public CompletableFuture listGoogleChatTargetAudiencesAsync( + String organizationBindingId) { + return listGoogleChatTargetAudiencesWithHttpInfoAsync(organizationBindingId) .thenApply( response -> { return response.getData(); @@ -589,54 +1987,45 @@ public CompletableFuture getSpaceByDisplayNameA } /** - * Get the resource name and organization binding ID of a space in the Datadog Google Chat - * integration. + * Get a list of all target audiences for a Google Chat organization binding in the Datadog Google + * Chat integration. * - * @param domainName The Google Chat domain name. (required) - * @param spaceDisplayName The Google Chat space display name. (required) - * @return ApiResponse<GoogleChatAppNamedSpaceResponse> + * @param organizationBindingId Your organization binding ID. (required) + * @return ApiResponse<GoogleChatTargetAudiencesResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSpaceByDisplayNameWithHttpInfo( - String domainName, String spaceDisplayName) throws ApiException { + public ApiResponse listGoogleChatTargetAudiencesWithHttpInfo( + String organizationBindingId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'domainName' is set - if (domainName == null) { - throw new ApiException( - 400, "Missing the required parameter 'domainName' when calling getSpaceByDisplayName"); - } - - // verify the required parameter 'spaceDisplayName' is set - if (spaceDisplayName == null) { + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { throw new ApiException( 400, - "Missing the required parameter 'spaceDisplayName' when calling getSpaceByDisplayName"); + "Missing the required parameter 'organizationBindingId' when calling" + + " listGoogleChatTargetAudiences"); } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences" .replaceAll( - "\\{" + "domain_name" + "\\}", apiClient.escapeString(domainName.toString())) - .replaceAll( - "\\{" + "space_display_name" + "\\}", - apiClient.escapeString(spaceDisplayName.toString())); + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.getSpaceByDisplayName", + "v2.GoogleChatIntegrationApi.listGoogleChatTargetAudiences", localVarPath, new ArrayList(), localVarHeaderParams, @@ -651,52 +2040,38 @@ public ApiResponse getSpaceByDisplayNameWithHtt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get space information by display name. + * Get all target audiences. * - *

See {@link #getSpaceByDisplayNameWithHttpInfo}. + *

See {@link #listGoogleChatTargetAudiencesWithHttpInfo}. * - * @param domainName The Google Chat domain name. (required) - * @param spaceDisplayName The Google Chat space display name. (required) - * @return CompletableFuture<ApiResponse<GoogleChatAppNamedSpaceResponse>> + * @param organizationBindingId Your organization binding ID. (required) + * @return CompletableFuture<ApiResponse<GoogleChatTargetAudiencesResponse>> */ - public CompletableFuture> - getSpaceByDisplayNameWithHttpInfoAsync(String domainName, String spaceDisplayName) { + public CompletableFuture> + listGoogleChatTargetAudiencesWithHttpInfoAsync(String organizationBindingId) { Object localVarPostBody = null; - // verify the required parameter 'domainName' is set - if (domainName == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'domainName' when calling getSpaceByDisplayName")); - return result; - } - - // verify the required parameter 'spaceDisplayName' is set - if (spaceDisplayName == null) { - CompletableFuture> result = + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'spaceDisplayName' when calling" - + " getSpaceByDisplayName")); + "Missing the required parameter 'organizationBindingId' when calling" + + " listGoogleChatTargetAudiences")); return result; } // create path and map variables String localVarPath = - "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}" + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences" .replaceAll( - "\\{" + "domain_name" + "\\}", apiClient.escapeString(domainName.toString())) - .replaceAll( - "\\{" + "space_display_name" + "\\}", - apiClient.escapeString(spaceDisplayName.toString())); + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())); Map localVarHeaderParams = new HashMap(); @@ -704,7 +2079,7 @@ public ApiResponse getSpaceByDisplayNameWithHtt try { builder = apiClient.createBuilder( - "v2.GoogleChatIntegrationApi.getSpaceByDisplayName", + "v2.GoogleChatIntegrationApi.listGoogleChatTargetAudiences", localVarPath, new ArrayList(), localVarHeaderParams, @@ -712,7 +2087,7 @@ public ApiResponse getSpaceByDisplayNameWithHtt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -725,7 +2100,7 @@ public ApiResponse getSpaceByDisplayNameWithHtt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -876,6 +2251,219 @@ public ApiResponse listOrganizationHandle new GenericType() {}); } + /** + * Update a target audience. + * + *

See {@link #updateGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @param body Target audience payload. (required) + * @return GoogleChatTargetAudienceResponse + * @throws ApiException if fails to make API call + */ + public GoogleChatTargetAudienceResponse updateGoogleChatTargetAudience( + String organizationBindingId, + String targetAudienceId, + GoogleChatTargetAudienceUpdateRequest body) + throws ApiException { + return updateGoogleChatTargetAudienceWithHttpInfo(organizationBindingId, targetAudienceId, body) + .getData(); + } + + /** + * Update a target audience. + * + *

See {@link #updateGoogleChatTargetAudienceWithHttpInfoAsync}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @param body Target audience payload. (required) + * @return CompletableFuture<GoogleChatTargetAudienceResponse> + */ + public CompletableFuture updateGoogleChatTargetAudienceAsync( + String organizationBindingId, + String targetAudienceId, + GoogleChatTargetAudienceUpdateRequest body) { + return updateGoogleChatTargetAudienceWithHttpInfoAsync( + organizationBindingId, targetAudienceId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a target audience for a Google Chat organization binding in the Datadog Google Chat + * integration. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @param body Target audience payload. (required) + * @return ApiResponse<GoogleChatTargetAudienceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateGoogleChatTargetAudienceWithHttpInfo( + String organizationBindingId, + String targetAudienceId, + GoogleChatTargetAudienceUpdateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " updateGoogleChatTargetAudience"); + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " updateGoogleChatTargetAudience"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateGoogleChatTargetAudience"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.updateGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a target audience. + * + *

See {@link #updateGoogleChatTargetAudienceWithHttpInfo}. + * + * @param organizationBindingId Your organization binding ID. (required) + * @param targetAudienceId Your target audience ID. (required) + * @param body Target audience payload. (required) + * @return CompletableFuture<ApiResponse<GoogleChatTargetAudienceResponse>> + */ + public CompletableFuture> + updateGoogleChatTargetAudienceWithHttpInfoAsync( + String organizationBindingId, + String targetAudienceId, + GoogleChatTargetAudienceUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'organizationBindingId' is set + if (organizationBindingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'organizationBindingId' when calling" + + " updateGoogleChatTargetAudience")); + return result; + } + + // verify the required parameter 'targetAudienceId' is set + if (targetAudienceId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'targetAudienceId' when calling" + + " updateGoogleChatTargetAudience")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateGoogleChatTargetAudience")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}" + .replaceAll( + "\\{" + "organization_binding_id" + "\\}", + apiClient.escapeString(organizationBindingId.toString())) + .replaceAll( + "\\{" + "target_audience_id" + "\\}", + apiClient.escapeString(targetAudienceId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.GoogleChatIntegrationApi.updateGoogleChatTargetAudience", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update organization handle. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserAttributes.java new file mode 100644 index 00000000000..99fb007070a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserAttributes.java @@ -0,0 +1,203 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Google Chat delegated user attributes. */ +@JsonPropertyOrder({ + GoogleChatDelegatedUserAttributes.JSON_PROPERTY_DISPLAY_NAME, + GoogleChatDelegatedUserAttributes.JSON_PROPERTY_EMAIL, + GoogleChatDelegatedUserAttributes.JSON_PROPERTY_FEATURES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatDelegatedUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FEATURES = "features"; + private List features = null; + + public GoogleChatDelegatedUserAttributes displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The delegated user's display name. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public GoogleChatDelegatedUserAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The delegated user's email address. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public GoogleChatDelegatedUserAttributes features(List features) { + this.features = features; + return this; + } + + public GoogleChatDelegatedUserAttributes addFeaturesItem(String featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * The list of features enabled for the delegated user. + * + * @return features + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFeatures() { + return features; + } + + public void setFeatures(List features) { + this.features = features; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatDelegatedUserAttributes + */ + @JsonAnySetter + public GoogleChatDelegatedUserAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatDelegatedUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatDelegatedUserAttributes googleChatDelegatedUserAttributes = + (GoogleChatDelegatedUserAttributes) o; + return Objects.equals(this.displayName, googleChatDelegatedUserAttributes.displayName) + && Objects.equals(this.email, googleChatDelegatedUserAttributes.email) + && Objects.equals(this.features, googleChatDelegatedUserAttributes.features) + && Objects.equals( + this.additionalProperties, googleChatDelegatedUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, features, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatDelegatedUserAttributes {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserData.java new file mode 100644 index 00000000000..3e8d1a00a62 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserData.java @@ -0,0 +1,198 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat delegated user data from a response. */ +@JsonPropertyOrder({ + GoogleChatDelegatedUserData.JSON_PROPERTY_ATTRIBUTES, + GoogleChatDelegatedUserData.JSON_PROPERTY_ID, + GoogleChatDelegatedUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatDelegatedUserData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GoogleChatDelegatedUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatDelegatedUserType type = + GoogleChatDelegatedUserType.GOOGLE_CHAT_DELEGATED_USER_TYPE; + + public GoogleChatDelegatedUserData attributes(GoogleChatDelegatedUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Google Chat delegated user attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatDelegatedUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GoogleChatDelegatedUserAttributes attributes) { + this.attributes = attributes; + } + + public GoogleChatDelegatedUserData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the delegated user. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GoogleChatDelegatedUserData type(GoogleChatDelegatedUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat delegated user resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatDelegatedUserType getType() { + return type; + } + + public void setType(GoogleChatDelegatedUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatDelegatedUserData + */ + @JsonAnySetter + public GoogleChatDelegatedUserData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatDelegatedUserData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatDelegatedUserData googleChatDelegatedUserData = (GoogleChatDelegatedUserData) o; + return Objects.equals(this.attributes, googleChatDelegatedUserData.attributes) + && Objects.equals(this.id, googleChatDelegatedUserData.id) + && Objects.equals(this.type, googleChatDelegatedUserData.type) + && Objects.equals( + this.additionalProperties, googleChatDelegatedUserData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatDelegatedUserData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserResponse.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserResponse.java new file mode 100644 index 00000000000..6e1cb2d716e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserResponse.java @@ -0,0 +1,147 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a Google Chat delegated user. */ +@JsonPropertyOrder({GoogleChatDelegatedUserResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatDelegatedUserResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatDelegatedUserData data; + + public GoogleChatDelegatedUserResponse() {} + + @JsonCreator + public GoogleChatDelegatedUserResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GoogleChatDelegatedUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GoogleChatDelegatedUserResponse data(GoogleChatDelegatedUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Google Chat delegated user data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatDelegatedUserData getData() { + return data; + } + + public void setData(GoogleChatDelegatedUserData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatDelegatedUserResponse + */ + @JsonAnySetter + public GoogleChatDelegatedUserResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatDelegatedUserResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatDelegatedUserResponse googleChatDelegatedUserResponse = + (GoogleChatDelegatedUserResponse) o; + return Objects.equals(this.data, googleChatDelegatedUserResponse.data) + && Objects.equals( + this.additionalProperties, googleChatDelegatedUserResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatDelegatedUserResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserType.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserType.java new file mode 100644 index 00000000000..97c21d2f8ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatDelegatedUserType.java @@ -0,0 +1,57 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Google Chat delegated user resource type. */ +@JsonSerialize(using = GoogleChatDelegatedUserType.GoogleChatDelegatedUserTypeSerializer.class) +public class GoogleChatDelegatedUserType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("google-chat-delegated-user")); + + public static final GoogleChatDelegatedUserType GOOGLE_CHAT_DELEGATED_USER_TYPE = + new GoogleChatDelegatedUserType("google-chat-delegated-user"); + + GoogleChatDelegatedUserType(String value) { + super(value, allowedValues); + } + + public static class GoogleChatDelegatedUserTypeSerializer + extends StdSerializer { + public GoogleChatDelegatedUserTypeSerializer(Class t) { + super(t); + } + + public GoogleChatDelegatedUserTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GoogleChatDelegatedUserType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GoogleChatDelegatedUserType fromValue(String value) { + return new GoogleChatDelegatedUserType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationAttributes.java new file mode 100644 index 00000000000..982394f7042 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationAttributes.java @@ -0,0 +1,166 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat organization attributes. */ +@JsonPropertyOrder({ + GoogleChatOrganizationAttributes.JSON_PROPERTY_DOMAIN_ID, + GoogleChatOrganizationAttributes.JSON_PROPERTY_DOMAIN_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DOMAIN_ID = "domain_id"; + private String domainId; + + public static final String JSON_PROPERTY_DOMAIN_NAME = "domain_name"; + private String domainName; + + public GoogleChatOrganizationAttributes domainId(String domainId) { + this.domainId = domainId; + return this; + } + + /** + * The Google Chat organization domain ID. + * + * @return domainId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public GoogleChatOrganizationAttributes domainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * The Google Chat organization domain name. + * + * @return domainName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDomainName() { + return domainName; + } + + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationAttributes + */ + @JsonAnySetter + public GoogleChatOrganizationAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationAttributes googleChatOrganizationAttributes = + (GoogleChatOrganizationAttributes) o; + return Objects.equals(this.domainId, googleChatOrganizationAttributes.domainId) + && Objects.equals(this.domainName, googleChatOrganizationAttributes.domainName) + && Objects.equals( + this.additionalProperties, googleChatOrganizationAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(domainId, domainName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationAttributes {\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationData.java new file mode 100644 index 00000000000..4b303e44014 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationData.java @@ -0,0 +1,227 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat organization data from a response. */ +@JsonPropertyOrder({ + GoogleChatOrganizationData.JSON_PROPERTY_ATTRIBUTES, + GoogleChatOrganizationData.JSON_PROPERTY_ID, + GoogleChatOrganizationData.JSON_PROPERTY_RELATIONSHIPS, + GoogleChatOrganizationData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GoogleChatOrganizationAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private GoogleChatOrganizationRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatOrganizationType type = + GoogleChatOrganizationType.GOOGLE_CHAT_ORGANIZATION_TYPE; + + public GoogleChatOrganizationData attributes(GoogleChatOrganizationAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Google Chat organization attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatOrganizationAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GoogleChatOrganizationAttributes attributes) { + this.attributes = attributes; + } + + public GoogleChatOrganizationData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the Google Chat organization binding. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GoogleChatOrganizationData relationships( + GoogleChatOrganizationRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Google Chat organization relationships. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatOrganizationRelationships getRelationships() { + return relationships; + } + + public void setRelationships(GoogleChatOrganizationRelationships relationships) { + this.relationships = relationships; + } + + public GoogleChatOrganizationData type(GoogleChatOrganizationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat organization resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatOrganizationType getType() { + return type; + } + + public void setType(GoogleChatOrganizationType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationData + */ + @JsonAnySetter + public GoogleChatOrganizationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationData googleChatOrganizationData = (GoogleChatOrganizationData) o; + return Objects.equals(this.attributes, googleChatOrganizationData.attributes) + && Objects.equals(this.id, googleChatOrganizationData.id) + && Objects.equals(this.relationships, googleChatOrganizationData.relationships) + && Objects.equals(this.type, googleChatOrganizationData.type) + && Objects.equals( + this.additionalProperties, googleChatOrganizationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationships.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationships.java new file mode 100644 index 00000000000..1937651e8c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationships.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat organization relationships. */ +@JsonPropertyOrder({GoogleChatOrganizationRelationships.JSON_PROPERTY_DELEGATED_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DELEGATED_USER = "delegated_user"; + private GoogleChatOrganizationRelationshipsDelegatedUser delegatedUser; + + public GoogleChatOrganizationRelationships delegatedUser( + GoogleChatOrganizationRelationshipsDelegatedUser delegatedUser) { + this.delegatedUser = delegatedUser; + this.unparsed |= delegatedUser.unparsed; + return this; + } + + /** + * The delegated user relationship. + * + * @return delegatedUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELEGATED_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatOrganizationRelationshipsDelegatedUser getDelegatedUser() { + return delegatedUser; + } + + public void setDelegatedUser(GoogleChatOrganizationRelationshipsDelegatedUser delegatedUser) { + this.delegatedUser = delegatedUser; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationRelationships + */ + @JsonAnySetter + public GoogleChatOrganizationRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationRelationships googleChatOrganizationRelationships = + (GoogleChatOrganizationRelationships) o; + return Objects.equals(this.delegatedUser, googleChatOrganizationRelationships.delegatedUser) + && Objects.equals( + this.additionalProperties, googleChatOrganizationRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(delegatedUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationRelationships {\n"); + sb.append(" delegatedUser: ").append(toIndentedString(delegatedUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUser.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUser.java new file mode 100644 index 00000000000..abdf60e87f3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUser.java @@ -0,0 +1,142 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The delegated user relationship. */ +@JsonPropertyOrder({GoogleChatOrganizationRelationshipsDelegatedUser.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationRelationshipsDelegatedUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatOrganizationRelationshipsDelegatedUserData data; + + public GoogleChatOrganizationRelationshipsDelegatedUser data( + GoogleChatOrganizationRelationshipsDelegatedUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Delegated user relationship data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatOrganizationRelationshipsDelegatedUserData getData() { + return data; + } + + public void setData(GoogleChatOrganizationRelationshipsDelegatedUserData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationRelationshipsDelegatedUser + */ + @JsonAnySetter + public GoogleChatOrganizationRelationshipsDelegatedUser putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationRelationshipsDelegatedUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationRelationshipsDelegatedUser + googleChatOrganizationRelationshipsDelegatedUser = + (GoogleChatOrganizationRelationshipsDelegatedUser) o; + return Objects.equals(this.data, googleChatOrganizationRelationshipsDelegatedUser.data) + && Objects.equals( + this.additionalProperties, + googleChatOrganizationRelationshipsDelegatedUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationRelationshipsDelegatedUser {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUserData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUserData.java new file mode 100644 index 00000000000..bd191724e9e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationRelationshipsDelegatedUserData.java @@ -0,0 +1,177 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Delegated user relationship data. */ +@JsonPropertyOrder({ + GoogleChatOrganizationRelationshipsDelegatedUserData.JSON_PROPERTY_ID, + GoogleChatOrganizationRelationshipsDelegatedUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationRelationshipsDelegatedUserData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatDelegatedUserType type = + GoogleChatDelegatedUserType.GOOGLE_CHAT_DELEGATED_USER_TYPE; + + public GoogleChatOrganizationRelationshipsDelegatedUserData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the delegated user. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GoogleChatOrganizationRelationshipsDelegatedUserData type( + GoogleChatDelegatedUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat delegated user resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatDelegatedUserType getType() { + return type; + } + + public void setType(GoogleChatDelegatedUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationRelationshipsDelegatedUserData + */ + @JsonAnySetter + public GoogleChatOrganizationRelationshipsDelegatedUserData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this GoogleChatOrganizationRelationshipsDelegatedUserData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationRelationshipsDelegatedUserData + googleChatOrganizationRelationshipsDelegatedUserData = + (GoogleChatOrganizationRelationshipsDelegatedUserData) o; + return Objects.equals(this.id, googleChatOrganizationRelationshipsDelegatedUserData.id) + && Objects.equals(this.type, googleChatOrganizationRelationshipsDelegatedUserData.type) + && Objects.equals( + this.additionalProperties, + googleChatOrganizationRelationshipsDelegatedUserData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationRelationshipsDelegatedUserData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationResponse.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationResponse.java new file mode 100644 index 00000000000..7e10dc20104 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationResponse.java @@ -0,0 +1,147 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a Google Chat organization binding. */ +@JsonPropertyOrder({GoogleChatOrganizationResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatOrganizationData data; + + public GoogleChatOrganizationResponse() {} + + @JsonCreator + public GoogleChatOrganizationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GoogleChatOrganizationData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GoogleChatOrganizationResponse data(GoogleChatOrganizationData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Google Chat organization data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatOrganizationData getData() { + return data; + } + + public void setData(GoogleChatOrganizationData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationResponse + */ + @JsonAnySetter + public GoogleChatOrganizationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationResponse googleChatOrganizationResponse = + (GoogleChatOrganizationResponse) o; + return Objects.equals(this.data, googleChatOrganizationResponse.data) + && Objects.equals( + this.additionalProperties, googleChatOrganizationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationType.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationType.java new file mode 100644 index 00000000000..3b1f688ab02 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationType.java @@ -0,0 +1,57 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Google Chat organization resource type. */ +@JsonSerialize(using = GoogleChatOrganizationType.GoogleChatOrganizationTypeSerializer.class) +public class GoogleChatOrganizationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("google-chat-organization")); + + public static final GoogleChatOrganizationType GOOGLE_CHAT_ORGANIZATION_TYPE = + new GoogleChatOrganizationType("google-chat-organization"); + + GoogleChatOrganizationType(String value) { + super(value, allowedValues); + } + + public static class GoogleChatOrganizationTypeSerializer + extends StdSerializer { + public GoogleChatOrganizationTypeSerializer(Class t) { + super(t); + } + + public GoogleChatOrganizationTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GoogleChatOrganizationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GoogleChatOrganizationType fromValue(String value) { + return new GoogleChatOrganizationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationsResponse.java new file mode 100644 index 00000000000..eb4c1d83695 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatOrganizationsResponse.java @@ -0,0 +1,157 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of Google Chat organization bindings. */ +@JsonPropertyOrder({GoogleChatOrganizationsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatOrganizationsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GoogleChatOrganizationsResponse() {} + + @JsonCreator + public GoogleChatOrganizationsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public GoogleChatOrganizationsResponse data(List data) { + this.data = data; + for (GoogleChatOrganizationData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GoogleChatOrganizationsResponse addDataItem(GoogleChatOrganizationData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of Google Chat organization bindings. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatOrganizationsResponse + */ + @JsonAnySetter + public GoogleChatOrganizationsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatOrganizationsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatOrganizationsResponse googleChatOrganizationsResponse = + (GoogleChatOrganizationsResponse) o; + return Objects.equals(this.data, googleChatOrganizationsResponse.data) + && Objects.equals( + this.additionalProperties, googleChatOrganizationsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatOrganizationsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceAttributes.java new file mode 100644 index 00000000000..0ea03a1e179 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceAttributes.java @@ -0,0 +1,175 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat target audience attributes. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceAttributes.JSON_PROPERTY_AUDIENCE_ID, + GoogleChatTargetAudienceAttributes.JSON_PROPERTY_AUDIENCE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_ID = "audience_id"; + private String audienceId; + + public static final String JSON_PROPERTY_AUDIENCE_NAME = "audience_name"; + private String audienceName; + + public GoogleChatTargetAudienceAttributes() {} + + @JsonCreator + public GoogleChatTargetAudienceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AUDIENCE_ID) String audienceId, + @JsonProperty(required = true, value = JSON_PROPERTY_AUDIENCE_NAME) String audienceName) { + this.audienceId = audienceId; + this.audienceName = audienceName; + } + + public GoogleChatTargetAudienceAttributes audienceId(String audienceId) { + this.audienceId = audienceId; + return this; + } + + /** + * The audience ID. + * + * @return audienceId + */ + @JsonProperty(JSON_PROPERTY_AUDIENCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAudienceId() { + return audienceId; + } + + public void setAudienceId(String audienceId) { + this.audienceId = audienceId; + } + + public GoogleChatTargetAudienceAttributes audienceName(String audienceName) { + this.audienceName = audienceName; + return this; + } + + /** + * The audience name. + * + * @return audienceName + */ + @JsonProperty(JSON_PROPERTY_AUDIENCE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAudienceName() { + return audienceName; + } + + public void setAudienceName(String audienceName) { + this.audienceName = audienceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceAttributes + */ + @JsonAnySetter + public GoogleChatTargetAudienceAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceAttributes googleChatTargetAudienceAttributes = + (GoogleChatTargetAudienceAttributes) o; + return Objects.equals(this.audienceId, googleChatTargetAudienceAttributes.audienceId) + && Objects.equals(this.audienceName, googleChatTargetAudienceAttributes.audienceName) + && Objects.equals( + this.additionalProperties, googleChatTargetAudienceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceId, audienceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceAttributes {\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" audienceName: ").append(toIndentedString(audienceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequest.java new file mode 100644 index 00000000000..26f606d1416 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequest.java @@ -0,0 +1,149 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Create target audience request. */ +@JsonPropertyOrder({GoogleChatTargetAudienceCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatTargetAudienceCreateRequestData data; + + public GoogleChatTargetAudienceCreateRequest() {} + + @JsonCreator + public GoogleChatTargetAudienceCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GoogleChatTargetAudienceCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GoogleChatTargetAudienceCreateRequest data( + GoogleChatTargetAudienceCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a create target audience request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceCreateRequestData getData() { + return data; + } + + public void setData(GoogleChatTargetAudienceCreateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceCreateRequest + */ + @JsonAnySetter + public GoogleChatTargetAudienceCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceCreateRequest googleChatTargetAudienceCreateRequest = + (GoogleChatTargetAudienceCreateRequest) o; + return Objects.equals(this.data, googleChatTargetAudienceCreateRequest.data) + && Objects.equals( + this.additionalProperties, googleChatTargetAudienceCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestAttributes.java new file mode 100644 index 00000000000..a0569c960cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestAttributes.java @@ -0,0 +1,180 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a Google Chat target audience. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceCreateRequestAttributes.JSON_PROPERTY_AUDIENCE_ID, + GoogleChatTargetAudienceCreateRequestAttributes.JSON_PROPERTY_AUDIENCE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceCreateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_ID = "audience_id"; + private String audienceId; + + public static final String JSON_PROPERTY_AUDIENCE_NAME = "audience_name"; + private String audienceName; + + public GoogleChatTargetAudienceCreateRequestAttributes() {} + + @JsonCreator + public GoogleChatTargetAudienceCreateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AUDIENCE_ID) String audienceId, + @JsonProperty(required = true, value = JSON_PROPERTY_AUDIENCE_NAME) String audienceName) { + this.audienceId = audienceId; + this.audienceName = audienceName; + } + + public GoogleChatTargetAudienceCreateRequestAttributes audienceId(String audienceId) { + this.audienceId = audienceId; + return this; + } + + /** + * The audience ID. + * + * @return audienceId + */ + @JsonProperty(JSON_PROPERTY_AUDIENCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAudienceId() { + return audienceId; + } + + public void setAudienceId(String audienceId) { + this.audienceId = audienceId; + } + + public GoogleChatTargetAudienceCreateRequestAttributes audienceName(String audienceName) { + this.audienceName = audienceName; + return this; + } + + /** + * The audience name. + * + * @return audienceName + */ + @JsonProperty(JSON_PROPERTY_AUDIENCE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAudienceName() { + return audienceName; + } + + public void setAudienceName(String audienceName) { + this.audienceName = audienceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceCreateRequestAttributes + */ + @JsonAnySetter + public GoogleChatTargetAudienceCreateRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceCreateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceCreateRequestAttributes + googleChatTargetAudienceCreateRequestAttributes = + (GoogleChatTargetAudienceCreateRequestAttributes) o; + return Objects.equals( + this.audienceId, googleChatTargetAudienceCreateRequestAttributes.audienceId) + && Objects.equals( + this.audienceName, googleChatTargetAudienceCreateRequestAttributes.audienceName) + && Objects.equals( + this.additionalProperties, + googleChatTargetAudienceCreateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceId, audienceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceCreateRequestAttributes {\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" audienceName: ").append(toIndentedString(audienceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestData.java new file mode 100644 index 00000000000..edb804b4553 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceCreateRequestData.java @@ -0,0 +1,187 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for a create target audience request. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceCreateRequestData.JSON_PROPERTY_ATTRIBUTES, + GoogleChatTargetAudienceCreateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceCreateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GoogleChatTargetAudienceCreateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatTargetAudienceType type = + GoogleChatTargetAudienceType.GOOGLE_CHAT_TARGET_AUDIENCE_TYPE; + + public GoogleChatTargetAudienceCreateRequestData() {} + + @JsonCreator + public GoogleChatTargetAudienceCreateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GoogleChatTargetAudienceCreateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GoogleChatTargetAudienceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GoogleChatTargetAudienceCreateRequestData attributes( + GoogleChatTargetAudienceCreateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a Google Chat target audience. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceCreateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GoogleChatTargetAudienceCreateRequestAttributes attributes) { + this.attributes = attributes; + } + + public GoogleChatTargetAudienceCreateRequestData type(GoogleChatTargetAudienceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat target audience resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceType getType() { + return type; + } + + public void setType(GoogleChatTargetAudienceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceCreateRequestData + */ + @JsonAnySetter + public GoogleChatTargetAudienceCreateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceCreateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceCreateRequestData googleChatTargetAudienceCreateRequestData = + (GoogleChatTargetAudienceCreateRequestData) o; + return Objects.equals(this.attributes, googleChatTargetAudienceCreateRequestData.attributes) + && Objects.equals(this.type, googleChatTargetAudienceCreateRequestData.type) + && Objects.equals( + this.additionalProperties, + googleChatTargetAudienceCreateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceCreateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceData.java new file mode 100644 index 00000000000..756a8a12ef6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceData.java @@ -0,0 +1,198 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Google Chat target audience data from a response. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceData.JSON_PROPERTY_ATTRIBUTES, + GoogleChatTargetAudienceData.JSON_PROPERTY_ID, + GoogleChatTargetAudienceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GoogleChatTargetAudienceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatTargetAudienceType type = + GoogleChatTargetAudienceType.GOOGLE_CHAT_TARGET_AUDIENCE_TYPE; + + public GoogleChatTargetAudienceData attributes(GoogleChatTargetAudienceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Google Chat target audience attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatTargetAudienceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GoogleChatTargetAudienceAttributes attributes) { + this.attributes = attributes; + } + + public GoogleChatTargetAudienceData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the target audience. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GoogleChatTargetAudienceData type(GoogleChatTargetAudienceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat target audience resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GoogleChatTargetAudienceType getType() { + return type; + } + + public void setType(GoogleChatTargetAudienceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceData + */ + @JsonAnySetter + public GoogleChatTargetAudienceData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceData googleChatTargetAudienceData = (GoogleChatTargetAudienceData) o; + return Objects.equals(this.attributes, googleChatTargetAudienceData.attributes) + && Objects.equals(this.id, googleChatTargetAudienceData.id) + && Objects.equals(this.type, googleChatTargetAudienceData.type) + && Objects.equals( + this.additionalProperties, googleChatTargetAudienceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceResponse.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceResponse.java new file mode 100644 index 00000000000..67c29825fc0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceResponse.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a Google Chat target audience. */ +@JsonPropertyOrder({GoogleChatTargetAudienceResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatTargetAudienceData data; + + public GoogleChatTargetAudienceResponse() {} + + @JsonCreator + public GoogleChatTargetAudienceResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GoogleChatTargetAudienceData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GoogleChatTargetAudienceResponse data(GoogleChatTargetAudienceData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Google Chat target audience data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceData getData() { + return data; + } + + public void setData(GoogleChatTargetAudienceData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceResponse + */ + @JsonAnySetter + public GoogleChatTargetAudienceResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceResponse googleChatTargetAudienceResponse = + (GoogleChatTargetAudienceResponse) o; + return Objects.equals(this.data, googleChatTargetAudienceResponse.data) + && Objects.equals( + this.additionalProperties, googleChatTargetAudienceResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceType.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceType.java new file mode 100644 index 00000000000..4e84ef49208 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceType.java @@ -0,0 +1,57 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Google Chat target audience resource type. */ +@JsonSerialize(using = GoogleChatTargetAudienceType.GoogleChatTargetAudienceTypeSerializer.class) +public class GoogleChatTargetAudienceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("google-chat-target-audience")); + + public static final GoogleChatTargetAudienceType GOOGLE_CHAT_TARGET_AUDIENCE_TYPE = + new GoogleChatTargetAudienceType("google-chat-target-audience"); + + GoogleChatTargetAudienceType(String value) { + super(value, allowedValues); + } + + public static class GoogleChatTargetAudienceTypeSerializer + extends StdSerializer { + public GoogleChatTargetAudienceTypeSerializer(Class t) { + super(t); + } + + public GoogleChatTargetAudienceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GoogleChatTargetAudienceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GoogleChatTargetAudienceType fromValue(String value) { + return new GoogleChatTargetAudienceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequest.java new file mode 100644 index 00000000000..40e58d4fea4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequest.java @@ -0,0 +1,149 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update target audience request. */ +@JsonPropertyOrder({GoogleChatTargetAudienceUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleChatTargetAudienceUpdateRequestData data; + + public GoogleChatTargetAudienceUpdateRequest() {} + + @JsonCreator + public GoogleChatTargetAudienceUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GoogleChatTargetAudienceUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GoogleChatTargetAudienceUpdateRequest data( + GoogleChatTargetAudienceUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for an update target audience request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceUpdateRequestData getData() { + return data; + } + + public void setData(GoogleChatTargetAudienceUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceUpdateRequest + */ + @JsonAnySetter + public GoogleChatTargetAudienceUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceUpdateRequest googleChatTargetAudienceUpdateRequest = + (GoogleChatTargetAudienceUpdateRequest) o; + return Objects.equals(this.data, googleChatTargetAudienceUpdateRequest.data) + && Objects.equals( + this.additionalProperties, googleChatTargetAudienceUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestAttributes.java new file mode 100644 index 00000000000..05290941275 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestAttributes.java @@ -0,0 +1,171 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a Google Chat target audience. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceUpdateRequestAttributes.JSON_PROPERTY_AUDIENCE_ID, + GoogleChatTargetAudienceUpdateRequestAttributes.JSON_PROPERTY_AUDIENCE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceUpdateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUDIENCE_ID = "audience_id"; + private String audienceId; + + public static final String JSON_PROPERTY_AUDIENCE_NAME = "audience_name"; + private String audienceName; + + public GoogleChatTargetAudienceUpdateRequestAttributes audienceId(String audienceId) { + this.audienceId = audienceId; + return this; + } + + /** + * The audience ID. + * + * @return audienceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUDIENCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudienceId() { + return audienceId; + } + + public void setAudienceId(String audienceId) { + this.audienceId = audienceId; + } + + public GoogleChatTargetAudienceUpdateRequestAttributes audienceName(String audienceName) { + this.audienceName = audienceName; + return this; + } + + /** + * The audience name. + * + * @return audienceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUDIENCE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAudienceName() { + return audienceName; + } + + public void setAudienceName(String audienceName) { + this.audienceName = audienceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceUpdateRequestAttributes + */ + @JsonAnySetter + public GoogleChatTargetAudienceUpdateRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceUpdateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceUpdateRequestAttributes + googleChatTargetAudienceUpdateRequestAttributes = + (GoogleChatTargetAudienceUpdateRequestAttributes) o; + return Objects.equals( + this.audienceId, googleChatTargetAudienceUpdateRequestAttributes.audienceId) + && Objects.equals( + this.audienceName, googleChatTargetAudienceUpdateRequestAttributes.audienceName) + && Objects.equals( + this.additionalProperties, + googleChatTargetAudienceUpdateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audienceId, audienceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceUpdateRequestAttributes {\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" audienceName: ").append(toIndentedString(audienceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestData.java new file mode 100644 index 00000000000..05a5dfa92a3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudienceUpdateRequestData.java @@ -0,0 +1,187 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for an update target audience request. */ +@JsonPropertyOrder({ + GoogleChatTargetAudienceUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + GoogleChatTargetAudienceUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudienceUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GoogleChatTargetAudienceUpdateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GoogleChatTargetAudienceType type = + GoogleChatTargetAudienceType.GOOGLE_CHAT_TARGET_AUDIENCE_TYPE; + + public GoogleChatTargetAudienceUpdateRequestData() {} + + @JsonCreator + public GoogleChatTargetAudienceUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GoogleChatTargetAudienceUpdateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GoogleChatTargetAudienceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GoogleChatTargetAudienceUpdateRequestData attributes( + GoogleChatTargetAudienceUpdateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a Google Chat target audience. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceUpdateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GoogleChatTargetAudienceUpdateRequestAttributes attributes) { + this.attributes = attributes; + } + + public GoogleChatTargetAudienceUpdateRequestData type(GoogleChatTargetAudienceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Google Chat target audience resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleChatTargetAudienceType getType() { + return type; + } + + public void setType(GoogleChatTargetAudienceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudienceUpdateRequestData + */ + @JsonAnySetter + public GoogleChatTargetAudienceUpdateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudienceUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudienceUpdateRequestData googleChatTargetAudienceUpdateRequestData = + (GoogleChatTargetAudienceUpdateRequestData) o; + return Objects.equals(this.attributes, googleChatTargetAudienceUpdateRequestData.attributes) + && Objects.equals(this.type, googleChatTargetAudienceUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, + googleChatTargetAudienceUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudienceUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudiencesResponse.java b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudiencesResponse.java new file mode 100644 index 00000000000..487f35d7728 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleChatTargetAudiencesResponse.java @@ -0,0 +1,157 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of Google Chat target audiences. */ +@JsonPropertyOrder({GoogleChatTargetAudiencesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleChatTargetAudiencesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GoogleChatTargetAudiencesResponse() {} + + @JsonCreator + public GoogleChatTargetAudiencesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public GoogleChatTargetAudiencesResponse data(List data) { + this.data = data; + for (GoogleChatTargetAudienceData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GoogleChatTargetAudiencesResponse addDataItem(GoogleChatTargetAudienceData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of Google Chat target audiences. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleChatTargetAudiencesResponse + */ + @JsonAnySetter + public GoogleChatTargetAudiencesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GoogleChatTargetAudiencesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleChatTargetAudiencesResponse googleChatTargetAudiencesResponse = + (GoogleChatTargetAudiencesResponse) o; + return Objects.equals(this.data, googleChatTargetAudiencesResponse.data) + && Objects.equals( + this.additionalProperties, googleChatTargetAudiencesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleChatTargetAudiencesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 097f6a07d55..4936788356b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/google_chat_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/google_chat_integration.feature index f722a7ea208..65c1f264a6b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/google_chat_integration.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a2ff6ce184c..56dde3dce0a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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": {