From f53379619509f70115c8ac27ee529fd171cd381c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 14 Apr 2026 22:03:59 +0000 Subject: [PATCH] Regenerate client from commit d1c1cb2 of spec repo --- .generator/schemas/v2/openapi.yaml | 274 ++++++++++++++ examples/v2/organizations/ListOrgs.java | 24 ++ examples/v2/users/DeleteUserInvitations.java | 23 ++ .../api/client/v2/api/OrganizationsApi.java | 170 +++++++++ .../datadog/api/client/v2/api/UsersApi.java | 134 +++++++ .../api/client/v2/model/ManagedOrgsData.java | 210 +++++++++++ .../model/ManagedOrgsRelationshipToOrg.java | 146 ++++++++ .../model/ManagedOrgsRelationshipToOrgs.java | 155 ++++++++ .../v2/model/ManagedOrgsRelationships.java | 179 +++++++++ .../client/v2/model/ManagedOrgsResponse.java | 186 ++++++++++ .../api/client/v2/model/ManagedOrgsType.java | 54 +++ .../api/client/v2/model/OrgAttributes.java | 351 ++++++++++++++++++ .../datadog/api/client/v2/model/OrgData.java | 209 +++++++++++ .../client/v2/model/OrgRelationshipData.java | 176 +++++++++ .../api/client/v2/model/OrgResourceType.java | 53 +++ .../api/client/v2/api/organizations.feature | 6 + .../com/datadog/api/client/v2/api/undo.json | 12 + .../datadog/api/client/v2/api/users.feature | 14 + 18 files changed, 2376 insertions(+) create mode 100644 examples/v2/organizations/ListOrgs.java create mode 100644 examples/v2/users/DeleteUserInvitations.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrg.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrgs.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ManagedOrgsType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1d02f30912a..2158eb926be 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -40512,6 +40512,74 @@ components: - type - id type: object + ManagedOrgsData: + description: The managed organizations resource. + properties: + id: + description: The UUID of the current organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + relationships: + $ref: "#/components/schemas/ManagedOrgsRelationships" + type: + $ref: "#/components/schemas/ManagedOrgsType" + required: + - id + - type + - relationships + type: object + ManagedOrgsRelationshipToOrg: + description: Relationship to the current organization. + properties: + data: + $ref: "#/components/schemas/OrgRelationshipData" + required: + - data + type: object + ManagedOrgsRelationshipToOrgs: + description: Relationship to the managed organizations. + properties: + data: + description: List of managed organization references. + items: + $ref: "#/components/schemas/OrgRelationshipData" + type: array + required: + - data + type: object + ManagedOrgsRelationships: + description: Relationships of the managed organizations resource. + properties: + current_org: + $ref: "#/components/schemas/ManagedOrgsRelationshipToOrg" + managed_orgs: + $ref: "#/components/schemas/ManagedOrgsRelationshipToOrgs" + required: + - current_org + - managed_orgs + type: object + ManagedOrgsResponse: + description: Response containing the current organization and its managed organizations. + properties: + data: + $ref: "#/components/schemas/ManagedOrgsData" + included: + description: Included organization resources. + items: + $ref: "#/components/schemas/OrgData" + type: array + required: + - data + - included + type: object + ManagedOrgsType: + description: The resource type for managed organizations. + enum: [managed_orgs] + example: "managed_orgs" + type: string + x-enum-varnames: + - MANAGED_ORGS MemberTeam: description: A member team properties: @@ -49207,6 +49275,53 @@ components: x-enum-varnames: - ASC - DESC + OrgAttributes: + description: Attributes of an organization. + properties: + created_at: + description: The creation timestamp of the organization. + example: "2019-09-26T17:28:28Z" + format: date-time + type: string + description: + description: A description of the organization. + example: "Production organization." + type: string + disabled: + description: Whether the organization is disabled. + example: false + type: boolean + modified_at: + description: The last modification timestamp of the organization. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + name: + description: The name of the organization. + example: "My Organization" + type: string + public_id: + description: The public identifier of the organization. + example: "abcdef12345" + type: string + sharing: + description: The sharing setting of the organization. + example: "none" + type: string + url: + description: The URL of the organization. + example: "https://app.datadoghq.com/account/my-org" + type: string + required: + - public_id + - name + - description + - sharing + - url + - disabled + - created_at + - modified_at + type: object OrgConfigGetResponse: description: A response with a single Org Config. properties: @@ -49508,6 +49623,23 @@ components: type: string x-enum-varnames: - USERS + OrgData: + description: An organization resource. + properties: + attributes: + $ref: "#/components/schemas/OrgAttributes" + id: + description: The UUID of the organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + type: + $ref: "#/components/schemas/OrgResourceType" + required: + - id + - type + - attributes + type: object OrgGroupAttributes: description: Attributes of an org group. properties: @@ -50400,6 +50532,27 @@ components: required: - data type: object + OrgRelationshipData: + description: Reference to an organization resource. + properties: + id: + description: The UUID of the organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + type: + $ref: "#/components/schemas/OrgResourceType" + required: + - id + - type + type: object + OrgResourceType: + description: The resource type for organizations. + enum: [orgs] + example: "orgs" + type: string + x-enum-varnames: + - ORGS Organization: description: Organization object. properties: @@ -102090,6 +102243,83 @@ paths: operator: OR permissions: - on_call_read + /api/v2/org: + get: + description: Returns the current organization and its managed organizations in JSON:API format. + operationId: ListOrgs + parameters: + - description: Filter managed organizations by name. + example: "My Child Org" + in: query + name: "filter[name]" + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + relationships: + current_org: + data: + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + managed_orgs: + data: + - id: "a1b2c3d4-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + type: "managed_orgs" + included: + - attributes: + created_at: "2019-09-26T17:28:28Z" + description: "Production organization." + disabled: false + modified_at: "2024-01-15T10:30:00Z" + name: "My Organization" + public_id: "abcdef12345" + sharing: "none" + url: "https://app.datadoghq.com/account/my-org" + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + - attributes: + created_at: "2020-05-10T12:00:00Z" + description: "Child organization." + disabled: false + modified_at: "2024-06-20T08:15:00Z" + name: "My Child Org" + public_id: "ghijkl67890" + sharing: "none" + url: "https://app.datadoghq.com/account/my-child-org" + id: "a1b2c3d4-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + schema: + $ref: "#/components/schemas/ManagedOrgsResponse" + description: OK + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + - org_connections_write + summary: List your managed organizations + tags: + - Organizations + "x-permission": + operator: OR + permissions: + - org_management + - org_connections_write /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -120262,6 +120492,50 @@ paths: permissions: - user_access_manage - service_account_write + /api/v2/users/{user_id}/invitations: + delete: + description: |- + Cancel all pending invitations for a specified user. + Requires the `user_access_invite` permission. + operationId: DeleteUserInvitations + parameters: + - description: The UUID of the user whose pending invitations should be canceled. + in: path + name: user_id + required: true + schema: + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + responses: + "200": + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + summary: Delete a pending user's invitations + tags: + - Users + "x-permission": + operator: OR + permissions: + - user_access_invite /api/v2/users/{user_id}/orgs: get: description: |- diff --git a/examples/v2/organizations/ListOrgs.java b/examples/v2/organizations/ListOrgs.java new file mode 100644 index 00000000000..27a9c735d19 --- /dev/null +++ b/examples/v2/organizations/ListOrgs.java @@ -0,0 +1,24 @@ +// List your managed organizations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrganizationsApi; +import com.datadog.api.client.v2.model.ManagedOrgsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + try { + ManagedOrgsResponse result = apiInstance.listOrgs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsApi#listOrgs"); + 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/users/DeleteUserInvitations.java b/examples/v2/users/DeleteUserInvitations.java new file mode 100644 index 00000000000..33ca7b2bc13 --- /dev/null +++ b/examples/v2/users/DeleteUserInvitations.java @@ -0,0 +1,23 @@ +// Delete a pending user's invitations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.UsersApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + UsersApi apiInstance = new UsersApi(defaultClient); + + try { + apiInstance.deleteUserInvitations(UUID.fromString("4dee724d-00cc-11ea-a77b-570c9d03c6c5")); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#deleteUserInvitations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java index 4300bee6882..5580fbb74ce 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java @@ -4,6 +4,7 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.ManagedOrgsResponse; import com.datadog.api.client.v2.model.OrgConfigGetResponse; import com.datadog.api.client.v2.model.OrgConfigListResponse; import com.datadog.api.client.v2.model.OrgConfigWriteRequest; @@ -12,6 +13,7 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -298,6 +300,174 @@ public CompletableFuture> listOrgConfigsWithH new GenericType() {}); } + /** Manage optional parameters to listOrgs. */ + public static class ListOrgsOptionalParameters { + private String filterName; + + /** + * Set filterName. + * + * @param filterName Filter managed organizations by name. (optional) + * @return ListOrgsOptionalParameters + */ + public ListOrgsOptionalParameters filterName(String filterName) { + this.filterName = filterName; + return this; + } + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @return ManagedOrgsResponse + * @throws ApiException if fails to make API call + */ + public ManagedOrgsResponse listOrgs() throws ApiException { + return listOrgsWithHttpInfo(new ListOrgsOptionalParameters()).getData(); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfoAsync}. + * + * @return CompletableFuture<ManagedOrgsResponse> + */ + public CompletableFuture listOrgsAsync() { + return listOrgsWithHttpInfoAsync(new ListOrgsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ManagedOrgsResponse + * @throws ApiException if fails to make API call + */ + public ManagedOrgsResponse listOrgs(ListOrgsOptionalParameters parameters) throws ApiException { + return listOrgsWithHttpInfo(parameters).getData(); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ManagedOrgsResponse> + */ + public CompletableFuture listOrgsAsync( + ListOrgsOptionalParameters parameters) { + return listOrgsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the current organization and its managed organizations in JSON:API format. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ManagedOrgsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listOrgsWithHttpInfo( + ListOrgsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String filterName = parameters.filterName; + // create path and map variables + String localVarPath = "/api/v2/org"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listOrgs", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ManagedOrgsResponse>> + */ + public CompletableFuture> listOrgsWithHttpInfoAsync( + ListOrgsOptionalParameters parameters) { + Object localVarPostBody = null; + String filterName = parameters.filterName; + // create path and map variables + String localVarPath = "/api/v2/org"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listOrgs", + localVarPath, + localVarQueryParams, + 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() {}); + } + /** * Update a specific Org Config. * diff --git a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java index f348e82138d..27e4a8b31be 100644 --- a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java @@ -22,6 +22,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( @@ -184,6 +185,139 @@ public CompletableFuture> createUserWithHttpInfoAsync( new GenericType() {}); } + /** + * Delete a pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfo}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @throws ApiException if fails to make API call + */ + public void deleteUserInvitations(UUID userId) throws ApiException { + deleteUserInvitationsWithHttpInfo(userId); + } + + /** + * Delete a pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfoAsync}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteUserInvitationsAsync(UUID userId) { + return deleteUserInvitationsWithHttpInfoAsync(userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Cancel all pending invitations for a specified user. Requires the user_access_invite + * permission. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse deleteUserInvitationsWithHttpInfo(UUID userId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling deleteUserInvitations"); + } + // create path and map variables + String localVarPath = + "/api/v2/users/{user_id}/invitations" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.UsersApi.deleteUserInvitations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfo}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteUserInvitationsWithHttpInfoAsync(UUID userId) { + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userId' when calling deleteUserInvitations")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/users/{user_id}/invitations" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.UsersApi.deleteUserInvitations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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); + } + /** * Disable a user. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java new file mode 100644 index 00000000000..9e9f9072ed5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java @@ -0,0 +1,210 @@ +/* + * 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 java.util.UUID; + +/** The managed organizations resource. */ +@JsonPropertyOrder({ + ManagedOrgsData.JSON_PROPERTY_ID, + ManagedOrgsData.JSON_PROPERTY_RELATIONSHIPS, + ManagedOrgsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ManagedOrgsRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ManagedOrgsType type; + + public ManagedOrgsData() {} + + @JsonCreator + public ManagedOrgsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + ManagedOrgsRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ManagedOrgsType type) { + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ManagedOrgsData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the current organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ManagedOrgsData relationships(ManagedOrgsRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the managed organizations resource. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ManagedOrgsRelationships relationships) { + this.relationships = relationships; + } + + public ManagedOrgsData type(ManagedOrgsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for managed organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsType getType() { + return type; + } + + public void setType(ManagedOrgsType 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 ManagedOrgsData + */ + @JsonAnySetter + public ManagedOrgsData 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 ManagedOrgsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsData managedOrgsData = (ManagedOrgsData) o; + return Objects.equals(this.id, managedOrgsData.id) + && Objects.equals(this.relationships, managedOrgsData.relationships) + && Objects.equals(this.type, managedOrgsData.type) + && Objects.equals(this.additionalProperties, managedOrgsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsData {\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/ManagedOrgsRelationshipToOrg.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrg.java new file mode 100644 index 00000000000..de1813d6b75 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrg.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; + +/** Relationship to the current organization. */ +@JsonPropertyOrder({ManagedOrgsRelationshipToOrg.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationshipToOrg { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OrgRelationshipData data; + + public ManagedOrgsRelationshipToOrg() {} + + @JsonCreator + public ManagedOrgsRelationshipToOrg( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OrgRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ManagedOrgsRelationshipToOrg data(OrgRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Reference to an organization resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgRelationshipData getData() { + return data; + } + + public void setData(OrgRelationshipData 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 ManagedOrgsRelationshipToOrg + */ + @JsonAnySetter + public ManagedOrgsRelationshipToOrg 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 ManagedOrgsRelationshipToOrg object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationshipToOrg managedOrgsRelationshipToOrg = (ManagedOrgsRelationshipToOrg) o; + return Objects.equals(this.data, managedOrgsRelationshipToOrg.data) + && Objects.equals( + this.additionalProperties, managedOrgsRelationshipToOrg.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationshipToOrg {\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/ManagedOrgsRelationshipToOrgs.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrgs.java new file mode 100644 index 00000000000..be1d4a1f34c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrgs.java @@ -0,0 +1,155 @@ +/* + * 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; + +/** Relationship to the managed organizations. */ +@JsonPropertyOrder({ManagedOrgsRelationshipToOrgs.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationshipToOrgs { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ManagedOrgsRelationshipToOrgs() {} + + @JsonCreator + public ManagedOrgsRelationshipToOrgs( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ManagedOrgsRelationshipToOrgs data(List data) { + this.data = data; + for (OrgRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ManagedOrgsRelationshipToOrgs addDataItem(OrgRelationshipData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of managed organization references. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ManagedOrgsRelationshipToOrgs + */ + @JsonAnySetter + public ManagedOrgsRelationshipToOrgs 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 ManagedOrgsRelationshipToOrgs object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationshipToOrgs managedOrgsRelationshipToOrgs = (ManagedOrgsRelationshipToOrgs) o; + return Objects.equals(this.data, managedOrgsRelationshipToOrgs.data) + && Objects.equals( + this.additionalProperties, managedOrgsRelationshipToOrgs.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationshipToOrgs {\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/ManagedOrgsRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationships.java new file mode 100644 index 00000000000..659b07a2059 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationships.java @@ -0,0 +1,179 @@ +/* + * 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; + +/** Relationships of the managed organizations resource. */ +@JsonPropertyOrder({ + ManagedOrgsRelationships.JSON_PROPERTY_CURRENT_ORG, + ManagedOrgsRelationships.JSON_PROPERTY_MANAGED_ORGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURRENT_ORG = "current_org"; + private ManagedOrgsRelationshipToOrg currentOrg; + + public static final String JSON_PROPERTY_MANAGED_ORGS = "managed_orgs"; + private ManagedOrgsRelationshipToOrgs managedOrgs; + + public ManagedOrgsRelationships() {} + + @JsonCreator + public ManagedOrgsRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CURRENT_ORG) + ManagedOrgsRelationshipToOrg currentOrg, + @JsonProperty(required = true, value = JSON_PROPERTY_MANAGED_ORGS) + ManagedOrgsRelationshipToOrgs managedOrgs) { + this.currentOrg = currentOrg; + this.unparsed |= currentOrg.unparsed; + this.managedOrgs = managedOrgs; + this.unparsed |= managedOrgs.unparsed; + } + + public ManagedOrgsRelationships currentOrg(ManagedOrgsRelationshipToOrg currentOrg) { + this.currentOrg = currentOrg; + this.unparsed |= currentOrg.unparsed; + return this; + } + + /** + * Relationship to the current organization. + * + * @return currentOrg + */ + @JsonProperty(JSON_PROPERTY_CURRENT_ORG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationshipToOrg getCurrentOrg() { + return currentOrg; + } + + public void setCurrentOrg(ManagedOrgsRelationshipToOrg currentOrg) { + this.currentOrg = currentOrg; + } + + public ManagedOrgsRelationships managedOrgs(ManagedOrgsRelationshipToOrgs managedOrgs) { + this.managedOrgs = managedOrgs; + this.unparsed |= managedOrgs.unparsed; + return this; + } + + /** + * Relationship to the managed organizations. + * + * @return managedOrgs + */ + @JsonProperty(JSON_PROPERTY_MANAGED_ORGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationshipToOrgs getManagedOrgs() { + return managedOrgs; + } + + public void setManagedOrgs(ManagedOrgsRelationshipToOrgs managedOrgs) { + this.managedOrgs = managedOrgs; + } + + /** + * 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 ManagedOrgsRelationships + */ + @JsonAnySetter + public ManagedOrgsRelationships 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 ManagedOrgsRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationships managedOrgsRelationships = (ManagedOrgsRelationships) o; + return Objects.equals(this.currentOrg, managedOrgsRelationships.currentOrg) + && Objects.equals(this.managedOrgs, managedOrgsRelationships.managedOrgs) + && Objects.equals(this.additionalProperties, managedOrgsRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currentOrg, managedOrgs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationships {\n"); + sb.append(" currentOrg: ").append(toIndentedString(currentOrg)).append("\n"); + sb.append(" managedOrgs: ").append(toIndentedString(managedOrgs)).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/ManagedOrgsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsResponse.java new file mode 100644 index 00000000000..d469c9d953d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsResponse.java @@ -0,0 +1,186 @@ +/* + * 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 the current organization and its managed organizations. */ +@JsonPropertyOrder({ + ManagedOrgsResponse.JSON_PROPERTY_DATA, + ManagedOrgsResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ManagedOrgsData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = new ArrayList<>(); + + public ManagedOrgsResponse() {} + + @JsonCreator + public ManagedOrgsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ManagedOrgsData data, + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDED) List included) { + this.data = data; + this.unparsed |= data.unparsed; + this.included = included; + } + + public ManagedOrgsResponse data(ManagedOrgsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The managed organizations resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsData getData() { + return data; + } + + public void setData(ManagedOrgsData data) { + this.data = data; + } + + public ManagedOrgsResponse included(List included) { + this.included = included; + for (OrgData item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ManagedOrgsResponse addIncludedItem(OrgData includedItem) { + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included organization resources. + * + * @return included + */ + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 ManagedOrgsResponse + */ + @JsonAnySetter + public ManagedOrgsResponse 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 ManagedOrgsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsResponse managedOrgsResponse = (ManagedOrgsResponse) o; + return Objects.equals(this.data, managedOrgsResponse.data) + && Objects.equals(this.included, managedOrgsResponse.included) + && Objects.equals(this.additionalProperties, managedOrgsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsResponse {\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/ManagedOrgsType.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsType.java new file mode 100644 index 00000000000..6e62edf76bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsType.java @@ -0,0 +1,54 @@ +/* + * 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 resource type for managed organizations. */ +@JsonSerialize(using = ManagedOrgsType.ManagedOrgsTypeSerializer.class) +public class ManagedOrgsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("managed_orgs")); + + public static final ManagedOrgsType MANAGED_ORGS = new ManagedOrgsType("managed_orgs"); + + ManagedOrgsType(String value) { + super(value, allowedValues); + } + + public static class ManagedOrgsTypeSerializer extends StdSerializer { + public ManagedOrgsTypeSerializer(Class t) { + super(t); + } + + public ManagedOrgsTypeSerializer() { + this(null); + } + + @Override + public void serialize(ManagedOrgsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ManagedOrgsType fromValue(String value) { + return new ManagedOrgsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java new file mode 100644 index 00000000000..d639720e76c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java @@ -0,0 +1,351 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an organization. */ +@JsonPropertyOrder({ + OrgAttributes.JSON_PROPERTY_CREATED_AT, + OrgAttributes.JSON_PROPERTY_DESCRIPTION, + OrgAttributes.JSON_PROPERTY_DISABLED, + OrgAttributes.JSON_PROPERTY_MODIFIED_AT, + OrgAttributes.JSON_PROPERTY_NAME, + OrgAttributes.JSON_PROPERTY_PUBLIC_ID, + OrgAttributes.JSON_PROPERTY_SHARING, + OrgAttributes.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DISABLED = "disabled"; + private Boolean disabled; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public static final String JSON_PROPERTY_SHARING = "sharing"; + private String sharing; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public OrgAttributes() {} + + @JsonCreator + public OrgAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_DISABLED) Boolean disabled, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PUBLIC_ID) String publicId, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARING) String sharing, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.createdAt = createdAt; + this.description = description; + this.disabled = disabled; + this.modifiedAt = modifiedAt; + this.name = name; + this.publicId = publicId; + this.sharing = sharing; + this.url = url; + } + + public OrgAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation timestamp of the organization. + * + * @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 OrgAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the organization. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public OrgAttributes disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * Whether the organization is disabled. + * + * @return disabled + */ + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDisabled() { + return disabled; + } + + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + + public OrgAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The last modification timestamp of the organization. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public OrgAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the organization. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public OrgAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The public identifier of the organization. + * + * @return publicId + */ + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + public OrgAttributes sharing(String sharing) { + this.sharing = sharing; + return this; + } + + /** + * The sharing setting of the organization. + * + * @return sharing + */ + @JsonProperty(JSON_PROPERTY_SHARING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSharing() { + return sharing; + } + + public void setSharing(String sharing) { + this.sharing = sharing; + } + + public OrgAttributes url(String url) { + this.url = url; + return this; + } + + /** + * The URL of the organization. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * 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 OrgAttributes + */ + @JsonAnySetter + public OrgAttributes 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 OrgAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgAttributes orgAttributes = (OrgAttributes) o; + return Objects.equals(this.createdAt, orgAttributes.createdAt) + && Objects.equals(this.description, orgAttributes.description) + && Objects.equals(this.disabled, orgAttributes.disabled) + && Objects.equals(this.modifiedAt, orgAttributes.modifiedAt) + && Objects.equals(this.name, orgAttributes.name) + && Objects.equals(this.publicId, orgAttributes.publicId) + && Objects.equals(this.sharing, orgAttributes.sharing) + && Objects.equals(this.url, orgAttributes.url) + && Objects.equals(this.additionalProperties, orgAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + disabled, + modifiedAt, + name, + publicId, + sharing, + url, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" sharing: ").append(toIndentedString(sharing)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/OrgData.java b/src/main/java/com/datadog/api/client/v2/model/OrgData.java new file mode 100644 index 00000000000..8116c9b7077 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgData.java @@ -0,0 +1,209 @@ +/* + * 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 java.util.UUID; + +/** An organization resource. */ +@JsonPropertyOrder({ + OrgData.JSON_PROPERTY_ATTRIBUTES, + OrgData.JSON_PROPERTY_ID, + OrgData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OrgAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OrgResourceType type; + + public OrgData() {} + + @JsonCreator + public OrgData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) OrgAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OrgResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OrgData attributes(OrgAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an organization. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OrgAttributes attributes) { + this.attributes = attributes; + } + + public OrgData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OrgData type(OrgResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgResourceType getType() { + return type; + } + + public void setType(OrgResourceType 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 OrgData + */ + @JsonAnySetter + public OrgData 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 OrgData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgData orgData = (OrgData) o; + return Objects.equals(this.attributes, orgData.attributes) + && Objects.equals(this.id, orgData.id) + && Objects.equals(this.type, orgData.type) + && Objects.equals(this.additionalProperties, orgData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgData {\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/OrgRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java new file mode 100644 index 00000000000..3283637b946 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java @@ -0,0 +1,176 @@ +/* + * 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 java.util.UUID; + +/** Reference to an organization resource. */ +@JsonPropertyOrder({OrgRelationshipData.JSON_PROPERTY_ID, OrgRelationshipData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OrgResourceType type; + + public OrgRelationshipData() {} + + @JsonCreator + public OrgRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OrgResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OrgRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OrgRelationshipData type(OrgResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgResourceType getType() { + return type; + } + + public void setType(OrgResourceType 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 OrgRelationshipData + */ + @JsonAnySetter + public OrgRelationshipData 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 OrgRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgRelationshipData orgRelationshipData = (OrgRelationshipData) o; + return Objects.equals(this.id, orgRelationshipData.id) + && Objects.equals(this.type, orgRelationshipData.type) + && Objects.equals(this.additionalProperties, orgRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgRelationshipData {\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/OrgResourceType.java b/src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java new file mode 100644 index 00000000000..688fcc32ca3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java @@ -0,0 +1,53 @@ +/* + * 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 resource type for organizations. */ +@JsonSerialize(using = OrgResourceType.OrgResourceTypeSerializer.class) +public class OrgResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("orgs")); + + public static final OrgResourceType ORGS = new OrgResourceType("orgs"); + + OrgResourceType(String value) { + super(value, allowedValues); + } + + public static class OrgResourceTypeSerializer extends StdSerializer { + public OrgResourceTypeSerializer(Class t) { + super(t); + } + + public OrgResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize(OrgResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OrgResourceType fromValue(String value) { + return new OrgResourceType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature index 45e56056c24..d50c9a305d5 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature @@ -41,6 +41,12 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/org-management + Scenario: List your managed organizations returns "OK" response + Given new "ListOrgs" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/org-management Scenario: Update a specific Org Config returns "Bad Request" response Given new "UpdateOrgConfig" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index bb84d5c5e03..471be1cd73c 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 @@ -4076,6 +4076,12 @@ "type": "safe" } }, + "ListOrgs": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { @@ -6872,6 +6878,12 @@ "type": "idempotent" } }, + "DeleteUserInvitations": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, "ListUserOrganizations": { "tag": "Users", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/users.feature b/src/test/resources/com/datadog/api/client/v2/api/users.feature index f64d3b89463..6e4f65eb57d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/users.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/users.feature @@ -25,6 +25,20 @@ Feature: Users And the response "data.attributes.disabled" is false And the response "data.attributes.service_account" is false + @generated @skip @team:DataDog/org-management + Scenario: Delete a pending user's invitations returns "Not found" response + Given new "DeleteUserInvitations" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/org-management + Scenario: Delete a pending user's invitations returns "OK" response + Given new "DeleteUserInvitations" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Disable a user returns "Not found" response Given new "DisableUser" request