From 04f913f8cbb86da00b843ed0e58f825766deffa5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Jun 2026 14:29:03 +0000 Subject: [PATCH] Regenerate client from commit 10cb14e of spec repo --- .generator/schemas/v2/openapi.yaml | 254 ++++++++++++++++ examples/v2/organizations/ListGlobalOrgs.java | 24 ++ .../ListGlobalOrgs_465966063.java | 26 ++ .../api/client/v2/api/OrganizationsApi.java | 272 +++++++++++++++++ .../api/client/v2/model/GlobalOrg.java | 277 ++++++++++++++++++ .../client/v2/model/GlobalOrgAttributes.java | 243 +++++++++++++++ .../api/client/v2/model/GlobalOrgData.java | 209 +++++++++++++ .../api/client/v2/model/GlobalOrgType.java | 54 ++++ .../api/client/v2/model/GlobalOrgUser.java | 202 +++++++++++++ .../api/client/v2/model/GlobalOrgsLinks.java | 212 ++++++++++++++ .../api/client/v2/model/GlobalOrgsMeta.java | 136 +++++++++ .../client/v2/model/GlobalOrgsMetaPage.java | 270 +++++++++++++++++ .../v2/model/GlobalOrgsMetaPageType.java | 55 ++++ .../client/v2/model/GlobalOrgsResponse.java | 212 ++++++++++++++ .../api/client/v2/api/organizations.feature | 21 ++ .../com/datadog/api/client/v2/api/undo.json | 6 + 16 files changed, 2473 insertions(+) create mode 100644 examples/v2/organizations/ListGlobalOrgs.java create mode 100644 examples/v2/organizations/ListGlobalOrgs_465966063.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrg.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgUser.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgsLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPageType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GlobalOrgsResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a3477e5791c..28246fadb69 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -37347,6 +37347,75 @@ components: type: string x-enum-varnames: - INCIDENTS_GLOBAL_SETTINGS + GlobalOrg: + description: Organization information for a global organization association. + properties: + id: + description: The numeric ID of the organization. + example: 123 + format: int64 + type: integer + name: + description: The name of the organization. + example: Example Org + type: string + public_id: + description: The public identifier of the organization. + example: abcdef12345 + nullable: true + type: string + subdomain: + description: The subdomain used to access the organization, if configured. + example: example + nullable: true + type: string + uuid: + description: The UUID of the organization. + example: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + format: uuid + type: string + required: + - id + - uuid + - name + type: object + GlobalOrgAttributes: + description: Attributes of an organization associated with the authenticated user. + properties: + org: + $ref: "#/components/schemas/GlobalOrg" + redirect_url: + description: The login URL used to switch into the organization, if available. + example: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + nullable: true + type: string + source_region: + description: The source region of the organization. + example: us1.prod.dog + type: string + user: + $ref: "#/components/schemas/GlobalOrgUser" + required: + - user + - org + - source_region + type: object + GlobalOrgData: + description: An organization associated with the authenticated user. + properties: + attributes: + $ref: "#/components/schemas/GlobalOrgAttributes" + id: + description: A unique identifier for this user and organization association. + example: "cfab5cf9-5472-48ea-a79c-a64045f4f745-13d10a96-6ff2-49be-be7b-4f56ebb13335" + type: string + type: + $ref: "#/components/schemas/GlobalOrgType" + required: + - id + - type + - attributes + type: object GlobalOrgIdentifier: description: A unique identifier for an organization including its site. properties: @@ -37363,6 +37432,104 @@ components: - org_uuid - org_site type: object + GlobalOrgType: + description: The resource type for global user organizations. + enum: [global_user_orgs] + example: global_user_orgs + type: string + x-enum-varnames: + - GLOBAL_USER_ORGS + GlobalOrgUser: + description: User information for a global organization association. + properties: + handle: + description: The handle of the user. + example: user@example.com + type: string + id: + description: The numeric ID of the user. + example: 42 + format: int64 + type: integer + uuid: + description: The UUID of the user. + example: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + format: uuid + type: string + required: + - id + - uuid + - handle + type: object + GlobalOrgsLinks: + description: Pagination links. + properties: + next: + description: Link to the next page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + type: string + type: object + GlobalOrgsMeta: + description: Response metadata object. + properties: + page: + $ref: "#/components/schemas/GlobalOrgsMetaPage" + type: object + GlobalOrgsMetaPage: + description: Paging attributes. + properties: + cursor: + description: The cursor used to get the current results, if any. + example: "" + type: string + limit: + description: Number of results returned. + example: 100 + format: int32 + type: integer + next_cursor: + description: The cursor used to get the next results, if any. + example: next-page + nullable: true + type: string + prev_cursor: + description: The cursor used to get the previous results, if any. + nullable: true + type: string + type: + $ref: "#/components/schemas/GlobalOrgsMetaPageType" + type: object + GlobalOrgsMetaPageType: + description: Type of global orgs pagination. + enum: [cursor] + example: cursor + type: string + x-enum-varnames: + - CURSOR + GlobalOrgsResponse: + description: Response containing organizations across regions for the authenticated user. + properties: + data: + description: Organizations across regions for the authenticated user. + items: + $ref: "#/components/schemas/GlobalOrgData" + type: array + links: + $ref: "#/components/schemas/GlobalOrgsLinks" + meta: + $ref: "#/components/schemas/GlobalOrgsMeta" + required: + - data + type: object GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. properties: @@ -119736,6 +119903,93 @@ paths: permissions: - feature_flag_config_write - feature_flag_environment_config_read + /api/v2/global_orgs: + get: + description: |- + Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + operationId: ListGlobalOrgs + parameters: + - description: The handle of the authenticated user. + in: query + name: user_handle + required: true + schema: + example: user@example.com + type: string + - description: Maximum number of results returned. + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: |- + String to query the next page of results. + This key is provided with each valid response from the API in `meta.page.next_cursor`. + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + org: + id: 123 + name: Example Org + public_id: abcdef12345 + subdomain: example + uuid: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + redirect_url: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + source_region: us1.prod.dog + user: + handle: user@example.com + id: 42 + uuid: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + id: "cfab5cf9-5472-48ea-a79c-a64045f4f745-13d10a96-6ff2-49be-be7b-4f56ebb13335" + type: global_user_orgs + links: + next: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + self: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + meta: + page: + cursor: "" + limit: 100 + next_cursor: next-page + type: cursor + schema: + $ref: "#/components/schemas/GlobalOrgsResponse" + description: OK + "400": {$ref: "#/components/responses/BadRequestResponse"} + "401": {$ref: "#/components/responses/UnauthorizedResponse"} + "403": {$ref: "#/components/responses/ForbiddenResponse"} + "429": {$ref: "#/components/responses/TooManyRequestsResponse"} + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_read + summary: List global orgs + tags: + - Organizations + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.next_cursor + limitParam: page[limit] + resultsPath: data + "x-permission": + operator: OR + permissions: + - user_access_read /api/v2/hamr: get: description: |- diff --git a/examples/v2/organizations/ListGlobalOrgs.java b/examples/v2/organizations/ListGlobalOrgs.java new file mode 100644 index 00000000000..3dd23d0acf9 --- /dev/null +++ b/examples/v2/organizations/ListGlobalOrgs.java @@ -0,0 +1,24 @@ +// List global orgs 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.GlobalOrgsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + try { + GlobalOrgsResponse result = apiInstance.listGlobalOrgs("user@example.com"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsApi#listGlobalOrgs"); + 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/organizations/ListGlobalOrgs_465966063.java b/examples/v2/organizations/ListGlobalOrgs_465966063.java new file mode 100644 index 00000000000..1165077ba05 --- /dev/null +++ b/examples/v2/organizations/ListGlobalOrgs_465966063.java @@ -0,0 +1,26 @@ +// List global orgs returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.OrganizationsApi; +import com.datadog.api.client.v2.model.GlobalOrgData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listGlobalOrgsWithPagination("user@example.com"); + + for (GlobalOrgData item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling OrganizationsApi#listGlobalOrgsWithPagination"); + System.err.println("Reason: " + e.getMessage()); + 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 5580fbb74ce..72e67eeca28 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 @@ -3,7 +3,10 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GlobalOrgData; +import com.datadog.api.client.v2.model.GlobalOrgsResponse; import com.datadog.api.client.v2.model.ManagedOrgsResponse; import com.datadog.api.client.v2.model.OrgConfigGetResponse; import com.datadog.api.client.v2.model.OrgConfigListResponse; @@ -13,6 +16,7 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -189,6 +193,274 @@ public CompletableFuture> getOrgConfigWithHttp new GenericType() {}); } + /** Manage optional parameters to listGlobalOrgs. */ + public static class ListGlobalOrgsOptionalParameters { + private Integer pageLimit; + private String pageCursor; + + /** + * Set pageLimit. + * + * @param pageLimit Maximum number of results returned. (optional, default to 100) + * @return ListGlobalOrgsOptionalParameters + */ + public ListGlobalOrgsOptionalParameters pageLimit(Integer pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set pageCursor. + * + * @param pageCursor String to query the next page of results. This key is provided with each + * valid response from the API in meta.page.next_cursor. (optional) + * @return ListGlobalOrgsOptionalParameters + */ + public ListGlobalOrgsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfo}. + * + * @param userHandle The handle of the authenticated user. (required) + * @return GlobalOrgsResponse + * @throws ApiException if fails to make API call + */ + public GlobalOrgsResponse listGlobalOrgs(String userHandle) throws ApiException { + return listGlobalOrgsWithHttpInfo(userHandle, new ListGlobalOrgsOptionalParameters()).getData(); + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfoAsync}. + * + * @param userHandle The handle of the authenticated user. (required) + * @return CompletableFuture<GlobalOrgsResponse> + */ + public CompletableFuture listGlobalOrgsAsync(String userHandle) { + return listGlobalOrgsWithHttpInfoAsync(userHandle, new ListGlobalOrgsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfo}. + * + * @param userHandle The handle of the authenticated user. (required) + * @param parameters Optional parameters for the request. + * @return GlobalOrgsResponse + * @throws ApiException if fails to make API call + */ + public GlobalOrgsResponse listGlobalOrgs( + String userHandle, ListGlobalOrgsOptionalParameters parameters) throws ApiException { + return listGlobalOrgsWithHttpInfo(userHandle, parameters).getData(); + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfoAsync}. + * + * @param userHandle The handle of the authenticated user. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GlobalOrgsResponse> + */ + public CompletableFuture listGlobalOrgsAsync( + String userHandle, ListGlobalOrgsOptionalParameters parameters) { + return listGlobalOrgsWithHttpInfoAsync(userHandle, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfo}. + * + * @param userHandle The handle of the authenticated user. (required) + * @return PaginationIterable<GlobalOrgData> + */ + public PaginationIterable listGlobalOrgsWithPagination(String userHandle) { + ListGlobalOrgsOptionalParameters parameters = new ListGlobalOrgsOptionalParameters(); + return listGlobalOrgsWithPagination(userHandle, parameters); + } + + /** + * List global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfo}. + * + * @param userHandle The handle of the authenticated user. (required) + * @return GlobalOrgsResponse + */ + public PaginationIterable listGlobalOrgsWithPagination( + String userHandle, ListGlobalOrgsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getNextCursor"; + String valueSetterPath = "pageCursor"; + Boolean valueSetterParamOptional = true; + Integer limit; + + if (parameters.pageLimit == null) { + limit = 100; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("userHandle", userHandle); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listGlobalOrgs", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * Returns organizations across regions for the authenticated user. The user_handle + * query parameter must match the authenticated user's handle. + * + * @param userHandle The handle of the authenticated user. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<GlobalOrgsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listGlobalOrgsWithHttpInfo( + String userHandle, ListGlobalOrgsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'userHandle' is set + if (userHandle == null) { + throw new ApiException( + 400, "Missing the required parameter 'userHandle' when calling listGlobalOrgs"); + } + Integer pageLimit = parameters.pageLimit; + String pageCursor = parameters.pageCursor; + // create path and map variables + String localVarPath = "/api/v2/global_orgs"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_handle", userHandle)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listGlobalOrgs", + 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 global orgs. + * + *

See {@link #listGlobalOrgsWithHttpInfo}. + * + * @param userHandle The handle of the authenticated user. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GlobalOrgsResponse>> + */ + public CompletableFuture> listGlobalOrgsWithHttpInfoAsync( + String userHandle, ListGlobalOrgsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'userHandle' is set + if (userHandle == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userHandle' when calling listGlobalOrgs")); + return result; + } + Integer pageLimit = parameters.pageLimit; + String pageCursor = parameters.pageCursor; + // create path and map variables + String localVarPath = "/api/v2/global_orgs"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_handle", userHandle)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listGlobalOrgs", + 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() {}); + } + /** * List Org Configs. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalOrg.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrg.java new file mode 100644 index 00000000000..19b91c1c146 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrg.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.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Organization information for a global organization association. */ +@JsonPropertyOrder({ + GlobalOrg.JSON_PROPERTY_ID, + GlobalOrg.JSON_PROPERTY_NAME, + GlobalOrg.JSON_PROPERTY_PUBLIC_ID, + GlobalOrg.JSON_PROPERTY_SUBDOMAIN, + GlobalOrg.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrg { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private JsonNullable publicId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBDOMAIN = "subdomain"; + private JsonNullable subdomain = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public GlobalOrg() {} + + @JsonCreator + public GlobalOrg( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) Long id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) UUID uuid) { + this.id = id; + this.name = name; + this.uuid = uuid; + } + + public GlobalOrg id(Long id) { + this.id = id; + return this; + } + + /** + * The numeric ID of the organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public GlobalOrg 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 GlobalOrg publicId(String publicId) { + this.publicId = JsonNullable.of(publicId); + return this; + } + + /** + * The public identifier of the organization. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPublicId() { + return publicId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPublicId_JsonNullable() { + return publicId; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + public void setPublicId_JsonNullable(JsonNullable publicId) { + this.publicId = publicId; + } + + public void setPublicId(String publicId) { + this.publicId = JsonNullable.of(publicId); + } + + public GlobalOrg subdomain(String subdomain) { + this.subdomain = JsonNullable.of(subdomain); + return this; + } + + /** + * The subdomain used to access the organization, if configured. + * + * @return subdomain + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSubdomain() { + return subdomain.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBDOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubdomain_JsonNullable() { + return subdomain; + } + + @JsonProperty(JSON_PROPERTY_SUBDOMAIN) + public void setSubdomain_JsonNullable(JsonNullable subdomain) { + this.subdomain = subdomain; + } + + public void setSubdomain(String subdomain) { + this.subdomain = JsonNullable.of(subdomain); + } + + public GlobalOrg uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * The UUID of the organization. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * 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 GlobalOrg + */ + @JsonAnySetter + public GlobalOrg 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 GlobalOrg object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrg globalOrg = (GlobalOrg) o; + return Objects.equals(this.id, globalOrg.id) + && Objects.equals(this.name, globalOrg.name) + && Objects.equals(this.publicId, globalOrg.publicId) + && Objects.equals(this.subdomain, globalOrg.subdomain) + && Objects.equals(this.uuid, globalOrg.uuid) + && Objects.equals(this.additionalProperties, globalOrg.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, publicId, subdomain, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrg {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" subdomain: ").append(toIndentedString(subdomain)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).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/GlobalOrgAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgAttributes.java new file mode 100644 index 00000000000..cec24faa1db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgAttributes.java @@ -0,0 +1,243 @@ +/* + * 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; + +/** Attributes of an organization associated with the authenticated user. */ +@JsonPropertyOrder({ + GlobalOrgAttributes.JSON_PROPERTY_ORG, + GlobalOrgAttributes.JSON_PROPERTY_REDIRECT_URL, + GlobalOrgAttributes.JSON_PROPERTY_SOURCE_REGION, + GlobalOrgAttributes.JSON_PROPERTY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ORG = "org"; + private GlobalOrg org; + + public static final String JSON_PROPERTY_REDIRECT_URL = "redirect_url"; + private JsonNullable redirectUrl = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SOURCE_REGION = "source_region"; + private String sourceRegion; + + public static final String JSON_PROPERTY_USER = "user"; + private GlobalOrgUser user; + + public GlobalOrgAttributes() {} + + @JsonCreator + public GlobalOrgAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ORG) GlobalOrg org, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE_REGION) String sourceRegion, + @JsonProperty(required = true, value = JSON_PROPERTY_USER) GlobalOrgUser user) { + this.org = org; + this.unparsed |= org.unparsed; + this.sourceRegion = sourceRegion; + this.user = user; + this.unparsed |= user.unparsed; + } + + public GlobalOrgAttributes org(GlobalOrg org) { + this.org = org; + this.unparsed |= org.unparsed; + return this; + } + + /** + * Organization information for a global organization association. + * + * @return org + */ + @JsonProperty(JSON_PROPERTY_ORG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalOrg getOrg() { + return org; + } + + public void setOrg(GlobalOrg org) { + this.org = org; + } + + public GlobalOrgAttributes redirectUrl(String redirectUrl) { + this.redirectUrl = JsonNullable.of(redirectUrl); + return this; + } + + /** + * The login URL used to switch into the organization, if available. + * + * @return redirectUrl + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getRedirectUrl() { + return redirectUrl.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRedirectUrl_JsonNullable() { + return redirectUrl; + } + + @JsonProperty(JSON_PROPERTY_REDIRECT_URL) + public void setRedirectUrl_JsonNullable(JsonNullable redirectUrl) { + this.redirectUrl = redirectUrl; + } + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = JsonNullable.of(redirectUrl); + } + + public GlobalOrgAttributes sourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * The source region of the organization. + * + * @return sourceRegion + */ + @JsonProperty(JSON_PROPERTY_SOURCE_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSourceRegion() { + return sourceRegion; + } + + public void setSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + } + + public GlobalOrgAttributes user(GlobalOrgUser user) { + this.user = user; + this.unparsed |= user.unparsed; + return this; + } + + /** + * User information for a global organization association. + * + * @return user + */ + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalOrgUser getUser() { + return user; + } + + public void setUser(GlobalOrgUser user) { + this.user = user; + } + + /** + * 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 GlobalOrgAttributes + */ + @JsonAnySetter + public GlobalOrgAttributes 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 GlobalOrgAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgAttributes globalOrgAttributes = (GlobalOrgAttributes) o; + return Objects.equals(this.org, globalOrgAttributes.org) + && Objects.equals(this.redirectUrl, globalOrgAttributes.redirectUrl) + && Objects.equals(this.sourceRegion, globalOrgAttributes.sourceRegion) + && Objects.equals(this.user, globalOrgAttributes.user) + && Objects.equals(this.additionalProperties, globalOrgAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(org, redirectUrl, sourceRegion, user, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgAttributes {\n"); + sb.append(" org: ").append(toIndentedString(org)).append("\n"); + sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); + sb.append(" sourceRegion: ").append(toIndentedString(sourceRegion)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).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/GlobalOrgData.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgData.java new file mode 100644 index 00000000000..8613c69f894 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgData.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; + +/** An organization associated with the authenticated user. */ +@JsonPropertyOrder({ + GlobalOrgData.JSON_PROPERTY_ATTRIBUTES, + GlobalOrgData.JSON_PROPERTY_ID, + GlobalOrgData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GlobalOrgAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalOrgType type; + + public GlobalOrgData() {} + + @JsonCreator + public GlobalOrgData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GlobalOrgAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) GlobalOrgType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GlobalOrgData attributes(GlobalOrgAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an organization associated with the authenticated user. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalOrgAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GlobalOrgAttributes attributes) { + this.attributes = attributes; + } + + public GlobalOrgData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier for this user and organization association. + * + * @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 GlobalOrgData type(GlobalOrgType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for global user organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GlobalOrgType getType() { + return type; + } + + public void setType(GlobalOrgType 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 GlobalOrgData + */ + @JsonAnySetter + public GlobalOrgData 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 GlobalOrgData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgData globalOrgData = (GlobalOrgData) o; + return Objects.equals(this.attributes, globalOrgData.attributes) + && Objects.equals(this.id, globalOrgData.id) + && Objects.equals(this.type, globalOrgData.type) + && Objects.equals(this.additionalProperties, globalOrgData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgData {\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/GlobalOrgType.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgType.java new file mode 100644 index 00000000000..b412efc9244 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgType.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 global user organizations. */ +@JsonSerialize(using = GlobalOrgType.GlobalOrgTypeSerializer.class) +public class GlobalOrgType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("global_user_orgs")); + + public static final GlobalOrgType GLOBAL_USER_ORGS = new GlobalOrgType("global_user_orgs"); + + GlobalOrgType(String value) { + super(value, allowedValues); + } + + public static class GlobalOrgTypeSerializer extends StdSerializer { + public GlobalOrgTypeSerializer(Class t) { + super(t); + } + + public GlobalOrgTypeSerializer() { + this(null); + } + + @Override + public void serialize(GlobalOrgType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GlobalOrgType fromValue(String value) { + return new GlobalOrgType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalOrgUser.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgUser.java new file mode 100644 index 00000000000..764d61a804a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgUser.java @@ -0,0 +1,202 @@ +/* + * 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; + +/** User information for a global organization association. */ +@JsonPropertyOrder({ + GlobalOrgUser.JSON_PROPERTY_HANDLE, + GlobalOrgUser.JSON_PROPERTY_ID, + GlobalOrgUser.JSON_PROPERTY_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public GlobalOrgUser() {} + + @JsonCreator + public GlobalOrgUser( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) Long id, + @JsonProperty(required = true, value = JSON_PROPERTY_UUID) UUID uuid) { + this.handle = handle; + this.id = id; + this.uuid = uuid; + } + + public GlobalOrgUser handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public GlobalOrgUser id(Long id) { + this.id = id; + return this; + } + + /** + * The numeric ID of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public GlobalOrgUser uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * The UUID of the user. + * + * @return uuid + */ + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * 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 GlobalOrgUser + */ + @JsonAnySetter + public GlobalOrgUser 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 GlobalOrgUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgUser globalOrgUser = (GlobalOrgUser) o; + return Objects.equals(this.handle, globalOrgUser.handle) + && Objects.equals(this.id, globalOrgUser.id) + && Objects.equals(this.uuid, globalOrgUser.uuid) + && Objects.equals(this.additionalProperties, globalOrgUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, id, uuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgUser {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).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/GlobalOrgsLinks.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsLinks.java new file mode 100644 index 00000000000..fa127e6f979 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsLinks.java @@ -0,0 +1,212 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Pagination links. */ +@JsonPropertyOrder({ + GlobalOrgsLinks.JSON_PROPERTY_NEXT, + GlobalOrgsLinks.JSON_PROPERTY_PREV, + GlobalOrgsLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgsLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NEXT = "next"; + private JsonNullable next = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PREV = "prev"; + private JsonNullable prev = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public GlobalOrgsLinks next(String next) { + this.next = JsonNullable.of(next); + return this; + } + + /** + * Link to the next page. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNext() { + return next.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNext_JsonNullable() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + public void setNext_JsonNullable(JsonNullable next) { + this.next = next; + } + + public void setNext(String next) { + this.next = JsonNullable.of(next); + } + + public GlobalOrgsLinks prev(String prev) { + this.prev = JsonNullable.of(prev); + return this; + } + + /** + * Link to the previous page. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrev() { + return prev.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrev_JsonNullable() { + return prev; + } + + @JsonProperty(JSON_PROPERTY_PREV) + public void setPrev_JsonNullable(JsonNullable prev) { + this.prev = prev; + } + + public void setPrev(String prev) { + this.prev = JsonNullable.of(prev); + } + + public GlobalOrgsLinks self(String self) { + this.self = self; + return this; + } + + /** + * Link to the current page. + * + * @return self + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 GlobalOrgsLinks + */ + @JsonAnySetter + public GlobalOrgsLinks 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 GlobalOrgsLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgsLinks globalOrgsLinks = (GlobalOrgsLinks) o; + return Objects.equals(this.next, globalOrgsLinks.next) + && Objects.equals(this.prev, globalOrgsLinks.prev) + && Objects.equals(this.self, globalOrgsLinks.self) + && Objects.equals(this.additionalProperties, globalOrgsLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(next, prev, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgsLinks {\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).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/GlobalOrgsMeta.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMeta.java new file mode 100644 index 00000000000..97650c6aab2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMeta.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Response metadata object. */ +@JsonPropertyOrder({GlobalOrgsMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgsMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private GlobalOrgsMetaPage page; + + public GlobalOrgsMeta page(GlobalOrgsMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Paging attributes. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalOrgsMetaPage getPage() { + return page; + } + + public void setPage(GlobalOrgsMetaPage page) { + this.page = page; + } + + /** + * 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 GlobalOrgsMeta + */ + @JsonAnySetter + public GlobalOrgsMeta 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 GlobalOrgsMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgsMeta globalOrgsMeta = (GlobalOrgsMeta) o; + return Objects.equals(this.page, globalOrgsMeta.page) + && Objects.equals(this.additionalProperties, globalOrgsMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgsMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/GlobalOrgsMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPage.java new file mode 100644 index 00000000000..935d9e45503 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPage.java @@ -0,0 +1,270 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Paging attributes. */ +@JsonPropertyOrder({ + GlobalOrgsMetaPage.JSON_PROPERTY_CURSOR, + GlobalOrgsMetaPage.JSON_PROPERTY_LIMIT, + GlobalOrgsMetaPage.JSON_PROPERTY_NEXT_CURSOR, + GlobalOrgsMetaPage.JSON_PROPERTY_PREV_CURSOR, + GlobalOrgsMetaPage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgsMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURSOR = "cursor"; + private String cursor; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Integer limit; + + public static final String JSON_PROPERTY_NEXT_CURSOR = "next_cursor"; + private JsonNullable nextCursor = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PREV_CURSOR = "prev_cursor"; + private JsonNullable prevCursor = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private GlobalOrgsMetaPageType type; + + public GlobalOrgsMetaPage cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * The cursor used to get the current results, if any. + * + * @return cursor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public GlobalOrgsMetaPage limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Number of results returned. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public GlobalOrgsMetaPage nextCursor(String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + return this; + } + + /** + * The cursor used to get the next results, if any. + * + * @return nextCursor + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNextCursor() { + return nextCursor.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { + this.nextCursor = nextCursor; + } + + public void setNextCursor(String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + + public GlobalOrgsMetaPage prevCursor(String prevCursor) { + this.prevCursor = JsonNullable.of(prevCursor); + return this; + } + + /** + * The cursor used to get the previous results, if any. + * + * @return prevCursor + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrevCursor() { + return prevCursor.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrevCursor_JsonNullable() { + return prevCursor; + } + + @JsonProperty(JSON_PROPERTY_PREV_CURSOR) + public void setPrevCursor_JsonNullable(JsonNullable prevCursor) { + this.prevCursor = prevCursor; + } + + public void setPrevCursor(String prevCursor) { + this.prevCursor = JsonNullable.of(prevCursor); + } + + public GlobalOrgsMetaPage type(GlobalOrgsMetaPageType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of global orgs pagination. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalOrgsMetaPageType getType() { + return type; + } + + public void setType(GlobalOrgsMetaPageType 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 GlobalOrgsMetaPage + */ + @JsonAnySetter + public GlobalOrgsMetaPage 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 GlobalOrgsMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgsMetaPage globalOrgsMetaPage = (GlobalOrgsMetaPage) o; + return Objects.equals(this.cursor, globalOrgsMetaPage.cursor) + && Objects.equals(this.limit, globalOrgsMetaPage.limit) + && Objects.equals(this.nextCursor, globalOrgsMetaPage.nextCursor) + && Objects.equals(this.prevCursor, globalOrgsMetaPage.prevCursor) + && Objects.equals(this.type, globalOrgsMetaPage.type) + && Objects.equals(this.additionalProperties, globalOrgsMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, limit, nextCursor, prevCursor, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgsMetaPage {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append(" prevCursor: ").append(toIndentedString(prevCursor)).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/GlobalOrgsMetaPageType.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPageType.java new file mode 100644 index 00000000000..68f90d7b655 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsMetaPageType.java @@ -0,0 +1,55 @@ +/* + * 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; + +/** Type of global orgs pagination. */ +@JsonSerialize(using = GlobalOrgsMetaPageType.GlobalOrgsMetaPageTypeSerializer.class) +public class GlobalOrgsMetaPageType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("cursor")); + + public static final GlobalOrgsMetaPageType CURSOR = new GlobalOrgsMetaPageType("cursor"); + + GlobalOrgsMetaPageType(String value) { + super(value, allowedValues); + } + + public static class GlobalOrgsMetaPageTypeSerializer + extends StdSerializer { + public GlobalOrgsMetaPageTypeSerializer(Class t) { + super(t); + } + + public GlobalOrgsMetaPageTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GlobalOrgsMetaPageType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GlobalOrgsMetaPageType fromValue(String value) { + return new GlobalOrgsMetaPageType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsResponse.java new file mode 100644 index 00000000000..a2f94e64336 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GlobalOrgsResponse.java @@ -0,0 +1,212 @@ +/* + * 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 organizations across regions for the authenticated user. */ +@JsonPropertyOrder({ + GlobalOrgsResponse.JSON_PROPERTY_DATA, + GlobalOrgsResponse.JSON_PROPERTY_LINKS, + GlobalOrgsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GlobalOrgsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private GlobalOrgsLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private GlobalOrgsMeta meta; + + public GlobalOrgsResponse() {} + + @JsonCreator + public GlobalOrgsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public GlobalOrgsResponse data(List data) { + this.data = data; + for (GlobalOrgData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GlobalOrgsResponse addDataItem(GlobalOrgData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Organizations across regions for the authenticated user. + * + * @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 GlobalOrgsResponse links(GlobalOrgsLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalOrgsLinks getLinks() { + return links; + } + + public void setLinks(GlobalOrgsLinks links) { + this.links = links; + } + + public GlobalOrgsResponse meta(GlobalOrgsMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Response metadata object. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalOrgsMeta getMeta() { + return meta; + } + + public void setMeta(GlobalOrgsMeta meta) { + this.meta = meta; + } + + /** + * 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 GlobalOrgsResponse + */ + @JsonAnySetter + public GlobalOrgsResponse 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 GlobalOrgsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GlobalOrgsResponse globalOrgsResponse = (GlobalOrgsResponse) o; + return Objects.equals(this.data, globalOrgsResponse.data) + && Objects.equals(this.links, globalOrgsResponse.links) + && Objects.equals(this.meta, globalOrgsResponse.meta) + && Objects.equals(this.additionalProperties, globalOrgsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GlobalOrgsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/organizations.feature b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature index d50c9a305d5..330aeabd221 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,27 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "Bad Request" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "OK" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login @with-pagination + Scenario: List global orgs returns "OK" response with pagination + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request with pagination 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 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 f1a04b48a1a..c6acd86254a 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 @@ -2609,6 +2609,12 @@ "type": "unsafe" } }, + "ListGlobalOrgs": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": {