diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bf25604f04..48bf817eb4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -682,6 +682,14 @@ components: required: true schema: type: string + IdentityProviderId: + description: The ID of the identity provider. + in: path + name: idp_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -1086,6 +1094,14 @@ components: required: true schema: type: string + OAuth2ClientId: + description: The ID of the OAuth2 client. + in: path + name: client_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000010" + type: string OAuthClientUUIDPathParameter: description: UUID of the OAuth2 client. in: path @@ -1117,6 +1133,14 @@ components: required: true schema: type: string + OrgAuthorizedClientId: + description: The ID of the org authorized client. + in: path + name: org_authorized_client_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string OrgConfigName: description: The name of an Org Config. in: path @@ -1828,6 +1852,22 @@ components: required: true schema: type: string + UserAuthorizedClientId: + description: The ID of the user authorized client. + in: path + name: user_authorized_client_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + UserAuthorizedClientIdForOrg: + description: The ID of the user authorized client. + in: path + name: user_authorized_client_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000002" + type: string UserID: description: "The ID of the user." in: path @@ -1836,6 +1876,14 @@ components: schema: example: "00000000-0000-9999-0000-000000000000" type: string + UserIdForOrgClient: + description: The ID of the user. + in: path + name: user_id + required: true + schema: + example: "00000000-0000-9999-0000-000000000001" + type: string UserUUIDPathParameter: description: The UUID of the user to add or remove as a watcher. example: "8146583c-0b5f-11ec-abf8-da7ad0900001" @@ -41242,6 +41290,100 @@ components: type: string x-mimetype: application/xml type: object + IdentityProviderAttributes: + description: Attributes of an organization identity provider. + properties: + authentication_method: + description: The authentication method used by this identity provider. + example: "SAML" + type: string + enabled: + description: Whether this identity provider is enabled for the organization. + example: true + type: boolean + required: + - authentication_method + - enabled + type: object + IdentityProviderData: + description: Data object representing an organization identity provider. + properties: + attributes: + $ref: "#/components/schemas/IdentityProviderAttributes" + id: + description: The unique identifier of the identity provider. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/IdentityProviderType" + required: + - id + - type + - attributes + type: object + IdentityProviderDataList: + description: List of organization identity provider data objects. + items: + $ref: "#/components/schemas/IdentityProviderData" + type: array + IdentityProviderResponse: + description: Response containing a single organization identity provider. + properties: + data: + $ref: "#/components/schemas/IdentityProviderData" + required: + - data + type: object + IdentityProviderType: + description: The resource type for identity providers. + enum: + - identity_providers + example: identity_providers + type: string + x-enum-varnames: + - IDENTITY_PROVIDERS + IdentityProviderUpdateAttributes: + description: Attributes for updating an organization identity provider. + properties: + enabled: + description: Whether to enable or disable this identity provider for the organization. + example: true + type: boolean + required: + - enabled + type: object + IdentityProviderUpdateData: + description: Data object for updating an organization identity provider. + properties: + attributes: + $ref: "#/components/schemas/IdentityProviderUpdateAttributes" + id: + description: The unique identifier of the identity provider to update. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/IdentityProviderType" + required: + - id + - type + - attributes + type: object + IdentityProviderUpdateRequest: + description: Request body for updating an organization identity provider. + properties: + data: + $ref: "#/components/schemas/IdentityProviderUpdateData" + required: + - data + type: object + IdentityProvidersResponse: + description: Response containing a list of identity providers for an organization. + properties: + data: + $ref: "#/components/schemas/IdentityProviderDataList" + required: + - data + type: object IncidentAttachmentType: default: incident_attachments description: The incident attachment resource type. @@ -66423,6 +66565,210 @@ components: - created_at - modified_at type: object + OrgAuthorizedClientAttributes: + description: Attributes of an org authorized client. + properties: + disabled: + description: Whether the organization has disabled this client. + example: false + type: boolean + last_exercised: + description: The date and time this client was last exercised. + example: "2024-01-15T10:30:00+00:00" + format: date-time + nullable: true + type: string + user_count: + description: The number of users in the organization who have authorized this client. + example: 2 + format: int64 + type: integer + required: + - last_exercised + - disabled + - user_count + type: object + OrgAuthorizedClientData: + description: Data object representing an org authorized client. + properties: + attributes: + $ref: "#/components/schemas/OrgAuthorizedClientAttributes" + id: + description: The unique identifier of the org authorized client. + example: "00000000-0000-0000-0000-000000000001" + type: string + relationships: + $ref: "#/components/schemas/OrgAuthorizedClientRelationships" + type: + $ref: "#/components/schemas/OrgAuthorizedClientType" + required: + - id + - type + - attributes + - relationships + type: object + OrgAuthorizedClientDataList: + description: List of org authorized client data objects. + items: + $ref: "#/components/schemas/OrgAuthorizedClientData" + type: array + OrgAuthorizedClientRelationshipOAuth2Client: + description: Relationship to the OAuth2 client for this org authorized client. + properties: + data: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipOAuth2ClientData" + required: + - data + type: object + OrgAuthorizedClientRelationshipOAuth2ClientData: + description: Data identifying the OAuth2 client associated with this org authorized client. + properties: + id: + description: The ID of the OAuth2 client. + example: "00000000-0000-0000-0000-000000000010" + type: string + type: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipOAuth2ClientDataType" + required: + - type + - id + type: object + OrgAuthorizedClientRelationshipOAuth2ClientDataType: + description: OAuth2 client resource type. + enum: + - oauth2_clients + example: oauth2_clients + type: string + x-enum-varnames: + - OAUTH2_CLIENTS + OrgAuthorizedClientRelationshipUserAuthorizedClients: + description: Relationship to the user authorized clients for this org authorized client. + properties: + data: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipUserAuthorizedClientsDataList" + links: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks" + required: + - links + - data + type: object + OrgAuthorizedClientRelationshipUserAuthorizedClientsData: + description: Data identifying a user authorized client. + properties: + id: + description: The ID of the user authorized client. + example: "00000000-0000-0000-0000-000000000020" + type: string + type: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType" + required: + - type + - id + type: object + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataList: + description: List of user authorized client relationship data objects. + items: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipUserAuthorizedClientsData" + type: array + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType: + description: User authorized client resource type. + enum: + - user_authorized_clients + example: user_authorized_clients + type: string + x-enum-varnames: + - USER_AUTHORIZED_CLIENTS + OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks: + description: Links for the user authorized clients relationship. + properties: + related: + description: Link to the user authorized clients for this org authorized client. + example: "/api/v2/org_authorized_clients/00000000-0000-0000-0000-000000000001/user_authorized_clients" + type: string + required: + - related + type: object + OrgAuthorizedClientRelationships: + description: Relationships for an org authorized client. + properties: + oauth2_client: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipOAuth2Client" + user_authorized_clients: + $ref: "#/components/schemas/OrgAuthorizedClientRelationshipUserAuthorizedClients" + required: + - oauth2_client + - user_authorized_clients + type: object + OrgAuthorizedClientResponse: + description: Response containing a single org authorized client. + properties: + data: + $ref: "#/components/schemas/OrgAuthorizedClientData" + required: + - data + type: object + OrgAuthorizedClientType: + description: The resource type for org authorized clients. + enum: + - org_authorized_clients + example: org_authorized_clients + type: string + x-enum-varnames: + - ORG_AUTHORIZED_CLIENTS + OrgAuthorizedClientUpdateAttributes: + description: Attributes for updating an org authorized client. + properties: + disabled: + description: Whether to disable or enable this client for the organization. + example: true + type: boolean + type: object + OrgAuthorizedClientUpdateData: + description: Data object for updating an org authorized client. + properties: + attributes: + $ref: "#/components/schemas/OrgAuthorizedClientUpdateAttributes" + id: + description: The unique identifier of the org authorized client to update. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/OrgAuthorizedClientType" + required: + - id + - type + type: object + OrgAuthorizedClientUpdateRequest: + description: Request body for updating an org authorized client. + properties: + data: + $ref: "#/components/schemas/OrgAuthorizedClientUpdateData" + required: + - data + type: object + OrgAuthorizedClientUserAuthorizationsSort: + description: Field to sort user authorizations by. + enum: + - user.name + - user.email + - oauth2_client.name + example: user.name + type: string + x-enum-varnames: + - USER_NAME + - USER_EMAIL + - OAUTH2_CLIENT_NAME + OrgAuthorizedClientsResponse: + description: Response containing a list of org authorized clients. + properties: + data: + $ref: "#/components/schemas/OrgAuthorizedClientDataList" + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + - meta + type: object OrgConfigGetResponse: description: A response with a single Org Config. properties: @@ -101200,6 +101546,14 @@ components: required: - data type: object + UpdateUserIdentityProvidersRequest: + description: Request body for setting identity provider overrides for a user. + properties: + data: + $ref: "#/components/schemas/UserRelationshipIdentityProviderDataList" + required: + - data + type: object UpdateWorkflowRequest: description: A request object for updating an existing workflow. example: @@ -101838,6 +102192,197 @@ components: - ACTIVE - DEACTIVATED - PENDING + UserAuthorizedClientAttributes: + description: Attributes of a user authorized client. + properties: + created_at: + description: The date and time this authorization was created. + example: "2024-01-10T08:00:00+00:00" + format: date-time + type: string + disabled: + description: Whether the user has disabled this authorization. + example: false + type: boolean + last_exercised: + description: The date and time this authorization was last exercised. + example: "2024-01-15T10:30:00+00:00" + format: date-time + nullable: true + type: string + modified_at: + description: The date and time this authorization was last modified. + example: "2024-01-10T08:00:00+00:00" + format: date-time + type: string + org_disabled: + description: Whether the organization has disabled this authorization. + example: false + type: boolean + required: + - created_at + - modified_at + - last_exercised + - disabled + - org_disabled + type: object + UserAuthorizedClientData: + description: Data object representing a user authorized client. + properties: + attributes: + $ref: "#/components/schemas/UserAuthorizedClientAttributes" + id: + description: The unique identifier of the user authorized client. + example: "00000000-0000-0000-0000-000000000001" + type: string + relationships: + $ref: "#/components/schemas/UserAuthorizedClientRelationships" + type: + $ref: "#/components/schemas/UserAuthorizedClientType" + required: + - id + - type + - attributes + - relationships + type: object + UserAuthorizedClientDataList: + description: List of user authorized client data objects. + items: + $ref: "#/components/schemas/UserAuthorizedClientData" + type: array + UserAuthorizedClientRelationshipOAuth2Client: + description: Relationship to the OAuth2 client that was authorized. + properties: + data: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipOAuth2ClientData" + required: + - data + type: object + UserAuthorizedClientRelationshipOAuth2ClientData: + description: Data identifying the OAuth2 client that was authorized. + properties: + id: + description: The ID of the OAuth2 client. + example: "00000000-0000-0000-0000-000000000010" + type: string + type: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipOAuth2ClientDataType" + required: + - type + - id + type: object + UserAuthorizedClientRelationshipOAuth2ClientDataType: + description: OAuth2 client resource type. + enum: + - oauth2_clients + example: oauth2_clients + type: string + x-enum-varnames: + - OAUTH2_CLIENTS + UserAuthorizedClientRelationshipScopeData: + description: Data identifying a scope granted to the OAuth2 client. + properties: + id: + description: The identifier of the scope. + example: "example_scope" + type: string + type: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipScopeDataType" + required: + - type + - id + type: object + UserAuthorizedClientRelationshipScopeDataList: + description: List of scope relationship data objects. + items: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipScopeData" + type: array + UserAuthorizedClientRelationshipScopeDataType: + description: Scope resource type. + enum: + - scopes + example: scopes + type: string + x-enum-varnames: + - SCOPES + UserAuthorizedClientRelationshipScopes: + description: Relationship to the scopes granted to the OAuth2 client. + properties: + data: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipScopeDataList" + required: + - data + type: object + UserAuthorizedClientRelationshipUser: + description: Relationship to the user who granted this authorization. + properties: + data: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipUserData" + required: + - data + type: object + UserAuthorizedClientRelationshipUserData: + description: Data identifying the user who granted this authorization. + properties: + id: + description: The ID of the user. + example: "00000000-0000-9999-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipUserDataType" + required: + - type + - id + type: object + UserAuthorizedClientRelationshipUserDataType: + description: User resource type. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + UserAuthorizedClientRelationships: + description: Relationships for a user authorized client. + properties: + oauth2_client: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipOAuth2Client" + scopes: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipScopes" + user: + $ref: "#/components/schemas/UserAuthorizedClientRelationshipUser" + required: + - user + - oauth2_client + - scopes + type: object + UserAuthorizedClientResponse: + description: Response containing a single user authorized client. + properties: + data: + $ref: "#/components/schemas/UserAuthorizedClientData" + required: + - data + type: object + UserAuthorizedClientType: + description: The resource type for user authorized clients. + enum: + - user_authorized_clients + example: user_authorized_clients + type: string + x-enum-varnames: + - USER_AUTHORIZED_CLIENTS + UserAuthorizedClientsResponse: + description: Response containing a list of user authorized clients. + properties: + data: + $ref: "#/components/schemas/UserAuthorizedClientDataList" + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + - meta + type: object UserCreateAttributes: description: Attributes of the created user. properties: @@ -101961,6 +102506,53 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserOverrideIdentityProviderAttributes: + description: Attributes of an identity provider override for a user. + properties: + authentication_method: + description: The authentication method used by this identity provider. + example: "SAML" + type: string + required: + - authentication_method + type: object + UserOverrideIdentityProviderData: + description: Data object representing a user identity provider override. + properties: + attributes: + $ref: "#/components/schemas/UserOverrideIdentityProviderAttributes" + id: + description: The unique identifier of the identity provider. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/UserOverrideIdentityProviderDataType" + required: + - id + - type + - attributes + type: object + UserOverrideIdentityProviderDataList: + description: List of user identity provider override data objects. + items: + $ref: "#/components/schemas/UserOverrideIdentityProviderData" + type: array + UserOverrideIdentityProviderDataType: + description: The resource type for identity providers. + enum: + - identity_providers + example: identity_providers + type: string + x-enum-varnames: + - IDENTITY_PROVIDERS + UserOverrideIdentityProvidersResponse: + description: Response containing a user's identity provider overrides. + properties: + data: + $ref: "#/components/schemas/UserOverrideIdentityProviderDataList" + required: + - data + type: object UserRelationshipData: description: Relationship to user object. properties: @@ -101974,6 +102566,32 @@ components: - id - type type: object + UserRelationshipIdentityProviderData: + description: Resource identifier for an identity provider in a relationship update. + properties: + id: + description: The unique identifier of the identity provider. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/UserRelationshipIdentityProviderDataType" + required: + - id + - type + type: object + UserRelationshipIdentityProviderDataList: + description: List of identity provider resource identifiers for a relationship update. + items: + $ref: "#/components/schemas/UserRelationshipIdentityProviderData" + type: array + UserRelationshipIdentityProviderDataType: + description: The resource type for identity providers. + enum: + - identity_providers + example: identity_providers + type: string + x-enum-varnames: + - IDENTITY_PROVIDERS UserRelationships: description: Relationships of the user object. properties: @@ -129082,15 +129700,93 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/idp/entity_integrations/{integration_id}: - delete: - description: Delete the configuration stored for a given integration in the caller's organization. - operationId: DeleteEntityIntegrationConfig + /api/v2/identity_providers: + get: + description: Get all identity providers available for the current organization. + operationId: ListIdentityProviders + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + authentication_method: "SAML" + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + - attributes: + authentication_method: google_oidc + enabled: false + id: "00000000-0000-0000-0000-000000000002" + type: identity_providers + - attributes: + authentication_method: standard + enabled: false + id: "00000000-0000-0000-0000-000000000003" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProvidersResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: List identity providers + tags: + - Identity Providers + "x-permission": + operator: OR + permissions: + - org_management + - user_access_manage + /api/v2/identity_providers/{idp_id}: + patch: + description: Enable or disable an identity provider for the current organization. + operationId: UpdateIdentityProvider parameters: - - $ref: "#/components/parameters/EntityIntegrationConfigID" + - $ref: "#/components/parameters/IdentityProviderId" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProviderUpdateRequest" + required: true responses: - "204": - description: No Content + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + authentication_method: "SAML" + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProviderResponse" + description: OK "400": content: application/json: @@ -129098,48 +129794,93 @@ paths: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request "403": - $ref: "#/components/responses/NotAuthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error "404": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found + description: Not found "429": $ref: "#/components/responses/TooManyRequestsResponse" - summary: Delete an entity integration configuration + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Update an identity provider tags: - - Entity Integration Configs - x-permission: + - Identity Providers + x-codegen-request-body-name: body + "x-permission": operator: OR permissions: - - manage_integrations - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + - org_management + /api/v2/identity_providers/{idp_id}/users: get: - description: Retrieve the configuration currently stored for a given integration in the caller's organization. - operationId: GetEntityIntegrationConfig + description: |- + Get all users in the organization whose login method has been overridden + to use the specified identity provider. + operationId: ListIdentityProviderUsers parameters: - - $ref: "#/components/parameters/EntityIntegrationConfigID" + - $ref: "#/components/parameters/IdentityProviderId" + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: User attribute to order results by. Options include `email` and `name`. + in: query + name: sort + required: false + schema: + default: email + example: email + type: string + - description: "Direction of sort. Options: `asc`, `desc`." + in: query + name: sort_dir + required: false + schema: + $ref: "#/components/schemas/QuerySortOrder" + - description: Filter users by the given string. Defaults to no filtering. + in: query + name: filter + required: false + schema: + type: string + - description: |- + Filter on status attribute. + Comma-separated list, with possible values `Active`, `Pending`, and `Disabled`. + Defaults to no filtering. + in: query + name: filter[status] + required: false + schema: + example: Active + type: string responses: "200": content: application/json: - example: - data: - attributes: - config: - enabled_repos: - - github_org_name: myorg - hostname: github.com - repo_name: myrepo - integration_id: github - org_id: 1234 - id: 01HJABCD12345678ABCDEFGHIJ - type: entity_integration_configs + examples: + default: + value: + data: + - attributes: + email: example@datadoghq.com + handle: example-user + name: Example User + status: Active + id: "00000000-0000-9999-0000-000000000001" + type: users + meta: + page: + total_count: 1 + total_filtered_count: 1 schema: - $ref: "#/components/schemas/EntityIntegrationConfigResponse" + $ref: "#/components/schemas/UsersResponse" description: OK "400": content: @@ -129147,6 +129888,51 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: List users with an identity provider override + tags: + - Identity Providers + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + "x-permission": + operator: OR + permissions: + - org_management + /api/v2/idp/entity_integrations/{integration_id}: + delete: + description: Delete the configuration stored for a given integration in the caller's organization. + operationId: DeleteEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "403": $ref: "#/components/responses/NotAuthorizedResponse" "404": @@ -129157,65 +129943,115 @@ paths: description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get an entity integration configuration + summary: Delete an entity integration configuration tags: - Entity Integration Configs x-permission: operator: OR permissions: - - integrations_read + - manage_integrations x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - put: - description: |- - Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: - - - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. - - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. - - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. - operationId: UpdateEntityIntegrationConfig + get: + description: Retrieve the configuration currently stored for a given integration in the caller's organization. + operationId: GetEntityIntegrationConfig parameters: - $ref: "#/components/parameters/EntityIntegrationConfigID" - requestBody: - content: - application/json: - examples: - default: - summary: GitHub integration configuration - value: - data: - attributes: - config: - enabled_repos: - - github_org_name: myorg - hostname: github.com - repo_name: myrepo - type: entity_integration_config_requests - jira: - summary: Jira integration configuration - value: - data: - attributes: - config: - enabled_projects: - - account_id: "123456789" - hostname: mycompany.atlassian.net - project_key: AAA - type: entity_integration_config_requests - pagerduty: - summary: PagerDuty integration configuration - value: - data: - attributes: - config: - accounts: - - enabled: true - subdomain: mycompany - type: entity_integration_config_requests - schema: - $ref: "#/components/schemas/EntityIntegrationConfigRequest" - required: true + responses: + "200": + content: + application/json: + example: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + integration_id: github + org_id: 1234 + id: 01HJABCD12345678ABCDEFGHIJ + type: entity_integration_configs + schema: + $ref: "#/components/schemas/EntityIntegrationConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an entity integration configuration + tags: + - Entity Integration Configs + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: |- + Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: + + - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. + - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. + - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. + operationId: UpdateEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + requestBody: + content: + application/json: + examples: + default: + summary: GitHub integration configuration + value: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + type: entity_integration_config_requests + jira: + summary: Jira integration configuration + value: + data: + attributes: + config: + enabled_projects: + - account_id: "123456789" + hostname: mycompany.atlassian.net + project_key: AAA + type: entity_integration_config_requests + pagerduty: + summary: PagerDuty integration configuration + value: + data: + attributes: + config: + accounts: + - enabled: true + subdomain: mycompany + type: entity_integration_config_requests + schema: + $ref: "#/components/schemas/EntityIntegrationConfigRequest" + required: true responses: "200": content: @@ -151165,6 +152001,478 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/org_authorized_clients: + get: + description: Get a list of all OAuth2 clients authorized for the current organization. + operationId: ListOrgAuthorizedClients + parameters: + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: Field to sort results by. Options include `oauth2_client.name`. + in: query + name: sort + required: false + schema: + default: oauth2_client.name + example: oauth2_client.name + type: string + - description: Filter results by client name, app title, or app description. + in: query + name: filter + required: false + schema: + type: string + - description: Filter results by the OAuth2 client name. + in: query + name: filter[oauth2_client][name] + required: false + schema: + type: string + - description: Filter results by the org-level disabled status. + in: query + name: filter[disabled] + required: false + schema: + type: string + - description: |- + Comma-separated list of related resources to include. + Options: `oauth2_client`, `oauth2_client.app`, `user_authorized_clients.user`. + in: query + name: include + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + disabled: false + last_exercised: "2024-01-15T10:30:00+00:00" + user_count: 2 + id: "00000000-0000-0000-0000-000000000001" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + user_authorized_clients: + data: + - id: "00000000-0000-0000-0000-000000000020" + type: user_authorized_clients + links: + related: "/api/v2/org_authorized_clients/00000000-0000-0000-0000-000000000001/user_authorized_clients" + type: org_authorized_clients + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/OrgAuthorizedClientsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_read + summary: List org authorized clients + tags: + - Org Authorized Clients + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - org_authorized_apps_read + - manage_integrations + /api/v2/org_authorized_clients/{org_authorized_client_id}: + delete: + description: Disable an OAuth2 client authorization for the current organization, revoking access for all users. + operationId: DeleteOrgAuthorizedClient + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_write + summary: Delete an org authorized client + tags: + - Org Authorized Clients + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + get: + description: Get a single OAuth2 client authorized for the current organization. + operationId: GetOrgAuthorizedClient + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + - description: |- + Comma-separated list of related resources to include. + Options: `oauth2_client`, `oauth2_client.app`, `oauth2_client.scopes`, `user_authorized_clients.user`. + in: query + name: include + required: false + schema: + type: string + - description: Filter included user authorized clients by disabled status. + in: query + name: filter[user_authorized_clients][disabled] + required: false + schema: + type: string + - description: Filter included user authorized clients by user disabled status. + in: query + name: filter[user_authorized_clients][user][disabled] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: false + last_exercised: "2024-01-15T10:30:00+00:00" + user_count: 2 + id: "00000000-0000-0000-0000-000000000001" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + user_authorized_clients: + data: + - id: "00000000-0000-0000-0000-000000000020" + type: user_authorized_clients + links: + related: "/api/v2/org_authorized_clients/00000000-0000-0000-0000-000000000001/user_authorized_clients" + type: org_authorized_clients + schema: + $ref: "#/components/schemas/OrgAuthorizedClientResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_read + summary: Get an org authorized client + tags: + - Org Authorized Clients + x-permission: + operator: OR + permissions: + - org_authorized_apps_read + patch: + description: Enable or disable an OAuth2 client authorization for the current organization. + operationId: UpdateOrgAuthorizedClient + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: true + id: "00000000-0000-0000-0000-000000000001" + type: org_authorized_clients + schema: + $ref: "#/components/schemas/OrgAuthorizedClientUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + disabled: true + last_exercised: "2024-01-15T10:30:00+00:00" + user_count: 2 + id: "00000000-0000-0000-0000-000000000001" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + user_authorized_clients: + data: [] + links: + related: "/api/v2/org_authorized_clients/00000000-0000-0000-0000-000000000001/user_authorized_clients" + type: org_authorized_clients + schema: + $ref: "#/components/schemas/OrgAuthorizedClientResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_write + summary: Update an org authorized client + tags: + - Org Authorized Clients + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + /api/v2/org_authorized_clients/{org_authorized_client_id}/user/{user_id}: + delete: + description: Disable all authorizations for a specific user for the specified OAuth2 client in the current organization. + operationId: DeleteOrgAuthorizedClientAllUserAuthorizations + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + - $ref: "#/components/parameters/UserIdForOrgClient" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_write + summary: Delete a user's authorizations for a client + tags: + - Org Authorized Clients + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + /api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients: + get: + description: Get a list of user authorizations for the specified OAuth2 client in the current organization. + operationId: ListOrgAuthorizedClientUserAuthorizations + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: "Field to sort results by. Options: `user.name`, `user.email`, `oauth2_client.name`." + in: query + name: sort + required: false + schema: + $ref: "#/components/schemas/OrgAuthorizedClientUserAuthorizationsSort" + - description: Filter results by the user authorization disabled status. + in: query + name: filter[disabled] + required: false + schema: + type: string + - description: Filter results by user name. + in: query + name: filter[user][name] + required: false + schema: + type: string + - description: Filter results by user email. + in: query + name: filter[user][email] + required: false + schema: + type: string + - description: Filter results by whether the user is disabled. + in: query + name: filter[user][disabled] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-10T08:00:00+00:00" + disabled: false + last_exercised: "2024-01-15T10:30:00+00:00" + modified_at: "2024-01-10T08:00:00+00:00" + org_disabled: false + id: "00000000-0000-0000-0000-000000000020" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + scopes: + data: + - id: "example_scope" + type: scopes + user: + data: + id: "00000000-0000-9999-0000-000000000001" + type: users + type: user_authorized_clients + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/UserAuthorizedClientsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_read + summary: List user authorizations for a client + tags: + - Org Authorized Clients + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - org_authorized_apps_read + /api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients/{user_authorized_client_id}: + delete: + description: Disable a specific user authorization for the specified OAuth2 client in the current organization. + operationId: DeleteOrgAuthorizedClientUserAuthorization + parameters: + - $ref: "#/components/parameters/OrgAuthorizedClientId" + - $ref: "#/components/parameters/UserAuthorizedClientIdForOrg" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_authorized_apps_write + summary: Delete a user authorization for a client + tags: + - Org Authorized Clients + x-permission: + operator: OR + permissions: + - org_authorized_apps_write /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -183296,6 +184604,207 @@ paths: operator: OR permissions: - usage_read + /api/v2/user_authorized_clients: + get: + description: Get a list of all OAuth2 clients authorized by the current user. + operationId: ListUserAuthorizedClients + parameters: + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: Filter results by client name, app title, or app description. + in: query + name: filter + required: false + schema: + type: string + - description: Filter results by the user-level disabled status. + in: query + name: filter[disabled] + required: false + schema: + type: string + - description: "Comma-separated list of related resources to include. Options: `oauth2_client`, `oauth2_client.app`." + in: query + name: include + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-10T08:00:00+00:00" + disabled: false + last_exercised: "2024-01-15T10:30:00+00:00" + modified_at: "2024-01-10T08:00:00+00:00" + org_disabled: false + id: "00000000-0000-0000-0000-000000000001" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + scopes: + data: + - id: "example_scope" + type: scopes + user: + data: + id: "00000000-0000-9999-0000-000000000001" + type: users + type: user_authorized_clients + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/UserAuthorizedClientsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - built_in_features + summary: List user authorized clients + tags: + - User Authorized Clients + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + /api/v2/user_authorized_clients/client/{client_id}: + delete: + description: Disable all authorizations the current user has granted to the specified OAuth2 client. + operationId: DeleteUserAuthorizedClientsByClient + parameters: + - $ref: "#/components/parameters/OAuth2ClientId" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete all user authorized clients for a client + tags: + - User Authorized Clients + /api/v2/user_authorized_clients/{user_authorized_client_id}: + delete: + description: Disable the current user's authorization for the specified OAuth2 client. + operationId: DeleteUserAuthorizedClient + parameters: + - $ref: "#/components/parameters/UserAuthorizedClientId" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - built_in_features + summary: Delete a user authorized client + tags: + - User Authorized Clients + get: + description: Get a single OAuth2 client authorization for the current user. + operationId: GetUserAuthorizedClient + parameters: + - $ref: "#/components/parameters/UserAuthorizedClientId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-10T08:00:00+00:00" + disabled: false + last_exercised: "2024-01-15T10:30:00+00:00" + modified_at: "2024-01-10T08:00:00+00:00" + org_disabled: false + id: "00000000-0000-0000-0000-000000000001" + relationships: + oauth2_client: + data: + id: "00000000-0000-0000-0000-000000000010" + type: oauth2_clients + scopes: + data: + - id: "example_scope" + type: scopes + user: + data: + id: "00000000-0000-9999-0000-000000000001" + type: users + type: user_authorized_clients + schema: + $ref: "#/components/schemas/UserAuthorizedClientResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - built_in_features + summary: Get a user authorized client + tags: + - User Authorized Clients /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. @@ -183744,6 +185253,55 @@ paths: permissions: - user_access_manage - service_account_write + /api/v2/users/{user_id}/identity_providers: + get: + description: |- + Get the identity provider overrides for a specific user in the organization. + When a user has no overrides set, they use the organization's default identity providers. + operationId: GetUserIdentityProviders + parameters: + - $ref: "#/components/parameters/UserID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + authentication_method: "SAML" + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/UserOverrideIdentityProvidersResponse" + 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_manage + summary: Get identity provider overrides for a user + tags: + - Users + "x-permission": + operator: OR + permissions: + - user_access_manage /api/v2/users/{user_id}/invitations: delete: description: |- @@ -183893,6 +185451,63 @@ paths: operator: OR permissions: - user_access_read + /api/v2/users/{user_id}/relationships/identity_providers: + patch: + description: |- + Set the identity provider overrides for a specific user in the organization. + Pass an empty list to remove all overrides, reverting the user to the organization's + default identity providers. + operationId: UpdateUserIdentityProviders + parameters: + - $ref: "#/components/parameters/UserID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/UpdateUserIdentityProvidersRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "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_manage + summary: Update identity provider overrides for a user + tags: + - Users + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - user_access_manage /api/v2/users/{user_uuid}/memberships: get: description: Get a list of memberships for a user @@ -185540,6 +187155,8 @@ tags: This is an enterprise-only feature. Request access by contacting Datadog support, or see the [IP Allowlist page](https://docs.datadoghq.com/account_management/org_settings/ip_allowlist/) for more information. name: IP Allowlist + - description: Manage identity providers and user authentication method overrides. + name: Identity Providers - description: Create, update, delete, and retrieve services which can be associated with incidents. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incident Services - description: Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. @@ -185688,6 +187305,8 @@ tags: externalDocs: url: https://docs.datadoghq.com/api/latest/opsgenie-integration name: Opsgenie Integration + - description: Manage OAuth2 client authorizations at the organization level. + name: Org Authorized Clients - description: |- Manage connections between organizations. Org connections allow for controlled sharing of data between different Datadog organizations. See the [Cross-Organization Visibiltiy](https://docs.datadoghq.com/account_management/org_settings/cross_org_visibility/) page for more information. name: Org Connections @@ -185874,6 +187493,8 @@ tags: description: Find out more at url: "https://docs.datadoghq.com/account_management/billing/usage_details/" name: Usage Metering + - description: Manage OAuth2 client authorizations at the user level. + name: User Authorized Clients - description: Create, edit, and disable users. externalDocs: url: https://docs.datadoghq.com/account_management/users diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 349f415aa9..e2a0deb0ec 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -396,6 +396,13 @@ datadog\_api\_client.v2.api.high\_availability\_multi\_region\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.identity\_providers\_api module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.identity_providers_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.incident\_services\_api module ---------------------------------------------------------- @@ -571,6 +578,13 @@ datadog\_api\_client.v2.api.opsgenie\_integration\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.org\_authorized\_clients\_api module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.org_authorized_clients_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.org\_connections\_api module -------------------------------------------------------- @@ -872,6 +886,13 @@ datadog\_api\_client.v2.api.usage\_metering\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.user\_authorized\_clients\_api module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.user_authorized_clients_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.users\_api module --------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5e58bcfce0..0b251677f2 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -16804,6 +16804,62 @@ datadog\_api\_client.v2.model.httpci\_app\_errors module :members: :show-inheritance: +datadog\_api\_client.v2.model.identity\_provider\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_update\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_update\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.identity_provider_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_provider\_update\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.identity_provider_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.identity\_providers\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.identity_providers_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.idp\_metadata\_form\_data module -------------------------------------------------------------- @@ -27976,6 +28032,125 @@ datadog\_api\_client.v2.model.org\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.org\_authorized\_client\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_o\_auth2\_client module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_o\_auth2\_client\_data module +-------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_o\_auth2\_client\_data\_type module +-------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_user\_authorized\_clients module +----------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_user\_authorized\_clients\_data module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_user\_authorized\_clients\_data\_type module +----------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationship\_user\_authorized\_clients\_links module +------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_links + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_relationships module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_update\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_update\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_update\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_client\_user\_authorizations\_sort module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_client_user_authorizations_sort + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_authorized\_clients\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_authorized_clients_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.org\_config\_get\_response module --------------------------------------------------------------- @@ -43691,6 +43866,13 @@ datadog\_api\_client.v2.model.update\_tenancy\_config\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_user\_identity\_providers\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_user_identity_providers_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_workflow\_request module -------------------------------------------------------------- @@ -43999,6 +44181,111 @@ datadog\_api\_client.v2.model.user\_attributes\_status module :members: :show-inheritance: +datadog\_api\_client.v2.model.user\_authorized\_client\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_data module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_o\_auth2\_client module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_o\_auth2\_client\_data module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_o\_auth2\_client\_data\_type module +--------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_scope\_data module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_scope_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_scope\_data\_type module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_scope_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_scopes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_scopes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_user module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_user\_data module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_user_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationship\_user\_data\_type module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationship_user_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_relationships module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_client\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_authorized_client_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_authorized\_clients\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.user_authorized_clients_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_create\_attributes module ------------------------------------------------------------- @@ -44076,6 +44363,34 @@ datadog\_api\_client.v2.model.user\_invitations\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.user\_override\_identity\_provider\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_override_identity_provider_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_override\_identity\_provider\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_override_identity_provider_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_override\_identity\_provider\_data\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_override_identity_provider_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_override\_identity\_providers\_response module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_override_identity_providers_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_relationship\_data module ------------------------------------------------------------- @@ -44083,6 +44398,20 @@ datadog\_api\_client.v2.model.user\_relationship\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.user\_relationship\_identity\_provider\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_relationship_identity_provider_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.user\_relationship\_identity\_provider\_data\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_relationship_identity_provider_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_relationships module -------------------------------------------------------- diff --git a/examples/v2/identity-providers/ListIdentityProviderUsers.py b/examples/v2/identity-providers/ListIdentityProviderUsers.py new file mode 100644 index 0000000000..c50b5794b0 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviderUsers.py @@ -0,0 +1,15 @@ +""" +List users with an identity provider override returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.identity_providers_api import IdentityProvidersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IdentityProvidersApi(api_client) + response = api_instance.list_identity_provider_users( + idp_id="00000000-0000-0000-0000-000000000001", + ) + + print(response) diff --git a/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.py b/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.py new file mode 100644 index 0000000000..875c8cc294 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.py @@ -0,0 +1,15 @@ +""" +List users with an identity provider override returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.identity_providers_api import IdentityProvidersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IdentityProvidersApi(api_client) + items = api_instance.list_identity_provider_users_with_pagination( + idp_id="00000000-0000-0000-0000-000000000001", + ) + for item in items: + print(item) diff --git a/examples/v2/identity-providers/ListIdentityProviders.py b/examples/v2/identity-providers/ListIdentityProviders.py new file mode 100644 index 0000000000..e1f7897657 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviders.py @@ -0,0 +1,13 @@ +""" +List identity providers returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.identity_providers_api import IdentityProvidersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IdentityProvidersApi(api_client) + response = api_instance.list_identity_providers() + + print(response) diff --git a/examples/v2/identity-providers/UpdateIdentityProvider.py b/examples/v2/identity-providers/UpdateIdentityProvider.py new file mode 100644 index 0000000000..bd272dc536 --- /dev/null +++ b/examples/v2/identity-providers/UpdateIdentityProvider.py @@ -0,0 +1,27 @@ +""" +Update an identity provider returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.identity_providers_api import IdentityProvidersApi +from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType +from datadog_api_client.v2.model.identity_provider_update_attributes import IdentityProviderUpdateAttributes +from datadog_api_client.v2.model.identity_provider_update_data import IdentityProviderUpdateData +from datadog_api_client.v2.model.identity_provider_update_request import IdentityProviderUpdateRequest + +body = IdentityProviderUpdateRequest( + data=IdentityProviderUpdateData( + attributes=IdentityProviderUpdateAttributes( + enabled=True, + ), + id="00000000-0000-0000-0000-000000000001", + type=IdentityProviderType.IDENTITY_PROVIDERS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = IdentityProvidersApi(api_client) + response = api_instance.update_identity_provider(idp_id="00000000-0000-0000-0000-000000000001", body=body) + + print(response) diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.py b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.py new file mode 100644 index 0000000000..60ff4cf58a --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.py @@ -0,0 +1,13 @@ +""" +Delete an org authorized client returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + api_instance.delete_org_authorized_client( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.py b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.py new file mode 100644 index 0000000000..5afe28c15a --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.py @@ -0,0 +1,14 @@ +""" +Delete a user's authorizations for a client returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + api_instance.delete_org_authorized_client_all_user_authorizations( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + user_id="00000000-0000-9999-0000-000000000001", + ) diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.py b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.py new file mode 100644 index 0000000000..17b4337da7 --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.py @@ -0,0 +1,14 @@ +""" +Delete a user authorization for a client returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + api_instance.delete_org_authorized_client_user_authorization( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + user_authorized_client_id="00000000-0000-0000-0000-000000000002", + ) diff --git a/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.py b/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.py new file mode 100644 index 0000000000..650179b65b --- /dev/null +++ b/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.py @@ -0,0 +1,15 @@ +""" +Get an org authorized client returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + response = api_instance.get_org_authorized_client( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) + + print(response) diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.py b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.py new file mode 100644 index 0000000000..b2e739207f --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.py @@ -0,0 +1,15 @@ +""" +List user authorizations for a client returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + response = api_instance.list_org_authorized_client_user_authorizations( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) + + print(response) diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.py b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.py new file mode 100644 index 0000000000..aa5d304854 --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.py @@ -0,0 +1,15 @@ +""" +List user authorizations for a client returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + items = api_instance.list_org_authorized_client_user_authorizations_with_pagination( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) + for item in items: + print(item) diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.py b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.py new file mode 100644 index 0000000000..e68ca8b569 --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.py @@ -0,0 +1,13 @@ +""" +List org authorized clients returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + response = api_instance.list_org_authorized_clients() + + print(response) diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.py b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.py new file mode 100644 index 0000000000..526c00bcad --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.py @@ -0,0 +1,13 @@ +""" +List org authorized clients returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + items = api_instance.list_org_authorized_clients_with_pagination() + for item in items: + print(item) diff --git a/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.py b/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.py new file mode 100644 index 0000000000..46b677b07d --- /dev/null +++ b/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.py @@ -0,0 +1,29 @@ +""" +Update an org authorized client returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi +from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType +from datadog_api_client.v2.model.org_authorized_client_update_attributes import OrgAuthorizedClientUpdateAttributes +from datadog_api_client.v2.model.org_authorized_client_update_data import OrgAuthorizedClientUpdateData +from datadog_api_client.v2.model.org_authorized_client_update_request import OrgAuthorizedClientUpdateRequest + +body = OrgAuthorizedClientUpdateRequest( + data=OrgAuthorizedClientUpdateData( + attributes=OrgAuthorizedClientUpdateAttributes( + disabled=True, + ), + id="00000000-0000-0000-0000-000000000001", + type=OrgAuthorizedClientType.ORG_AUTHORIZED_CLIENTS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgAuthorizedClientsApi(api_client) + response = api_instance.update_org_authorized_client( + org_authorized_client_id="00000000-0000-0000-0000-000000000001", body=body + ) + + print(response) diff --git a/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.py b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.py new file mode 100644 index 0000000000..87e079575d --- /dev/null +++ b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.py @@ -0,0 +1,13 @@ +""" +Delete a user authorized client returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UserAuthorizedClientsApi(api_client) + api_instance.delete_user_authorized_client( + user_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) diff --git a/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.py b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.py new file mode 100644 index 0000000000..a7aea2f408 --- /dev/null +++ b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.py @@ -0,0 +1,13 @@ +""" +Delete all user authorized clients for a client returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UserAuthorizedClientsApi(api_client) + api_instance.delete_user_authorized_clients_by_client( + client_id="00000000-0000-0000-0000-000000000010", + ) diff --git a/examples/v2/user-authorized-clients/GetUserAuthorizedClient.py b/examples/v2/user-authorized-clients/GetUserAuthorizedClient.py new file mode 100644 index 0000000000..cc45b46bfe --- /dev/null +++ b/examples/v2/user-authorized-clients/GetUserAuthorizedClient.py @@ -0,0 +1,15 @@ +""" +Get a user authorized client returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UserAuthorizedClientsApi(api_client) + response = api_instance.get_user_authorized_client( + user_authorized_client_id="00000000-0000-0000-0000-000000000001", + ) + + print(response) diff --git a/examples/v2/user-authorized-clients/ListUserAuthorizedClients.py b/examples/v2/user-authorized-clients/ListUserAuthorizedClients.py new file mode 100644 index 0000000000..1544168cc3 --- /dev/null +++ b/examples/v2/user-authorized-clients/ListUserAuthorizedClients.py @@ -0,0 +1,13 @@ +""" +List user authorized clients returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UserAuthorizedClientsApi(api_client) + response = api_instance.list_user_authorized_clients() + + print(response) diff --git a/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.py b/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.py new file mode 100644 index 0000000000..c9f51fa65f --- /dev/null +++ b/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.py @@ -0,0 +1,13 @@ +""" +List user authorized clients returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UserAuthorizedClientsApi(api_client) + items = api_instance.list_user_authorized_clients_with_pagination() + for item in items: + print(item) diff --git a/examples/v2/users/GetUserIdentityProviders.py b/examples/v2/users/GetUserIdentityProviders.py new file mode 100644 index 0000000000..617f429764 --- /dev/null +++ b/examples/v2/users/GetUserIdentityProviders.py @@ -0,0 +1,15 @@ +""" +Get identity provider overrides for a user returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.users_api import UsersApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UsersApi(api_client) + response = api_instance.get_user_identity_providers( + user_id="00000000-0000-9999-0000-000000000000", + ) + + print(response) diff --git a/examples/v2/users/UpdateUserIdentityProviders.py b/examples/v2/users/UpdateUserIdentityProviders.py new file mode 100644 index 0000000000..6cf4e67b8b --- /dev/null +++ b/examples/v2/users/UpdateUserIdentityProviders.py @@ -0,0 +1,25 @@ +""" +Update identity provider overrides for a user returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.users_api import UsersApi +from datadog_api_client.v2.model.update_user_identity_providers_request import UpdateUserIdentityProvidersRequest +from datadog_api_client.v2.model.user_relationship_identity_provider_data import UserRelationshipIdentityProviderData +from datadog_api_client.v2.model.user_relationship_identity_provider_data_type import ( + UserRelationshipIdentityProviderDataType, +) + +body = UpdateUserIdentityProvidersRequest( + data=[ + UserRelationshipIdentityProviderData( + id="00000000-0000-0000-0000-000000000001", + type=UserRelationshipIdentityProviderDataType.IDENTITY_PROVIDERS, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UsersApi(api_client) + api_instance.update_user_identity_providers(user_id="00000000-0000-9999-0000-000000000000", body=body) diff --git a/src/datadog_api_client/v2/api/identity_providers_api.py b/src/datadog_api_client/v2/api/identity_providers_api.py new file mode 100644 index 0000000000..71a513e4f3 --- /dev/null +++ b/src/datadog_api_client/v2/api/identity_providers_api.py @@ -0,0 +1,287 @@ +# 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. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.identity_providers_response import IdentityProvidersResponse +from datadog_api_client.v2.model.identity_provider_response import IdentityProviderResponse +from datadog_api_client.v2.model.identity_provider_update_request import IdentityProviderUpdateRequest +from datadog_api_client.v2.model.users_response import UsersResponse +from datadog_api_client.v2.model.query_sort_order import QuerySortOrder +from datadog_api_client.v2.model.user import User + + +class IdentityProvidersApi: + """ + Manage identity providers and user authentication method overrides. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._list_identity_providers_endpoint = _Endpoint( + settings={ + "response_type": (IdentityProvidersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/identity_providers", + "operation_id": "list_identity_providers", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_identity_provider_users_endpoint = _Endpoint( + settings={ + "response_type": (UsersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/identity_providers/{idp_id}/users", + "operation_id": "list_identity_provider_users", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "idp_id": { + "required": True, + "openapi_types": (str,), + "attribute": "idp_id", + "location": "path", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "sort_dir": { + "openapi_types": (QuerySortOrder,), + "attribute": "sort_dir", + "location": "query", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "filter_status": { + "openapi_types": (str,), + "attribute": "filter[status]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_identity_provider_endpoint = _Endpoint( + settings={ + "response_type": (IdentityProviderResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/identity_providers/{idp_id}", + "operation_id": "update_identity_provider", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "idp_id": { + "required": True, + "openapi_types": (str,), + "attribute": "idp_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (IdentityProviderUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def list_identity_providers( + self, + ) -> IdentityProvidersResponse: + """List identity providers. + + Get all identity providers available for the current organization. + + :rtype: IdentityProvidersResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_identity_providers_endpoint.call_with_http_info(**kwargs) + + def list_identity_provider_users( + self, + idp_id: str, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + sort_dir: Union[QuerySortOrder, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_status: Union[str, UnsetType] = unset, + ) -> UsersResponse: + """List users with an identity provider override. + + Get all users in the organization whose login method has been overridden + to use the specified identity provider. + + :param idp_id: The ID of the identity provider. + :type idp_id: str + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: User attribute to order results by. Options include ``email`` and ``name``. + :type sort: str, optional + :param sort_dir: Direction of sort. Options: ``asc`` , ``desc``. + :type sort_dir: QuerySortOrder, optional + :param filter: Filter users by the given string. Defaults to no filtering. + :type filter: str, optional + :param filter_status: Filter on status attribute. + Comma-separated list, with possible values ``Active`` , ``Pending`` , and ``Disabled``. + Defaults to no filtering. + :type filter_status: str, optional + :rtype: UsersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["idp_id"] = idp_id + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if sort_dir is not unset: + kwargs["sort_dir"] = sort_dir + + if filter is not unset: + kwargs["filter"] = filter + + if filter_status is not unset: + kwargs["filter_status"] = filter_status + + return self._list_identity_provider_users_endpoint.call_with_http_info(**kwargs) + + def list_identity_provider_users_with_pagination( + self, + idp_id: str, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + sort_dir: Union[QuerySortOrder, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_status: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[User]: + """List users with an identity provider override. + + Provide a paginated version of :meth:`list_identity_provider_users`, returning all items. + + :param idp_id: The ID of the identity provider. + :type idp_id: str + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: User attribute to order results by. Options include ``email`` and ``name``. + :type sort: str, optional + :param sort_dir: Direction of sort. Options: ``asc`` , ``desc``. + :type sort_dir: QuerySortOrder, optional + :param filter: Filter users by the given string. Defaults to no filtering. + :type filter: str, optional + :param filter_status: Filter on status attribute. + Comma-separated list, with possible values ``Active`` , ``Pending`` , and ``Disabled``. + Defaults to no filtering. + :type filter_status: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[User] + """ + kwargs: Dict[str, Any] = {} + kwargs["idp_id"] = idp_id + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if sort_dir is not unset: + kwargs["sort_dir"] = sort_dir + + if filter is not unset: + kwargs["filter"] = filter + + if filter_status is not unset: + kwargs["filter_status"] = filter_status + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._list_identity_provider_users_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_param": "page_number", + "page_start": 0, + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + + def update_identity_provider( + self, + idp_id: str, + body: IdentityProviderUpdateRequest, + ) -> IdentityProviderResponse: + """Update an identity provider. + + Enable or disable an identity provider for the current organization. + + :param idp_id: The ID of the identity provider. + :type idp_id: str + :type body: IdentityProviderUpdateRequest + :rtype: IdentityProviderResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["idp_id"] = idp_id + + kwargs["body"] = body + + return self._update_identity_provider_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/org_authorized_clients_api.py b/src/datadog_api_client/v2/api/org_authorized_clients_api.py new file mode 100644 index 0000000000..fa3ee66ed1 --- /dev/null +++ b/src/datadog_api_client/v2/api/org_authorized_clients_api.py @@ -0,0 +1,668 @@ +# 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. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.org_authorized_clients_response import OrgAuthorizedClientsResponse +from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData +from datadog_api_client.v2.model.org_authorized_client_response import OrgAuthorizedClientResponse +from datadog_api_client.v2.model.org_authorized_client_update_request import OrgAuthorizedClientUpdateRequest +from datadog_api_client.v2.model.user_authorized_clients_response import UserAuthorizedClientsResponse +from datadog_api_client.v2.model.org_authorized_client_user_authorizations_sort import ( + OrgAuthorizedClientUserAuthorizationsSort, +) +from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData + + +class OrgAuthorizedClientsApi: + """ + Manage OAuth2 client authorizations at the organization level. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._delete_org_authorized_client_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}", + "operation_id": "delete_org_authorized_client", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_org_authorized_client_all_user_authorizations_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}/user/{user_id}", + "operation_id": "delete_org_authorized_client_all_user_authorizations", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_org_authorized_client_user_authorization_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients/{user_authorized_client_id}", + "operation_id": "delete_org_authorized_client_user_authorization", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + "user_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_authorized_client_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_org_authorized_client_endpoint = _Endpoint( + settings={ + "response_type": (OrgAuthorizedClientResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}", + "operation_id": "get_org_authorized_client", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "filter_user_authorized_clients_disabled": { + "openapi_types": (str,), + "attribute": "filter[user_authorized_clients][disabled]", + "location": "query", + }, + "filter_user_authorized_clients_user_disabled": { + "openapi_types": (str,), + "attribute": "filter[user_authorized_clients][user][disabled]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_org_authorized_clients_endpoint = _Endpoint( + settings={ + "response_type": (OrgAuthorizedClientsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients", + "operation_id": "list_org_authorized_clients", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "filter_oauth2_client_name": { + "openapi_types": (str,), + "attribute": "filter[oauth2_client][name]", + "location": "query", + }, + "filter_disabled": { + "openapi_types": (str,), + "attribute": "filter[disabled]", + "location": "query", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_org_authorized_client_user_authorizations_endpoint = _Endpoint( + settings={ + "response_type": (UserAuthorizedClientsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients", + "operation_id": "list_org_authorized_client_user_authorizations", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "sort": { + "openapi_types": (OrgAuthorizedClientUserAuthorizationsSort,), + "attribute": "sort", + "location": "query", + }, + "filter_disabled": { + "openapi_types": (str,), + "attribute": "filter[disabled]", + "location": "query", + }, + "filter_user_name": { + "openapi_types": (str,), + "attribute": "filter[user][name]", + "location": "query", + }, + "filter_user_email": { + "openapi_types": (str,), + "attribute": "filter[user][email]", + "location": "query", + }, + "filter_user_disabled": { + "openapi_types": (str,), + "attribute": "filter[user][disabled]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_org_authorized_client_endpoint = _Endpoint( + settings={ + "response_type": (OrgAuthorizedClientResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_authorized_clients/{org_authorized_client_id}", + "operation_id": "update_org_authorized_client", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "org_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "org_authorized_client_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (OrgAuthorizedClientUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def delete_org_authorized_client( + self, + org_authorized_client_id: str, + ) -> None: + """Delete an org authorized client. + + Disable an OAuth2 client authorization for the current organization, revoking access for all users. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + return self._delete_org_authorized_client_endpoint.call_with_http_info(**kwargs) + + def delete_org_authorized_client_all_user_authorizations( + self, + org_authorized_client_id: str, + user_id: str, + ) -> None: + """Delete a user's authorizations for a client. + + Disable all authorizations for a specific user for the specified OAuth2 client in the current organization. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :param user_id: The ID of the user. + :type user_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + kwargs["user_id"] = user_id + + return self._delete_org_authorized_client_all_user_authorizations_endpoint.call_with_http_info(**kwargs) + + def delete_org_authorized_client_user_authorization( + self, + org_authorized_client_id: str, + user_authorized_client_id: str, + ) -> None: + """Delete a user authorization for a client. + + Disable a specific user authorization for the specified OAuth2 client in the current organization. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :param user_authorized_client_id: The ID of the user authorized client. + :type user_authorized_client_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + kwargs["user_authorized_client_id"] = user_authorized_client_id + + return self._delete_org_authorized_client_user_authorization_endpoint.call_with_http_info(**kwargs) + + def get_org_authorized_client( + self, + org_authorized_client_id: str, + *, + include: Union[str, UnsetType] = unset, + filter_user_authorized_clients_disabled: Union[str, UnsetType] = unset, + filter_user_authorized_clients_user_disabled: Union[str, UnsetType] = unset, + ) -> OrgAuthorizedClientResponse: + """Get an org authorized client. + + Get a single OAuth2 client authorized for the current organization. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :param include: Comma-separated list of related resources to include. + Options: ``oauth2_client`` , ``oauth2_client.app`` , ``oauth2_client.scopes`` , ``user_authorized_clients.user``. + :type include: str, optional + :param filter_user_authorized_clients_disabled: Filter included user authorized clients by disabled status. + :type filter_user_authorized_clients_disabled: str, optional + :param filter_user_authorized_clients_user_disabled: Filter included user authorized clients by user disabled status. + :type filter_user_authorized_clients_user_disabled: str, optional + :rtype: OrgAuthorizedClientResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + if include is not unset: + kwargs["include"] = include + + if filter_user_authorized_clients_disabled is not unset: + kwargs["filter_user_authorized_clients_disabled"] = filter_user_authorized_clients_disabled + + if filter_user_authorized_clients_user_disabled is not unset: + kwargs["filter_user_authorized_clients_user_disabled"] = filter_user_authorized_clients_user_disabled + + return self._get_org_authorized_client_endpoint.call_with_http_info(**kwargs) + + def list_org_authorized_clients( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_oauth2_client_name: Union[str, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> OrgAuthorizedClientsResponse: + """List org authorized clients. + + Get a list of all OAuth2 clients authorized for the current organization. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: Field to sort results by. Options include ``oauth2_client.name``. + :type sort: str, optional + :param filter: Filter results by client name, app title, or app description. + :type filter: str, optional + :param filter_oauth2_client_name: Filter results by the OAuth2 client name. + :type filter_oauth2_client_name: str, optional + :param filter_disabled: Filter results by the org-level disabled status. + :type filter_disabled: str, optional + :param include: Comma-separated list of related resources to include. + Options: ``oauth2_client`` , ``oauth2_client.app`` , ``user_authorized_clients.user``. + :type include: str, optional + :rtype: OrgAuthorizedClientsResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if filter is not unset: + kwargs["filter"] = filter + + if filter_oauth2_client_name is not unset: + kwargs["filter_oauth2_client_name"] = filter_oauth2_client_name + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if include is not unset: + kwargs["include"] = include + + return self._list_org_authorized_clients_endpoint.call_with_http_info(**kwargs) + + def list_org_authorized_clients_with_pagination( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_oauth2_client_name: Union[str, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[OrgAuthorizedClientData]: + """List org authorized clients. + + Provide a paginated version of :meth:`list_org_authorized_clients`, returning all items. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: Field to sort results by. Options include ``oauth2_client.name``. + :type sort: str, optional + :param filter: Filter results by client name, app title, or app description. + :type filter: str, optional + :param filter_oauth2_client_name: Filter results by the OAuth2 client name. + :type filter_oauth2_client_name: str, optional + :param filter_disabled: Filter results by the org-level disabled status. + :type filter_disabled: str, optional + :param include: Comma-separated list of related resources to include. + Options: ``oauth2_client`` , ``oauth2_client.app`` , ``user_authorized_clients.user``. + :type include: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[OrgAuthorizedClientData] + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if filter is not unset: + kwargs["filter"] = filter + + if filter_oauth2_client_name is not unset: + kwargs["filter_oauth2_client_name"] = filter_oauth2_client_name + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if include is not unset: + kwargs["include"] = include + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._list_org_authorized_clients_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_param": "page_number", + "page_start": 0, + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + + def list_org_authorized_client_user_authorizations( + self, + org_authorized_client_id: str, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[OrgAuthorizedClientUserAuthorizationsSort, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + filter_user_name: Union[str, UnsetType] = unset, + filter_user_email: Union[str, UnsetType] = unset, + filter_user_disabled: Union[str, UnsetType] = unset, + ) -> UserAuthorizedClientsResponse: + """List user authorizations for a client. + + Get a list of user authorizations for the specified OAuth2 client in the current organization. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: Field to sort results by. Options: ``user.name`` , ``user.email`` , ``oauth2_client.name``. + :type sort: OrgAuthorizedClientUserAuthorizationsSort, optional + :param filter_disabled: Filter results by the user authorization disabled status. + :type filter_disabled: str, optional + :param filter_user_name: Filter results by user name. + :type filter_user_name: str, optional + :param filter_user_email: Filter results by user email. + :type filter_user_email: str, optional + :param filter_user_disabled: Filter results by whether the user is disabled. + :type filter_user_disabled: str, optional + :rtype: UserAuthorizedClientsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if filter_user_name is not unset: + kwargs["filter_user_name"] = filter_user_name + + if filter_user_email is not unset: + kwargs["filter_user_email"] = filter_user_email + + if filter_user_disabled is not unset: + kwargs["filter_user_disabled"] = filter_user_disabled + + return self._list_org_authorized_client_user_authorizations_endpoint.call_with_http_info(**kwargs) + + def list_org_authorized_client_user_authorizations_with_pagination( + self, + org_authorized_client_id: str, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + sort: Union[OrgAuthorizedClientUserAuthorizationsSort, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + filter_user_name: Union[str, UnsetType] = unset, + filter_user_email: Union[str, UnsetType] = unset, + filter_user_disabled: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[UserAuthorizedClientData]: + """List user authorizations for a client. + + Provide a paginated version of :meth:`list_org_authorized_client_user_authorizations`, returning all items. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param sort: Field to sort results by. Options: ``user.name`` , ``user.email`` , ``oauth2_client.name``. + :type sort: OrgAuthorizedClientUserAuthorizationsSort, optional + :param filter_disabled: Filter results by the user authorization disabled status. + :type filter_disabled: str, optional + :param filter_user_name: Filter results by user name. + :type filter_user_name: str, optional + :param filter_user_email: Filter results by user email. + :type filter_user_email: str, optional + :param filter_user_disabled: Filter results by whether the user is disabled. + :type filter_user_disabled: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[UserAuthorizedClientData] + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if sort is not unset: + kwargs["sort"] = sort + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if filter_user_name is not unset: + kwargs["filter_user_name"] = filter_user_name + + if filter_user_email is not unset: + kwargs["filter_user_email"] = filter_user_email + + if filter_user_disabled is not unset: + kwargs["filter_user_disabled"] = filter_user_disabled + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._list_org_authorized_client_user_authorizations_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_param": "page_number", + "page_start": 0, + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + + def update_org_authorized_client( + self, + org_authorized_client_id: str, + body: OrgAuthorizedClientUpdateRequest, + ) -> OrgAuthorizedClientResponse: + """Update an org authorized client. + + Enable or disable an OAuth2 client authorization for the current organization. + + :param org_authorized_client_id: The ID of the org authorized client. + :type org_authorized_client_id: str + :type body: OrgAuthorizedClientUpdateRequest + :rtype: OrgAuthorizedClientResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["org_authorized_client_id"] = org_authorized_client_id + + kwargs["body"] = body + + return self._update_org_authorized_client_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/user_authorized_clients_api.py b/src/datadog_api_client/v2/api/user_authorized_clients_api.py new file mode 100644 index 0000000000..105afdb39a --- /dev/null +++ b/src/datadog_api_client/v2/api/user_authorized_clients_api.py @@ -0,0 +1,291 @@ +# 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. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.user_authorized_clients_response import UserAuthorizedClientsResponse +from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData +from datadog_api_client.v2.model.user_authorized_client_response import UserAuthorizedClientResponse + + +class UserAuthorizedClientsApi: + """ + Manage OAuth2 client authorizations at the user level. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._delete_user_authorized_client_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/user_authorized_clients/{user_authorized_client_id}", + "operation_id": "delete_user_authorized_client", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "user_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_authorized_client_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_user_authorized_clients_by_client_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/user_authorized_clients/client/{client_id}", + "operation_id": "delete_user_authorized_clients_by_client", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "client_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_user_authorized_client_endpoint = _Endpoint( + settings={ + "response_type": (UserAuthorizedClientResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/user_authorized_clients/{user_authorized_client_id}", + "operation_id": "get_user_authorized_client", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "user_authorized_client_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_authorized_client_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_user_authorized_clients_endpoint = _Endpoint( + settings={ + "response_type": (UserAuthorizedClientsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/user_authorized_clients", + "operation_id": "list_user_authorized_clients", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "filter_disabled": { + "openapi_types": (str,), + "attribute": "filter[disabled]", + "location": "query", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + def delete_user_authorized_client( + self, + user_authorized_client_id: str, + ) -> None: + """Delete a user authorized client. + + Disable the current user's authorization for the specified OAuth2 client. + + :param user_authorized_client_id: The ID of the user authorized client. + :type user_authorized_client_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["user_authorized_client_id"] = user_authorized_client_id + + return self._delete_user_authorized_client_endpoint.call_with_http_info(**kwargs) + + def delete_user_authorized_clients_by_client( + self, + client_id: str, + ) -> None: + """Delete all user authorized clients for a client. + + Disable all authorizations the current user has granted to the specified OAuth2 client. + + :param client_id: The ID of the OAuth2 client. + :type client_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["client_id"] = client_id + + return self._delete_user_authorized_clients_by_client_endpoint.call_with_http_info(**kwargs) + + def get_user_authorized_client( + self, + user_authorized_client_id: str, + ) -> UserAuthorizedClientResponse: + """Get a user authorized client. + + Get a single OAuth2 client authorization for the current user. + + :param user_authorized_client_id: The ID of the user authorized client. + :type user_authorized_client_id: str + :rtype: UserAuthorizedClientResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["user_authorized_client_id"] = user_authorized_client_id + + return self._get_user_authorized_client_endpoint.call_with_http_info(**kwargs) + + def list_user_authorized_clients( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> UserAuthorizedClientsResponse: + """List user authorized clients. + + Get a list of all OAuth2 clients authorized by the current user. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param filter: Filter results by client name, app title, or app description. + :type filter: str, optional + :param filter_disabled: Filter results by the user-level disabled status. + :type filter_disabled: str, optional + :param include: Comma-separated list of related resources to include. Options: ``oauth2_client`` , ``oauth2_client.app``. + :type include: str, optional + :rtype: UserAuthorizedClientsResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if filter is not unset: + kwargs["filter"] = filter + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if include is not unset: + kwargs["include"] = include + + return self._list_user_authorized_clients_endpoint.call_with_http_info(**kwargs) + + def list_user_authorized_clients_with_pagination( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + filter_disabled: Union[str, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[UserAuthorizedClientData]: + """List user authorized clients. + + Provide a paginated version of :meth:`list_user_authorized_clients`, returning all items. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :param filter: Filter results by client name, app title, or app description. + :type filter: str, optional + :param filter_disabled: Filter results by the user-level disabled status. + :type filter_disabled: str, optional + :param include: Comma-separated list of related resources to include. Options: ``oauth2_client`` , ``oauth2_client.app``. + :type include: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[UserAuthorizedClientData] + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + if filter is not unset: + kwargs["filter"] = filter + + if filter_disabled is not unset: + kwargs["filter_disabled"] = filter_disabled + + if include is not unset: + kwargs["include"] = include + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._list_user_authorized_clients_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_param": "page_number", + "page_start": 0, + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) diff --git a/src/datadog_api_client/v2/api/users_api.py b/src/datadog_api_client/v2/api/users_api.py index 3f5aa252f0..8642e82d93 100644 --- a/src/datadog_api_client/v2/api/users_api.py +++ b/src/datadog_api_client/v2/api/users_api.py @@ -26,7 +26,9 @@ from datadog_api_client.v2.model.query_sort_order import QuerySortOrder from datadog_api_client.v2.model.user import User from datadog_api_client.v2.model.user_create_request import UserCreateRequest +from datadog_api_client.v2.model.user_override_identity_providers_response import UserOverrideIdentityProvidersResponse from datadog_api_client.v2.model.permissions_response import PermissionsResponse +from datadog_api_client.v2.model.update_user_identity_providers_request import UpdateUserIdentityProvidersRequest class UsersApi: @@ -187,6 +189,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_user_identity_providers_endpoint = _Endpoint( + settings={ + "response_type": (UserOverrideIdentityProvidersResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/users/{user_id}/identity_providers", + "operation_id": "get_user_identity_providers", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_user_organizations_endpoint = _Endpoint( settings={ "response_type": (UserResponse,), @@ -346,6 +371,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_user_identity_providers_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/users/{user_id}/relationships/identity_providers", + "operation_id": "update_user_identity_providers", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateUserIdentityProvidersRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def anonymize_users( self, body: AnonymizeUsersRequest, @@ -465,6 +516,24 @@ def get_user( return self._get_user_endpoint.call_with_http_info(**kwargs) + def get_user_identity_providers( + self, + user_id: str, + ) -> UserOverrideIdentityProvidersResponse: + """Get identity provider overrides for a user. + + Get the identity provider overrides for a specific user in the organization. + When a user has no overrides set, they use the organization's default identity providers. + + :param user_id: The ID of the user. + :type user_id: str + :rtype: UserOverrideIdentityProvidersResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["user_id"] = user_id + + return self._get_user_identity_providers_endpoint.call_with_http_info(**kwargs) + def list_user_organizations( self, user_id: str, @@ -680,3 +749,26 @@ def update_user( kwargs["body"] = body return self._update_user_endpoint.call_with_http_info(**kwargs) + + def update_user_identity_providers( + self, + user_id: str, + body: UpdateUserIdentityProvidersRequest, + ) -> None: + """Update identity provider overrides for a user. + + Set the identity provider overrides for a specific user in the organization. + Pass an empty list to remove all overrides, reverting the user to the organization's + default identity providers. + + :param user_id: The ID of the user. + :type user_id: str + :type body: UpdateUserIdentityProvidersRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["user_id"] = user_id + + kwargs["body"] = body + + return self._update_user_identity_providers_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index f3175d1eab..2a25a21438 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -55,6 +55,7 @@ from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi from datadog_api_client.v2.api.high_availability_multi_region_api import HighAvailabilityMultiRegionApi from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi +from datadog_api_client.v2.api.identity_providers_api import IdentityProvidersApi from datadog_api_client.v2.api.incident_services_api import IncidentServicesApi from datadog_api_client.v2.api.incidents_api import IncidentsApi from datadog_api_client.v2.api.integrations_api import IntegrationsApi @@ -79,6 +80,7 @@ from datadog_api_client.v2.api.on_call_api import OnCallApi from datadog_api_client.v2.api.on_call_paging_api import OnCallPagingApi from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi +from datadog_api_client.v2.api.org_authorized_clients_api import OrgAuthorizedClientsApi from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi from datadog_api_client.v2.api.org_groups_api import OrgGroupsApi from datadog_api_client.v2.api.organizations_api import OrganizationsApi @@ -122,6 +124,7 @@ from datadog_api_client.v2.api.teams_api import TeamsApi from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi +from datadog_api_client.v2.api.user_authorized_clients_api import UserAuthorizedClientsApi from datadog_api_client.v2.api.users_api import UsersApi from datadog_api_client.v2.api.web_integrations_api import WebIntegrationsApi from datadog_api_client.v2.api.webhooks_integration_api import WebhooksIntegrationApi @@ -187,6 +190,7 @@ "GoogleChatIntegrationApi", "HighAvailabilityMultiRegionApi", "IPAllowlistApi", + "IdentityProvidersApi", "IncidentServicesApi", "IncidentsApi", "IntegrationsApi", @@ -211,6 +215,7 @@ "OnCallApi", "OnCallPagingApi", "OpsgenieIntegrationApi", + "OrgAuthorizedClientsApi", "OrgConnectionsApi", "OrgGroupsApi", "OrganizationsApi", @@ -254,6 +259,7 @@ "TeamsApi", "TestOptimizationApi", "UsageMeteringApi", + "UserAuthorizedClientsApi", "UsersApi", "WebIntegrationsApi", "WebhooksIntegrationApi", diff --git a/src/datadog_api_client/v2/model/identity_provider_attributes.py b/src/datadog_api_client/v2/model/identity_provider_attributes.py new file mode 100644 index 0000000000..a13f4c626e --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_attributes.py @@ -0,0 +1,39 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IdentityProviderAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "authentication_method": (str,), + "enabled": (bool,), + } + + attribute_map = { + "authentication_method": "authentication_method", + "enabled": "enabled", + } + + def __init__(self_, authentication_method: str, enabled: bool, **kwargs): + """ + Attributes of an organization identity provider. + + :param authentication_method: The authentication method used by this identity provider. + :type authentication_method: str + + :param enabled: Whether this identity provider is enabled for the organization. + :type enabled: bool + """ + super().__init__(kwargs) + + self_.authentication_method = authentication_method + self_.enabled = enabled diff --git a/src/datadog_api_client/v2/model/identity_provider_data.py b/src/datadog_api_client/v2/model/identity_provider_data.py new file mode 100644 index 0000000000..623c043c6c --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_data.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.identity_provider_attributes import IdentityProviderAttributes + from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType + + +class IdentityProviderData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.identity_provider_attributes import IdentityProviderAttributes + from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType + + return { + "attributes": (IdentityProviderAttributes,), + "id": (str,), + "type": (IdentityProviderType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IdentityProviderAttributes, id: str, type: IdentityProviderType, **kwargs): + """ + Data object representing an organization identity provider. + + :param attributes: Attributes of an organization identity provider. + :type attributes: IdentityProviderAttributes + + :param id: The unique identifier of the identity provider. + :type id: str + + :param type: The resource type for identity providers. + :type type: IdentityProviderType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/identity_provider_response.py b/src/datadog_api_client/v2/model/identity_provider_response.py new file mode 100644 index 0000000000..2b2bb78e79 --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.identity_provider_data import IdentityProviderData + + +class IdentityProviderResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.identity_provider_data import IdentityProviderData + + return { + "data": (IdentityProviderData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IdentityProviderData, **kwargs): + """ + Response containing a single organization identity provider. + + :param data: Data object representing an organization identity provider. + :type data: IdentityProviderData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/identity_provider_type.py b/src/datadog_api_client/v2/model/identity_provider_type.py new file mode 100644 index 0000000000..efdbafc963 --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IdentityProviderType(ModelSimple): + """ + The resource type for identity providers. + + :param value: If omitted defaults to "identity_providers". Must be one of ["identity_providers"]. + :type value: str + """ + + allowed_values = { + "identity_providers", + } + IDENTITY_PROVIDERS: ClassVar["IdentityProviderType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IdentityProviderType.IDENTITY_PROVIDERS = IdentityProviderType("identity_providers") diff --git a/src/datadog_api_client/v2/model/identity_provider_update_attributes.py b/src/datadog_api_client/v2/model/identity_provider_update_attributes.py new file mode 100644 index 0000000000..5fdf0b2bf8 --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_update_attributes.py @@ -0,0 +1,33 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IdentityProviderUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: bool, **kwargs): + """ + Attributes for updating an organization identity provider. + + :param enabled: Whether to enable or disable this identity provider for the organization. + :type enabled: bool + """ + super().__init__(kwargs) + + self_.enabled = enabled diff --git a/src/datadog_api_client/v2/model/identity_provider_update_data.py b/src/datadog_api_client/v2/model/identity_provider_update_data.py new file mode 100644 index 0000000000..91903ccb4d --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_update_data.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.identity_provider_update_attributes import IdentityProviderUpdateAttributes + from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType + + +class IdentityProviderUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.identity_provider_update_attributes import IdentityProviderUpdateAttributes + from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType + + return { + "attributes": (IdentityProviderUpdateAttributes,), + "id": (str,), + "type": (IdentityProviderType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: IdentityProviderUpdateAttributes, id: str, type: IdentityProviderType, **kwargs): + """ + Data object for updating an organization identity provider. + + :param attributes: Attributes for updating an organization identity provider. + :type attributes: IdentityProviderUpdateAttributes + + :param id: The unique identifier of the identity provider to update. + :type id: str + + :param type: The resource type for identity providers. + :type type: IdentityProviderType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/identity_provider_update_request.py b/src/datadog_api_client/v2/model/identity_provider_update_request.py new file mode 100644 index 0000000000..db2d7484cb --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_provider_update_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.identity_provider_update_data import IdentityProviderUpdateData + + +class IdentityProviderUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.identity_provider_update_data import IdentityProviderUpdateData + + return { + "data": (IdentityProviderUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IdentityProviderUpdateData, **kwargs): + """ + Request body for updating an organization identity provider. + + :param data: Data object for updating an organization identity provider. + :type data: IdentityProviderUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/identity_providers_response.py b/src/datadog_api_client/v2/model/identity_providers_response.py new file mode 100644 index 0000000000..94fce95ddb --- /dev/null +++ b/src/datadog_api_client/v2/model/identity_providers_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.identity_provider_data import IdentityProviderData + + +class IdentityProvidersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.identity_provider_data import IdentityProviderData + + return { + "data": ([IdentityProviderData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[IdentityProviderData], **kwargs): + """ + Response containing a list of identity providers for an organization. + + :param data: List of organization identity provider data objects. + :type data: [IdentityProviderData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_authorized_client_attributes.py b/src/datadog_api_client/v2/model/org_authorized_client_attributes.py new file mode 100644 index 0000000000..31d04763f8 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_attributes.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, +) + + +class OrgAuthorizedClientAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "disabled": (bool,), + "last_exercised": (datetime, none_type), + "user_count": (int,), + } + + attribute_map = { + "disabled": "disabled", + "last_exercised": "last_exercised", + "user_count": "user_count", + } + + def __init__(self_, disabled: bool, last_exercised: Union[datetime, none_type], user_count: int, **kwargs): + """ + Attributes of an org authorized client. + + :param disabled: Whether the organization has disabled this client. + :type disabled: bool + + :param last_exercised: The date and time this client was last exercised. + :type last_exercised: datetime, none_type + + :param user_count: The number of users in the organization who have authorized this client. + :type user_count: int + """ + super().__init__(kwargs) + + self_.disabled = disabled + self_.last_exercised = last_exercised + self_.user_count = user_count diff --git a/src/datadog_api_client/v2/model/org_authorized_client_data.py b/src/datadog_api_client/v2/model/org_authorized_client_data.py new file mode 100644 index 0000000000..801ee99168 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_data.py @@ -0,0 +1,69 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_attributes import OrgAuthorizedClientAttributes + from datadog_api_client.v2.model.org_authorized_client_relationships import OrgAuthorizedClientRelationships + from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType + + +class OrgAuthorizedClientData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_attributes import OrgAuthorizedClientAttributes + from datadog_api_client.v2.model.org_authorized_client_relationships import OrgAuthorizedClientRelationships + from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType + + return { + "attributes": (OrgAuthorizedClientAttributes,), + "id": (str,), + "relationships": (OrgAuthorizedClientRelationships,), + "type": (OrgAuthorizedClientType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: OrgAuthorizedClientAttributes, + id: str, + relationships: OrgAuthorizedClientRelationships, + type: OrgAuthorizedClientType, + **kwargs, + ): + """ + Data object representing an org authorized client. + + :param attributes: Attributes of an org authorized client. + :type attributes: OrgAuthorizedClientAttributes + + :param id: The unique identifier of the org authorized client. + :type id: str + + :param relationships: Relationships for an org authorized client. + :type relationships: OrgAuthorizedClientRelationships + + :param type: The resource type for org authorized clients. + :type type: OrgAuthorizedClientType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client.py new file mode 100644 index 0000000000..e3c620a1ac --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data import ( + OrgAuthorizedClientRelationshipOAuth2ClientData, + ) + + +class OrgAuthorizedClientRelationshipOAuth2Client(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data import ( + OrgAuthorizedClientRelationshipOAuth2ClientData, + ) + + return { + "data": (OrgAuthorizedClientRelationshipOAuth2ClientData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgAuthorizedClientRelationshipOAuth2ClientData, **kwargs): + """ + Relationship to the OAuth2 client for this org authorized client. + + :param data: Data identifying the OAuth2 client associated with this org authorized client. + :type data: OrgAuthorizedClientRelationshipOAuth2ClientData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data.py new file mode 100644 index 0000000000..24d4a8706f --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data_type import ( + OrgAuthorizedClientRelationshipOAuth2ClientDataType, + ) + + +class OrgAuthorizedClientRelationshipOAuth2ClientData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data_type import ( + OrgAuthorizedClientRelationshipOAuth2ClientDataType, + ) + + return { + "id": (str,), + "type": (OrgAuthorizedClientRelationshipOAuth2ClientDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: OrgAuthorizedClientRelationshipOAuth2ClientDataType, **kwargs): + """ + Data identifying the OAuth2 client associated with this org authorized client. + + :param id: The ID of the OAuth2 client. + :type id: str + + :param type: OAuth2 client resource type. + :type type: OrgAuthorizedClientRelationshipOAuth2ClientDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data_type.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data_type.py new file mode 100644 index 0000000000..73d35cbf9a --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_o_auth2_client_data_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgAuthorizedClientRelationshipOAuth2ClientDataType(ModelSimple): + """ + OAuth2 client resource type. + + :param value: If omitted defaults to "oauth2_clients". Must be one of ["oauth2_clients"]. + :type value: str + """ + + allowed_values = { + "oauth2_clients", + } + OAUTH2_CLIENTS: ClassVar["OrgAuthorizedClientRelationshipOAuth2ClientDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgAuthorizedClientRelationshipOAuth2ClientDataType.OAUTH2_CLIENTS = ( + OrgAuthorizedClientRelationshipOAuth2ClientDataType("oauth2_clients") +) diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients.py new file mode 100644 index 0000000000..74a737f855 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsData, + ) + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_links import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks, + ) + + +class OrgAuthorizedClientRelationshipUserAuthorizedClients(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsData, + ) + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_links import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks, + ) + + return { + "data": ([OrgAuthorizedClientRelationshipUserAuthorizedClientsData],), + "links": (OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks,), + } + + attribute_map = { + "data": "data", + "links": "links", + } + + def __init__( + self_, + data: List[OrgAuthorizedClientRelationshipUserAuthorizedClientsData], + links: OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks, + **kwargs, + ): + """ + Relationship to the user authorized clients for this org authorized client. + + :param data: List of user authorized client relationship data objects. + :type data: [OrgAuthorizedClientRelationshipUserAuthorizedClientsData] + + :param links: Links for the user authorized clients relationship. + :type links: OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks + """ + super().__init__(kwargs) + + self_.data = data + self_.links = links diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data.py new file mode 100644 index 0000000000..203851c4a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data_type import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType, + ) + + +class OrgAuthorizedClientRelationshipUserAuthorizedClientsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data_type import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType, + ) + + return { + "id": (str,), + "type": (OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType, **kwargs): + """ + Data identifying a user authorized client. + + :param id: The ID of the user authorized client. + :type id: str + + :param type: User authorized client resource type. + :type type: OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data_type.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data_type.py new file mode 100644 index 0000000000..7891bf49f3 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_data_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType(ModelSimple): + """ + User authorized client resource type. + + :param value: If omitted defaults to "user_authorized_clients". Must be one of ["user_authorized_clients"]. + :type value: str + """ + + allowed_values = { + "user_authorized_clients", + } + USER_AUTHORIZED_CLIENTS: ClassVar["OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType.USER_AUTHORIZED_CLIENTS = ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType("user_authorized_clients") +) diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_links.py b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_links.py new file mode 100644 index 0000000000..061d13a689 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationship_user_authorized_clients_links.py @@ -0,0 +1,33 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "related": (str,), + } + + attribute_map = { + "related": "related", + } + + def __init__(self_, related: str, **kwargs): + """ + Links for the user authorized clients relationship. + + :param related: Link to the user authorized clients for this org authorized client. + :type related: str + """ + super().__init__(kwargs) + + self_.related = related diff --git a/src/datadog_api_client/v2/model/org_authorized_client_relationships.py b/src/datadog_api_client/v2/model/org_authorized_client_relationships.py new file mode 100644 index 0000000000..10806b7393 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_relationships.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client import ( + OrgAuthorizedClientRelationshipOAuth2Client, + ) + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients import ( + OrgAuthorizedClientRelationshipUserAuthorizedClients, + ) + + +class OrgAuthorizedClientRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client import ( + OrgAuthorizedClientRelationshipOAuth2Client, + ) + from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients import ( + OrgAuthorizedClientRelationshipUserAuthorizedClients, + ) + + return { + "oauth2_client": (OrgAuthorizedClientRelationshipOAuth2Client,), + "user_authorized_clients": (OrgAuthorizedClientRelationshipUserAuthorizedClients,), + } + + attribute_map = { + "oauth2_client": "oauth2_client", + "user_authorized_clients": "user_authorized_clients", + } + + def __init__( + self_, + oauth2_client: OrgAuthorizedClientRelationshipOAuth2Client, + user_authorized_clients: OrgAuthorizedClientRelationshipUserAuthorizedClients, + **kwargs, + ): + """ + Relationships for an org authorized client. + + :param oauth2_client: Relationship to the OAuth2 client for this org authorized client. + :type oauth2_client: OrgAuthorizedClientRelationshipOAuth2Client + + :param user_authorized_clients: Relationship to the user authorized clients for this org authorized client. + :type user_authorized_clients: OrgAuthorizedClientRelationshipUserAuthorizedClients + """ + super().__init__(kwargs) + + self_.oauth2_client = oauth2_client + self_.user_authorized_clients = user_authorized_clients diff --git a/src/datadog_api_client/v2/model/org_authorized_client_response.py b/src/datadog_api_client/v2/model/org_authorized_client_response.py new file mode 100644 index 0000000000..14be2f4d5c --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData + + +class OrgAuthorizedClientResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData + + return { + "data": (OrgAuthorizedClientData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgAuthorizedClientData, **kwargs): + """ + Response containing a single org authorized client. + + :param data: Data object representing an org authorized client. + :type data: OrgAuthorizedClientData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_authorized_client_type.py b/src/datadog_api_client/v2/model/org_authorized_client_type.py new file mode 100644 index 0000000000..42c054f944 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgAuthorizedClientType(ModelSimple): + """ + The resource type for org authorized clients. + + :param value: If omitted defaults to "org_authorized_clients". Must be one of ["org_authorized_clients"]. + :type value: str + """ + + allowed_values = { + "org_authorized_clients", + } + ORG_AUTHORIZED_CLIENTS: ClassVar["OrgAuthorizedClientType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgAuthorizedClientType.ORG_AUTHORIZED_CLIENTS = OrgAuthorizedClientType("org_authorized_clients") diff --git a/src/datadog_api_client/v2/model/org_authorized_client_update_attributes.py b/src/datadog_api_client/v2/model/org_authorized_client_update_attributes.py new file mode 100644 index 0000000000..2a6d718de6 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_update_attributes.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class OrgAuthorizedClientUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "disabled": (bool,), + } + + attribute_map = { + "disabled": "disabled", + } + + def __init__(self_, disabled: Union[bool, UnsetType] = unset, **kwargs): + """ + Attributes for updating an org authorized client. + + :param disabled: Whether to disable or enable this client for the organization. + :type disabled: bool, optional + """ + if disabled is not unset: + kwargs["disabled"] = disabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_authorized_client_update_data.py b/src/datadog_api_client/v2/model/org_authorized_client_update_data.py new file mode 100644 index 0000000000..1e4e20419b --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_update_data.py @@ -0,0 +1,65 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_update_attributes import OrgAuthorizedClientUpdateAttributes + from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType + + +class OrgAuthorizedClientUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_update_attributes import ( + OrgAuthorizedClientUpdateAttributes, + ) + from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType + + return { + "attributes": (OrgAuthorizedClientUpdateAttributes,), + "id": (str,), + "type": (OrgAuthorizedClientType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: OrgAuthorizedClientType, + attributes: Union[OrgAuthorizedClientUpdateAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data object for updating an org authorized client. + + :param attributes: Attributes for updating an org authorized client. + :type attributes: OrgAuthorizedClientUpdateAttributes, optional + + :param id: The unique identifier of the org authorized client to update. + :type id: str + + :param type: The resource type for org authorized clients. + :type type: OrgAuthorizedClientType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_authorized_client_update_request.py b/src/datadog_api_client/v2/model/org_authorized_client_update_request.py new file mode 100644 index 0000000000..4b2b0dca02 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_update_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_update_data import OrgAuthorizedClientUpdateData + + +class OrgAuthorizedClientUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_update_data import OrgAuthorizedClientUpdateData + + return { + "data": (OrgAuthorizedClientUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgAuthorizedClientUpdateData, **kwargs): + """ + Request body for updating an org authorized client. + + :param data: Data object for updating an org authorized client. + :type data: OrgAuthorizedClientUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_authorized_client_user_authorizations_sort.py b/src/datadog_api_client/v2/model/org_authorized_client_user_authorizations_sort.py new file mode 100644 index 0000000000..06d75914b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_client_user_authorizations_sort.py @@ -0,0 +1,43 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgAuthorizedClientUserAuthorizationsSort(ModelSimple): + """ + Field to sort user authorizations by. + + :param value: Must be one of ["user.name", "user.email", "oauth2_client.name"]. + :type value: str + """ + + allowed_values = { + "user.name", + "user.email", + "oauth2_client.name", + } + USER_NAME: ClassVar["OrgAuthorizedClientUserAuthorizationsSort"] + USER_EMAIL: ClassVar["OrgAuthorizedClientUserAuthorizationsSort"] + OAUTH2_CLIENT_NAME: ClassVar["OrgAuthorizedClientUserAuthorizationsSort"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgAuthorizedClientUserAuthorizationsSort.USER_NAME = OrgAuthorizedClientUserAuthorizationsSort("user.name") +OrgAuthorizedClientUserAuthorizationsSort.USER_EMAIL = OrgAuthorizedClientUserAuthorizationsSort("user.email") +OrgAuthorizedClientUserAuthorizationsSort.OAUTH2_CLIENT_NAME = OrgAuthorizedClientUserAuthorizationsSort( + "oauth2_client.name" +) diff --git a/src/datadog_api_client/v2/model/org_authorized_clients_response.py b/src/datadog_api_client/v2/model/org_authorized_clients_response.py new file mode 100644 index 0000000000..08ae13497f --- /dev/null +++ b/src/datadog_api_client/v2/model/org_authorized_clients_response.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData + from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes + + +class OrgAuthorizedClientsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData + from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes + + return { + "data": ([OrgAuthorizedClientData],), + "meta": (ResponseMetaAttributes,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[OrgAuthorizedClientData], meta: ResponseMetaAttributes, **kwargs): + """ + Response containing a list of org authorized clients. + + :param data: List of org authorized client data objects. + :type data: [OrgAuthorizedClientData] + + :param meta: Object describing meta attributes of response. + :type meta: ResponseMetaAttributes + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/update_user_identity_providers_request.py b/src/datadog_api_client/v2/model/update_user_identity_providers_request.py new file mode 100644 index 0000000000..909bb91114 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_user_identity_providers_request.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_relationship_identity_provider_data import ( + UserRelationshipIdentityProviderData, + ) + + +class UpdateUserIdentityProvidersRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_relationship_identity_provider_data import ( + UserRelationshipIdentityProviderData, + ) + + return { + "data": ([UserRelationshipIdentityProviderData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[UserRelationshipIdentityProviderData], **kwargs): + """ + Request body for setting identity provider overrides for a user. + + :param data: List of identity provider resource identifiers for a relationship update. + :type data: [UserRelationshipIdentityProviderData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_authorized_client_attributes.py b/src/datadog_api_client/v2/model/user_authorized_client_attributes.py new file mode 100644 index 0000000000..3dcdbb864e --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_attributes.py @@ -0,0 +1,68 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, +) + + +class UserAuthorizedClientAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "disabled": (bool,), + "last_exercised": (datetime, none_type), + "modified_at": (datetime,), + "org_disabled": (bool,), + } + + attribute_map = { + "created_at": "created_at", + "disabled": "disabled", + "last_exercised": "last_exercised", + "modified_at": "modified_at", + "org_disabled": "org_disabled", + } + + def __init__( + self_, + created_at: datetime, + disabled: bool, + last_exercised: Union[datetime, none_type], + modified_at: datetime, + org_disabled: bool, + **kwargs, + ): + """ + Attributes of a user authorized client. + + :param created_at: The date and time this authorization was created. + :type created_at: datetime + + :param disabled: Whether the user has disabled this authorization. + :type disabled: bool + + :param last_exercised: The date and time this authorization was last exercised. + :type last_exercised: datetime, none_type + + :param modified_at: The date and time this authorization was last modified. + :type modified_at: datetime + + :param org_disabled: Whether the organization has disabled this authorization. + :type org_disabled: bool + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.disabled = disabled + self_.last_exercised = last_exercised + self_.modified_at = modified_at + self_.org_disabled = org_disabled diff --git a/src/datadog_api_client/v2/model/user_authorized_client_data.py b/src/datadog_api_client/v2/model/user_authorized_client_data.py new file mode 100644 index 0000000000..e71f3e1a72 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_data.py @@ -0,0 +1,69 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_attributes import UserAuthorizedClientAttributes + from datadog_api_client.v2.model.user_authorized_client_relationships import UserAuthorizedClientRelationships + from datadog_api_client.v2.model.user_authorized_client_type import UserAuthorizedClientType + + +class UserAuthorizedClientData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_attributes import UserAuthorizedClientAttributes + from datadog_api_client.v2.model.user_authorized_client_relationships import UserAuthorizedClientRelationships + from datadog_api_client.v2.model.user_authorized_client_type import UserAuthorizedClientType + + return { + "attributes": (UserAuthorizedClientAttributes,), + "id": (str,), + "relationships": (UserAuthorizedClientRelationships,), + "type": (UserAuthorizedClientType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: UserAuthorizedClientAttributes, + id: str, + relationships: UserAuthorizedClientRelationships, + type: UserAuthorizedClientType, + **kwargs, + ): + """ + Data object representing a user authorized client. + + :param attributes: Attributes of a user authorized client. + :type attributes: UserAuthorizedClientAttributes + + :param id: The unique identifier of the user authorized client. + :type id: str + + :param relationships: Relationships for a user authorized client. + :type relationships: UserAuthorizedClientRelationships + + :param type: The resource type for user authorized clients. + :type type: UserAuthorizedClientType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client.py new file mode 100644 index 0000000000..cf893224f5 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data import ( + UserAuthorizedClientRelationshipOAuth2ClientData, + ) + + +class UserAuthorizedClientRelationshipOAuth2Client(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data import ( + UserAuthorizedClientRelationshipOAuth2ClientData, + ) + + return { + "data": (UserAuthorizedClientRelationshipOAuth2ClientData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UserAuthorizedClientRelationshipOAuth2ClientData, **kwargs): + """ + Relationship to the OAuth2 client that was authorized. + + :param data: Data identifying the OAuth2 client that was authorized. + :type data: UserAuthorizedClientRelationshipOAuth2ClientData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data.py new file mode 100644 index 0000000000..d4f5afe8b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data_type import ( + UserAuthorizedClientRelationshipOAuth2ClientDataType, + ) + + +class UserAuthorizedClientRelationshipOAuth2ClientData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data_type import ( + UserAuthorizedClientRelationshipOAuth2ClientDataType, + ) + + return { + "id": (str,), + "type": (UserAuthorizedClientRelationshipOAuth2ClientDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserAuthorizedClientRelationshipOAuth2ClientDataType, **kwargs): + """ + Data identifying the OAuth2 client that was authorized. + + :param id: The ID of the OAuth2 client. + :type id: str + + :param type: OAuth2 client resource type. + :type type: UserAuthorizedClientRelationshipOAuth2ClientDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data_type.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data_type.py new file mode 100644 index 0000000000..71e2ca3c53 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_o_auth2_client_data_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserAuthorizedClientRelationshipOAuth2ClientDataType(ModelSimple): + """ + OAuth2 client resource type. + + :param value: If omitted defaults to "oauth2_clients". Must be one of ["oauth2_clients"]. + :type value: str + """ + + allowed_values = { + "oauth2_clients", + } + OAUTH2_CLIENTS: ClassVar["UserAuthorizedClientRelationshipOAuth2ClientDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserAuthorizedClientRelationshipOAuth2ClientDataType.OAUTH2_CLIENTS = ( + UserAuthorizedClientRelationshipOAuth2ClientDataType("oauth2_clients") +) diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data.py new file mode 100644 index 0000000000..10ce4d340c --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data_type import ( + UserAuthorizedClientRelationshipScopeDataType, + ) + + +class UserAuthorizedClientRelationshipScopeData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data_type import ( + UserAuthorizedClientRelationshipScopeDataType, + ) + + return { + "id": (str,), + "type": (UserAuthorizedClientRelationshipScopeDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserAuthorizedClientRelationshipScopeDataType, **kwargs): + """ + Data identifying a scope granted to the OAuth2 client. + + :param id: The identifier of the scope. + :type id: str + + :param type: Scope resource type. + :type type: UserAuthorizedClientRelationshipScopeDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data_type.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data_type.py new file mode 100644 index 0000000000..e48c523ef1 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scope_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserAuthorizedClientRelationshipScopeDataType(ModelSimple): + """ + Scope resource type. + + :param value: If omitted defaults to "scopes". Must be one of ["scopes"]. + :type value: str + """ + + allowed_values = { + "scopes", + } + SCOPES: ClassVar["UserAuthorizedClientRelationshipScopeDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserAuthorizedClientRelationshipScopeDataType.SCOPES = UserAuthorizedClientRelationshipScopeDataType("scopes") diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_scopes.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scopes.py new file mode 100644 index 0000000000..84980ee3e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_scopes.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data import ( + UserAuthorizedClientRelationshipScopeData, + ) + + +class UserAuthorizedClientRelationshipScopes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data import ( + UserAuthorizedClientRelationshipScopeData, + ) + + return { + "data": ([UserAuthorizedClientRelationshipScopeData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[UserAuthorizedClientRelationshipScopeData], **kwargs): + """ + Relationship to the scopes granted to the OAuth2 client. + + :param data: List of scope relationship data objects. + :type data: [UserAuthorizedClientRelationshipScopeData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_user.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user.py new file mode 100644 index 0000000000..673edc616b --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_user_data import ( + UserAuthorizedClientRelationshipUserData, + ) + + +class UserAuthorizedClientRelationshipUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_user_data import ( + UserAuthorizedClientRelationshipUserData, + ) + + return { + "data": (UserAuthorizedClientRelationshipUserData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UserAuthorizedClientRelationshipUserData, **kwargs): + """ + Relationship to the user who granted this authorization. + + :param data: Data identifying the user who granted this authorization. + :type data: UserAuthorizedClientRelationshipUserData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data.py new file mode 100644 index 0000000000..4b4b204698 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_user_data_type import ( + UserAuthorizedClientRelationshipUserDataType, + ) + + +class UserAuthorizedClientRelationshipUserData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_user_data_type import ( + UserAuthorizedClientRelationshipUserDataType, + ) + + return { + "id": (str,), + "type": (UserAuthorizedClientRelationshipUserDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserAuthorizedClientRelationshipUserDataType, **kwargs): + """ + Data identifying the user who granted this authorization. + + :param id: The ID of the user. + :type id: str + + :param type: User resource type. + :type type: UserAuthorizedClientRelationshipUserDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data_type.py b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data_type.py new file mode 100644 index 0000000000..0a8d61fa53 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationship_user_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserAuthorizedClientRelationshipUserDataType(ModelSimple): + """ + User resource type. + + :param value: If omitted defaults to "users". Must be one of ["users"]. + :type value: str + """ + + allowed_values = { + "users", + } + USERS: ClassVar["UserAuthorizedClientRelationshipUserDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserAuthorizedClientRelationshipUserDataType.USERS = UserAuthorizedClientRelationshipUserDataType("users") diff --git a/src/datadog_api_client/v2/model/user_authorized_client_relationships.py b/src/datadog_api_client/v2/model/user_authorized_client_relationships.py new file mode 100644 index 0000000000..2898275335 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_relationships.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client import ( + UserAuthorizedClientRelationshipOAuth2Client, + ) + from datadog_api_client.v2.model.user_authorized_client_relationship_scopes import ( + UserAuthorizedClientRelationshipScopes, + ) + from datadog_api_client.v2.model.user_authorized_client_relationship_user import ( + UserAuthorizedClientRelationshipUser, + ) + + +class UserAuthorizedClientRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client import ( + UserAuthorizedClientRelationshipOAuth2Client, + ) + from datadog_api_client.v2.model.user_authorized_client_relationship_scopes import ( + UserAuthorizedClientRelationshipScopes, + ) + from datadog_api_client.v2.model.user_authorized_client_relationship_user import ( + UserAuthorizedClientRelationshipUser, + ) + + return { + "oauth2_client": (UserAuthorizedClientRelationshipOAuth2Client,), + "scopes": (UserAuthorizedClientRelationshipScopes,), + "user": (UserAuthorizedClientRelationshipUser,), + } + + attribute_map = { + "oauth2_client": "oauth2_client", + "scopes": "scopes", + "user": "user", + } + + def __init__( + self_, + oauth2_client: UserAuthorizedClientRelationshipOAuth2Client, + scopes: UserAuthorizedClientRelationshipScopes, + user: UserAuthorizedClientRelationshipUser, + **kwargs, + ): + """ + Relationships for a user authorized client. + + :param oauth2_client: Relationship to the OAuth2 client that was authorized. + :type oauth2_client: UserAuthorizedClientRelationshipOAuth2Client + + :param scopes: Relationship to the scopes granted to the OAuth2 client. + :type scopes: UserAuthorizedClientRelationshipScopes + + :param user: Relationship to the user who granted this authorization. + :type user: UserAuthorizedClientRelationshipUser + """ + super().__init__(kwargs) + + self_.oauth2_client = oauth2_client + self_.scopes = scopes + self_.user = user diff --git a/src/datadog_api_client/v2/model/user_authorized_client_response.py b/src/datadog_api_client/v2/model/user_authorized_client_response.py new file mode 100644 index 0000000000..944a016b2b --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData + + +class UserAuthorizedClientResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData + + return { + "data": (UserAuthorizedClientData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UserAuthorizedClientData, **kwargs): + """ + Response containing a single user authorized client. + + :param data: Data object representing a user authorized client. + :type data: UserAuthorizedClientData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_authorized_client_type.py b/src/datadog_api_client/v2/model/user_authorized_client_type.py new file mode 100644 index 0000000000..eea732682b --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_client_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserAuthorizedClientType(ModelSimple): + """ + The resource type for user authorized clients. + + :param value: If omitted defaults to "user_authorized_clients". Must be one of ["user_authorized_clients"]. + :type value: str + """ + + allowed_values = { + "user_authorized_clients", + } + USER_AUTHORIZED_CLIENTS: ClassVar["UserAuthorizedClientType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserAuthorizedClientType.USER_AUTHORIZED_CLIENTS = UserAuthorizedClientType("user_authorized_clients") diff --git a/src/datadog_api_client/v2/model/user_authorized_clients_response.py b/src/datadog_api_client/v2/model/user_authorized_clients_response.py new file mode 100644 index 0000000000..1079ee8206 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_authorized_clients_response.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData + from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes + + +class UserAuthorizedClientsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData + from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes + + return { + "data": ([UserAuthorizedClientData],), + "meta": (ResponseMetaAttributes,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[UserAuthorizedClientData], meta: ResponseMetaAttributes, **kwargs): + """ + Response containing a list of user authorized clients. + + :param data: List of user authorized client data objects. + :type data: [UserAuthorizedClientData] + + :param meta: Object describing meta attributes of response. + :type meta: ResponseMetaAttributes + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/user_override_identity_provider_attributes.py b/src/datadog_api_client/v2/model/user_override_identity_provider_attributes.py new file mode 100644 index 0000000000..5a10b80510 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_override_identity_provider_attributes.py @@ -0,0 +1,33 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UserOverrideIdentityProviderAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "authentication_method": (str,), + } + + attribute_map = { + "authentication_method": "authentication_method", + } + + def __init__(self_, authentication_method: str, **kwargs): + """ + Attributes of an identity provider override for a user. + + :param authentication_method: The authentication method used by this identity provider. + :type authentication_method: str + """ + super().__init__(kwargs) + + self_.authentication_method = authentication_method diff --git a/src/datadog_api_client/v2/model/user_override_identity_provider_data.py b/src/datadog_api_client/v2/model/user_override_identity_provider_data.py new file mode 100644 index 0000000000..700cad6890 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_override_identity_provider_data.py @@ -0,0 +1,68 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_override_identity_provider_attributes import ( + UserOverrideIdentityProviderAttributes, + ) + from datadog_api_client.v2.model.user_override_identity_provider_data_type import ( + UserOverrideIdentityProviderDataType, + ) + + +class UserOverrideIdentityProviderData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_override_identity_provider_attributes import ( + UserOverrideIdentityProviderAttributes, + ) + from datadog_api_client.v2.model.user_override_identity_provider_data_type import ( + UserOverrideIdentityProviderDataType, + ) + + return { + "attributes": (UserOverrideIdentityProviderAttributes,), + "id": (str,), + "type": (UserOverrideIdentityProviderDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: UserOverrideIdentityProviderAttributes, + id: str, + type: UserOverrideIdentityProviderDataType, + **kwargs, + ): + """ + Data object representing a user identity provider override. + + :param attributes: Attributes of an identity provider override for a user. + :type attributes: UserOverrideIdentityProviderAttributes + + :param id: The unique identifier of the identity provider. + :type id: str + + :param type: The resource type for identity providers. + :type type: UserOverrideIdentityProviderDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_override_identity_provider_data_type.py b/src/datadog_api_client/v2/model/user_override_identity_provider_data_type.py new file mode 100644 index 0000000000..998bd50336 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_override_identity_provider_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserOverrideIdentityProviderDataType(ModelSimple): + """ + The resource type for identity providers. + + :param value: If omitted defaults to "identity_providers". Must be one of ["identity_providers"]. + :type value: str + """ + + allowed_values = { + "identity_providers", + } + IDENTITY_PROVIDERS: ClassVar["UserOverrideIdentityProviderDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserOverrideIdentityProviderDataType.IDENTITY_PROVIDERS = UserOverrideIdentityProviderDataType("identity_providers") diff --git a/src/datadog_api_client/v2/model/user_override_identity_providers_response.py b/src/datadog_api_client/v2/model/user_override_identity_providers_response.py new file mode 100644 index 0000000000..8e3c50c032 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_override_identity_providers_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_override_identity_provider_data import UserOverrideIdentityProviderData + + +class UserOverrideIdentityProvidersResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_override_identity_provider_data import UserOverrideIdentityProviderData + + return { + "data": ([UserOverrideIdentityProviderData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[UserOverrideIdentityProviderData], **kwargs): + """ + Response containing a user's identity provider overrides. + + :param data: List of user identity provider override data objects. + :type data: [UserOverrideIdentityProviderData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/user_relationship_identity_provider_data.py b/src/datadog_api_client/v2/model/user_relationship_identity_provider_data.py new file mode 100644 index 0000000000..83490f775c --- /dev/null +++ b/src/datadog_api_client/v2/model/user_relationship_identity_provider_data.py @@ -0,0 +1,50 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_relationship_identity_provider_data_type import ( + UserRelationshipIdentityProviderDataType, + ) + + +class UserRelationshipIdentityProviderData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_relationship_identity_provider_data_type import ( + UserRelationshipIdentityProviderDataType, + ) + + return { + "id": (str,), + "type": (UserRelationshipIdentityProviderDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserRelationshipIdentityProviderDataType, **kwargs): + """ + Resource identifier for an identity provider in a relationship update. + + :param id: The unique identifier of the identity provider. + :type id: str + + :param type: The resource type for identity providers. + :type type: UserRelationshipIdentityProviderDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_relationship_identity_provider_data_type.py b/src/datadog_api_client/v2/model/user_relationship_identity_provider_data_type.py new file mode 100644 index 0000000000..a2852d3246 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_relationship_identity_provider_data_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserRelationshipIdentityProviderDataType(ModelSimple): + """ + The resource type for identity providers. + + :param value: If omitted defaults to "identity_providers". Must be one of ["identity_providers"]. + :type value: str + """ + + allowed_values = { + "identity_providers", + } + IDENTITY_PROVIDERS: ClassVar["UserRelationshipIdentityProviderDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserRelationshipIdentityProviderDataType.IDENTITY_PROVIDERS = UserRelationshipIdentityProviderDataType( + "identity_providers" +) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 4244b5b342..143523dc44 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3134,6 +3134,14 @@ from datadog_api_client.v2.model.ip_allowlist_type import IPAllowlistType from datadog_api_client.v2.model.ip_allowlist_update_request import IPAllowlistUpdateRequest from datadog_api_client.v2.model.idp_metadata_form_data import IdPMetadataFormData +from datadog_api_client.v2.model.identity_provider_attributes import IdentityProviderAttributes +from datadog_api_client.v2.model.identity_provider_data import IdentityProviderData +from datadog_api_client.v2.model.identity_provider_response import IdentityProviderResponse +from datadog_api_client.v2.model.identity_provider_type import IdentityProviderType +from datadog_api_client.v2.model.identity_provider_update_attributes import IdentityProviderUpdateAttributes +from datadog_api_client.v2.model.identity_provider_update_data import IdentityProviderUpdateData +from datadog_api_client.v2.model.identity_provider_update_request import IdentityProviderUpdateRequest +from datadog_api_client.v2.model.identity_providers_response import IdentityProvidersResponse from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType from datadog_api_client.v2.model.incident_create_attributes import IncidentCreateAttributes from datadog_api_client.v2.model.incident_create_data import IncidentCreateData @@ -5647,6 +5655,39 @@ from datadog_api_client.v2.model.opsgenie_services_response import OpsgenieServicesResponse from datadog_api_client.v2.model.order_direction import OrderDirection from datadog_api_client.v2.model.org_attributes import OrgAttributes +from datadog_api_client.v2.model.org_authorized_client_attributes import OrgAuthorizedClientAttributes +from datadog_api_client.v2.model.org_authorized_client_data import OrgAuthorizedClientData +from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client import ( + OrgAuthorizedClientRelationshipOAuth2Client, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data import ( + OrgAuthorizedClientRelationshipOAuth2ClientData, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_o_auth2_client_data_type import ( + OrgAuthorizedClientRelationshipOAuth2ClientDataType, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients import ( + OrgAuthorizedClientRelationshipUserAuthorizedClients, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsData, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_data_type import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType, +) +from datadog_api_client.v2.model.org_authorized_client_relationship_user_authorized_clients_links import ( + OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks, +) +from datadog_api_client.v2.model.org_authorized_client_relationships import OrgAuthorizedClientRelationships +from datadog_api_client.v2.model.org_authorized_client_response import OrgAuthorizedClientResponse +from datadog_api_client.v2.model.org_authorized_client_type import OrgAuthorizedClientType +from datadog_api_client.v2.model.org_authorized_client_update_attributes import OrgAuthorizedClientUpdateAttributes +from datadog_api_client.v2.model.org_authorized_client_update_data import OrgAuthorizedClientUpdateData +from datadog_api_client.v2.model.org_authorized_client_update_request import OrgAuthorizedClientUpdateRequest +from datadog_api_client.v2.model.org_authorized_client_user_authorizations_sort import ( + OrgAuthorizedClientUserAuthorizationsSort, +) +from datadog_api_client.v2.model.org_authorized_clients_response import OrgAuthorizedClientsResponse from datadog_api_client.v2.model.org_config_get_response import OrgConfigGetResponse from datadog_api_client.v2.model.org_config_list_response import OrgConfigListResponse from datadog_api_client.v2.model.org_config_read import OrgConfigRead @@ -8815,6 +8856,7 @@ ) from datadog_api_client.v2.model.update_tenancy_config_data_type import UpdateTenancyConfigDataType from datadog_api_client.v2.model.update_tenancy_config_request import UpdateTenancyConfigRequest +from datadog_api_client.v2.model.update_user_identity_providers_request import UpdateUserIdentityProvidersRequest from datadog_api_client.v2.model.update_workflow_request import UpdateWorkflowRequest from datadog_api_client.v2.model.update_workflow_response import UpdateWorkflowResponse from datadog_api_client.v2.model.upsert_allocation_request import UpsertAllocationRequest @@ -8873,6 +8915,37 @@ from datadog_api_client.v2.model.user import User from datadog_api_client.v2.model.user_attributes import UserAttributes from datadog_api_client.v2.model.user_attributes_status import UserAttributesStatus +from datadog_api_client.v2.model.user_authorized_client_attributes import UserAuthorizedClientAttributes +from datadog_api_client.v2.model.user_authorized_client_data import UserAuthorizedClientData +from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client import ( + UserAuthorizedClientRelationshipOAuth2Client, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data import ( + UserAuthorizedClientRelationshipOAuth2ClientData, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_o_auth2_client_data_type import ( + UserAuthorizedClientRelationshipOAuth2ClientDataType, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data import ( + UserAuthorizedClientRelationshipScopeData, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_scope_data_type import ( + UserAuthorizedClientRelationshipScopeDataType, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_scopes import ( + UserAuthorizedClientRelationshipScopes, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_user import UserAuthorizedClientRelationshipUser +from datadog_api_client.v2.model.user_authorized_client_relationship_user_data import ( + UserAuthorizedClientRelationshipUserData, +) +from datadog_api_client.v2.model.user_authorized_client_relationship_user_data_type import ( + UserAuthorizedClientRelationshipUserDataType, +) +from datadog_api_client.v2.model.user_authorized_client_relationships import UserAuthorizedClientRelationships +from datadog_api_client.v2.model.user_authorized_client_response import UserAuthorizedClientResponse +from datadog_api_client.v2.model.user_authorized_client_type import UserAuthorizedClientType +from datadog_api_client.v2.model.user_authorized_clients_response import UserAuthorizedClientsResponse from datadog_api_client.v2.model.user_create_attributes import UserCreateAttributes from datadog_api_client.v2.model.user_create_data import UserCreateData from datadog_api_client.v2.model.user_create_request import UserCreateRequest @@ -8884,7 +8957,17 @@ from datadog_api_client.v2.model.user_invitations_request import UserInvitationsRequest from datadog_api_client.v2.model.user_invitations_response import UserInvitationsResponse from datadog_api_client.v2.model.user_invitations_type import UserInvitationsType +from datadog_api_client.v2.model.user_override_identity_provider_attributes import ( + UserOverrideIdentityProviderAttributes, +) +from datadog_api_client.v2.model.user_override_identity_provider_data import UserOverrideIdentityProviderData +from datadog_api_client.v2.model.user_override_identity_provider_data_type import UserOverrideIdentityProviderDataType +from datadog_api_client.v2.model.user_override_identity_providers_response import UserOverrideIdentityProvidersResponse from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData +from datadog_api_client.v2.model.user_relationship_identity_provider_data import UserRelationshipIdentityProviderData +from datadog_api_client.v2.model.user_relationship_identity_provider_data_type import ( + UserRelationshipIdentityProviderDataType, +) from datadog_api_client.v2.model.user_relationships import UserRelationships from datadog_api_client.v2.model.user_resource_type import UserResourceType from datadog_api_client.v2.model.user_response import UserResponse @@ -11502,6 +11585,14 @@ "IPAllowlistType", "IPAllowlistUpdateRequest", "IdPMetadataFormData", + "IdentityProviderAttributes", + "IdentityProviderData", + "IdentityProviderResponse", + "IdentityProviderType", + "IdentityProviderUpdateAttributes", + "IdentityProviderUpdateData", + "IdentityProviderUpdateRequest", + "IdentityProvidersResponse", "IncidentAttachmentType", "IncidentCreateAttributes", "IncidentCreateData", @@ -13085,6 +13176,23 @@ "OpsgenieServicesResponse", "OrderDirection", "OrgAttributes", + "OrgAuthorizedClientAttributes", + "OrgAuthorizedClientData", + "OrgAuthorizedClientRelationshipOAuth2Client", + "OrgAuthorizedClientRelationshipOAuth2ClientData", + "OrgAuthorizedClientRelationshipOAuth2ClientDataType", + "OrgAuthorizedClientRelationshipUserAuthorizedClients", + "OrgAuthorizedClientRelationshipUserAuthorizedClientsData", + "OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType", + "OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks", + "OrgAuthorizedClientRelationships", + "OrgAuthorizedClientResponse", + "OrgAuthorizedClientType", + "OrgAuthorizedClientUpdateAttributes", + "OrgAuthorizedClientUpdateData", + "OrgAuthorizedClientUpdateRequest", + "OrgAuthorizedClientUserAuthorizationsSort", + "OrgAuthorizedClientsResponse", "OrgConfigGetResponse", "OrgConfigListResponse", "OrgConfigRead", @@ -15337,6 +15445,7 @@ "UpdateTenancyConfigDataAttributesRegionsConfig", "UpdateTenancyConfigDataType", "UpdateTenancyConfigRequest", + "UpdateUserIdentityProvidersRequest", "UpdateWorkflowRequest", "UpdateWorkflowResponse", "UpsertAllocationRequest", @@ -15381,6 +15490,21 @@ "User", "UserAttributes", "UserAttributesStatus", + "UserAuthorizedClientAttributes", + "UserAuthorizedClientData", + "UserAuthorizedClientRelationshipOAuth2Client", + "UserAuthorizedClientRelationshipOAuth2ClientData", + "UserAuthorizedClientRelationshipOAuth2ClientDataType", + "UserAuthorizedClientRelationshipScopeData", + "UserAuthorizedClientRelationshipScopeDataType", + "UserAuthorizedClientRelationshipScopes", + "UserAuthorizedClientRelationshipUser", + "UserAuthorizedClientRelationshipUserData", + "UserAuthorizedClientRelationshipUserDataType", + "UserAuthorizedClientRelationships", + "UserAuthorizedClientResponse", + "UserAuthorizedClientType", + "UserAuthorizedClientsResponse", "UserCreateAttributes", "UserCreateData", "UserCreateRequest", @@ -15392,7 +15516,13 @@ "UserInvitationsRequest", "UserInvitationsResponse", "UserInvitationsType", + "UserOverrideIdentityProviderAttributes", + "UserOverrideIdentityProviderData", + "UserOverrideIdentityProviderDataType", + "UserOverrideIdentityProvidersResponse", "UserRelationshipData", + "UserRelationshipIdentityProviderData", + "UserRelationshipIdentityProviderDataType", "UserRelationships", "UserResourceType", "UserResponse", diff --git a/tests/v2/features/identity_providers.feature b/tests/v2/features/identity_providers.feature new file mode 100644 index 0000000000..6fcc67f91f --- /dev/null +++ b/tests/v2/features/identity_providers.feature @@ -0,0 +1,66 @@ +@endpoint(identity-providers) @endpoint(identity-providers-v2) +Feature: Identity Providers + Manage identity providers and user authentication method overrides. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "IdentityProviders" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List identity providers returns "OK" response + Given new "ListIdentityProviders" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List users with an identity provider override returns "Bad Request" response + Given new "ListIdentityProviderUsers" request + And request contains "idp_id" 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 users with an identity provider override returns "Not found" response + Given new "ListIdentityProviderUsers" request + And request contains "idp_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List users with an identity provider override returns "OK" response + Given new "ListIdentityProviderUsers" request + And request contains "idp_id" 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 users with an identity provider override returns "OK" response with pagination + Given new "ListIdentityProviderUsers" request + And request contains "idp_id" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an identity provider returns "Bad Request" response + Given new "UpdateIdentityProvider" request + And request contains "idp_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an identity provider returns "Not found" response + Given new "UpdateIdentityProvider" request + And request contains "idp_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}} + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an identity provider returns "OK" response + Given new "UpdateIdentityProvider" request + And request contains "idp_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/org_authorized_clients.feature b/tests/v2/features/org_authorized_clients.feature new file mode 100644 index 0000000000..a196173a29 --- /dev/null +++ b/tests/v2/features/org_authorized_clients.feature @@ -0,0 +1,133 @@ +@endpoint(org-authorized-clients) @endpoint(org-authorized-clients-v2) +Feature: Org Authorized Clients + Manage OAuth2 client authorizations at the organization level. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OrgAuthorizedClients" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user authorization for a client returns "No Content" response + Given new "DeleteOrgAuthorizedClientUserAuthorization" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user authorization for a client returns "Not Found" response + Given new "DeleteOrgAuthorizedClientUserAuthorization" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user's authorizations for a client returns "No Content" response + Given new "DeleteOrgAuthorizedClientAllUserAuthorizations" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user's authorizations for a client returns "Not Found" response + Given new "DeleteOrgAuthorizedClientAllUserAuthorizations" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + 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/delegated-auth-login + Scenario: Delete an org authorized client returns "No Content" response + Given new "DeleteOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an org authorized client returns "Not Found" response + Given new "DeleteOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an org authorized client returns "Not Found" response + Given new "GetOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an org authorized client returns "OK" response + Given new "GetOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List org authorized clients returns "OK" response + Given new "ListOrgAuthorizedClients" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login @with-pagination + Scenario: List org authorized clients returns "OK" response with pagination + Given new "ListOrgAuthorizedClients" request + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List user authorizations for a client returns "Not Found" response + Given new "ListOrgAuthorizedClientUserAuthorizations" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List user authorizations for a client returns "OK" response + Given new "ListOrgAuthorizedClientUserAuthorizations" request + And request contains "org_authorized_client_id" 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 user authorizations for a client returns "OK" response with pagination + Given new "ListOrgAuthorizedClientUserAuthorizations" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an org authorized client returns "Bad Request" response + Given new "UpdateOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"disabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "org_authorized_clients"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an org authorized client returns "Not Found" response + Given new "UpdateOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"disabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "org_authorized_clients"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an org authorized client returns "OK" response + Given new "UpdateOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"disabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "org_authorized_clients"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update an org authorized client returns "Unprocessable Entity" response + Given new "UpdateOrgAuthorizedClient" request + And request contains "org_authorized_client_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"disabled": true}, "id": "00000000-0000-0000-0000-000000000001", "type": "org_authorized_clients"}} + When the request is sent + Then the response status is 422 Unprocessable Entity diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 25fb6bb2dc..7915ff34b9 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2764,6 +2764,25 @@ "type": "unsafe" } }, + "ListIdentityProviders": { + "tag": "Identity Providers", + "undo": { + "type": "safe" + } + }, + "UpdateIdentityProvider": { + "tag": "Identity Providers", + "undo": { + "operationId": "ListIdentityProviders", + "type": "idempotent" + } + }, + "ListIdentityProviderUsers": { + "tag": "Identity Providers", + "undo": { + "type": "safe" + } + }, "DeleteEntityIntegrationConfig": { "tag": "Entity Integration Configs", "undo": { @@ -5464,6 +5483,52 @@ "type": "idempotent" } }, + "ListOrgAuthorizedClients": { + "tag": "Org Authorized Clients", + "undo": { + "type": "safe" + } + }, + "DeleteOrgAuthorizedClient": { + "tag": "Org Authorized Clients", + "undo": { + "operationId": "ListOrgAuthorizedClients", + "type": "idempotent" + } + }, + "GetOrgAuthorizedClient": { + "tag": "Org Authorized Clients", + "undo": { + "type": "safe" + } + }, + "UpdateOrgAuthorizedClient": { + "tag": "Org Authorized Clients", + "undo": { + "operationId": "ListOrgAuthorizedClients", + "type": "idempotent" + } + }, + "DeleteOrgAuthorizedClientAllUserAuthorizations": { + "tag": "Org Authorized Clients", + "undo": { + "operationId": "ListOrgAuthorizedClientUserAuthorizations", + "type": "idempotent" + } + }, + "ListOrgAuthorizedClientUserAuthorizations": { + "tag": "Org Authorized Clients", + "undo": { + "type": "safe" + } + }, + "DeleteOrgAuthorizedClientUserAuthorization": { + "tag": "Org Authorized Clients", + "undo": { + "operationId": "ListOrgAuthorizedClientUserAuthorizations", + "type": "idempotent" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { @@ -8909,6 +8974,32 @@ "type": "safe" } }, + "ListUserAuthorizedClients": { + "tag": "User Authorized Clients", + "undo": { + "type": "safe" + } + }, + "DeleteUserAuthorizedClientsByClient": { + "tag": "User Authorized Clients", + "undo": { + "operationId": "ListUserAuthorizedClients", + "type": "idempotent" + } + }, + "DeleteUserAuthorizedClient": { + "tag": "User Authorized Clients", + "undo": { + "operationId": "ListUserAuthorizedClients", + "type": "idempotent" + } + }, + "GetUserAuthorizedClient": { + "tag": "User Authorized Clients", + "undo": { + "type": "safe" + } + }, "SendInvitations": { "tag": "Users", "undo": { @@ -8958,6 +9049,12 @@ "type": "idempotent" } }, + "GetUserIdentityProviders": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, "DeleteUserInvitations": { "tag": "Users", "undo": { @@ -8976,6 +9073,13 @@ "type": "safe" } }, + "UpdateUserIdentityProviders": { + "tag": "Users", + "undo": { + "operationId": "GetUserIdentityProviders", + "type": "idempotent" + } + }, "GetUserMemberships": { "tag": "Teams", "undo": { diff --git a/tests/v2/features/user_authorized_clients.feature b/tests/v2/features/user_authorized_clients.feature new file mode 100644 index 0000000000..591a889cd0 --- /dev/null +++ b/tests/v2/features/user_authorized_clients.feature @@ -0,0 +1,62 @@ +@endpoint(user-authorized-clients) @endpoint(user-authorized-clients-v2) +Feature: User Authorized Clients + Manage OAuth2 client authorizations at the user level. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "UserAuthorizedClients" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user authorized client returns "No Content" response + Given new "DeleteUserAuthorizedClient" request + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete a user authorized client returns "Not Found" response + Given new "DeleteUserAuthorizedClient" request + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete all user authorized clients for a client returns "No Content" response + Given new "DeleteUserAuthorizedClientsByClient" request + And request contains "client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete all user authorized clients for a client returns "Not Found" response + Given new "DeleteUserAuthorizedClientsByClient" request + And request contains "client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get a user authorized client returns "Not Found" response + Given new "GetUserAuthorizedClient" request + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get a user authorized client returns "OK" response + Given new "GetUserAuthorizedClient" request + And request contains "user_authorized_client_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List user authorized clients returns "OK" response + Given new "ListUserAuthorizedClients" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login @with-pagination + Scenario: List user authorized clients returns "OK" response with pagination + Given new "ListUserAuthorizedClients" request + When the request with pagination is sent + Then the response status is 200 OK diff --git a/tests/v2/features/users.feature b/tests/v2/features/users.feature index 9d9fa48963..b3d2a2a9ea 100644 --- a/tests/v2/features/users.feature +++ b/tests/v2/features/users.feature @@ -124,6 +124,20 @@ Feature: Users When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/org-management + Scenario: Get identity provider overrides for a user returns "Not found" response + Given new "GetUserIdentityProviders" 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: Get identity provider overrides for a user returns "OK" response + Given new "GetUserIdentityProviders" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Get user details returns "Not found" response Given new "GetUser" request @@ -256,3 +270,27 @@ Feature: Users And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} When the request is sent Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/org-management + Scenario: Update identity provider overrides for a user returns "Bad Request" response + Given new "UpdateUserIdentityProviders" request + And request contains "user_id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/org-management + Scenario: Update identity provider overrides for a user returns "No Content" response + Given new "UpdateUserIdentityProviders" request + And request contains "user_id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}]} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/org-management + Scenario: Update identity provider overrides for a user returns "Not found" response + Given new "UpdateUserIdentityProviders" request + And request contains "user_id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000001", "type": "identity_providers"}]} + When the request is sent + Then the response status is 404 Not found