diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d235bdcd3db3..c5aea6aff5d7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -39547,6 +39547,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: @@ -48114,6 +48182,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: @@ -48415,6 +48530,44 @@ 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 + 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: @@ -98143,6 +98296,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: ListOrgsV2 + 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). @@ -114716,6 +114946,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/ListOrgsV2.ts b/examples/v2/organizations/ListOrgsV2.ts new file mode 100644 index 000000000000..03edf2b1e899 --- /dev/null +++ b/examples/v2/organizations/ListOrgsV2.ts @@ -0,0 +1,17 @@ +/** + * List your managed organizations returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.OrganizationsApi(configuration); + +apiInstance + .listOrgsV2() + .then((data: v2.ManagedOrgsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/users/DeleteUserInvitations.ts b/examples/v2/users/DeleteUserInvitations.ts new file mode 100644 index 000000000000..ad72e6ce1480 --- /dev/null +++ b/examples/v2/users/DeleteUserInvitations.ts @@ -0,0 +1,21 @@ +/** + * Delete a pending user's invitations returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.UsersApi(configuration); + +const params: v2.UsersApiDeleteUserInvitationsRequest = { + userId: "4dee724d-00cc-11ea-a77b-570c9d03c6c5", +}; + +apiInstance + .deleteUserInvitations(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 4072ea04d4c7..92a314dcd902 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -9110,6 +9110,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "{}", }, + "v2.ListOrgsV2": { + "filterName": { + "type": "string", + "format": "", + }, + "operationResponseType": "ManagedOrgsResponse", + }, "v2.ListOrgConfigs": { "operationResponseType": "OrgConfigListResponse", }, @@ -12100,6 +12107,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "UserResponse", }, + "v2.DeleteUserInvitations": { + "userId": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "{}", + }, "v2.ListUserOrganizations": { "userId": { "type": "string", diff --git a/features/v2/organizations.feature b/features/v2/organizations.feature index ddec7484e764..b5e870d0d98d 100644 --- a/features/v2/organizations.feature +++ b/features/v2/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 "ListOrgsV2" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/team-aaa-identity Scenario: Update a specific Org Config returns "Bad Request" response Given new "UpdateOrgConfig" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 02afc91a4bbe..0e7f9515ea95 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3951,6 +3951,12 @@ "type": "safe" } }, + "ListOrgsV2": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { @@ -6543,6 +6549,12 @@ "type": "idempotent" } }, + "DeleteUserInvitations": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, "ListUserOrganizations": { "tag": "Users", "undo": { diff --git a/features/v2/users.feature b/features/v2/users.feature index ce27d729985f..3fc0a99938a9 100644 --- a/features/v2/users.feature +++ b/features/v2/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/team-aaa-identity Scenario: Disable a user returns "Not found" response Given new "DisableUser" request diff --git a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts index 7787c0da4f3a..e33a14ded910 100644 --- a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts +++ b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts @@ -20,6 +20,7 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ManagedOrgsResponse } from "../models/ManagedOrgsResponse"; import { OrgConfigGetResponse } from "../models/OrgConfigGetResponse"; import { OrgConfigListResponse } from "../models/OrgConfigListResponse"; import { OrgConfigWriteRequest } from "../models/OrgConfigWriteRequest"; @@ -82,6 +83,41 @@ export class OrganizationsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listOrgsV2( + filterName?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/org"; + + // Make Request Context + const requestContext = _config + .getServer("v2.OrganizationsApi.listOrgsV2") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (filterName !== undefined) { + requestContext.setQueryParam( + "filter[name]", + ObjectSerializer.serialize(filterName, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async updateOrgConfig( orgConfigName: string, body: OrgConfigWriteRequest, @@ -294,6 +330,68 @@ export class OrganizationsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listOrgsV2 + * @throws ApiException if the response code was not in [200, 299] + */ + public async listOrgsV2( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ManagedOrgsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ManagedOrgsResponse" + ) as ManagedOrgsResponse; + return body; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ManagedOrgsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ManagedOrgsResponse", + "" + ) as ManagedOrgsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -418,6 +516,14 @@ export interface OrganizationsApiGetOrgConfigRequest { orgConfigName: string; } +export interface OrganizationsApiListOrgsV2Request { + /** + * Filter managed organizations by name. + * @type string + */ + filterName?: string; +} + export interface OrganizationsApiUpdateOrgConfigRequest { /** * The name of an Org Config. @@ -493,6 +599,27 @@ export class OrganizationsApi { }); } + /** + * Returns the current organization and its managed organizations in JSON:API format. + * @param param The request object + */ + public listOrgsV2( + param: OrganizationsApiListOrgsV2Request = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listOrgsV2( + param.filterName, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOrgsV2(responseContext); + }); + }); + } + /** * Update the value of a specific Org Config. * @param param The request object diff --git a/packages/datadog-api-client-v2/apis/UsersApi.ts b/packages/datadog-api-client-v2/apis/UsersApi.ts index b0e324848365..dfe8bfe04974 100644 --- a/packages/datadog-api-client-v2/apis/UsersApi.ts +++ b/packages/datadog-api-client-v2/apis/UsersApi.ts @@ -71,6 +71,40 @@ export class UsersApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteUserInvitations( + userId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new RequiredError("userId", "deleteUserInvitations"); + } + + // Path Params + const localVarPath = "/api/v2/users/{user_id}/invitations".replace( + "{user_id}", + encodeURIComponent(String(userId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.UsersApi.deleteUserInvitations") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async disableUser( userId: string, _options?: Configuration @@ -472,6 +506,57 @@ export class UsersApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteUserInvitations + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteUserInvitations(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -961,6 +1046,14 @@ export interface UsersApiCreateUserRequest { body: UserCreateRequest; } +export interface UsersApiDeleteUserInvitationsRequest { + /** + * The UUID of the user whose pending invitations should be canceled. + * @type string + */ + userId: string; +} + export interface UsersApiDisableUserRequest { /** * The ID of the user. @@ -1096,6 +1189,28 @@ export class UsersApi { }); } + /** + * Cancel all pending invitations for a specified user. + * Requires the `user_access_invite` permission. + * @param param The request object + */ + public deleteUserInvitations( + param: UsersApiDeleteUserInvitationsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteUserInvitations( + param.userId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteUserInvitations(responseContext); + }); + }); + } + /** * Disable a user. Can only be used with an application key belonging * to an administrator user. diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index ece9e11b1213..3c30375f0124 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -789,6 +789,7 @@ export { export { OrganizationsApiGetOrgConfigRequest, + OrganizationsApiListOrgsV2Request, OrganizationsApiUpdateOrgConfigRequest, OrganizationsApiUploadIdPMetadataRequest, OrganizationsApi, @@ -1249,6 +1250,7 @@ export { export { UsersApiCreateUserRequest, + UsersApiDeleteUserInvitationsRequest, UsersApiDisableUserRequest, UsersApiGetInvitationRequest, UsersApiGetUserRequest, @@ -3750,6 +3752,12 @@ export { MaintenanceDataRelationshipsLastModifiedByUser } from "./models/Mainten export { MaintenanceDataRelationshipsLastModifiedByUserData } from "./models/MaintenanceDataRelationshipsLastModifiedByUserData"; export { MaintenanceDataRelationshipsStatusPage } from "./models/MaintenanceDataRelationshipsStatusPage"; export { MaintenanceDataRelationshipsStatusPageData } from "./models/MaintenanceDataRelationshipsStatusPageData"; +export { ManagedOrgsData } from "./models/ManagedOrgsData"; +export { ManagedOrgsRelationships } from "./models/ManagedOrgsRelationships"; +export { ManagedOrgsRelationshipToOrg } from "./models/ManagedOrgsRelationshipToOrg"; +export { ManagedOrgsRelationshipToOrgs } from "./models/ManagedOrgsRelationshipToOrgs"; +export { ManagedOrgsResponse } from "./models/ManagedOrgsResponse"; +export { ManagedOrgsType } from "./models/ManagedOrgsType"; export { MemberTeam } from "./models/MemberTeam"; export { MemberTeamType } from "./models/MemberTeamType"; export { Metadata } from "./models/Metadata"; @@ -4319,6 +4327,7 @@ export { OrderDirection } from "./models/OrderDirection"; export { Organization } from "./models/Organization"; export { OrganizationAttributes } from "./models/OrganizationAttributes"; export { OrganizationsType } from "./models/OrganizationsType"; +export { OrgAttributes } from "./models/OrgAttributes"; export { OrgConfigGetResponse } from "./models/OrgConfigGetResponse"; export { OrgConfigListResponse } from "./models/OrgConfigListResponse"; export { OrgConfigRead } from "./models/OrgConfigRead"; @@ -4349,6 +4358,9 @@ export { OrgConnectionUpdateRequest } from "./models/OrgConnectionUpdateRequest" export { OrgConnectionUserRelationship } from "./models/OrgConnectionUserRelationship"; export { OrgConnectionUserRelationshipData } from "./models/OrgConnectionUserRelationshipData"; export { OrgConnectionUserRelationshipDataType } from "./models/OrgConnectionUserRelationshipDataType"; +export { OrgData } from "./models/OrgData"; +export { OrgRelationshipData } from "./models/OrgRelationshipData"; +export { OrgResourceType } from "./models/OrgResourceType"; export { OutboundEdge } from "./models/OutboundEdge"; export { OutcomesBatchAttributes } from "./models/OutcomesBatchAttributes"; export { OutcomesBatchRequest } from "./models/OutcomesBatchRequest"; diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsData.ts b/packages/datadog-api-client-v2/models/ManagedOrgsData.ts new file mode 100644 index 000000000000..a59c1c6e1488 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsData.ts @@ -0,0 +1,74 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ManagedOrgsRelationships } from "./ManagedOrgsRelationships"; +import { ManagedOrgsType } from "./ManagedOrgsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The managed organizations resource. + */ +export class ManagedOrgsData { + /** + * The UUID of the current organization. + */ + "id": string; + /** + * Relationships of the managed organizations resource. + */ + "relationships": ManagedOrgsRelationships; + /** + * The resource type for managed organizations. + */ + "type": ManagedOrgsType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + relationships: { + baseName: "relationships", + type: "ManagedOrgsRelationships", + required: true, + }, + type: { + baseName: "type", + type: "ManagedOrgsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ManagedOrgsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrg.ts b/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrg.ts new file mode 100644 index 000000000000..22bf07906955 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrg.ts @@ -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 2020-Present Datadog, Inc. + */ +import { OrgRelationshipData } from "./OrgRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to the current organization. + */ +export class ManagedOrgsRelationshipToOrg { + /** + * Reference to an organization resource. + */ + "data": OrgRelationshipData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgRelationshipData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ManagedOrgsRelationshipToOrg.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrgs.ts b/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrgs.ts new file mode 100644 index 000000000000..196dee30cae2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsRelationshipToOrgs.ts @@ -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 2020-Present Datadog, Inc. + */ +import { OrgRelationshipData } from "./OrgRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to the managed organizations. + */ +export class ManagedOrgsRelationshipToOrgs { + /** + * List of managed organization references. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ManagedOrgsRelationshipToOrgs.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsRelationships.ts b/packages/datadog-api-client-v2/models/ManagedOrgsRelationships.ts new file mode 100644 index 000000000000..64610e4b99bc --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsRelationships.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ManagedOrgsRelationshipToOrg } from "./ManagedOrgsRelationshipToOrg"; +import { ManagedOrgsRelationshipToOrgs } from "./ManagedOrgsRelationshipToOrgs"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of the managed organizations resource. + */ +export class ManagedOrgsRelationships { + /** + * Relationship to the current organization. + */ + "currentOrg": ManagedOrgsRelationshipToOrg; + /** + * Relationship to the managed organizations. + */ + "managedOrgs": ManagedOrgsRelationshipToOrgs; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + currentOrg: { + baseName: "current_org", + type: "ManagedOrgsRelationshipToOrg", + required: true, + }, + managedOrgs: { + baseName: "managed_orgs", + type: "ManagedOrgsRelationshipToOrgs", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ManagedOrgsRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsResponse.ts b/packages/datadog-api-client-v2/models/ManagedOrgsResponse.ts new file mode 100644 index 000000000000..b73104fcb213 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsResponse.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ManagedOrgsData } from "./ManagedOrgsData"; +import { OrgData } from "./OrgData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the current organization and its managed organizations. + */ +export class ManagedOrgsResponse { + /** + * The managed organizations resource. + */ + "data": ManagedOrgsData; + /** + * Included organization resources. + */ + "included": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ManagedOrgsData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ManagedOrgsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ManagedOrgsType.ts b/packages/datadog-api-client-v2/models/ManagedOrgsType.ts new file mode 100644 index 000000000000..ad22b801e834 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ManagedOrgsType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The resource type for managed organizations. + */ + +export type ManagedOrgsType = typeof MANAGED_ORGS | UnparsedObject; +export const MANAGED_ORGS = "managed_orgs"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 576909906262..33c400ba0cc6 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -1928,6 +1928,11 @@ import { MaintenanceDataRelationshipsLastModifiedByUser } from "./MaintenanceDat import { MaintenanceDataRelationshipsLastModifiedByUserData } from "./MaintenanceDataRelationshipsLastModifiedByUserData"; import { MaintenanceDataRelationshipsStatusPage } from "./MaintenanceDataRelationshipsStatusPage"; import { MaintenanceDataRelationshipsStatusPageData } from "./MaintenanceDataRelationshipsStatusPageData"; +import { ManagedOrgsData } from "./ManagedOrgsData"; +import { ManagedOrgsRelationshipToOrg } from "./ManagedOrgsRelationshipToOrg"; +import { ManagedOrgsRelationshipToOrgs } from "./ManagedOrgsRelationshipToOrgs"; +import { ManagedOrgsRelationships } from "./ManagedOrgsRelationships"; +import { ManagedOrgsResponse } from "./ManagedOrgsResponse"; import { MemberTeam } from "./MemberTeam"; import { Metadata } from "./Metadata"; import { Metric } from "./Metric"; @@ -2280,6 +2285,7 @@ import { OpsgenieServiceUpdateAttributes } from "./OpsgenieServiceUpdateAttribut import { OpsgenieServiceUpdateData } from "./OpsgenieServiceUpdateData"; import { OpsgenieServiceUpdateRequest } from "./OpsgenieServiceUpdateRequest"; import { OpsgenieServicesResponse } from "./OpsgenieServicesResponse"; +import { OrgAttributes } from "./OrgAttributes"; import { OrgConfigGetResponse } from "./OrgConfigGetResponse"; import { OrgConfigListResponse } from "./OrgConfigListResponse"; import { OrgConfigRead } from "./OrgConfigRead"; @@ -2305,6 +2311,8 @@ import { OrgConnectionUpdateAttributes } from "./OrgConnectionUpdateAttributes"; import { OrgConnectionUpdateRequest } from "./OrgConnectionUpdateRequest"; import { OrgConnectionUserRelationship } from "./OrgConnectionUserRelationship"; import { OrgConnectionUserRelationshipData } from "./OrgConnectionUserRelationshipData"; +import { OrgData } from "./OrgData"; +import { OrgRelationshipData } from "./OrgRelationshipData"; import { Organization } from "./Organization"; import { OrganizationAttributes } from "./OrganizationAttributes"; import { OutboundEdge } from "./OutboundEdge"; @@ -4559,6 +4567,7 @@ const enumsMap: { [key: string]: any[] } = { LogsSortOrder: ["asc", "desc"], LogsStorageTier: ["indexes", "online-archives", "flex"], MaintenanceDataAttributesStatus: ["scheduled", "in_progress", "completed"], + ManagedOrgsType: ["managed_orgs"], MemberTeamType: ["member_teams"], MetricActiveConfigurationType: ["actively_queried_configurations"], MetricBulkConfigureTagsType: ["metric_bulk_configure_tags"], @@ -4911,6 +4920,7 @@ const enumsMap: { [key: string]: any[] } = { OrgConnectionType: ["org_connection"], OrgConnectionTypeEnum: ["logs", "metrics", "audit"], OrgConnectionUserRelationshipDataType: ["users"], + OrgResourceType: ["orgs"], OrganizationsType: ["orgs"], OutcomeType: ["outcome"], OutcomesBatchType: ["batched-outcome"], @@ -8042,6 +8052,11 @@ const typeMap: { [index: string]: any } = { MaintenanceDataRelationshipsStatusPage, MaintenanceDataRelationshipsStatusPageData: MaintenanceDataRelationshipsStatusPageData, + ManagedOrgsData: ManagedOrgsData, + ManagedOrgsRelationshipToOrg: ManagedOrgsRelationshipToOrg, + ManagedOrgsRelationshipToOrgs: ManagedOrgsRelationshipToOrgs, + ManagedOrgsRelationships: ManagedOrgsRelationships, + ManagedOrgsResponse: ManagedOrgsResponse, MemberTeam: MemberTeam, Metadata: Metadata, Metric: Metric, @@ -8546,6 +8561,7 @@ const typeMap: { [index: string]: any } = { OpsgenieServiceUpdateData: OpsgenieServiceUpdateData, OpsgenieServiceUpdateRequest: OpsgenieServiceUpdateRequest, OpsgenieServicesResponse: OpsgenieServicesResponse, + OrgAttributes: OrgAttributes, OrgConfigGetResponse: OrgConfigGetResponse, OrgConfigListResponse: OrgConfigListResponse, OrgConfigRead: OrgConfigRead, @@ -8571,6 +8587,8 @@ const typeMap: { [index: string]: any } = { OrgConnectionUpdateRequest: OrgConnectionUpdateRequest, OrgConnectionUserRelationship: OrgConnectionUserRelationship, OrgConnectionUserRelationshipData: OrgConnectionUserRelationshipData, + OrgData: OrgData, + OrgRelationshipData: OrgRelationshipData, Organization: Organization, OrganizationAttributes: OrganizationAttributes, OutboundEdge: OutboundEdge, diff --git a/packages/datadog-api-client-v2/models/OrgAttributes.ts b/packages/datadog-api-client-v2/models/OrgAttributes.ts new file mode 100644 index 000000000000..78611b70a824 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OrgAttributes.ts @@ -0,0 +1,118 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of an organization. + */ +export class OrgAttributes { + /** + * The creation timestamp of the organization. + */ + "createdAt": Date; + /** + * A description of the organization. + */ + "description": string; + /** + * Whether the organization is disabled. + */ + "disabled": boolean; + /** + * The last modification timestamp of the organization. + */ + "modifiedAt": Date; + /** + * The name of the organization. + */ + "name": string; + /** + * The public identifier of the organization. + */ + "publicId": string; + /** + * The sharing setting of the organization. + */ + "sharing": string; + /** + * The URL of the organization. + */ + "url": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + disabled: { + baseName: "disabled", + type: "boolean", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + required: true, + format: "date-time", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + publicId: { + baseName: "public_id", + type: "string", + required: true, + }, + sharing: { + baseName: "sharing", + type: "string", + required: true, + }, + url: { + baseName: "url", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OrgData.ts b/packages/datadog-api-client-v2/models/OrgData.ts new file mode 100644 index 000000000000..4dca6f717f85 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OrgData.ts @@ -0,0 +1,74 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { OrgAttributes } from "./OrgAttributes"; +import { OrgResourceType } from "./OrgResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An organization resource. + */ +export class OrgData { + /** + * Attributes of an organization. + */ + "attributes": OrgAttributes; + /** + * The UUID of the organization. + */ + "id": string; + /** + * The resource type for organizations. + */ + "type": OrgResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OrgAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "OrgResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OrgRelationshipData.ts b/packages/datadog-api-client-v2/models/OrgRelationshipData.ts new file mode 100644 index 000000000000..1b590f3215e3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OrgRelationshipData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { OrgResourceType } from "./OrgResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Reference to an organization resource. + */ +export class OrgRelationshipData { + /** + * The UUID of the organization. + */ + "id": string; + /** + * The resource type for organizations. + */ + "type": OrgResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "OrgResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/OrgResourceType.ts b/packages/datadog-api-client-v2/models/OrgResourceType.ts new file mode 100644 index 000000000000..7d96e346d9c2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/OrgResourceType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The resource type for organizations. + */ + +export type OrgResourceType = typeof ORGS | UnparsedObject; +export const ORGS = "orgs";