From 36655b8dc1123b870cce426db1a5ccd0ac915faa Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 3 Mar 2026 08:31:50 +0000 Subject: [PATCH] Regenerate client from commit 199c222 of spec repo --- .generator/schemas/v2/openapi.yaml | 702 +++++++++ .../v2/events/CreateEventEmailAddress.java | 46 + .../events/CreateOnCallEventEmailAddress.java | 45 + .../v2/events/DeleteEventEmailAddress.java | 24 + .../events/DeleteOnCallEventEmailAddress.java | 25 + examples/v2/events/GetEventEmailAddress.java | 27 + .../v2/events/ListEventEmailAddresses.java | 25 + .../events/ListOnCallEventEmailAddresses.java | 25 + .../v2/events/UpdateEventEmailAddress.java | 47 + .../com/datadog/api/client/ApiClient.java | 8 + .../datadog/api/client/v2/api/EventsApi.java | 1379 ++++++++++++++++- .../v2/model/EventEmailAddressAlertType.java | 60 + .../EventEmailAddressCreateAttributes.java | 282 ++++ .../v2/model/EventEmailAddressCreateData.java | 183 +++ .../model/EventEmailAddressCreateRequest.java | 147 ++ ...ventEmailAddressCreatedByRelationship.java | 147 ++ .../v2/model/EventEmailAddressData.java | 241 +++ .../v2/model/EventEmailAddressFormat.java | 58 + .../model/EventEmailAddressIncludedUser.java | 206 +++ ...entEmailAddressIncludedUserAttributes.java | 146 ++ .../model/EventEmailAddressRelationships.java | 192 +++ .../model/EventEmailAddressResourceType.java | 57 + .../EventEmailAddressResponseAttributes.java | 434 ++++++ ...ventEmailAddressRevokedByRelationship.java | 138 ++ .../EventEmailAddressSingleResponse.java | 191 +++ .../EventEmailAddressUpdateAttributes.java | 253 +++ .../v2/model/EventEmailAddressUpdateData.java | 183 +++ .../model/EventEmailAddressUpdateRequest.java | 147 ++ .../v2/model/EventEmailAddressUserData.java | 174 +++ .../v2/model/EventEmailAddressesResponse.java | 196 +++ ...CallEventEmailAddressCreateAttributes.java | 277 ++++ .../OnCallEventEmailAddressCreateData.java | 185 +++ .../OnCallEventEmailAddressCreateRequest.java | 148 ++ .../datadog/api/client/v2/api/events.feature | 162 ++ .../com/datadog/api/client/v2/api/undo.json | 62 + 35 files changed, 6596 insertions(+), 26 deletions(-) create mode 100644 examples/v2/events/CreateEventEmailAddress.java create mode 100644 examples/v2/events/CreateOnCallEventEmailAddress.java create mode 100644 examples/v2/events/DeleteEventEmailAddress.java create mode 100644 examples/v2/events/DeleteOnCallEventEmailAddress.java create mode 100644 examples/v2/events/GetEventEmailAddress.java create mode 100644 examples/v2/events/ListEventEmailAddresses.java create mode 100644 examples/v2/events/ListOnCallEventEmailAddresses.java create mode 100644 examples/v2/events/UpdateEventEmailAddress.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressAlertType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreatedByRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressFormat.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUser.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUserAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRevokedByRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressSingleResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUserData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/EventEmailAddressesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateRequest.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5b151db2a84..af90ad1cb93 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23771,6 +23771,299 @@ components: the default subdomain. type: string type: object + EventEmailAddressAlertType: + description: The alert type of events generated from the email address. + enum: + - info + - warn + - error + - success + example: info + type: string + x-enum-varnames: + - INFO + - WARN + - ERROR + - SUCCESS + EventEmailAddressCreateAttributes: + description: Attributes for creating an event email address. + properties: + alert_type: + $ref: '#/components/schemas/EventEmailAddressAlertType' + description: + description: A description of the event email address. + example: Email address for production alerts. + maxLength: 1024 + type: string + format: + $ref: '#/components/schemas/EventEmailAddressFormat' + notify_handles: + $ref: '#/components/schemas/EventEmailAddressNotifyHandles' + tags: + $ref: '#/components/schemas/EventEmailAddressTags' + required: + - format + type: object + EventEmailAddressCreateData: + description: Data for creating an event email address. + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressCreateAttributes' + type: + $ref: '#/components/schemas/EventEmailAddressResourceType' + required: + - type + - attributes + type: object + EventEmailAddressCreateRequest: + description: Request body for creating an event email address. + properties: + data: + $ref: '#/components/schemas/EventEmailAddressCreateData' + required: + - data + type: object + EventEmailAddressCreatedByRelationship: + description: Relationship to the user who created the email address. + properties: + data: + $ref: '#/components/schemas/EventEmailAddressUserData' + required: + - data + type: object + EventEmailAddressData: + description: A single event email address resource. + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressResponseAttributes' + id: + description: The UUID of the event email address. + example: 00000000-0000-0000-0000-000000000001 + type: string + relationships: + $ref: '#/components/schemas/EventEmailAddressRelationships' + type: + $ref: '#/components/schemas/EventEmailAddressResourceType' + required: + - type + - id + - attributes + - relationships + type: object + EventEmailAddressFormat: + description: The format of events ingested through the email address. + enum: + - json + - plain-text + example: json + type: string + x-enum-varnames: + - JSON + - PLAIN_TEXT + EventEmailAddressIncludedUser: + description: An included user resource in an event email address response. + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressIncludedUserAttributes' + id: + description: The UUID of the user. + example: 00000000-0000-0000-0000-000000000001 + type: string + type: + description: The type of the resource. + example: users + type: string + required: + - type + - id + - attributes + type: object + EventEmailAddressIncludedUserAttributes: + description: Attributes of an included user resource. + properties: + name: + description: The name of the user. + example: John Doe + type: string + required: + - name + type: object + EventEmailAddressNotifyHandles: + description: A list of handles to notify when an email is received. + example: + - '@slack-my-channel' + items: + description: A notification handle. + maxLength: 256 + minLength: 1 + type: string + maxItems: 10 + type: array + EventEmailAddressRelationships: + description: Relationships associated with an event email address resource. + properties: + created_by: + $ref: '#/components/schemas/EventEmailAddressCreatedByRelationship' + revoked_by: + $ref: '#/components/schemas/EventEmailAddressRevokedByRelationship' + required: + - created_by + type: object + EventEmailAddressResourceType: + description: The type of the resource. Must be `event_emails`. + enum: + - event_emails + example: event_emails + type: string + x-enum-varnames: + - EVENT_EMAILS + EventEmailAddressResponseAttributes: + description: Attributes of an event email address resource. + properties: + alert_type: + $ref: '#/components/schemas/EventEmailAddressAlertType' + created_at: + description: The timestamp of when the event email address was created. + example: '2025-04-11T13:58:07Z' + format: date-time + type: string + description: + description: A description of the event email address. + example: Email address for production alerts. + maxLength: 1024 + nullable: true + type: string + email: + description: The generated email address for ingesting events. + example: api-abc12345@event-intake.datadoghq.com + type: string + format: + $ref: '#/components/schemas/EventEmailAddressFormat' + last_used_at: + description: The timestamp of when the event email address was last used. + example: null + format: date-time + nullable: true + type: string + notify_handles: + $ref: '#/components/schemas/EventEmailAddressNotifyHandles' + revoked_at: + description: The timestamp of when the event email address was revoked. + example: null + format: date-time + nullable: true + type: string + tags: + $ref: '#/components/schemas/EventEmailAddressTags' + required: + - email + - format + - created_at + type: object + EventEmailAddressRevokedByRelationship: + description: Relationship to the user who revoked the email address. + example: null + nullable: true + properties: + data: + $ref: '#/components/schemas/EventEmailAddressUserData' + type: object + EventEmailAddressSingleResponse: + description: Response containing a single event email address. + properties: + data: + $ref: '#/components/schemas/EventEmailAddressData' + included: + description: Related resources included in the response. + items: + $ref: '#/components/schemas/EventEmailAddressIncludedUser' + type: array + required: + - data + type: object + EventEmailAddressTags: + description: A list of tags to apply to events generated from the email address. + example: + - env:production + - team:my-team + items: + description: A tag. + maxLength: 200 + minLength: 1 + type: string + maxItems: 20 + type: array + EventEmailAddressUpdateAttributes: + description: Attributes for updating an event email address. + properties: + alert_type: + $ref: '#/components/schemas/EventEmailAddressAlertType' + description: + description: A description of the event email address. + example: Updated description for the email address. + maxLength: 1024 + nullable: true + type: string + notify_handles: + $ref: '#/components/schemas/EventEmailAddressNotifyHandles' + tags: + $ref: '#/components/schemas/EventEmailAddressTags' + required: + - description + - alert_type + - tags + - notify_handles + type: object + EventEmailAddressUpdateData: + description: Data for updating an event email address. + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressUpdateAttributes' + type: + $ref: '#/components/schemas/EventEmailAddressResourceType' + required: + - type + - attributes + type: object + EventEmailAddressUpdateRequest: + description: Request body for updating an event email address. + properties: + data: + $ref: '#/components/schemas/EventEmailAddressUpdateData' + required: + - data + type: object + EventEmailAddressUserData: + description: A user data reference in a relationship. + properties: + id: + description: The UUID of the user. + example: 00000000-0000-0000-0000-000000000001 + type: string + type: + description: The type of the resource. + example: users + type: string + required: + - type + - id + type: object + EventEmailAddressesResponse: + description: Response containing a list of event email addresses. + properties: + data: + description: A list of event email address resources. + items: + $ref: '#/components/schemas/EventEmailAddressData' + type: array + included: + description: Related resources included in the response. + items: + $ref: '#/components/schemas/EventEmailAddressIncludedUser' + type: array + required: + - data + type: object EventPayload: additionalProperties: false description: Event attributes. @@ -45607,6 +45900,50 @@ components: required: - type type: object + OnCallEventEmailAddressCreateAttributes: + description: Attributes for creating an on-call event email address. + properties: + alert_type: + $ref: '#/components/schemas/EventEmailAddressAlertType' + description: + description: A description of the on-call event email address. + example: On-call email address for my team. + maxLength: 1024 + type: string + format: + $ref: '#/components/schemas/EventEmailAddressFormat' + tags: + $ref: '#/components/schemas/EventEmailAddressTags' + team_handle: + description: 'The team handle associated with the on-call email address. + + Must contain only alphanumeric characters, hyphens, and underscores.' + example: my-team + maxLength: 195 + type: string + required: + - format + - team_handle + type: object + OnCallEventEmailAddressCreateData: + description: Data for creating an on-call event email address. + properties: + attributes: + $ref: '#/components/schemas/OnCallEventEmailAddressCreateAttributes' + type: + $ref: '#/components/schemas/EventEmailAddressResourceType' + required: + - type + - attributes + type: object + OnCallEventEmailAddressCreateRequest: + description: Request body for creating an on-call event email address. + properties: + data: + $ref: '#/components/schemas/OnCallEventEmailAddressCreateData' + required: + - data + type: object OnCallNotificationRule: description: A top-level wrapper for a notification rule example: @@ -82017,6 +82354,371 @@ paths: tags: - Events x-codegen-request-body-name: body + /api/v2/events/mail: + get: + description: List all API email addresses for your organization. + operationId: ListEventEmailAddresses + parameters: + - description: When set to `true`, returns only active (non-revoked) email addresses. + in: query + name: active + required: false + schema: + type: boolean + - description: 'Comma-separated list of related resources to include in the + response. + + Supported values are `created_by` and `revoked_by`.' + in: query + name: include + required: false + schema: + example: created_by,revoked_by + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List event email addresses + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new API email address to use in an event email integration + rule. + operationId: CreateEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressSingleResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '405': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Method Not Allowed + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/events/mail/on-call: + get: + description: List all on-call event email addresses for a given team handle. + operationId: ListOnCallEventEmailAddresses + parameters: + - description: The team handle to filter on-call event email addresses. + in: query + name: filter[team_handle] + required: true + schema: + example: my-team + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List on-call event email addresses + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new on-call event email address associated with a team + handle. + operationId: CreateOnCallEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OnCallEventEmailAddressCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressSingleResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/events/mail/on-call/{id}: + delete: + description: Revoke an existing on-call event email address in your organization. + operationId: DeleteOnCallEventEmailAddress + parameters: + - description: The UUID of the on-call event email address. + in: path + name: id + required: true + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Revoke an on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/events/mail/{email_uuid}: + delete: + description: Revoke an existing API email address in your organization. + operationId: DeleteEventEmailAddress + parameters: + - description: The UUID of the event email address. + in: path + name: email_uuid + required: true + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Revoke an event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a single API email address for your organization. + operationId: GetEventEmailAddress + parameters: + - description: The UUID of the event email address. + in: path + name: email_uuid + required: true + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressSingleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get an event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing API email address in your organization. + operationId: UpdateEventEmailAddress + parameters: + - description: The UUID of the event email address. + in: path + name: email_uuid + required: true + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressSingleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update an event email address + tags: + - Events + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/events/search: post: description: 'List endpoint returns events that match an events search query. diff --git a/examples/v2/events/CreateEventEmailAddress.java b/examples/v2/events/CreateEventEmailAddress.java new file mode 100644 index 00000000000..62d3f887ae9 --- /dev/null +++ b/examples/v2/events/CreateEventEmailAddress.java @@ -0,0 +1,46 @@ +// Create an event email address returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressAlertType; +import com.datadog.api.client.v2.model.EventEmailAddressCreateAttributes; +import com.datadog.api.client.v2.model.EventEmailAddressCreateData; +import com.datadog.api.client.v2.model.EventEmailAddressCreateRequest; +import com.datadog.api.client.v2.model.EventEmailAddressFormat; +import com.datadog.api.client.v2.model.EventEmailAddressResourceType; +import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + EventEmailAddressCreateRequest body = + new EventEmailAddressCreateRequest() + .data( + new EventEmailAddressCreateData() + .attributes( + new EventEmailAddressCreateAttributes() + .alertType(EventEmailAddressAlertType.INFO) + .description("Email address for production alerts.") + .format(EventEmailAddressFormat.JSON) + .notifyHandles(Collections.singletonList("@slack-my-channel")) + .tags(Arrays.asList("env:production", "team:my-team"))) + .type(EventEmailAddressResourceType.EVENT_EMAILS)); + + try { + EventEmailAddressSingleResponse result = apiInstance.createEventEmailAddress(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#createEventEmailAddress"); + 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/events/CreateOnCallEventEmailAddress.java b/examples/v2/events/CreateOnCallEventEmailAddress.java new file mode 100644 index 00000000000..7978417e2d0 --- /dev/null +++ b/examples/v2/events/CreateOnCallEventEmailAddress.java @@ -0,0 +1,45 @@ +// Create an on-call event email address returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressAlertType; +import com.datadog.api.client.v2.model.EventEmailAddressFormat; +import com.datadog.api.client.v2.model.EventEmailAddressResourceType; +import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse; +import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateAttributes; +import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateData; +import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateRequest; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createOnCallEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + OnCallEventEmailAddressCreateRequest body = + new OnCallEventEmailAddressCreateRequest() + .data( + new OnCallEventEmailAddressCreateData() + .attributes( + new OnCallEventEmailAddressCreateAttributes() + .alertType(EventEmailAddressAlertType.INFO) + .description("On-call email address for my team.") + .format(EventEmailAddressFormat.JSON) + .tags(Arrays.asList("env:production", "team:my-team")) + .teamHandle("my-team")) + .type(EventEmailAddressResourceType.EVENT_EMAILS)); + + try { + EventEmailAddressSingleResponse result = apiInstance.createOnCallEventEmailAddress(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#createOnCallEventEmailAddress"); + 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/events/DeleteEventEmailAddress.java b/examples/v2/events/DeleteEventEmailAddress.java new file mode 100644 index 00000000000..46947e669b5 --- /dev/null +++ b/examples/v2/events/DeleteEventEmailAddress.java @@ -0,0 +1,24 @@ +// Revoke an event email address returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + try { + apiInstance.deleteEventEmailAddress(UUID.fromString("00000000-0000-0000-0000-000000000001")); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#deleteEventEmailAddress"); + 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/events/DeleteOnCallEventEmailAddress.java b/examples/v2/events/DeleteOnCallEventEmailAddress.java new file mode 100644 index 00000000000..a85962d19c6 --- /dev/null +++ b/examples/v2/events/DeleteOnCallEventEmailAddress.java @@ -0,0 +1,25 @@ +// Revoke an on-call event email address returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteOnCallEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + try { + apiInstance.deleteOnCallEventEmailAddress( + UUID.fromString("00000000-0000-0000-0000-000000000001")); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#deleteOnCallEventEmailAddress"); + 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/events/GetEventEmailAddress.java b/examples/v2/events/GetEventEmailAddress.java new file mode 100644 index 00000000000..1ec20f2be39 --- /dev/null +++ b/examples/v2/events/GetEventEmailAddress.java @@ -0,0 +1,27 @@ +// Get an event email address returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + try { + EventEmailAddressSingleResponse result = + apiInstance.getEventEmailAddress(UUID.fromString("00000000-0000-0000-0000-000000000001")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#getEventEmailAddress"); + 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/events/ListEventEmailAddresses.java b/examples/v2/events/ListEventEmailAddresses.java new file mode 100644 index 00000000000..a30390e0264 --- /dev/null +++ b/examples/v2/events/ListEventEmailAddresses.java @@ -0,0 +1,25 @@ +// List event email addresses returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listEventEmailAddresses", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + try { + EventEmailAddressesResponse result = apiInstance.listEventEmailAddresses(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#listEventEmailAddresses"); + 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/events/ListOnCallEventEmailAddresses.java b/examples/v2/events/ListOnCallEventEmailAddresses.java new file mode 100644 index 00000000000..8ad4ea2530b --- /dev/null +++ b/examples/v2/events/ListOnCallEventEmailAddresses.java @@ -0,0 +1,25 @@ +// List on-call event email addresses returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listOnCallEventEmailAddresses", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + try { + EventEmailAddressesResponse result = apiInstance.listOnCallEventEmailAddresses("my-team"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#listOnCallEventEmailAddresses"); + 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/events/UpdateEventEmailAddress.java b/examples/v2/events/UpdateEventEmailAddress.java new file mode 100644 index 00000000000..4c6be7fc4b6 --- /dev/null +++ b/examples/v2/events/UpdateEventEmailAddress.java @@ -0,0 +1,47 @@ +// Update an event email address returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.EventsApi; +import com.datadog.api.client.v2.model.EventEmailAddressAlertType; +import com.datadog.api.client.v2.model.EventEmailAddressResourceType; +import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse; +import com.datadog.api.client.v2.model.EventEmailAddressUpdateAttributes; +import com.datadog.api.client.v2.model.EventEmailAddressUpdateData; +import com.datadog.api.client.v2.model.EventEmailAddressUpdateRequest; +import java.util.Arrays; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateEventEmailAddress", true); + EventsApi apiInstance = new EventsApi(defaultClient); + + EventEmailAddressUpdateRequest body = + new EventEmailAddressUpdateRequest() + .data( + new EventEmailAddressUpdateData() + .attributes( + new EventEmailAddressUpdateAttributes() + .alertType(EventEmailAddressAlertType.INFO) + .description("Updated description for the email address.") + .notifyHandles(Collections.singletonList("@slack-my-channel")) + .tags(Arrays.asList("env:production", "team:my-team"))) + .type(EventEmailAddressResourceType.EVENT_EMAILS)); + + try { + EventEmailAddressSingleResponse result = + apiInstance.updateEventEmailAddress( + UUID.fromString("00000000-0000-0000-0000-000000000001"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#updateEventEmailAddress"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index e5a488f9638..e9d59b2941b 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -833,6 +833,14 @@ public class ApiClient { put("v2.getDeploymentRule", false); put("v2.updateDeploymentGate", false); put("v2.updateDeploymentRule", false); + put("v2.createEventEmailAddress", false); + put("v2.createOnCallEventEmailAddress", false); + put("v2.deleteEventEmailAddress", false); + put("v2.deleteOnCallEventEmailAddress", false); + put("v2.getEventEmailAddress", false); + put("v2.listEventEmailAddresses", false); + put("v2.listOnCallEventEmailAddresses", false); + put("v2.updateEventEmailAddress", false); put("v2.createHamrOrgConnection", false); put("v2.getHamrOrgConnection", false); put("v2.createGlobalIncidentHandle", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java index 7a8cfbce750..2979f43f37e 100644 --- a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java @@ -7,11 +7,16 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.EventCreateRequestPayload; import com.datadog.api.client.v2.model.EventCreateResponsePayload; +import com.datadog.api.client.v2.model.EventEmailAddressCreateRequest; +import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse; +import com.datadog.api.client.v2.model.EventEmailAddressUpdateRequest; +import com.datadog.api.client.v2.model.EventEmailAddressesResponse; import com.datadog.api.client.v2.model.EventResponse; import com.datadog.api.client.v2.model.EventsListRequest; import com.datadog.api.client.v2.model.EventsListResponse; import com.datadog.api.client.v2.model.EventsRequestPage; import com.datadog.api.client.v2.model.EventsSort; +import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateRequest; import com.datadog.api.client.v2.model.V2EventResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -20,6 +25,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @jakarta.annotation.Generated( @@ -200,6 +206,618 @@ public CompletableFuture> createEventWit new GenericType() {}); } + /** + * Create an event email address. + * + *

See {@link #createEventEmailAddressWithHttpInfo}. + * + * @param body (required) + * @return EventEmailAddressSingleResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressSingleResponse createEventEmailAddress( + EventEmailAddressCreateRequest body) throws ApiException { + return createEventEmailAddressWithHttpInfo(body).getData(); + } + + /** + * Create an event email address. + * + *

See {@link #createEventEmailAddressWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<EventEmailAddressSingleResponse> + */ + public CompletableFuture createEventEmailAddressAsync( + EventEmailAddressCreateRequest body) { + return createEventEmailAddressWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new API email address to use in an event email integration rule. + * + * @param body (required) + * @return ApiResponse<EventEmailAddressSingleResponse> + * @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 -
405 Method Not Allowed -
429 Too many requests -
+ */ + public ApiResponse createEventEmailAddressWithHttpInfo( + EventEmailAddressCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createEventEmailAddress"); + } + // create path and map variables + String localVarPath = "/api/v2/events/mail"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.createEventEmailAddress", + 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 an event email address. + * + *

See {@link #createEventEmailAddressWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<EventEmailAddressSingleResponse>> + */ + public CompletableFuture> + createEventEmailAddressWithHttpInfoAsync(EventEmailAddressCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // 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 createEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/events/mail"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.createEventEmailAddress", + 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 an on-call event email address. + * + *

See {@link #createOnCallEventEmailAddressWithHttpInfo}. + * + * @param body (required) + * @return EventEmailAddressSingleResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressSingleResponse createOnCallEventEmailAddress( + OnCallEventEmailAddressCreateRequest body) throws ApiException { + return createOnCallEventEmailAddressWithHttpInfo(body).getData(); + } + + /** + * Create an on-call event email address. + * + *

See {@link #createOnCallEventEmailAddressWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<EventEmailAddressSingleResponse> + */ + public CompletableFuture createOnCallEventEmailAddressAsync( + OnCallEventEmailAddressCreateRequest body) { + return createOnCallEventEmailAddressWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new on-call event email address associated with a team handle. + * + * @param body (required) + * @return ApiResponse<EventEmailAddressSingleResponse> + * @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 -
429 Too many requests -
+ */ + public ApiResponse createOnCallEventEmailAddressWithHttpInfo( + OnCallEventEmailAddressCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createOnCallEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createOnCallEventEmailAddress"); + } + // create path and map variables + String localVarPath = "/api/v2/events/mail/on-call"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.createOnCallEventEmailAddress", + 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 an on-call event email address. + * + *

See {@link #createOnCallEventEmailAddressWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<EventEmailAddressSingleResponse>> + */ + public CompletableFuture> + createOnCallEventEmailAddressWithHttpInfoAsync(OnCallEventEmailAddressCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createOnCallEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // 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 createOnCallEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/events/mail/on-call"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.createOnCallEventEmailAddress", + 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() {}); + } + + /** + * Revoke an event email address. + * + *

See {@link #deleteEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @throws ApiException if fails to make API call + */ + public void deleteEventEmailAddress(UUID emailUuid) throws ApiException { + deleteEventEmailAddressWithHttpInfo(emailUuid); + } + + /** + * Revoke an event email address. + * + *

See {@link #deleteEventEmailAddressWithHttpInfoAsync}. + * + * @param emailUuid The UUID of the event email address. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteEventEmailAddressAsync(UUID emailUuid) { + return deleteEventEmailAddressWithHttpInfoAsync(emailUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Revoke an existing API email address in your organization. + * + * @param emailUuid The UUID of the event email address. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteEventEmailAddressWithHttpInfo(UUID emailUuid) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'emailUuid' when calling deleteEventEmailAddress"); + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.deleteEventEmailAddress", + 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); + } + + /** + * Revoke an event email address. + * + *

See {@link #deleteEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteEventEmailAddressWithHttpInfoAsync( + UUID emailUuid) { + // Check if unstable operation is enabled + String operationId = "deleteEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'emailUuid' when calling deleteEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.deleteEventEmailAddress", + 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); + } + + /** + * Revoke an on-call event email address. + * + *

See {@link #deleteOnCallEventEmailAddressWithHttpInfo}. + * + * @param id The UUID of the on-call event email address. (required) + * @throws ApiException if fails to make API call + */ + public void deleteOnCallEventEmailAddress(UUID id) throws ApiException { + deleteOnCallEventEmailAddressWithHttpInfo(id); + } + + /** + * Revoke an on-call event email address. + * + *

See {@link #deleteOnCallEventEmailAddressWithHttpInfoAsync}. + * + * @param id The UUID of the on-call event email address. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteOnCallEventEmailAddressAsync(UUID id) { + return deleteOnCallEventEmailAddressWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Revoke an existing on-call event email address in your organization. + * + * @param id The UUID of the on-call event email address. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteOnCallEventEmailAddressWithHttpInfo(UUID id) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteOnCallEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteOnCallEventEmailAddress"); + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/on-call/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.deleteOnCallEventEmailAddress", + 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); + } + + /** + * Revoke an on-call event email address. + * + *

See {@link #deleteOnCallEventEmailAddressWithHttpInfo}. + * + * @param id The UUID of the on-call event email address. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteOnCallEventEmailAddressWithHttpInfoAsync( + UUID id) { + // Check if unstable operation is enabled + String operationId = "deleteOnCallEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'id' when calling deleteOnCallEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/on-call/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.deleteOnCallEventEmailAddress", + 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 an event. * @@ -255,21 +873,375 @@ public ApiResponse getEventWithHttpInfo(String eventId) throws throw new ApiException(400, "Missing the required parameter 'eventId' when calling getEvent"); } // create path and map variables - String localVarPath = - "/api/v2/events/{event_id}" - .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + String localVarPath = + "/api/v2/events/{event_id}" + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.getEvent", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an event. + * + *

See {@link #getEventWithHttpInfo}. + * + * @param eventId The UID of the event. (required) + * @return CompletableFuture<ApiResponse<V2EventResponse>> + */ + public CompletableFuture> getEventWithHttpInfoAsync(String eventId) { + Object localVarPostBody = null; + + // verify the required parameter 'eventId' is set + if (eventId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'eventId' when calling getEvent")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/events/{event_id}" + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.getEvent", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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 an event email address. + * + *

See {@link #getEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @return EventEmailAddressSingleResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressSingleResponse getEventEmailAddress(UUID emailUuid) throws ApiException { + return getEventEmailAddressWithHttpInfo(emailUuid).getData(); + } + + /** + * Get an event email address. + * + *

See {@link #getEventEmailAddressWithHttpInfoAsync}. + * + * @param emailUuid The UUID of the event email address. (required) + * @return CompletableFuture<EventEmailAddressSingleResponse> + */ + public CompletableFuture getEventEmailAddressAsync( + UUID emailUuid) { + return getEventEmailAddressWithHttpInfoAsync(emailUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single API email address for your organization. + * + * @param emailUuid The UUID of the event email address. (required) + * @return ApiResponse<EventEmailAddressSingleResponse> + * @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 getEventEmailAddressWithHttpInfo( + UUID emailUuid) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'emailUuid' when calling getEventEmailAddress"); + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.getEventEmailAddress", + 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 an event email address. + * + *

See {@link #getEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @return CompletableFuture<ApiResponse<EventEmailAddressSingleResponse>> + */ + public CompletableFuture> + getEventEmailAddressWithHttpInfoAsync(UUID emailUuid) { + // Check if unstable operation is enabled + String operationId = "getEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'emailUuid' when calling getEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.getEventEmailAddress", + 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() {}); + } + + /** Manage optional parameters to listEventEmailAddresses. */ + public static class ListEventEmailAddressesOptionalParameters { + private Boolean active; + private String include; + + /** + * Set active. + * + * @param active When set to true, returns only active (non-revoked) email + * addresses. (optional) + * @return ListEventEmailAddressesOptionalParameters + */ + public ListEventEmailAddressesOptionalParameters active(Boolean active) { + this.active = active; + return this; + } + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include in the response. + * Supported values are created_by and revoked_by. (optional) + * @return ListEventEmailAddressesOptionalParameters + */ + public ListEventEmailAddressesOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * List event email addresses. + * + *

See {@link #listEventEmailAddressesWithHttpInfo}. + * + * @return EventEmailAddressesResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressesResponse listEventEmailAddresses() throws ApiException { + return listEventEmailAddressesWithHttpInfo(new ListEventEmailAddressesOptionalParameters()) + .getData(); + } + + /** + * List event email addresses. + * + *

See {@link #listEventEmailAddressesWithHttpInfoAsync}. + * + * @return CompletableFuture<EventEmailAddressesResponse> + */ + public CompletableFuture listEventEmailAddressesAsync() { + return listEventEmailAddressesWithHttpInfoAsync(new ListEventEmailAddressesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List event email addresses. + * + *

See {@link #listEventEmailAddressesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return EventEmailAddressesResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressesResponse listEventEmailAddresses( + ListEventEmailAddressesOptionalParameters parameters) throws ApiException { + return listEventEmailAddressesWithHttpInfo(parameters).getData(); + } + + /** + * List event email addresses. + * + *

See {@link #listEventEmailAddressesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<EventEmailAddressesResponse> + */ + public CompletableFuture listEventEmailAddressesAsync( + ListEventEmailAddressesOptionalParameters parameters) { + return listEventEmailAddressesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all API email addresses for your organization. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<EventEmailAddressesResponse> + * @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 listEventEmailAddressesWithHttpInfo( + ListEventEmailAddressesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listEventEmailAddresses"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Boolean active = parameters.active; + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/events/mail"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "active", active)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.EventsApi.getEvent", + "v2.EventsApi.listEventEmailAddresses", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -278,47 +1250,57 @@ public ApiResponse getEventWithHttpInfo(String eventId) throws localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an event. + * List event email addresses. * - *

See {@link #getEventWithHttpInfo}. + *

See {@link #listEventEmailAddressesWithHttpInfo}. * - * @param eventId The UID of the event. (required) - * @return CompletableFuture<ApiResponse<V2EventResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<EventEmailAddressesResponse>> */ - public CompletableFuture> getEventWithHttpInfoAsync(String eventId) { - Object localVarPostBody = null; - - // verify the required parameter 'eventId' is set - if (eventId == null) { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + listEventEmailAddressesWithHttpInfoAsync( + ListEventEmailAddressesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listEventEmailAddresses"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'eventId' when calling getEvent")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = null; + Boolean active = parameters.active; + String include = parameters.include; // create path and map variables - String localVarPath = - "/api/v2/events/{event_id}" - .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + String localVarPath = "/api/v2/events/mail"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "active", active)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.EventsApi.getEvent", + "v2.EventsApi.listEventEmailAddresses", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -330,7 +1312,7 @@ public CompletableFuture> getEventWithHttpInfoAsync localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to listEvents. */ @@ -639,6 +1621,171 @@ public CompletableFuture> listEventsWithHttpInfo new GenericType() {}); } + /** + * List on-call event email addresses. + * + *

See {@link #listOnCallEventEmailAddressesWithHttpInfo}. + * + * @param filterTeamHandle The team handle to filter on-call event email addresses. (required) + * @return EventEmailAddressesResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressesResponse listOnCallEventEmailAddresses(String filterTeamHandle) + throws ApiException { + return listOnCallEventEmailAddressesWithHttpInfo(filterTeamHandle).getData(); + } + + /** + * List on-call event email addresses. + * + *

See {@link #listOnCallEventEmailAddressesWithHttpInfoAsync}. + * + * @param filterTeamHandle The team handle to filter on-call event email addresses. (required) + * @return CompletableFuture<EventEmailAddressesResponse> + */ + public CompletableFuture listOnCallEventEmailAddressesAsync( + String filterTeamHandle) { + return listOnCallEventEmailAddressesWithHttpInfoAsync(filterTeamHandle) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all on-call event email addresses for a given team handle. + * + * @param filterTeamHandle The team handle to filter on-call event email addresses. (required) + * @return ApiResponse<EventEmailAddressesResponse> + * @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 -
429 Too many requests -
+ */ + public ApiResponse listOnCallEventEmailAddressesWithHttpInfo( + String filterTeamHandle) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listOnCallEventEmailAddresses"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'filterTeamHandle' is set + if (filterTeamHandle == null) { + throw new ApiException( + 400, + "Missing the required parameter 'filterTeamHandle' when calling" + + " listOnCallEventEmailAddresses"); + } + // create path and map variables + String localVarPath = "/api/v2/events/mail/on-call"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[team_handle]", filterTeamHandle)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.listOnCallEventEmailAddresses", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * List on-call event email addresses. + * + *

See {@link #listOnCallEventEmailAddressesWithHttpInfo}. + * + * @param filterTeamHandle The team handle to filter on-call event email addresses. (required) + * @return CompletableFuture<ApiResponse<EventEmailAddressesResponse>> + */ + public CompletableFuture> + listOnCallEventEmailAddressesWithHttpInfoAsync(String filterTeamHandle) { + // Check if unstable operation is enabled + String operationId = "listOnCallEventEmailAddresses"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'filterTeamHandle' is set + if (filterTeamHandle == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterTeamHandle' when calling" + + " listOnCallEventEmailAddresses")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/events/mail/on-call"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[team_handle]", filterTeamHandle)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.listOnCallEventEmailAddresses", + localVarPath, + localVarQueryParams, + 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() {}); + } + /** Manage optional parameters to searchEvents. */ public static class SearchEventsOptionalParameters { private EventsListRequest body; @@ -863,4 +2010,184 @@ public CompletableFuture> searchEventsWithHttpIn false, new GenericType() {}); } + + /** + * Update an event email address. + * + *

See {@link #updateEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @param body (required) + * @return EventEmailAddressSingleResponse + * @throws ApiException if fails to make API call + */ + public EventEmailAddressSingleResponse updateEventEmailAddress( + UUID emailUuid, EventEmailAddressUpdateRequest body) throws ApiException { + return updateEventEmailAddressWithHttpInfo(emailUuid, body).getData(); + } + + /** + * Update an event email address. + * + *

See {@link #updateEventEmailAddressWithHttpInfoAsync}. + * + * @param emailUuid The UUID of the event email address. (required) + * @param body (required) + * @return CompletableFuture<EventEmailAddressSingleResponse> + */ + public CompletableFuture updateEventEmailAddressAsync( + UUID emailUuid, EventEmailAddressUpdateRequest body) { + return updateEventEmailAddressWithHttpInfoAsync(emailUuid, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing API email address in your organization. + * + * @param emailUuid The UUID of the event email address. (required) + * @param body (required) + * @return ApiResponse<EventEmailAddressSingleResponse> + * @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 updateEventEmailAddressWithHttpInfo( + UUID emailUuid, EventEmailAddressUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'emailUuid' when calling updateEventEmailAddress"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateEventEmailAddress"); + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.EventsApi.updateEventEmailAddress", + 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 an event email address. + * + *

See {@link #updateEventEmailAddressWithHttpInfo}. + * + * @param emailUuid The UUID of the event email address. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<EventEmailAddressSingleResponse>> + */ + public CompletableFuture> + updateEventEmailAddressWithHttpInfoAsync( + UUID emailUuid, EventEmailAddressUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateEventEmailAddress"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'emailUuid' is set + if (emailUuid == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'emailUuid' when calling updateEventEmailAddress")); + 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 updateEventEmailAddress")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/events/mail/{email_uuid}" + .replaceAll("\\{" + "email_uuid" + "\\}", apiClient.escapeString(emailUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.EventsApi.updateEventEmailAddress", + 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() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressAlertType.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressAlertType.java new file mode 100644 index 00000000000..43f5fe65f28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressAlertType.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** The alert type of events generated from the email address. */ +@JsonSerialize(using = EventEmailAddressAlertType.EventEmailAddressAlertTypeSerializer.class) +public class EventEmailAddressAlertType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("info", "warn", "error", "success")); + + public static final EventEmailAddressAlertType INFO = new EventEmailAddressAlertType("info"); + public static final EventEmailAddressAlertType WARN = new EventEmailAddressAlertType("warn"); + public static final EventEmailAddressAlertType ERROR = new EventEmailAddressAlertType("error"); + public static final EventEmailAddressAlertType SUCCESS = + new EventEmailAddressAlertType("success"); + + EventEmailAddressAlertType(String value) { + super(value, allowedValues); + } + + public static class EventEmailAddressAlertTypeSerializer + extends StdSerializer { + public EventEmailAddressAlertTypeSerializer(Class t) { + super(t); + } + + public EventEmailAddressAlertTypeSerializer() { + this(null); + } + + @Override + public void serialize( + EventEmailAddressAlertType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EventEmailAddressAlertType fromValue(String value) { + return new EventEmailAddressAlertType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateAttributes.java new file mode 100644 index 00000000000..f32fa44fce6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateAttributes.java @@ -0,0 +1,282 @@ +/* + * 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; + +/** Attributes for creating an event email address. */ +@JsonPropertyOrder({ + EventEmailAddressCreateAttributes.JSON_PROPERTY_ALERT_TYPE, + EventEmailAddressCreateAttributes.JSON_PROPERTY_DESCRIPTION, + EventEmailAddressCreateAttributes.JSON_PROPERTY_FORMAT, + EventEmailAddressCreateAttributes.JSON_PROPERTY_NOTIFY_HANDLES, + EventEmailAddressCreateAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALERT_TYPE = "alert_type"; + private EventEmailAddressAlertType alertType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FORMAT = "format"; + private EventEmailAddressFormat format; + + public static final String JSON_PROPERTY_NOTIFY_HANDLES = "notify_handles"; + private List notifyHandles = null; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public EventEmailAddressCreateAttributes() {} + + @JsonCreator + public EventEmailAddressCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMAT) EventEmailAddressFormat format) { + this.format = format; + this.unparsed |= !format.isValid(); + } + + public EventEmailAddressCreateAttributes alertType(EventEmailAddressAlertType alertType) { + this.alertType = alertType; + this.unparsed |= !alertType.isValid(); + return this; + } + + /** + * The alert type of events generated from the email address. + * + * @return alertType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALERT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventEmailAddressAlertType getAlertType() { + return alertType; + } + + public void setAlertType(EventEmailAddressAlertType alertType) { + if (!alertType.isValid()) { + this.unparsed = true; + } + this.alertType = alertType; + } + + public EventEmailAddressCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the event email address. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public EventEmailAddressCreateAttributes format(EventEmailAddressFormat format) { + this.format = format; + this.unparsed |= !format.isValid(); + return this; + } + + /** + * The format of events ingested through the email address. + * + * @return format + */ + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressFormat getFormat() { + return format; + } + + public void setFormat(EventEmailAddressFormat format) { + if (!format.isValid()) { + this.unparsed = true; + } + this.format = format; + } + + public EventEmailAddressCreateAttributes notifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + return this; + } + + public EventEmailAddressCreateAttributes addNotifyHandlesItem(String notifyHandlesItem) { + if (this.notifyHandles == null) { + this.notifyHandles = new ArrayList<>(); + } + this.notifyHandles.add(notifyHandlesItem); + return this; + } + + /** + * A list of handles to notify when an email is received. + * + * @return notifyHandles + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_HANDLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNotifyHandles() { + return notifyHandles; + } + + public void setNotifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + } + + public EventEmailAddressCreateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public EventEmailAddressCreateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags to apply to events generated from the email address. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * 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 EventEmailAddressCreateAttributes + */ + @JsonAnySetter + public EventEmailAddressCreateAttributes 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 EventEmailAddressCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressCreateAttributes eventEmailAddressCreateAttributes = + (EventEmailAddressCreateAttributes) o; + return Objects.equals(this.alertType, eventEmailAddressCreateAttributes.alertType) + && Objects.equals(this.description, eventEmailAddressCreateAttributes.description) + && Objects.equals(this.format, eventEmailAddressCreateAttributes.format) + && Objects.equals(this.notifyHandles, eventEmailAddressCreateAttributes.notifyHandles) + && Objects.equals(this.tags, eventEmailAddressCreateAttributes.tags) + && Objects.equals( + this.additionalProperties, eventEmailAddressCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alertType, description, format, notifyHandles, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressCreateAttributes {\n"); + sb.append(" alertType: ").append(toIndentedString(alertType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" notifyHandles: ").append(toIndentedString(notifyHandles)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/EventEmailAddressCreateData.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateData.java new file mode 100644 index 00000000000..47d5e2659d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateData.java @@ -0,0 +1,183 @@ +/* + * 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 creating an event email address. */ +@JsonPropertyOrder({ + EventEmailAddressCreateData.JSON_PROPERTY_ATTRIBUTES, + EventEmailAddressCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private EventEmailAddressCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventEmailAddressResourceType type; + + public EventEmailAddressCreateData() {} + + @JsonCreator + public EventEmailAddressCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + EventEmailAddressCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EventEmailAddressResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EventEmailAddressCreateData attributes(EventEmailAddressCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating an event email address. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(EventEmailAddressCreateAttributes attributes) { + this.attributes = attributes; + } + + public EventEmailAddressCreateData type(EventEmailAddressResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. Must be event_emails. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressResourceType getType() { + return type; + } + + public void setType(EventEmailAddressResourceType 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 EventEmailAddressCreateData + */ + @JsonAnySetter + public EventEmailAddressCreateData 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 EventEmailAddressCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressCreateData eventEmailAddressCreateData = (EventEmailAddressCreateData) o; + return Objects.equals(this.attributes, eventEmailAddressCreateData.attributes) + && Objects.equals(this.type, eventEmailAddressCreateData.type) + && Objects.equals( + this.additionalProperties, eventEmailAddressCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressCreateData {\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/EventEmailAddressCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateRequest.java new file mode 100644 index 00000000000..adf93fd3941 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreateRequest.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; + +/** Request body for creating an event email address. */ +@JsonPropertyOrder({EventEmailAddressCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EventEmailAddressCreateData data; + + public EventEmailAddressCreateRequest() {} + + @JsonCreator + public EventEmailAddressCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EventEmailAddressCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public EventEmailAddressCreateRequest data(EventEmailAddressCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating an event email address. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressCreateData getData() { + return data; + } + + public void setData(EventEmailAddressCreateData 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 EventEmailAddressCreateRequest + */ + @JsonAnySetter + public EventEmailAddressCreateRequest 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 EventEmailAddressCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressCreateRequest eventEmailAddressCreateRequest = + (EventEmailAddressCreateRequest) o; + return Objects.equals(this.data, eventEmailAddressCreateRequest.data) + && Objects.equals( + this.additionalProperties, eventEmailAddressCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressCreateRequest {\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/EventEmailAddressCreatedByRelationship.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreatedByRelationship.java new file mode 100644 index 00000000000..b2ed5be19e6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressCreatedByRelationship.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; + +/** Relationship to the user who created the email address. */ +@JsonPropertyOrder({EventEmailAddressCreatedByRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressCreatedByRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EventEmailAddressUserData data; + + public EventEmailAddressCreatedByRelationship() {} + + @JsonCreator + public EventEmailAddressCreatedByRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EventEmailAddressUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public EventEmailAddressCreatedByRelationship data(EventEmailAddressUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user data reference in a relationship. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressUserData getData() { + return data; + } + + public void setData(EventEmailAddressUserData 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 EventEmailAddressCreatedByRelationship + */ + @JsonAnySetter + public EventEmailAddressCreatedByRelationship 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 EventEmailAddressCreatedByRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressCreatedByRelationship eventEmailAddressCreatedByRelationship = + (EventEmailAddressCreatedByRelationship) o; + return Objects.equals(this.data, eventEmailAddressCreatedByRelationship.data) + && Objects.equals( + this.additionalProperties, eventEmailAddressCreatedByRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressCreatedByRelationship {\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/EventEmailAddressData.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressData.java new file mode 100644 index 00000000000..7347043fb08 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressData.java @@ -0,0 +1,241 @@ +/* + * 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; + +/** A single event email address resource. */ +@JsonPropertyOrder({ + EventEmailAddressData.JSON_PROPERTY_ATTRIBUTES, + EventEmailAddressData.JSON_PROPERTY_ID, + EventEmailAddressData.JSON_PROPERTY_RELATIONSHIPS, + EventEmailAddressData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private EventEmailAddressResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private EventEmailAddressRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventEmailAddressResourceType type; + + public EventEmailAddressData() {} + + @JsonCreator + public EventEmailAddressData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + EventEmailAddressResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + EventEmailAddressRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EventEmailAddressResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EventEmailAddressData attributes(EventEmailAddressResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an event email address resource. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(EventEmailAddressResponseAttributes attributes) { + this.attributes = attributes; + } + + public EventEmailAddressData id(String id) { + this.id = id; + return this; + } + + /** + * The UUID of the event email address. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EventEmailAddressData relationships(EventEmailAddressRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships associated with an event email address resource. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressRelationships getRelationships() { + return relationships; + } + + public void setRelationships(EventEmailAddressRelationships relationships) { + this.relationships = relationships; + } + + public EventEmailAddressData type(EventEmailAddressResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. Must be event_emails. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressResourceType getType() { + return type; + } + + public void setType(EventEmailAddressResourceType 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 EventEmailAddressData + */ + @JsonAnySetter + public EventEmailAddressData 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 EventEmailAddressData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressData eventEmailAddressData = (EventEmailAddressData) o; + return Objects.equals(this.attributes, eventEmailAddressData.attributes) + && Objects.equals(this.id, eventEmailAddressData.id) + && Objects.equals(this.relationships, eventEmailAddressData.relationships) + && Objects.equals(this.type, eventEmailAddressData.type) + && Objects.equals(this.additionalProperties, eventEmailAddressData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressData {\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/EventEmailAddressFormat.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressFormat.java new file mode 100644 index 00000000000..f21c714972e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressFormat.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** The format of events ingested through the email address. */ +@JsonSerialize(using = EventEmailAddressFormat.EventEmailAddressFormatSerializer.class) +public class EventEmailAddressFormat extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("json", "plain-text")); + + public static final EventEmailAddressFormat JSON = new EventEmailAddressFormat("json"); + public static final EventEmailAddressFormat PLAIN_TEXT = + new EventEmailAddressFormat("plain-text"); + + EventEmailAddressFormat(String value) { + super(value, allowedValues); + } + + public static class EventEmailAddressFormatSerializer + extends StdSerializer { + public EventEmailAddressFormatSerializer(Class t) { + super(t); + } + + public EventEmailAddressFormatSerializer() { + this(null); + } + + @Override + public void serialize( + EventEmailAddressFormat value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EventEmailAddressFormat fromValue(String value) { + return new EventEmailAddressFormat(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUser.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUser.java new file mode 100644 index 00000000000..438e7d6da6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUser.java @@ -0,0 +1,206 @@ +/* + * 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; + +/** An included user resource in an event email address response. */ +@JsonPropertyOrder({ + EventEmailAddressIncludedUser.JSON_PROPERTY_ATTRIBUTES, + EventEmailAddressIncludedUser.JSON_PROPERTY_ID, + EventEmailAddressIncludedUser.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressIncludedUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private EventEmailAddressIncludedUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public EventEmailAddressIncludedUser() {} + + @JsonCreator + public EventEmailAddressIncludedUser( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + EventEmailAddressIncludedUserAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public EventEmailAddressIncludedUser attributes( + EventEmailAddressIncludedUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an included user resource. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressIncludedUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(EventEmailAddressIncludedUserAttributes attributes) { + this.attributes = attributes; + } + + public EventEmailAddressIncludedUser id(String id) { + this.id = id; + return this; + } + + /** + * The UUID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EventEmailAddressIncludedUser type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 EventEmailAddressIncludedUser + */ + @JsonAnySetter + public EventEmailAddressIncludedUser 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 EventEmailAddressIncludedUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressIncludedUser eventEmailAddressIncludedUser = (EventEmailAddressIncludedUser) o; + return Objects.equals(this.attributes, eventEmailAddressIncludedUser.attributes) + && Objects.equals(this.id, eventEmailAddressIncludedUser.id) + && Objects.equals(this.type, eventEmailAddressIncludedUser.type) + && Objects.equals( + this.additionalProperties, eventEmailAddressIncludedUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressIncludedUser {\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/EventEmailAddressIncludedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUserAttributes.java new file mode 100644 index 00000000000..327525fbdff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressIncludedUserAttributes.java @@ -0,0 +1,146 @@ +/* + * 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 of an included user resource. */ +@JsonPropertyOrder({EventEmailAddressIncludedUserAttributes.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressIncludedUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public EventEmailAddressIncludedUserAttributes() {} + + @JsonCreator + public EventEmailAddressIncludedUserAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public EventEmailAddressIncludedUserAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 EventEmailAddressIncludedUserAttributes + */ + @JsonAnySetter + public EventEmailAddressIncludedUserAttributes 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 EventEmailAddressIncludedUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressIncludedUserAttributes eventEmailAddressIncludedUserAttributes = + (EventEmailAddressIncludedUserAttributes) o; + return Objects.equals(this.name, eventEmailAddressIncludedUserAttributes.name) + && Objects.equals( + this.additionalProperties, + eventEmailAddressIncludedUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressIncludedUserAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/EventEmailAddressRelationships.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRelationships.java new file mode 100644 index 00000000000..21130fc2fbd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRelationships.java @@ -0,0 +1,192 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Relationships associated with an event email address resource. */ +@JsonPropertyOrder({ + EventEmailAddressRelationships.JSON_PROPERTY_CREATED_BY, + EventEmailAddressRelationships.JSON_PROPERTY_REVOKED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private EventEmailAddressCreatedByRelationship createdBy; + + public static final String JSON_PROPERTY_REVOKED_BY = "revoked_by"; + private JsonNullable revokedBy = + JsonNullable.undefined(); + + public EventEmailAddressRelationships() {} + + @JsonCreator + public EventEmailAddressRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + EventEmailAddressCreatedByRelationship createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + } + + public EventEmailAddressRelationships createdBy( + EventEmailAddressCreatedByRelationship createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * Relationship to the user who created the email address. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressCreatedByRelationship getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(EventEmailAddressCreatedByRelationship createdBy) { + this.createdBy = createdBy; + } + + public EventEmailAddressRelationships revokedBy( + EventEmailAddressRevokedByRelationship revokedBy) { + this.revokedBy = JsonNullable.of(revokedBy); + return this; + } + + /** + * Relationship to the user who revoked the email address. + * + * @return revokedBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public EventEmailAddressRevokedByRelationship getRevokedBy() { + return revokedBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REVOKED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRevokedBy_JsonNullable() { + return revokedBy; + } + + @JsonProperty(JSON_PROPERTY_REVOKED_BY) + public void setRevokedBy_JsonNullable( + JsonNullable revokedBy) { + this.revokedBy = revokedBy; + } + + public void setRevokedBy(EventEmailAddressRevokedByRelationship revokedBy) { + this.revokedBy = JsonNullable.of(revokedBy); + } + + /** + * 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 EventEmailAddressRelationships + */ + @JsonAnySetter + public EventEmailAddressRelationships 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 EventEmailAddressRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressRelationships eventEmailAddressRelationships = + (EventEmailAddressRelationships) o; + return Objects.equals(this.createdBy, eventEmailAddressRelationships.createdBy) + && Objects.equals(this.revokedBy, eventEmailAddressRelationships.revokedBy) + && Objects.equals( + this.additionalProperties, eventEmailAddressRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, revokedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" revokedBy: ").append(toIndentedString(revokedBy)).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/EventEmailAddressResourceType.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResourceType.java new file mode 100644 index 00000000000..09be32c9182 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResourceType.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; + +/** The type of the resource. Must be event_emails. */ +@JsonSerialize(using = EventEmailAddressResourceType.EventEmailAddressResourceTypeSerializer.class) +public class EventEmailAddressResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("event_emails")); + + public static final EventEmailAddressResourceType EVENT_EMAILS = + new EventEmailAddressResourceType("event_emails"); + + EventEmailAddressResourceType(String value) { + super(value, allowedValues); + } + + public static class EventEmailAddressResourceTypeSerializer + extends StdSerializer { + public EventEmailAddressResourceTypeSerializer(Class t) { + super(t); + } + + public EventEmailAddressResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + EventEmailAddressResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EventEmailAddressResourceType fromValue(String value) { + return new EventEmailAddressResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResponseAttributes.java new file mode 100644 index 00000000000..ebcbede6545 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressResponseAttributes.java @@ -0,0 +1,434 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of an event email address resource. */ +@JsonPropertyOrder({ + EventEmailAddressResponseAttributes.JSON_PROPERTY_ALERT_TYPE, + EventEmailAddressResponseAttributes.JSON_PROPERTY_CREATED_AT, + EventEmailAddressResponseAttributes.JSON_PROPERTY_DESCRIPTION, + EventEmailAddressResponseAttributes.JSON_PROPERTY_EMAIL, + EventEmailAddressResponseAttributes.JSON_PROPERTY_FORMAT, + EventEmailAddressResponseAttributes.JSON_PROPERTY_LAST_USED_AT, + EventEmailAddressResponseAttributes.JSON_PROPERTY_NOTIFY_HANDLES, + EventEmailAddressResponseAttributes.JSON_PROPERTY_REVOKED_AT, + EventEmailAddressResponseAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALERT_TYPE = "alert_type"; + private EventEmailAddressAlertType alertType; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_FORMAT = "format"; + private EventEmailAddressFormat format; + + public static final String JSON_PROPERTY_LAST_USED_AT = "last_used_at"; + private JsonNullable lastUsedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NOTIFY_HANDLES = "notify_handles"; + private List notifyHandles = null; + + public static final String JSON_PROPERTY_REVOKED_AT = "revoked_at"; + private JsonNullable revokedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public EventEmailAddressResponseAttributes() {} + + @JsonCreator + public EventEmailAddressResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_EMAIL) String email, + @JsonProperty(required = true, value = JSON_PROPERTY_FORMAT) EventEmailAddressFormat format) { + this.createdAt = createdAt; + this.email = email; + this.format = format; + this.unparsed |= !format.isValid(); + } + + public EventEmailAddressResponseAttributes alertType(EventEmailAddressAlertType alertType) { + this.alertType = alertType; + this.unparsed |= !alertType.isValid(); + return this; + } + + /** + * The alert type of events generated from the email address. + * + * @return alertType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALERT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventEmailAddressAlertType getAlertType() { + return alertType; + } + + public void setAlertType(EventEmailAddressAlertType alertType) { + if (!alertType.isValid()) { + this.unparsed = true; + } + this.alertType = alertType; + } + + public EventEmailAddressResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of when the event email address was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public EventEmailAddressResponseAttributes description(String description) { + this.description = JsonNullable.of(description); + return this; + } + + /** + * A description of the event email address. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + public EventEmailAddressResponseAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The generated email address for ingesting events. + * + * @return email + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public EventEmailAddressResponseAttributes format(EventEmailAddressFormat format) { + this.format = format; + this.unparsed |= !format.isValid(); + return this; + } + + /** + * The format of events ingested through the email address. + * + * @return format + */ + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressFormat getFormat() { + return format; + } + + public void setFormat(EventEmailAddressFormat format) { + if (!format.isValid()) { + this.unparsed = true; + } + this.format = format; + } + + public EventEmailAddressResponseAttributes lastUsedAt(OffsetDateTime lastUsedAt) { + this.lastUsedAt = JsonNullable.of(lastUsedAt); + return this; + } + + /** + * The timestamp of when the event email address was last used. + * + * @return lastUsedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getLastUsedAt() { + return lastUsedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST_USED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLastUsedAt_JsonNullable() { + return lastUsedAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_USED_AT) + public void setLastUsedAt_JsonNullable(JsonNullable lastUsedAt) { + this.lastUsedAt = lastUsedAt; + } + + public void setLastUsedAt(OffsetDateTime lastUsedAt) { + this.lastUsedAt = JsonNullable.of(lastUsedAt); + } + + public EventEmailAddressResponseAttributes notifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + return this; + } + + public EventEmailAddressResponseAttributes addNotifyHandlesItem(String notifyHandlesItem) { + if (this.notifyHandles == null) { + this.notifyHandles = new ArrayList<>(); + } + this.notifyHandles.add(notifyHandlesItem); + return this; + } + + /** + * A list of handles to notify when an email is received. + * + * @return notifyHandles + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_HANDLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNotifyHandles() { + return notifyHandles; + } + + public void setNotifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + } + + public EventEmailAddressResponseAttributes revokedAt(OffsetDateTime revokedAt) { + this.revokedAt = JsonNullable.of(revokedAt); + return this; + } + + /** + * The timestamp of when the event email address was revoked. + * + * @return revokedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getRevokedAt() { + return revokedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REVOKED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRevokedAt_JsonNullable() { + return revokedAt; + } + + @JsonProperty(JSON_PROPERTY_REVOKED_AT) + public void setRevokedAt_JsonNullable(JsonNullable revokedAt) { + this.revokedAt = revokedAt; + } + + public void setRevokedAt(OffsetDateTime revokedAt) { + this.revokedAt = JsonNullable.of(revokedAt); + } + + public EventEmailAddressResponseAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public EventEmailAddressResponseAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags to apply to events generated from the email address. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * 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 EventEmailAddressResponseAttributes + */ + @JsonAnySetter + public EventEmailAddressResponseAttributes 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 EventEmailAddressResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressResponseAttributes eventEmailAddressResponseAttributes = + (EventEmailAddressResponseAttributes) o; + return Objects.equals(this.alertType, eventEmailAddressResponseAttributes.alertType) + && Objects.equals(this.createdAt, eventEmailAddressResponseAttributes.createdAt) + && Objects.equals(this.description, eventEmailAddressResponseAttributes.description) + && Objects.equals(this.email, eventEmailAddressResponseAttributes.email) + && Objects.equals(this.format, eventEmailAddressResponseAttributes.format) + && Objects.equals(this.lastUsedAt, eventEmailAddressResponseAttributes.lastUsedAt) + && Objects.equals(this.notifyHandles, eventEmailAddressResponseAttributes.notifyHandles) + && Objects.equals(this.revokedAt, eventEmailAddressResponseAttributes.revokedAt) + && Objects.equals(this.tags, eventEmailAddressResponseAttributes.tags) + && Objects.equals( + this.additionalProperties, eventEmailAddressResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + alertType, + createdAt, + description, + email, + format, + lastUsedAt, + notifyHandles, + revokedAt, + tags, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressResponseAttributes {\n"); + sb.append(" alertType: ").append(toIndentedString(alertType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" lastUsedAt: ").append(toIndentedString(lastUsedAt)).append("\n"); + sb.append(" notifyHandles: ").append(toIndentedString(notifyHandles)).append("\n"); + sb.append(" revokedAt: ").append(toIndentedString(revokedAt)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/EventEmailAddressRevokedByRelationship.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRevokedByRelationship.java new file mode 100644 index 00000000000..5dcbb760d54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressRevokedByRelationship.java @@ -0,0 +1,138 @@ +/* + * 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; + +/** Relationship to the user who revoked the email address. */ +@JsonPropertyOrder({EventEmailAddressRevokedByRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressRevokedByRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EventEmailAddressUserData data; + + public EventEmailAddressRevokedByRelationship data(EventEmailAddressUserData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A user data reference in a relationship. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventEmailAddressUserData getData() { + return data; + } + + public void setData(EventEmailAddressUserData 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 EventEmailAddressRevokedByRelationship + */ + @JsonAnySetter + public EventEmailAddressRevokedByRelationship 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 EventEmailAddressRevokedByRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressRevokedByRelationship eventEmailAddressRevokedByRelationship = + (EventEmailAddressRevokedByRelationship) o; + return Objects.equals(this.data, eventEmailAddressRevokedByRelationship.data) + && Objects.equals( + this.additionalProperties, eventEmailAddressRevokedByRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressRevokedByRelationship {\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/EventEmailAddressSingleResponse.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressSingleResponse.java new file mode 100644 index 00000000000..060453b38c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressSingleResponse.java @@ -0,0 +1,191 @@ +/* + * 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 single event email address. */ +@JsonPropertyOrder({ + EventEmailAddressSingleResponse.JSON_PROPERTY_DATA, + EventEmailAddressSingleResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressSingleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EventEmailAddressData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public EventEmailAddressSingleResponse() {} + + @JsonCreator + public EventEmailAddressSingleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EventEmailAddressData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public EventEmailAddressSingleResponse data(EventEmailAddressData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A single event email address resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressData getData() { + return data; + } + + public void setData(EventEmailAddressData data) { + this.data = data; + } + + public EventEmailAddressSingleResponse included(List included) { + this.included = included; + for (EventEmailAddressIncludedUser item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EventEmailAddressSingleResponse addIncludedItem( + EventEmailAddressIncludedUser includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Related resources included in the response. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * 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 EventEmailAddressSingleResponse + */ + @JsonAnySetter + public EventEmailAddressSingleResponse 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 EventEmailAddressSingleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressSingleResponse eventEmailAddressSingleResponse = + (EventEmailAddressSingleResponse) o; + return Objects.equals(this.data, eventEmailAddressSingleResponse.data) + && Objects.equals(this.included, eventEmailAddressSingleResponse.included) + && Objects.equals( + this.additionalProperties, eventEmailAddressSingleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressSingleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).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/EventEmailAddressUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateAttributes.java new file mode 100644 index 00000000000..b9cda2431f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateAttributes.java @@ -0,0 +1,253 @@ +/* + * 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; + +/** Attributes for updating an event email address. */ +@JsonPropertyOrder({ + EventEmailAddressUpdateAttributes.JSON_PROPERTY_ALERT_TYPE, + EventEmailAddressUpdateAttributes.JSON_PROPERTY_DESCRIPTION, + EventEmailAddressUpdateAttributes.JSON_PROPERTY_NOTIFY_HANDLES, + EventEmailAddressUpdateAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALERT_TYPE = "alert_type"; + private EventEmailAddressAlertType alertType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NOTIFY_HANDLES = "notify_handles"; + private List notifyHandles = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public EventEmailAddressUpdateAttributes() {} + + @JsonCreator + public EventEmailAddressUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ALERT_TYPE) + EventEmailAddressAlertType alertType, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTIFY_HANDLES) + List notifyHandles, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.alertType = alertType; + this.unparsed |= !alertType.isValid(); + this.description = description; + if (description != null) {} + this.notifyHandles = notifyHandles; + this.tags = tags; + } + + public EventEmailAddressUpdateAttributes alertType(EventEmailAddressAlertType alertType) { + this.alertType = alertType; + this.unparsed |= !alertType.isValid(); + return this; + } + + /** + * The alert type of events generated from the email address. + * + * @return alertType + */ + @JsonProperty(JSON_PROPERTY_ALERT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressAlertType getAlertType() { + return alertType; + } + + public void setAlertType(EventEmailAddressAlertType alertType) { + if (!alertType.isValid()) { + this.unparsed = true; + } + this.alertType = alertType; + } + + public EventEmailAddressUpdateAttributes description(String description) { + this.description = description; + if (description != null) {} + return this; + } + + /** + * A description of the event email address. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public EventEmailAddressUpdateAttributes notifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + return this; + } + + public EventEmailAddressUpdateAttributes addNotifyHandlesItem(String notifyHandlesItem) { + this.notifyHandles.add(notifyHandlesItem); + return this; + } + + /** + * A list of handles to notify when an email is received. + * + * @return notifyHandles + */ + @JsonProperty(JSON_PROPERTY_NOTIFY_HANDLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getNotifyHandles() { + return notifyHandles; + } + + public void setNotifyHandles(List notifyHandles) { + this.notifyHandles = notifyHandles; + } + + public EventEmailAddressUpdateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public EventEmailAddressUpdateAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags to apply to events generated from the email address. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * 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 EventEmailAddressUpdateAttributes + */ + @JsonAnySetter + public EventEmailAddressUpdateAttributes 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 EventEmailAddressUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressUpdateAttributes eventEmailAddressUpdateAttributes = + (EventEmailAddressUpdateAttributes) o; + return Objects.equals(this.alertType, eventEmailAddressUpdateAttributes.alertType) + && Objects.equals(this.description, eventEmailAddressUpdateAttributes.description) + && Objects.equals(this.notifyHandles, eventEmailAddressUpdateAttributes.notifyHandles) + && Objects.equals(this.tags, eventEmailAddressUpdateAttributes.tags) + && Objects.equals( + this.additionalProperties, eventEmailAddressUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alertType, description, notifyHandles, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressUpdateAttributes {\n"); + sb.append(" alertType: ").append(toIndentedString(alertType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" notifyHandles: ").append(toIndentedString(notifyHandles)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/EventEmailAddressUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateData.java new file mode 100644 index 00000000000..ce73abb9ae4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateData.java @@ -0,0 +1,183 @@ +/* + * 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 updating an event email address. */ +@JsonPropertyOrder({ + EventEmailAddressUpdateData.JSON_PROPERTY_ATTRIBUTES, + EventEmailAddressUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private EventEmailAddressUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventEmailAddressResourceType type; + + public EventEmailAddressUpdateData() {} + + @JsonCreator + public EventEmailAddressUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + EventEmailAddressUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EventEmailAddressResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EventEmailAddressUpdateData attributes(EventEmailAddressUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an event email address. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(EventEmailAddressUpdateAttributes attributes) { + this.attributes = attributes; + } + + public EventEmailAddressUpdateData type(EventEmailAddressResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. Must be event_emails. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressResourceType getType() { + return type; + } + + public void setType(EventEmailAddressResourceType 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 EventEmailAddressUpdateData + */ + @JsonAnySetter + public EventEmailAddressUpdateData 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 EventEmailAddressUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressUpdateData eventEmailAddressUpdateData = (EventEmailAddressUpdateData) o; + return Objects.equals(this.attributes, eventEmailAddressUpdateData.attributes) + && Objects.equals(this.type, eventEmailAddressUpdateData.type) + && Objects.equals( + this.additionalProperties, eventEmailAddressUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressUpdateData {\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/EventEmailAddressUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateRequest.java new file mode 100644 index 00000000000..cdbdc4c48ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUpdateRequest.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; + +/** Request body for updating an event email address. */ +@JsonPropertyOrder({EventEmailAddressUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private EventEmailAddressUpdateData data; + + public EventEmailAddressUpdateRequest() {} + + @JsonCreator + public EventEmailAddressUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EventEmailAddressUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public EventEmailAddressUpdateRequest data(EventEmailAddressUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating an event email address. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressUpdateData getData() { + return data; + } + + public void setData(EventEmailAddressUpdateData 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 EventEmailAddressUpdateRequest + */ + @JsonAnySetter + public EventEmailAddressUpdateRequest 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 EventEmailAddressUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressUpdateRequest eventEmailAddressUpdateRequest = + (EventEmailAddressUpdateRequest) o; + return Objects.equals(this.data, eventEmailAddressUpdateRequest.data) + && Objects.equals( + this.additionalProperties, eventEmailAddressUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressUpdateRequest {\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/EventEmailAddressUserData.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUserData.java new file mode 100644 index 00000000000..6cc7eb10a43 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressUserData.java @@ -0,0 +1,174 @@ +/* + * 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; + +/** A user data reference in a relationship. */ +@JsonPropertyOrder({ + EventEmailAddressUserData.JSON_PROPERTY_ID, + EventEmailAddressUserData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressUserData { + @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 String type; + + public EventEmailAddressUserData() {} + + @JsonCreator + public EventEmailAddressUserData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public EventEmailAddressUserData id(String id) { + this.id = id; + return this; + } + + /** + * The UUID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EventEmailAddressUserData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 EventEmailAddressUserData + */ + @JsonAnySetter + public EventEmailAddressUserData 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 EventEmailAddressUserData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressUserData eventEmailAddressUserData = (EventEmailAddressUserData) o; + return Objects.equals(this.id, eventEmailAddressUserData.id) + && Objects.equals(this.type, eventEmailAddressUserData.type) + && Objects.equals( + this.additionalProperties, eventEmailAddressUserData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressUserData {\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/EventEmailAddressesResponse.java b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressesResponse.java new file mode 100644 index 00000000000..11b268756fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EventEmailAddressesResponse.java @@ -0,0 +1,196 @@ +/* + * 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 event email addresses. */ +@JsonPropertyOrder({ + EventEmailAddressesResponse.JSON_PROPERTY_DATA, + EventEmailAddressesResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EventEmailAddressesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public EventEmailAddressesResponse() {} + + @JsonCreator + public EventEmailAddressesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public EventEmailAddressesResponse data(List data) { + this.data = data; + for (EventEmailAddressData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EventEmailAddressesResponse addDataItem(EventEmailAddressData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of event email address resources. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public EventEmailAddressesResponse included(List included) { + this.included = included; + for (EventEmailAddressIncludedUser item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public EventEmailAddressesResponse addIncludedItem(EventEmailAddressIncludedUser includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Related resources included in the response. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * 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 EventEmailAddressesResponse + */ + @JsonAnySetter + public EventEmailAddressesResponse 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 EventEmailAddressesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEmailAddressesResponse eventEmailAddressesResponse = (EventEmailAddressesResponse) o; + return Objects.equals(this.data, eventEmailAddressesResponse.data) + && Objects.equals(this.included, eventEmailAddressesResponse.included) + && Objects.equals( + this.additionalProperties, eventEmailAddressesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEmailAddressesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).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/OnCallEventEmailAddressCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateAttributes.java new file mode 100644 index 00000000000..a5ecf33d425 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateAttributes.java @@ -0,0 +1,277 @@ +/* + * 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; + +/** Attributes for creating an on-call event email address. */ +@JsonPropertyOrder({ + OnCallEventEmailAddressCreateAttributes.JSON_PROPERTY_ALERT_TYPE, + OnCallEventEmailAddressCreateAttributes.JSON_PROPERTY_DESCRIPTION, + OnCallEventEmailAddressCreateAttributes.JSON_PROPERTY_FORMAT, + OnCallEventEmailAddressCreateAttributes.JSON_PROPERTY_TAGS, + OnCallEventEmailAddressCreateAttributes.JSON_PROPERTY_TEAM_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallEventEmailAddressCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALERT_TYPE = "alert_type"; + private EventEmailAddressAlertType alertType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FORMAT = "format"; + private EventEmailAddressFormat format; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TEAM_HANDLE = "team_handle"; + private String teamHandle; + + public OnCallEventEmailAddressCreateAttributes() {} + + @JsonCreator + public OnCallEventEmailAddressCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMAT) EventEmailAddressFormat format, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAM_HANDLE) String teamHandle) { + this.format = format; + this.unparsed |= !format.isValid(); + this.teamHandle = teamHandle; + } + + public OnCallEventEmailAddressCreateAttributes alertType(EventEmailAddressAlertType alertType) { + this.alertType = alertType; + this.unparsed |= !alertType.isValid(); + return this; + } + + /** + * The alert type of events generated from the email address. + * + * @return alertType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALERT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventEmailAddressAlertType getAlertType() { + return alertType; + } + + public void setAlertType(EventEmailAddressAlertType alertType) { + if (!alertType.isValid()) { + this.unparsed = true; + } + this.alertType = alertType; + } + + public OnCallEventEmailAddressCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the on-call event email address. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public OnCallEventEmailAddressCreateAttributes format(EventEmailAddressFormat format) { + this.format = format; + this.unparsed |= !format.isValid(); + return this; + } + + /** + * The format of events ingested through the email address. + * + * @return format + */ + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressFormat getFormat() { + return format; + } + + public void setFormat(EventEmailAddressFormat format) { + if (!format.isValid()) { + this.unparsed = true; + } + this.format = format; + } + + public OnCallEventEmailAddressCreateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public OnCallEventEmailAddressCreateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * A list of tags to apply to events generated from the email address. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public OnCallEventEmailAddressCreateAttributes teamHandle(String teamHandle) { + this.teamHandle = teamHandle; + return this; + } + + /** + * The team handle associated with the on-call email address. Must contain only alphanumeric + * characters, hyphens, and underscores. + * + * @return teamHandle + */ + @JsonProperty(JSON_PROPERTY_TEAM_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTeamHandle() { + return teamHandle; + } + + public void setTeamHandle(String teamHandle) { + this.teamHandle = teamHandle; + } + + /** + * 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 OnCallEventEmailAddressCreateAttributes + */ + @JsonAnySetter + public OnCallEventEmailAddressCreateAttributes 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 OnCallEventEmailAddressCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallEventEmailAddressCreateAttributes onCallEventEmailAddressCreateAttributes = + (OnCallEventEmailAddressCreateAttributes) o; + return Objects.equals(this.alertType, onCallEventEmailAddressCreateAttributes.alertType) + && Objects.equals(this.description, onCallEventEmailAddressCreateAttributes.description) + && Objects.equals(this.format, onCallEventEmailAddressCreateAttributes.format) + && Objects.equals(this.tags, onCallEventEmailAddressCreateAttributes.tags) + && Objects.equals(this.teamHandle, onCallEventEmailAddressCreateAttributes.teamHandle) + && Objects.equals( + this.additionalProperties, + onCallEventEmailAddressCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alertType, description, format, tags, teamHandle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallEventEmailAddressCreateAttributes {\n"); + sb.append(" alertType: ").append(toIndentedString(alertType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" teamHandle: ").append(toIndentedString(teamHandle)).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/OnCallEventEmailAddressCreateData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateData.java new file mode 100644 index 00000000000..36d14e4a49d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateData.java @@ -0,0 +1,185 @@ +/* + * 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 creating an on-call event email address. */ +@JsonPropertyOrder({ + OnCallEventEmailAddressCreateData.JSON_PROPERTY_ATTRIBUTES, + OnCallEventEmailAddressCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallEventEmailAddressCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OnCallEventEmailAddressCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventEmailAddressResourceType type; + + public OnCallEventEmailAddressCreateData() {} + + @JsonCreator + public OnCallEventEmailAddressCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + OnCallEventEmailAddressCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EventEmailAddressResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallEventEmailAddressCreateData attributes( + OnCallEventEmailAddressCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating an on-call event email address. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallEventEmailAddressCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OnCallEventEmailAddressCreateAttributes attributes) { + this.attributes = attributes; + } + + public OnCallEventEmailAddressCreateData type(EventEmailAddressResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. Must be event_emails. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventEmailAddressResourceType getType() { + return type; + } + + public void setType(EventEmailAddressResourceType 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 OnCallEventEmailAddressCreateData + */ + @JsonAnySetter + public OnCallEventEmailAddressCreateData 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 OnCallEventEmailAddressCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallEventEmailAddressCreateData onCallEventEmailAddressCreateData = + (OnCallEventEmailAddressCreateData) o; + return Objects.equals(this.attributes, onCallEventEmailAddressCreateData.attributes) + && Objects.equals(this.type, onCallEventEmailAddressCreateData.type) + && Objects.equals( + this.additionalProperties, onCallEventEmailAddressCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallEventEmailAddressCreateData {\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/OnCallEventEmailAddressCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateRequest.java new file mode 100644 index 00000000000..ec998d16faf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallEventEmailAddressCreateRequest.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; + +/** Request body for creating an on-call event email address. */ +@JsonPropertyOrder({OnCallEventEmailAddressCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallEventEmailAddressCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OnCallEventEmailAddressCreateData data; + + public OnCallEventEmailAddressCreateRequest() {} + + @JsonCreator + public OnCallEventEmailAddressCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + OnCallEventEmailAddressCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public OnCallEventEmailAddressCreateRequest data(OnCallEventEmailAddressCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating an on-call event email address. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallEventEmailAddressCreateData getData() { + return data; + } + + public void setData(OnCallEventEmailAddressCreateData 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 OnCallEventEmailAddressCreateRequest + */ + @JsonAnySetter + public OnCallEventEmailAddressCreateRequest 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 OnCallEventEmailAddressCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallEventEmailAddressCreateRequest onCallEventEmailAddressCreateRequest = + (OnCallEventEmailAddressCreateRequest) o; + return Objects.equals(this.data, onCallEventEmailAddressCreateRequest.data) + && Objects.equals( + this.additionalProperties, onCallEventEmailAddressCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallEventEmailAddressCreateRequest {\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/events.feature b/src/test/resources/com/datadog/api/client/v2/api/events.feature index 5beda13d5e3..9ff0d0a1e21 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/events.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/events.feature @@ -17,6 +17,46 @@ Feature: Events And a valid "appKeyAuth" key in the system And an instance of "Events" API + @generated @skip @team:DataDog/event-management + Scenario: Create an event email address returns "Bad Request" response + Given operation "CreateEventEmailAddress" enabled + And new "CreateEventEmailAddress" request + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Email address for production alerts.", "format": "json", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Create an event email address returns "Created" response + Given operation "CreateEventEmailAddress" enabled + And new "CreateEventEmailAddress" request + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Email address for production alerts.", "format": "json", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/event-management + Scenario: Create an event email address returns "Method Not Allowed" response + Given operation "CreateEventEmailAddress" enabled + And new "CreateEventEmailAddress" request + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Email address for production alerts.", "format": "json", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 405 Method Not Allowed + + @generated @skip @team:DataDog/event-management + Scenario: Create an on-call event email address returns "Bad Request" response + Given operation "CreateOnCallEventEmailAddress" enabled + And new "CreateOnCallEventEmailAddress" request + And body with value {"data": {"attributes": {"alert_type": "info", "description": "On-call email address for my team.", "format": "json", "tags": ["env:production", "team:my-team"], "team_handle": "my-team"}, "type": "event_emails"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Create an on-call event email address returns "Created" response + Given operation "CreateOnCallEventEmailAddress" enabled + And new "CreateOnCallEventEmailAddress" request + And body with value {"data": {"attributes": {"alert_type": "info", "description": "On-call email address for my team.", "format": "json", "tags": ["env:production", "team:my-team"], "team_handle": "my-team"}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response Given new "ListEvents" request @@ -50,6 +90,30 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/event-management + Scenario: Get an event email address returns "Bad Request" response + Given operation "GetEventEmailAddress" enabled + And new "GetEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Get an event email address returns "Not Found" response + Given operation "GetEventEmailAddress" enabled + And new "GetEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/event-management + Scenario: Get an event email address returns "OK" response + Given operation "GetEventEmailAddress" enabled + And new "GetEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/event-management Scenario: Get an event returns "Bad Request" response Given new "GetEvent" request @@ -71,6 +135,29 @@ Feature: Events When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/event-management + Scenario: List event email addresses returns "OK" response + Given operation "ListEventEmailAddresses" enabled + And new "ListEventEmailAddresses" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/event-management + Scenario: List on-call event email addresses returns "Bad Request" response + Given operation "ListOnCallEventEmailAddresses" enabled + And new "ListOnCallEventEmailAddresses" request + And request contains "filter[team_handle]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: List on-call event email addresses returns "OK" response + Given operation "ListOnCallEventEmailAddresses" enabled + And new "ListOnCallEventEmailAddresses" request + And request contains "filter[team_handle]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request @@ -87,6 +174,54 @@ Feature: Events And the response "data.type" is equal to "event" And the response "data.attributes.attributes.evt" has field "uid" + @generated @skip @team:DataDog/event-management + Scenario: Revoke an event email address returns "Bad Request" response + Given operation "DeleteEventEmailAddress" enabled + And new "DeleteEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Revoke an event email address returns "No Content" response + Given operation "DeleteEventEmailAddress" enabled + And new "DeleteEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/event-management + Scenario: Revoke an event email address returns "Not Found" response + Given operation "DeleteEventEmailAddress" enabled + And new "DeleteEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/event-management + Scenario: Revoke an on-call event email address returns "Bad Request" response + Given operation "DeleteOnCallEventEmailAddress" enabled + And new "DeleteOnCallEventEmailAddress" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Revoke an on-call event email address returns "No Content" response + Given operation "DeleteOnCallEventEmailAddress" enabled + And new "DeleteOnCallEventEmailAddress" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/event-management + Scenario: Revoke an on-call event email address returns "Not Found" response + Given operation "DeleteOnCallEventEmailAddress" enabled + And new "DeleteOnCallEventEmailAddress" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/event-management Scenario: Search events returns "Bad Request" response Given new "SearchEvents" request @@ -109,3 +244,30 @@ Feature: Events When the request with pagination is sent Then the response status is 200 OK And the response has 3 items + + @generated @skip @team:DataDog/event-management + Scenario: Update an event email address returns "Bad Request" response + Given operation "UpdateEventEmailAddress" enabled + And new "UpdateEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Updated description for the email address.", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/event-management + Scenario: Update an event email address returns "Not Found" response + Given operation "UpdateEventEmailAddress" enabled + And new "UpdateEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Updated description for the email address.", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/event-management + Scenario: Update an event email address returns "OK" response + Given operation "UpdateEventEmailAddress" enabled + And new "UpdateEventEmailAddress" request + And request contains "email_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"alert_type": "info", "description": "Updated description for the email address.", "notify_handles": ["@slack-my-channel"], "tags": ["env:production", "team:my-team"]}, "type": "event_emails"}} + When the request is sent + Then the response status is 200 OK 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 09186eef673..4c52d6ba475 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 @@ -1737,6 +1737,68 @@ "type": "safe" } }, + "ListEventEmailAddresses": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "DeleteEventEmailAddress", + "parameters": [ + { + "name": "email_uuid", + "source": "" + } + ], + "type": "unsafe" + } + }, + "ListOnCallEventEmailAddresses": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "DeleteOnCallEventEmailAddress", + "parameters": [ + { + "name": "id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "idempotent" + } + }, + "DeleteEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "idempotent" + } + }, + "GetEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "UpdateEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "idempotent" + } + }, "SearchEvents": { "tag": "Events", "undo": {