diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 10f16a21b7d4..3661bf3fc2f3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -699,6 +699,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 @@ -1140,6 +1148,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 @@ -1171,6 +1187,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 @@ -1893,6 +1917,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 @@ -1901,6 +1941,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" @@ -10745,6 +10793,51 @@ components: - findings - project type: object + AttachLinearIssueRequest: + description: Request for attaching security findings to a Linear issue. + properties: + data: + $ref: "#/components/schemas/AttachLinearIssueRequestData" + required: + - data + type: object + AttachLinearIssueRequestData: + description: Data of the Linear issue to attach security findings to. + properties: + attributes: + $ref: "#/components/schemas/AttachLinearIssueRequestDataAttributes" + relationships: + $ref: "#/components/schemas/AttachLinearIssueRequestDataRelationships" + type: + $ref: "#/components/schemas/LinearIssuesDataType" + required: + - attributes + - relationships + - type + type: object + AttachLinearIssueRequestDataAttributes: + description: Attributes of the Linear issue to attach security findings to. + properties: + linear_issue_url: + description: URL of the Linear issue to attach security findings to. + example: "https://linear.app/your-workspace/issue/ENG-123" + type: string + required: + - linear_issue_url + type: object + AttachLinearIssueRequestDataRelationships: + description: Relationships of the Linear issue to attach security findings to. + properties: + findings: + $ref: "#/components/schemas/Findings" + description: Security findings to attach to the Linear issue. + project: + $ref: "#/components/schemas/CaseManagementProject" + description: Case management project with the Linear integration configured. It is used to attach security findings to the Linear issue. + required: + - findings + - project + type: object AttachServiceNowTicketRequest: description: Request for attaching security findings to a ServiceNow ticket. properties: @@ -23958,6 +24051,74 @@ components: - findings - project type: object + CreateLinearIssueRequestArray: + description: List of requests to create Linear issues for security findings. + properties: + data: + description: Array of Linear issue creation request data objects. + items: + $ref: "#/components/schemas/CreateLinearIssueRequestData" + type: array + required: + - data + type: object + CreateLinearIssueRequestData: + description: Data of the Linear issue to create. + properties: + attributes: + $ref: "#/components/schemas/CreateLinearIssueRequestDataAttributes" + relationships: + $ref: "#/components/schemas/CreateLinearIssueRequestDataRelationships" + type: + $ref: "#/components/schemas/LinearIssuesDataType" + required: + - type + type: object + CreateLinearIssueRequestDataAttributes: + description: Attributes of the Linear issue to create. + properties: + assignee_id: + description: Unique identifier of the Datadog user assigned to the Linear issue. + example: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + type: string + description: + description: Description of the Linear issue. If not provided, the description will be automatically generated. + example: "A description of the Linear issue." + type: string + label_ids: + description: Linear label IDs to set on the created issue. + example: + - "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + items: + description: A Linear label ID. + type: string + type: array + linear_project_id: + description: Unique identifier of the Linear project to pin the issue to. If not provided, the issue is not associated with a Linear project. + example: "d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d" + type: string + priority: + $ref: "#/components/schemas/CasePriority" + description: Datadog case priority mapped to the Linear issue priority. If not provided, the priority will be automatically set to "NOT_DEFINED". + example: "P4" + title: + description: Title of the Linear issue. If not provided, the title will be automatically generated. + example: "A title for the Linear issue." + type: string + type: object + CreateLinearIssueRequestDataRelationships: + description: Relationships of the Linear issue to create. + properties: + findings: + $ref: "#/components/schemas/Findings" + description: Security findings to create a Linear issue for. + project: + $ref: "#/components/schemas/CaseManagementProject" + description: Case management project configured with the Linear integration. It is used to create the Linear issue. + required: + - findings + - project + type: object CreateMaintenanceRequest: description: Request object for creating a maintenance. example: @@ -28702,12 +28863,12 @@ components: - "department:engineering" - "region:us-east-1" env: "production" - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_id: "github.com/organization/example-repository" service: "shopist" - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: "backend" version: "v1.12.07" id: "4242fcdd31586083" @@ -28731,10 +28892,10 @@ components: example: production type: string finished_at: - description: Unix timestamp when the deployment finished. - example: 1693491984000000000 - format: int64 - type: integer + description: The time when the deployment finished. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string git: $ref: "#/components/schemas/DORAGitInfoResponse" service: @@ -28742,10 +28903,10 @@ components: example: shopist type: string started_at: - description: Unix timestamp when the deployment started. - example: 1693491974000000000 - format: int64 - type: integer + description: The time when the deployment started. + example: "2023-08-31T14:26:14Z" + format: date-time + type: string team: description: Name of the team owning the deployed service. example: backend @@ -28757,7 +28918,6 @@ components: required: - service - started_at - - finished_at type: object DORADeploymentPatchRemediation: description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. @@ -28935,12 +29095,12 @@ components: - "department:engineering" - "region:us-east-1" env: "production" - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_id: "github.com/organization/example-repository" service: "shopist" - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: "backend" version: "v1.12.07" id: "4242fcdd31586083" @@ -28950,12 +29110,12 @@ components: - "language:go" - "department:platform" env: "production" - finished_at: 1693492084000000000 + finished_at: "2023-08-31T14:28:04Z" git: commit_sha: "77bdc9350f2cc9b250b69abddab733dd55e1a599" repository_id: "github.com/organization/api-service" service: "api-service" - started_at: 1693492074000000000 + started_at: "2023-08-31T14:27:54Z" team: "backend" version: "v2.1.0" id: "4242fcdd31586084" @@ -29077,12 +29237,12 @@ components: - "incident_type:database" - "department:engineering" env: "production" - finished_at: 1693492274000000000 + finished_at: "2023-08-31T14:31:14Z" name: "Database outage" services: - "shopist" severity: "SEV-1" - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: "backend" id: "4242fcdd31586085" type: "dora_incident" @@ -29091,13 +29251,13 @@ components: - "incident_type:service_down" - "department:platform" env: "production" - finished_at: 1693492474000000000 + finished_at: "2023-08-31T14:34:34Z" name: "API service outage" services: - "api-service" - "payment-service" severity: "SEV-2" - started_at: 1693492374000000000 + started_at: "2023-08-31T14:32:54Z" team: "backend" id: "4242fcdd31586086" type: "dora_incident" @@ -29138,7 +29298,7 @@ components: - "incident_type:database" - "department:engineering" env: "production" - finished_at: 1693492274000000000 + finished_at: "2023-08-31T14:31:14Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_url: "https://github.com/organization/example-repository" @@ -29146,7 +29306,7 @@ components: services: - "shopist" severity: "SEV-1" - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: "backend" id: "4242fcdd31586085" type: "dora_incident" @@ -29169,10 +29329,10 @@ components: example: production type: string finished_at: - description: Unix timestamp when the incident finished. - example: 1693491984000000000 - format: int64 - type: integer + description: The time when the incident finished. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string git: $ref: "#/components/schemas/DORAGitInfo" name: @@ -29191,10 +29351,10 @@ components: example: SEV-1 type: string started_at: - description: Unix timestamp when the incident started. - example: 1693491974000000000 - format: int64 - type: integer + description: The time when the incident started. + example: "2023-08-31T14:26:14Z" + format: date-time + type: string team: description: Name of the team owning the services impacted. example: backend @@ -29203,8 +29363,6 @@ components: description: Version to correlate with APM Deployment Tracking. example: v1.12.07 type: string - required: - - started_at type: object DORAListDeploymentsRequest: description: Request to get a list of deployments. @@ -36878,6 +37036,9 @@ components: description: Key of the case. example: "PROJ-123" type: string + linear_issue: + $ref: "#/components/schemas/FindingLinearIssue" + description: Linear issue associated with the case. modified_at: description: Timestamp of when the case was last modified. example: "2025-01-01T00:00:00.000Z" @@ -37010,6 +37171,44 @@ components: example: "https://domain.atlassian.net/browse/PROJ-123" type: string type: object + FindingLinearIssue: + description: Linear issue associated with the case. + properties: + error_message: + description: Error message if the Linear issue creation failed. + example: "Linear issue creation failed." + type: string + result: + $ref: "#/components/schemas/FindingLinearIssueResult" + status: + description: Status of the Linear issue creation. Can be "COMPLETED" if the Linear issue was created successfully, or "FAILED" if the Linear issue creation failed. + example: "COMPLETED" + type: string + type: object + FindingLinearIssueResult: + description: Result of the Linear issue creation. + properties: + account_id: + description: Account ID of the Linear workspace. + example: "463a8631-680e-455c-bfd3-3ed04d326eb7" + type: string + issue_id: + description: Unique identifier of the Linear issue. + example: "9c1e5f8a-2b3d-4c7e-8f6a-1d2e3f4a5b6c" + type: string + issue_key: + description: Key of the Linear issue. + example: "ENG-123" + type: string + team_id: + description: Team ID of the Linear issue. + example: "b5d3c8a1-7e6f-4d2c-9a8b-3c4d5e6f7a8b" + type: string + url: + description: URL of the Linear issue. + example: "https://linear.app/your-workspace/issue/ENG-123" + type: string + type: object FindingMute: additionalProperties: false description: Information about the mute status of this finding. @@ -44160,6 +44359,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. @@ -56335,6 +56628,15 @@ components: type: string x-enum-varnames: - LICENSEREQUEST + LinearIssuesDataType: + default: linear_issues + description: Linear issues resource type. + enum: + - linear_issues + example: linear_issues + type: string + x-enum-varnames: + - LINEAR_ISSUES Links: description: The JSON:API links related to pagination. properties: @@ -71160,6 +71462,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: @@ -107690,6 +108196,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 UpdateVariantRequest: description: Request to update an existing variant's name and value. properties: @@ -108340,6 +108854,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: @@ -108463,6 +109168,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: @@ -108476,6 +109228,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: @@ -132426,9 +133204,9 @@ paths: data: - attributes: env: production - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" service: test-service - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: backend id: abc-123 type: dora_deployment @@ -132477,9 +133255,9 @@ paths: data: attributes: env: production - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" service: test-service - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: backend id: abc-123 type: dora_deployment @@ -132700,7 +133478,7 @@ paths: services: - test-service severity: SEV-1 - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: backend id: abc-123 type: dora_failure @@ -132753,7 +133531,7 @@ paths: services: - test-service severity: SEV-1 - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: backend id: abc-123 type: dora_failure @@ -136763,6 +137541,224 @@ 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/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/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: + "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: + 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: Update an identity provider + tags: + - Identity Providers + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - org_management + /api/v2/identity_providers/{idp_id}/users: + get: + 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/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: + 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/UsersResponse" + 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 + "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. @@ -160162,6 +161158,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). @@ -173712,6 +175180,153 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write + /api/v2/security/findings/linear_issues: + patch: + description: >- + Attach security findings to a Linear issue by providing the Linear issue URL. + + You can attach up to 50 security findings per Linear issue. If the Linear issue is not linked to any case, this operation will create a case for the security findings and link the Linear issue to the newly created case. Security findings that are already attached to another Linear issue will be detached from their previous Linear issue and attached to the specified Linear issue. + operationId: AttachLinearIssue + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + linear_issue_url: https://linear.app/your-workspace/issue/ENG-123 + relationships: + findings: + data: + - id: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: findings + project: + data: + id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: projects + type: linear_issues + schema: + $ref: "#/components/schemas/AttachLinearIssueRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: A description of the Linear issue. + modified_at: "2024-01-01T00:00:00+00:00" + priority: P4 + status: OPEN + title: A title for the Linear issue. + id: 00000000-0000-0000-0000-000000000008 + type: cases + schema: + $ref: "#/components/schemas/FindingCaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a Linear issue + tags: + - "Security Monitoring" + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: >- + Create Linear issues for security findings. + + This operation creates a case in Datadog and a Linear issue linked to that case for bidirectional sync between Datadog and Linear. You can create up to 50 Linear issues per request and associate up to 50 security findings per Linear issue. Security findings that are already attached to another Linear issue will be detached from their previous Linear issue and attached to the newly created Linear issue. + operationId: CreateLinearIssues + requestBody: + content: + application/json: + examples: + default: + value: + data: + - attributes: + assignee_id: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 + description: A description of the Linear issue. + label_ids: + - a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d + linear_project_id: d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d + priority: NOT_DEFINED + title: A title for the Linear issue. + relationships: + findings: + data: + - id: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: findings + project: + data: + id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: projects + type: linear_issues + schema: + $ref: "#/components/schemas/CreateLinearIssueRequestArray" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: A description of the Linear issue. + modified_at: "2024-01-01T00:00:00+00:00" + priority: P4 + status: OPEN + title: A title for the Linear issue. + id: 00000000-0000-0000-0000-000000000007 + type: cases + schema: + $ref: "#/components/schemas/FindingCaseResponseArray" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create Linear issues for security findings + tags: + - "Security Monitoring" + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + 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/security/findings/mute: patch: description: >- @@ -194814,6 +196429,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. @@ -195262,6 +197078,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: |- @@ -195411,6 +197276,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 @@ -197190,6 +199112,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: 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. name: Incidents - description: |- @@ -197336,6 +199260,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 @@ -197542,6 +199468,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/.generator/src/generator/openapi.py b/.generator/src/generator/openapi.py index e385f0870b3d..25c7e964231c 100644 --- a/.generator/src/generator/openapi.py +++ b/.generator/src/generator/openapi.py @@ -123,7 +123,7 @@ def child_models(schema, alternative_name=None, seen=None): ) if (schema.get("type") == "object" or "properties" in schema or has_sub_models) and not ( - "additionalProperties" in schema and "properties" not in schema + schema.get("additionalProperties") not in (None, False) and "properties" not in schema ): if not has_sub_models and name is None: # this is a basic map object so we don't need a type diff --git a/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen new file mode 100644 index 000000000000..4f30c83806e6 --- /dev/null +++ b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen @@ -0,0 +1 @@ +2023-08-31T14:26:14.000Z \ No newline at end of file diff --git a/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml new file mode 100644 index 000000000000..7c991a45596e --- /dev/null +++ b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Thu, 31 Aug 2023 14:26:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":"2023-08-31T00:00:00Z","to":"2023-09-01T00:00:00Z"},"type":"dora_deployments_list_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/dora/deployments + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"abc-123","type":"dora_deployment","attributes":{"service":"shopist","started_at":"2023-08-31T14:26:14Z","finished_at":"2023-08-31T14:26:24Z","env":"production","team":"backend","version":"v1.12.07"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb b/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb new file mode 100644 index 000000000000..6669697c7627 --- /dev/null +++ b/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb @@ -0,0 +1,15 @@ +# Get a list of deployment events returns deployments with date-time timestamps + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new + +body = DatadogAPIClient::V2::DORAListDeploymentsRequest.new({ + data: DatadogAPIClient::V2::DORAListDeploymentsRequestData.new({ + attributes: DatadogAPIClient::V2::DORAListDeploymentsRequestAttributes.new({ + from: "2023-08-31T00:00:00Z", + to: "2023-09-01T00:00:00Z", + }), + type: DatadogAPIClient::V2::DORAListDeploymentsRequestDataType::DORA_DEPLOYMENTS_LIST_REQUEST, + }), +}) +p api_instance.list_dora_deployments(body) diff --git a/examples/v2/identity-providers/ListIdentityProviderUsers.rb b/examples/v2/identity-providers/ListIdentityProviderUsers.rb new file mode 100644 index 000000000000..f6e955161bd3 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviderUsers.rb @@ -0,0 +1,5 @@ +# List users with an identity provider override returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IdentityProvidersAPI.new +p api_instance.list_identity_provider_users("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.rb b/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.rb new file mode 100644 index 000000000000..5545fda10ab3 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviderUsers_486416181.rb @@ -0,0 +1,5 @@ +# List users with an identity provider override returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IdentityProvidersAPI.new +api_instance.list_identity_provider_users_with_pagination("00000000-0000-0000-0000-000000000001") { |item| puts item } diff --git a/examples/v2/identity-providers/ListIdentityProviders.rb b/examples/v2/identity-providers/ListIdentityProviders.rb new file mode 100644 index 000000000000..00546a0f23f4 --- /dev/null +++ b/examples/v2/identity-providers/ListIdentityProviders.rb @@ -0,0 +1,5 @@ +# List identity providers returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IdentityProvidersAPI.new +p api_instance.list_identity_providers() diff --git a/examples/v2/identity-providers/UpdateIdentityProvider.rb b/examples/v2/identity-providers/UpdateIdentityProvider.rb new file mode 100644 index 000000000000..38cdd67e2a57 --- /dev/null +++ b/examples/v2/identity-providers/UpdateIdentityProvider.rb @@ -0,0 +1,15 @@ +# Update an identity provider returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IdentityProvidersAPI.new + +body = DatadogAPIClient::V2::IdentityProviderUpdateRequest.new({ + data: DatadogAPIClient::V2::IdentityProviderUpdateData.new({ + attributes: DatadogAPIClient::V2::IdentityProviderUpdateAttributes.new({ + enabled: true, + }), + id: "00000000-0000-0000-0000-000000000001", + type: DatadogAPIClient::V2::IdentityProviderType::IDENTITY_PROVIDERS, + }), +}) +p api_instance.update_identity_provider("00000000-0000-0000-0000-000000000001", body) diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.rb b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.rb new file mode 100644 index 000000000000..39249cdd76da --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClient.rb @@ -0,0 +1,5 @@ +# Delete an org authorized client returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +api_instance.delete_org_authorized_client("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.rb b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.rb new file mode 100644 index 000000000000..fe072e08475e --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientAllUserAuthorizations.rb @@ -0,0 +1,5 @@ +# Delete a user's authorizations for a client returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +api_instance.delete_org_authorized_client_all_user_authorizations("00000000-0000-0000-0000-000000000001", "00000000-0000-9999-0000-000000000001") diff --git a/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.rb b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.rb new file mode 100644 index 000000000000..9e1ed3c4a219 --- /dev/null +++ b/examples/v2/org-authorized-clients/DeleteOrgAuthorizedClientUserAuthorization.rb @@ -0,0 +1,5 @@ +# Delete a user authorization for a client returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +api_instance.delete_org_authorized_client_user_authorization("00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002") diff --git a/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.rb b/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.rb new file mode 100644 index 000000000000..3f984249ee69 --- /dev/null +++ b/examples/v2/org-authorized-clients/GetOrgAuthorizedClient.rb @@ -0,0 +1,5 @@ +# Get an org authorized client returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +p api_instance.get_org_authorized_client("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.rb b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.rb new file mode 100644 index 000000000000..fe1f56009c32 --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations.rb @@ -0,0 +1,5 @@ +# List user authorizations for a client returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +p api_instance.list_org_authorized_client_user_authorizations("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.rb b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.rb new file mode 100644 index 000000000000..ecea4ba10e1a --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClientUserAuthorizations_742202381.rb @@ -0,0 +1,5 @@ +# List user authorizations for a client returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +api_instance.list_org_authorized_client_user_authorizations_with_pagination("00000000-0000-0000-0000-000000000001") { |item| puts item } diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.rb b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.rb new file mode 100644 index 000000000000..8a22b5241453 --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients.rb @@ -0,0 +1,5 @@ +# List org authorized clients returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +p api_instance.list_org_authorized_clients() diff --git a/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.rb b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.rb new file mode 100644 index 000000000000..a5a8c41acccc --- /dev/null +++ b/examples/v2/org-authorized-clients/ListOrgAuthorizedClients_547493980.rb @@ -0,0 +1,5 @@ +# List org authorized clients returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new +api_instance.list_org_authorized_clients_with_pagination() { |item| puts item } diff --git a/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.rb b/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.rb new file mode 100644 index 000000000000..3a3841698bd3 --- /dev/null +++ b/examples/v2/org-authorized-clients/UpdateOrgAuthorizedClient.rb @@ -0,0 +1,15 @@ +# Update an org authorized client returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgAuthorizedClientsAPI.new + +body = DatadogAPIClient::V2::OrgAuthorizedClientUpdateRequest.new({ + data: DatadogAPIClient::V2::OrgAuthorizedClientUpdateData.new({ + attributes: DatadogAPIClient::V2::OrgAuthorizedClientUpdateAttributes.new({ + disabled: true, + }), + id: "00000000-0000-0000-0000-000000000001", + type: DatadogAPIClient::V2::OrgAuthorizedClientType::ORG_AUTHORIZED_CLIENTS, + }), +}) +p api_instance.update_org_authorized_client("00000000-0000-0000-0000-000000000001", body) diff --git a/examples/v2/security-monitoring/AttachLinearIssue.rb b/examples/v2/security-monitoring/AttachLinearIssue.rb new file mode 100644 index 000000000000..949a6ca643f8 --- /dev/null +++ b/examples/v2/security-monitoring/AttachLinearIssue.rb @@ -0,0 +1,33 @@ +# Attach security findings to a Linear issue returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.attach_linear_issue".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachLinearIssueRequest.new({ + data: DatadogAPIClient::V2::AttachLinearIssueRequestData.new({ + attributes: DatadogAPIClient::V2::AttachLinearIssueRequestDataAttributes.new({ + linear_issue_url: "https://linear.app/your-workspace/issue/ENG-123", + }), + relationships: DatadogAPIClient::V2::AttachLinearIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::LinearIssuesDataType::LINEAR_ISSUES, + }), +}) +p api_instance.attach_linear_issue(body) diff --git a/examples/v2/security-monitoring/CreateLinearIssues.rb b/examples/v2/security-monitoring/CreateLinearIssues.rb new file mode 100644 index 000000000000..40a8c59def4d --- /dev/null +++ b/examples/v2/security-monitoring/CreateLinearIssues.rb @@ -0,0 +1,42 @@ +# Create Linear issues for security findings returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_linear_issues".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateLinearIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateLinearIssueRequestData.new({ + attributes: DatadogAPIClient::V2::CreateLinearIssueRequestDataAttributes.new({ + assignee_id: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", + description: "A description of the Linear issue.", + label_ids: [ + "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d", + ], + linear_project_id: "d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d", + priority: DatadogAPIClient::V2::CasePriority::NOT_DEFINED, + title: "A title for the Linear issue.", + }), + relationships: DatadogAPIClient::V2::CreateLinearIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::LinearIssuesDataType::LINEAR_ISSUES, + }), + ], +}) +p api_instance.create_linear_issues(body) diff --git a/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.rb b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.rb new file mode 100644 index 000000000000..8a7947befdce --- /dev/null +++ b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClient.rb @@ -0,0 +1,5 @@ +# Delete a user authorized client returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UserAuthorizedClientsAPI.new +api_instance.delete_user_authorized_client("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.rb b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.rb new file mode 100644 index 000000000000..321ff63b61a1 --- /dev/null +++ b/examples/v2/user-authorized-clients/DeleteUserAuthorizedClientsByClient.rb @@ -0,0 +1,5 @@ +# Delete all user authorized clients for a client returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UserAuthorizedClientsAPI.new +api_instance.delete_user_authorized_clients_by_client("00000000-0000-0000-0000-000000000010") diff --git a/examples/v2/user-authorized-clients/GetUserAuthorizedClient.rb b/examples/v2/user-authorized-clients/GetUserAuthorizedClient.rb new file mode 100644 index 000000000000..2ed9bea5334f --- /dev/null +++ b/examples/v2/user-authorized-clients/GetUserAuthorizedClient.rb @@ -0,0 +1,5 @@ +# Get a user authorized client returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UserAuthorizedClientsAPI.new +p api_instance.get_user_authorized_client("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/user-authorized-clients/ListUserAuthorizedClients.rb b/examples/v2/user-authorized-clients/ListUserAuthorizedClients.rb new file mode 100644 index 000000000000..c5876cc39ae6 --- /dev/null +++ b/examples/v2/user-authorized-clients/ListUserAuthorizedClients.rb @@ -0,0 +1,5 @@ +# List user authorized clients returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UserAuthorizedClientsAPI.new +p api_instance.list_user_authorized_clients() diff --git a/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.rb b/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.rb new file mode 100644 index 000000000000..5c73a64f032d --- /dev/null +++ b/examples/v2/user-authorized-clients/ListUserAuthorizedClients_1051662547.rb @@ -0,0 +1,5 @@ +# List user authorized clients returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UserAuthorizedClientsAPI.new +api_instance.list_user_authorized_clients_with_pagination() { |item| puts item } diff --git a/examples/v2/users/GetUserIdentityProviders.rb b/examples/v2/users/GetUserIdentityProviders.rb new file mode 100644 index 000000000000..68404b6562f4 --- /dev/null +++ b/examples/v2/users/GetUserIdentityProviders.rb @@ -0,0 +1,5 @@ +# Get identity provider overrides for a user returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UsersAPI.new +p api_instance.get_user_identity_providers("00000000-0000-9999-0000-000000000000") diff --git a/examples/v2/users/UpdateUserIdentityProviders.rb b/examples/v2/users/UpdateUserIdentityProviders.rb new file mode 100644 index 000000000000..74981d815310 --- /dev/null +++ b/examples/v2/users/UpdateUserIdentityProviders.rb @@ -0,0 +1,14 @@ +# Update identity provider overrides for a user returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::UsersAPI.new + +body = DatadogAPIClient::V2::UpdateUserIdentityProvidersRequest.new({ + data: [ + DatadogAPIClient::V2::UserRelationshipIdentityProviderData.new({ + id: "00000000-0000-0000-0000-000000000001", + type: DatadogAPIClient::V2::UserRelationshipIdentityProviderDataType::IDENTITY_PROVIDERS, + }), + ], +}) +api_instance.update_user_identity_providers("00000000-0000-9999-0000-000000000000", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 045336f70c3d..9ca74170ce5e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1328,6 +1328,9 @@ "user_id" => "String", "body" => "UserUpdateRequest", }, + "v2.GetUserIdentityProviders" => { + "user_id" => "String", + }, "v2.DeleteUserInvitations" => { "user_id" => "UUID", }, @@ -1337,6 +1340,10 @@ "v2.ListUserPermissions" => { "user_id" => "String", }, + "v2.UpdateUserIdentityProviders" => { + "user_id" => "String", + "body" => "UpdateUserIdentityProvidersRequest", + }, "v2.ListAPIKeys" => { "page_size" => "Integer", "page_number" => "Integer", @@ -2124,6 +2131,12 @@ "v2.CreateJiraIssues" => { "body" => "CreateJiraIssueRequestArray", }, + "v2.AttachLinearIssue" => { + "body" => "AttachLinearIssueRequest", + }, + "v2.CreateLinearIssues" => { + "body" => "CreateLinearIssueRequestArray", + }, "v2.MuteSecurityFindings" => { "body" => "MuteFindingsRequest", }, @@ -3394,6 +3407,19 @@ "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, + "v2.UpdateIdentityProvider" => { + "idp_id" => "String", + "body" => "IdentityProviderUpdateRequest", + }, + "v2.ListIdentityProviderUsers" => { + "idp_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "String", + "sort_dir" => "QuerySortOrder", + "filter" => "String", + "filter_status" => "String", + }, "v2.DeleteEntityIntegrationConfig" => { "integration_id" => "String", }, @@ -4517,6 +4543,46 @@ "v2.DisableCustomerOrg" => { "body" => "CustomerOrgDisableRequest", }, + "v2.ListOrgAuthorizedClients" => { + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "String", + "filter" => "String", + "filter_oauth2_client_name" => "String", + "filter_disabled" => "String", + "include" => "String", + }, + "v2.DeleteOrgAuthorizedClient" => { + "org_authorized_client_id" => "String", + }, + "v2.GetOrgAuthorizedClient" => { + "org_authorized_client_id" => "String", + "include" => "String", + "filter_user_authorized_clients_disabled" => "String", + "filter_user_authorized_clients_user_disabled" => "String", + }, + "v2.UpdateOrgAuthorizedClient" => { + "org_authorized_client_id" => "String", + "body" => "OrgAuthorizedClientUpdateRequest", + }, + "v2.DeleteOrgAuthorizedClientAllUserAuthorizations" => { + "org_authorized_client_id" => "String", + "user_id" => "String", + }, + "v2.ListOrgAuthorizedClientUserAuthorizations" => { + "org_authorized_client_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "OrgAuthorizedClientUserAuthorizationsSort", + "filter_disabled" => "String", + "filter_user_name" => "String", + "filter_user_email" => "String", + "filter_user_disabled" => "String", + }, + "v2.DeleteOrgAuthorizedClientUserAuthorization" => { + "org_authorized_client_id" => "String", + "user_authorized_client_id" => "String", + }, "v2.ListOrgConnections" => { "sink_org_id" => "String", "source_org_id" => "String", @@ -5967,6 +6033,22 @@ "v2.GetUserMemberships" => { "user_uuid" => "String", }, + "v2.ListUserAuthorizedClients" => { + "page_size" => "Integer", + "page_number" => "Integer", + "filter" => "String", + "filter_disabled" => "String", + "include" => "String", + }, + "v2.DeleteUserAuthorizedClientsByClient" => { + "client_id" => "String", + }, + "v2.DeleteUserAuthorizedClient" => { + "user_authorized_client_id" => "String", + }, + "v2.GetUserAuthorizedClient" => { + "user_authorized_client_id" => "String", + }, "v2.ListWebIntegrationAccounts" => { "integration_name" => "String", }, diff --git a/features/v2/dora_metrics.feature b/features/v2/dora_metrics.feature index 768442f37f5c..d0dc8943ad91 100644 --- a/features/v2/dora_metrics.feature +++ b/features/v2/dora_metrics.feature @@ -88,6 +88,18 @@ Feature: DORA Metrics When the request is sent Then the response status is 200 OK + @replay-only @team:DataDog/ci-app-backend + Scenario: Get a list of deployment events returns deployments with date-time timestamps + Given a valid "appKeyAuth" key in the system + And new "ListDORADeployments" request + And body with value {"data": {"attributes": {"from": "2023-08-31T00:00:00Z", "to": "2023-09-01T00:00:00Z"}, "type": "dora_deployments_list_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].type" is equal to "dora_deployment" + And the response "data[0].attributes" has field "started_at" + And the response "data[0].attributes" has field "finished_at" + @team:DataDog/ci-app-backend Scenario: Get a list of failure events returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/features/v2/identity_providers.feature b/features/v2/identity_providers.feature new file mode 100644 index 000000000000..6fcc67f91fe6 --- /dev/null +++ b/features/v2/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/features/v2/org_authorized_clients.feature b/features/v2/org_authorized_clients.feature new file mode 100644 index 000000000000..a196173a2906 --- /dev/null +++ b/features/v2/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/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 0a0409f407c7..c204c1d587fc 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -111,6 +111,30 @@ Feature: Security Monitoring And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a Linear issue returns "Bad Request" response + Given operation "AttachLinearIssue" enabled + And new "AttachLinearIssue" request + And body with value {"data": {"attributes": {"linear_issue_url": "https://linear.app/your-workspace/issue/ENG-123"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a Linear issue returns "Not Found" response + Given operation "AttachLinearIssue" enabled + And new "AttachLinearIssue" request + And body with value {"data": {"attributes": {"linear_issue_url": "https://linear.app/your-workspace/issue/ENG-123"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a Linear issue returns "OK" response + Given operation "AttachLinearIssue" enabled + And new "AttachLinearIssue" request + And body with value {"data": {"attributes": {"linear_issue_url": "https://linear.app/your-workspace/issue/ENG-123"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a ServiceNow ticket returns "Bad Request" response Given new "AttachServiceNowTicket" request @@ -527,6 +551,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-investigation + Scenario: Create Linear issues for security findings returns "Bad Request" response + Given operation "CreateLinearIssues" enabled + And new "CreateLinearIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Linear issue.", "label_ids": ["a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"], "linear_project_id": "d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d", "priority": "NOT_DEFINED", "title": "A title for the Linear issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-investigation + Scenario: Create Linear issues for security findings returns "Created" response + Given operation "CreateLinearIssues" enabled + And new "CreateLinearIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Linear issue.", "label_ids": ["a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"], "linear_project_id": "d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d", "priority": "NOT_DEFINED", "title": "A title for the Linear issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}]} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/k9-investigation + Scenario: Create Linear issues for security findings returns "Not Found" response + Given operation "CreateLinearIssues" enabled + And new "CreateLinearIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Linear issue.", "label_ids": ["a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"], "linear_project_id": "d4c3b2a1-6f5e-8b7a-0d9c-2f1e4a3b6c5d", "priority": "NOT_DEFINED", "title": "A title for the Linear issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "linear_issues"}]} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-investigation Scenario: Create ServiceNow tickets for security findings returns "Bad Request" response Given new "CreateServiceNowTickets" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 37f5bce7a2c8..9db948088ae6 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2830,6 +2830,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": { @@ -5682,6 +5701,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": { @@ -7184,6 +7249,25 @@ "type": "unsafe" } }, + "AttachLinearIssue": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateLinearIssues": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, "MuteSecurityFindings": { "tag": "Security Monitoring", "undo": { @@ -9330,6 +9414,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": { @@ -9379,6 +9489,12 @@ "type": "idempotent" } }, + "GetUserIdentityProviders": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, "DeleteUserInvitations": { "tag": "Users", "undo": { @@ -9397,6 +9513,13 @@ "type": "safe" } }, + "UpdateUserIdentityProviders": { + "tag": "Users", + "undo": { + "operationId": "GetUserIdentityProviders", + "type": "idempotent" + } + }, "GetUserMemberships": { "tag": "Teams", "undo": { diff --git a/features/v2/user_authorized_clients.feature b/features/v2/user_authorized_clients.feature new file mode 100644 index 000000000000..591a889cd009 --- /dev/null +++ b/features/v2/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/features/v2/users.feature b/features/v2/users.feature index 9d9fa4896358..b3d2a2a9ea77 100644 --- a/features/v2/users.feature +++ b/features/v2/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 diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 0c247f9a57bc..e962893abe58 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -337,6 +337,7 @@ def initialize "v2.get_aws_cloud_auth_persona_mapping": false, "v2.list_aws_cloud_auth_persona_mappings": false, "v2.activate_content_pack": false, + "v2.attach_linear_issue": false, "v2.batch_get_security_monitoring_dataset_dependencies": false, "v2.bulk_create_sample_log_generation_subscriptions": false, "v2.bulk_export_security_monitoring_terraform_resources": false, @@ -344,6 +345,7 @@ def initialize "v2.convert_job_result_to_signal": false, "v2.convert_security_monitoring_terraform_resource": false, "v2.create_io_c_triage_state": false, + "v2.create_linear_issues": false, "v2.create_sample_log_generation_subscription": false, "v2.create_security_findings_automation_due_date_rule": false, "v2.create_security_findings_automation_mute_rule": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b5448a033d8c..cdff09d5da7f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1516,6 +1516,10 @@ def overrides "v2.attach_jira_issue_request_data" => "AttachJiraIssueRequestData", "v2.attach_jira_issue_request_data_attributes" => "AttachJiraIssueRequestDataAttributes", "v2.attach_jira_issue_request_data_relationships" => "AttachJiraIssueRequestDataRelationships", + "v2.attach_linear_issue_request" => "AttachLinearIssueRequest", + "v2.attach_linear_issue_request_data" => "AttachLinearIssueRequestData", + "v2.attach_linear_issue_request_data_attributes" => "AttachLinearIssueRequestDataAttributes", + "v2.attach_linear_issue_request_data_relationships" => "AttachLinearIssueRequestDataRelationships", "v2.attachment" => "Attachment", "v2.attachment_array" => "AttachmentArray", "v2.attachment_data" => "AttachmentData", @@ -2439,6 +2443,10 @@ def overrides "v2.create_jira_issue_request_data" => "CreateJiraIssueRequestData", "v2.create_jira_issue_request_data_attributes" => "CreateJiraIssueRequestDataAttributes", "v2.create_jira_issue_request_data_relationships" => "CreateJiraIssueRequestDataRelationships", + "v2.create_linear_issue_request_array" => "CreateLinearIssueRequestArray", + "v2.create_linear_issue_request_data" => "CreateLinearIssueRequestData", + "v2.create_linear_issue_request_data_attributes" => "CreateLinearIssueRequestDataAttributes", + "v2.create_linear_issue_request_data_relationships" => "CreateLinearIssueRequestDataRelationships", "v2.create_maintenance_request" => "CreateMaintenanceRequest", "v2.create_maintenance_request_data" => "CreateMaintenanceRequestData", "v2.create_maintenance_request_data_attributes" => "CreateMaintenanceRequestDataAttributes", @@ -3064,6 +3072,7 @@ def overrides "v2.entity_v3_api_datadog" => "EntityV3APIDatadog", "v2.entity_v3_api_kind" => "EntityV3APIKind", "v2.entity_v3_api_spec" => "EntityV3APISpec", + "v2.entity_v3_api_spec_interface" => "EntityV3APISpecInterface", "v2.entity_v3_api_spec_interface_definition" => "EntityV3APISpecInterfaceDefinition", "v2.entity_v3_api_spec_interface_file_ref" => "EntityV3APISpecInterfaceFileRef", "v2.entity_v3_api_version" => "EntityV3APIVersion", @@ -3250,6 +3259,8 @@ def overrides "v2.finding_evaluation" => "FindingEvaluation", "v2.finding_jira_issue" => "FindingJiraIssue", "v2.finding_jira_issue_result" => "FindingJiraIssueResult", + "v2.finding_linear_issue" => "FindingLinearIssue", + "v2.finding_linear_issue_result" => "FindingLinearIssueResult", "v2.finding_mute" => "FindingMute", "v2.finding_mute_reason" => "FindingMuteReason", "v2.finding_rule" => "FindingRule", @@ -3666,6 +3677,14 @@ def overrides "v2.http_token_auth_type" => "HTTPTokenAuthType", "v2.http_token_auth_update" => "HTTPTokenAuthUpdate", "v2.http_token_update" => "HTTPTokenUpdate", + "v2.identity_provider_attributes" => "IdentityProviderAttributes", + "v2.identity_provider_data" => "IdentityProviderData", + "v2.identity_provider_response" => "IdentityProviderResponse", + "v2.identity_providers_response" => "IdentityProvidersResponse", + "v2.identity_provider_type" => "IdentityProviderType", + "v2.identity_provider_update_attributes" => "IdentityProviderUpdateAttributes", + "v2.identity_provider_update_data" => "IdentityProviderUpdateData", + "v2.identity_provider_update_request" => "IdentityProviderUpdateRequest", "v2.idp_metadata_form_data" => "IdPMetadataFormData", "v2.il2_cpp_sourcemap_attributes" => "IL2CPPSourcemapAttributes", "v2.il2_cpp_sourcemap_data" => "IL2CPPSourcemapData", @@ -4048,6 +4067,7 @@ def overrides "v2.licenses_list_response_data_attributes" => "LicensesListResponseDataAttributes", "v2.licenses_list_response_data_attributes_licenses_items" => "LicensesListResponseDataAttributesLicensesItems", "v2.licenses_list_response_data_type" => "LicensesListResponseDataType", + "v2.linear_issues_data_type" => "LinearIssuesDataType", "v2.links" => "Links", "v2.list_allocations_response" => "ListAllocationsResponse", "v2.list_apis_response" => "ListAPIsResponse", @@ -5352,6 +5372,23 @@ def overrides "v2.organization_attributes" => "OrganizationAttributes", "v2.organizations_type" => "OrganizationsType", "v2.org_attributes" => "OrgAttributes", + "v2.org_authorized_client_attributes" => "OrgAuthorizedClientAttributes", + "v2.org_authorized_client_data" => "OrgAuthorizedClientData", + "v2.org_authorized_client_relationship_o_auth2_client" => "OrgAuthorizedClientRelationshipOAuth2Client", + "v2.org_authorized_client_relationship_o_auth2_client_data" => "OrgAuthorizedClientRelationshipOAuth2ClientData", + "v2.org_authorized_client_relationship_o_auth2_client_data_type" => "OrgAuthorizedClientRelationshipOAuth2ClientDataType", + "v2.org_authorized_client_relationships" => "OrgAuthorizedClientRelationships", + "v2.org_authorized_client_relationship_user_authorized_clients" => "OrgAuthorizedClientRelationshipUserAuthorizedClients", + "v2.org_authorized_client_relationship_user_authorized_clients_data" => "OrgAuthorizedClientRelationshipUserAuthorizedClientsData", + "v2.org_authorized_client_relationship_user_authorized_clients_data_type" => "OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType", + "v2.org_authorized_client_relationship_user_authorized_clients_links" => "OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks", + "v2.org_authorized_client_response" => "OrgAuthorizedClientResponse", + "v2.org_authorized_clients_response" => "OrgAuthorizedClientsResponse", + "v2.org_authorized_client_type" => "OrgAuthorizedClientType", + "v2.org_authorized_client_update_attributes" => "OrgAuthorizedClientUpdateAttributes", + "v2.org_authorized_client_update_data" => "OrgAuthorizedClientUpdateData", + "v2.org_authorized_client_update_request" => "OrgAuthorizedClientUpdateRequest", + "v2.org_authorized_client_user_authorizations_sort" => "OrgAuthorizedClientUserAuthorizationsSort", "v2.org_config_get_response" => "OrgConfigGetResponse", "v2.org_config_list_response" => "OrgConfigListResponse", "v2.org_config_read" => "OrgConfigRead", @@ -7672,6 +7709,7 @@ def overrides "v2.update_tenancy_config_data_attributes_regions_config" => "UpdateTenancyConfigDataAttributesRegionsConfig", "v2.update_tenancy_config_data_type" => "UpdateTenancyConfigDataType", "v2.update_tenancy_config_request" => "UpdateTenancyConfigRequest", + "v2.update_user_identity_providers_request" => "UpdateUserIdentityProvidersRequest", "v2.update_variant_request" => "UpdateVariantRequest", "v2.update_workflow_request" => "UpdateWorkflowRequest", "v2.update_workflow_response" => "UpdateWorkflowResponse", @@ -7717,6 +7755,21 @@ def overrides "v2.user" => "User", "v2.user_attributes" => "UserAttributes", "v2.user_attributes_status" => "UserAttributesStatus", + "v2.user_authorized_client_attributes" => "UserAuthorizedClientAttributes", + "v2.user_authorized_client_data" => "UserAuthorizedClientData", + "v2.user_authorized_client_relationship_o_auth2_client" => "UserAuthorizedClientRelationshipOAuth2Client", + "v2.user_authorized_client_relationship_o_auth2_client_data" => "UserAuthorizedClientRelationshipOAuth2ClientData", + "v2.user_authorized_client_relationship_o_auth2_client_data_type" => "UserAuthorizedClientRelationshipOAuth2ClientDataType", + "v2.user_authorized_client_relationships" => "UserAuthorizedClientRelationships", + "v2.user_authorized_client_relationship_scope_data" => "UserAuthorizedClientRelationshipScopeData", + "v2.user_authorized_client_relationship_scope_data_type" => "UserAuthorizedClientRelationshipScopeDataType", + "v2.user_authorized_client_relationship_scopes" => "UserAuthorizedClientRelationshipScopes", + "v2.user_authorized_client_relationship_user" => "UserAuthorizedClientRelationshipUser", + "v2.user_authorized_client_relationship_user_data" => "UserAuthorizedClientRelationshipUserData", + "v2.user_authorized_client_relationship_user_data_type" => "UserAuthorizedClientRelationshipUserDataType", + "v2.user_authorized_client_response" => "UserAuthorizedClientResponse", + "v2.user_authorized_clients_response" => "UserAuthorizedClientsResponse", + "v2.user_authorized_client_type" => "UserAuthorizedClientType", "v2.user_create_attributes" => "UserCreateAttributes", "v2.user_create_data" => "UserCreateData", "v2.user_create_request" => "UserCreateRequest", @@ -7728,7 +7781,13 @@ def overrides "v2.user_invitations_request" => "UserInvitationsRequest", "v2.user_invitations_response" => "UserInvitationsResponse", "v2.user_invitations_type" => "UserInvitationsType", + "v2.user_override_identity_provider_attributes" => "UserOverrideIdentityProviderAttributes", + "v2.user_override_identity_provider_data" => "UserOverrideIdentityProviderData", + "v2.user_override_identity_provider_data_type" => "UserOverrideIdentityProviderDataType", + "v2.user_override_identity_providers_response" => "UserOverrideIdentityProvidersResponse", "v2.user_relationship_data" => "UserRelationshipData", + "v2.user_relationship_identity_provider_data" => "UserRelationshipIdentityProviderData", + "v2.user_relationship_identity_provider_data_type" => "UserRelationshipIdentityProviderDataType", "v2.user_relationships" => "UserRelationships", "v2.user_resource_type" => "UserResourceType", "v2.user_response" => "UserResponse", @@ -7979,6 +8038,7 @@ def overrides "v2.governance_controls_api" => "GovernanceControlsAPI", "v2.governance_insights_api" => "GovernanceInsightsAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", + "v2.identity_providers_api" => "IdentityProvidersAPI", "v2.incidents_api" => "IncidentsAPI", "v2.integrations_api" => "IntegrationsAPI", "v2.ip_allowlist_api" => "IPAllowlistAPI", @@ -8003,6 +8063,7 @@ def overrides "v2.on_call_api" => "OnCallAPI", "v2.on_call_paging_api" => "OnCallPagingAPI", "v2.opsgenie_integration_api" => "OpsgenieIntegrationAPI", + "v2.org_authorized_clients_api" => "OrgAuthorizedClientsAPI", "v2.org_connections_api" => "OrgConnectionsAPI", "v2.org_groups_api" => "OrgGroupsAPI", "v2.organizations_api" => "OrganizationsAPI", @@ -8049,6 +8110,7 @@ def overrides "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", "v2.usage_metering_api" => "UsageMeteringAPI", + "v2.user_authorized_clients_api" => "UserAuthorizedClientsAPI", "v2.users_api" => "UsersAPI", "v2.web_integrations_api" => "WebIntegrationsAPI", "v2.webhooks_integration_api" => "WebhooksIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/identity_providers_api.rb b/lib/datadog_api_client/v2/api/identity_providers_api.rb new file mode 100644 index 000000000000..ffdeb5e98ede --- /dev/null +++ b/lib/datadog_api_client/v2/api/identity_providers_api.rb @@ -0,0 +1,262 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class IdentityProvidersAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # List identity providers. + # + # @see #list_identity_providers_with_http_info + def list_identity_providers(opts = {}) + data, _status_code, _headers = list_identity_providers_with_http_info(opts) + data + end + + # List identity providers. + # + # Get all identity providers available for the current organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(IdentityProvidersResponse, Integer, Hash)>] IdentityProvidersResponse data, response status code and response headers + def list_identity_providers_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IdentityProvidersAPI.list_identity_providers ...' + end + # resource path + local_var_path = '/api/v2/identity_providers' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IdentityProvidersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_identity_providers, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IdentityProvidersAPI#list_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List users with an identity provider override. + # + # @see #list_identity_provider_users_with_http_info + def list_identity_provider_users(idp_id, opts = {}) + data, _status_code, _headers = list_identity_provider_users_with_http_info(idp_id, opts) + data + end + + # 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 [String] The ID of the identity provider. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [String] :sort User attribute to order results by. Options include `email` and `name`. + # @option opts [QuerySortOrder] :sort_dir Direction of sort. Options: `asc`, `desc`. + # @option opts [String] :filter Filter users by the given string. Defaults to no filtering. + # @option opts [String] :filter_status Filter on status attribute. Comma-separated list, with possible values `Active`, `Pending`, and `Disabled`. Defaults to no filtering. + # @return [Array<(UsersResponse, Integer, Hash)>] UsersResponse data, response status code and response headers + def list_identity_provider_users_with_http_info(idp_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IdentityProvidersAPI.list_identity_provider_users ...' + end + # verify the required parameter 'idp_id' is set + if @api_client.config.client_side_validation && idp_id.nil? + fail ArgumentError, "Missing the required parameter 'idp_id' when calling IdentityProvidersAPI.list_identity_provider_users" + end + allowable_values = ['asc', 'desc'] + if @api_client.config.client_side_validation && opts[:'sort_dir'] && !allowable_values.include?(opts[:'sort_dir']) + fail ArgumentError, "invalid value for \"sort_dir\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/identity_providers/{idp_id}/users'.sub('{idp_id}', CGI.escape(idp_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UsersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_identity_provider_users, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IdentityProvidersAPI#list_identity_provider_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List users with an identity provider override. + # + # Provide a paginated version of {#list_identity_provider_users}, returning all items. + # + # To use it you need to use a block: list_identity_provider_users_with_pagination { |item| p item } + # + # @yield [User] Paginated items + def list_identity_provider_users_with_pagination(idp_id, opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_identity_provider_users(idp_id, opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + + # Update an identity provider. + # + # @see #update_identity_provider_with_http_info + def update_identity_provider(idp_id, body, opts = {}) + data, _status_code, _headers = update_identity_provider_with_http_info(idp_id, body, opts) + data + end + + # Update an identity provider. + # + # Enable or disable an identity provider for the current organization. + # + # @param idp_id [String] The ID of the identity provider. + # @param body [IdentityProviderUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(IdentityProviderResponse, Integer, Hash)>] IdentityProviderResponse data, response status code and response headers + def update_identity_provider_with_http_info(idp_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IdentityProvidersAPI.update_identity_provider ...' + end + # verify the required parameter 'idp_id' is set + if @api_client.config.client_side_validation && idp_id.nil? + fail ArgumentError, "Missing the required parameter 'idp_id' when calling IdentityProvidersAPI.update_identity_provider" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IdentityProvidersAPI.update_identity_provider" + end + # resource path + local_var_path = '/api/v2/identity_providers/{idp_id}'.sub('{idp_id}', CGI.escape(idp_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IdentityProviderResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_identity_provider, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IdentityProvidersAPI#update_identity_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/org_authorized_clients_api.rb b/lib/datadog_api_client/v2/api/org_authorized_clients_api.rb new file mode 100644 index 000000000000..9714c9bb9280 --- /dev/null +++ b/lib/datadog_api_client/v2/api/org_authorized_clients_api.rb @@ -0,0 +1,575 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class OrgAuthorizedClientsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete an org authorized client. + # + # @see #delete_org_authorized_client_with_http_info + def delete_org_authorized_client(org_authorized_client_id, opts = {}) + delete_org_authorized_client_with_http_info(org_authorized_client_id, opts) + nil + end + + # Delete an org authorized client. + # + # Disable an OAuth2 client authorization for the current organization, revoking access for all users. + # + # @param org_authorized_client_id [String] The ID of the org authorized client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_org_authorized_client_with_http_info(org_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_org_authorized_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#delete_org_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a user's authorizations for a client. + # + # @see #delete_org_authorized_client_all_user_authorizations_with_http_info + def delete_org_authorized_client_all_user_authorizations(org_authorized_client_id, user_id, opts = {}) + delete_org_authorized_client_all_user_authorizations_with_http_info(org_authorized_client_id, user_id, opts) + nil + end + + # 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 [String] The ID of the org authorized client. + # @param user_id [String] The ID of the user. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_org_authorized_client_all_user_authorizations_with_http_info(org_authorized_client_id, user_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations" + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}/user/{user_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')).sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_org_authorized_client_all_user_authorizations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#delete_org_authorized_client_all_user_authorizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a user authorization for a client. + # + # @see #delete_org_authorized_client_user_authorization_with_http_info + def delete_org_authorized_client_user_authorization(org_authorized_client_id, user_authorized_client_id, opts = {}) + delete_org_authorized_client_user_authorization_with_http_info(org_authorized_client_id, user_authorized_client_id, opts) + nil + end + + # 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 [String] The ID of the org authorized client. + # @param user_authorized_client_id [String] The ID of the user authorized client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_org_authorized_client_user_authorization_with_http_info(org_authorized_client_id, user_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization" + end + # verify the required parameter 'user_authorized_client_id' is set + if @api_client.config.client_side_validation && user_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients/{user_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')).sub('{user_authorized_client_id}', CGI.escape(user_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_org_authorized_client_user_authorization, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#delete_org_authorized_client_user_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an org authorized client. + # + # @see #get_org_authorized_client_with_http_info + def get_org_authorized_client(org_authorized_client_id, opts = {}) + data, _status_code, _headers = get_org_authorized_client_with_http_info(org_authorized_client_id, opts) + data + end + + # Get an org authorized client. + # + # Get a single OAuth2 client authorized for the current organization. + # + # @param org_authorized_client_id [String] The ID of the org authorized client. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include. Options: `oauth2_client`, `oauth2_client.app`, `oauth2_client.scopes`, `user_authorized_clients.user`. + # @option opts [String] :filter_user_authorized_clients_disabled Filter included user authorized clients by disabled status. + # @option opts [String] :filter_user_authorized_clients_user_disabled Filter included user authorized clients by user disabled status. + # @return [Array<(OrgAuthorizedClientResponse, Integer, Hash)>] OrgAuthorizedClientResponse data, response status code and response headers + def get_org_authorized_client_with_http_info(org_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.get_org_authorized_client ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.get_org_authorized_client" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'filter[user_authorized_clients][disabled]'] = opts[:'filter_user_authorized_clients_disabled'] if !opts[:'filter_user_authorized_clients_disabled'].nil? + query_params[:'filter[user_authorized_clients][user][disabled]'] = opts[:'filter_user_authorized_clients_user_disabled'] if !opts[:'filter_user_authorized_clients_user_disabled'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OrgAuthorizedClientResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_org_authorized_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#get_org_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List org authorized clients. + # + # @see #list_org_authorized_clients_with_http_info + def list_org_authorized_clients(opts = {}) + data, _status_code, _headers = list_org_authorized_clients_with_http_info(opts) + data + end + + # List org authorized clients. + # + # Get a list of all OAuth2 clients authorized for the current organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [String] :sort Field to sort results by. Options include `oauth2_client.name`. + # @option opts [String] :filter Filter results by client name, app title, or app description. + # @option opts [String] :filter_oauth2_client_name Filter results by the OAuth2 client name. + # @option opts [String] :filter_disabled Filter results by the org-level disabled status. + # @option opts [String] :include Comma-separated list of related resources to include. Options: `oauth2_client`, `oauth2_client.app`, `user_authorized_clients.user`. + # @return [Array<(OrgAuthorizedClientsResponse, Integer, Hash)>] OrgAuthorizedClientsResponse data, response status code and response headers + def list_org_authorized_clients_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.list_org_authorized_clients ...' + end + # resource path + local_var_path = '/api/v2/org_authorized_clients' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'filter[oauth2_client][name]'] = opts[:'filter_oauth2_client_name'] if !opts[:'filter_oauth2_client_name'].nil? + query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OrgAuthorizedClientsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_org_authorized_clients, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#list_org_authorized_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List org authorized clients. + # + # Provide a paginated version of {#list_org_authorized_clients}, returning all items. + # + # To use it you need to use a block: list_org_authorized_clients_with_pagination { |item| p item } + # + # @yield [OrgAuthorizedClientData] Paginated items + def list_org_authorized_clients_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_org_authorized_clients(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + + # List user authorizations for a client. + # + # @see #list_org_authorized_client_user_authorizations_with_http_info + def list_org_authorized_client_user_authorizations(org_authorized_client_id, opts = {}) + data, _status_code, _headers = list_org_authorized_client_user_authorizations_with_http_info(org_authorized_client_id, opts) + data + end + + # 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 [String] The ID of the org authorized client. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [OrgAuthorizedClientUserAuthorizationsSort] :sort Field to sort results by. Options: `user.name`, `user.email`, `oauth2_client.name`. + # @option opts [String] :filter_disabled Filter results by the user authorization disabled status. + # @option opts [String] :filter_user_name Filter results by user name. + # @option opts [String] :filter_user_email Filter results by user email. + # @option opts [String] :filter_user_disabled Filter results by whether the user is disabled. + # @return [Array<(UserAuthorizedClientsResponse, Integer, Hash)>] UserAuthorizedClientsResponse data, response status code and response headers + def list_org_authorized_client_user_authorizations_with_http_info(org_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.list_org_authorized_client_user_authorizations ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.list_org_authorized_client_user_authorizations" + end + allowable_values = ['user.name', 'user.email', 'oauth2_client.name'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil? + query_params[:'filter[user][name]'] = opts[:'filter_user_name'] if !opts[:'filter_user_name'].nil? + query_params[:'filter[user][email]'] = opts[:'filter_user_email'] if !opts[:'filter_user_email'].nil? + query_params[:'filter[user][disabled]'] = opts[:'filter_user_disabled'] if !opts[:'filter_user_disabled'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UserAuthorizedClientsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_org_authorized_client_user_authorizations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#list_org_authorized_client_user_authorizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List user authorizations for a client. + # + # Provide a paginated version of {#list_org_authorized_client_user_authorizations}, returning all items. + # + # To use it you need to use a block: list_org_authorized_client_user_authorizations_with_pagination { |item| p item } + # + # @yield [UserAuthorizedClientData] Paginated items + def list_org_authorized_client_user_authorizations_with_pagination(org_authorized_client_id, opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_org_authorized_client_user_authorizations(org_authorized_client_id, opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + + # Update an org authorized client. + # + # @see #update_org_authorized_client_with_http_info + def update_org_authorized_client(org_authorized_client_id, body, opts = {}) + data, _status_code, _headers = update_org_authorized_client_with_http_info(org_authorized_client_id, body, opts) + data + end + + # Update an org authorized client. + # + # Enable or disable an OAuth2 client authorization for the current organization. + # + # @param org_authorized_client_id [String] The ID of the org authorized client. + # @param body [OrgAuthorizedClientUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OrgAuthorizedClientResponse, Integer, Hash)>] OrgAuthorizedClientResponse data, response status code and response headers + def update_org_authorized_client_with_http_info(org_authorized_client_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.update_org_authorized_client ...' + end + # verify the required parameter 'org_authorized_client_id' is set + if @api_client.config.client_side_validation && org_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.update_org_authorized_client" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OrgAuthorizedClientsAPI.update_org_authorized_client" + end + # resource path + local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OrgAuthorizedClientResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_org_authorized_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgAuthorizedClientsAPI#update_org_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 020516777fdf..9751fcbb908b 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -237,6 +237,80 @@ def attach_jira_issue_with_http_info(body, opts = {}) return data, status_code, headers end + # Attach security findings to a Linear issue. + # + # @see #attach_linear_issue_with_http_info + def attach_linear_issue(body, opts = {}) + data, _status_code, _headers = attach_linear_issue_with_http_info(body, opts) + data + end + + # Attach security findings to a Linear issue. + # + # Attach security findings to a Linear issue by providing the Linear issue URL. + # You can attach up to 50 security findings per Linear issue. If the Linear issue is not linked to any case, this operation will create a case for the security findings and link the Linear issue to the newly created case. Security findings that are already attached to another Linear issue will be detached from their previous Linear issue and attached to the specified Linear issue. + # + # @param body [AttachLinearIssueRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers + def attach_linear_issue_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.attach_linear_issue".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.attach_linear_issue") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.attach_linear_issue")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_linear_issue ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.attach_linear_issue" + end + # resource path + local_var_path = '/api/v2/security/findings/linear_issues' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :attach_linear_issue, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#attach_linear_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Attach security findings to a ServiceNow ticket. # # @see #attach_service_now_ticket_with_http_info @@ -1607,6 +1681,80 @@ def create_jira_issues_with_http_info(body, opts = {}) return data, status_code, headers end + # Create Linear issues for security findings. + # + # @see #create_linear_issues_with_http_info + def create_linear_issues(body, opts = {}) + data, _status_code, _headers = create_linear_issues_with_http_info(body, opts) + data + end + + # Create Linear issues for security findings. + # + # Create Linear issues for security findings. + # This operation creates a case in Datadog and a Linear issue linked to that case for bidirectional sync between Datadog and Linear. You can create up to 50 Linear issues per request and associate up to 50 security findings per Linear issue. Security findings that are already attached to another Linear issue will be detached from their previous Linear issue and attached to the newly created Linear issue. + # + # @param body [CreateLinearIssueRequestArray] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers + def create_linear_issues_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_linear_issues".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_linear_issues") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_linear_issues")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_linear_issues ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_linear_issues" + end + # resource path + local_var_path = '/api/v2/security/findings/linear_issues' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_linear_issues, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_linear_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Subscribe to sample log generation. # # @see #create_sample_log_generation_subscription_with_http_info diff --git a/lib/datadog_api_client/v2/api/user_authorized_clients_api.rb b/lib/datadog_api_client/v2/api/user_authorized_clients_api.rb new file mode 100644 index 000000000000..d6b06a9e16a4 --- /dev/null +++ b/lib/datadog_api_client/v2/api/user_authorized_clients_api.rb @@ -0,0 +1,313 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class UserAuthorizedClientsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete a user authorized client. + # + # @see #delete_user_authorized_client_with_http_info + def delete_user_authorized_client(user_authorized_client_id, opts = {}) + delete_user_authorized_client_with_http_info(user_authorized_client_id, opts) + nil + end + + # Delete a user authorized client. + # + # Disable the current user's authorization for the specified OAuth2 client. + # + # @param user_authorized_client_id [String] The ID of the user authorized client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.delete_user_authorized_client ...' + end + # verify the required parameter 'user_authorized_client_id' is set + if @api_client.config.client_side_validation && user_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling UserAuthorizedClientsAPI.delete_user_authorized_client" + end + # resource path + local_var_path = '/api/v2/user_authorized_clients/{user_authorized_client_id}'.sub('{user_authorized_client_id}', CGI.escape(user_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_user_authorized_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#delete_user_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete all user authorized clients for a client. + # + # @see #delete_user_authorized_clients_by_client_with_http_info + def delete_user_authorized_clients_by_client(client_id, opts = {}) + delete_user_authorized_clients_by_client_with_http_info(client_id, opts) + nil + end + + # Delete all user authorized clients for a client. + # + # Disable all authorizations the current user has granted to the specified OAuth2 client. + # + # @param client_id [String] The ID of the OAuth2 client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_user_authorized_clients_by_client_with_http_info(client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.delete_user_authorized_clients_by_client ...' + end + # verify the required parameter 'client_id' is set + if @api_client.config.client_side_validation && client_id.nil? + fail ArgumentError, "Missing the required parameter 'client_id' when calling UserAuthorizedClientsAPI.delete_user_authorized_clients_by_client" + end + # resource path + local_var_path = '/api/v2/user_authorized_clients/client/{client_id}'.sub('{client_id}', CGI.escape(client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_user_authorized_clients_by_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#delete_user_authorized_clients_by_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a user authorized client. + # + # @see #get_user_authorized_client_with_http_info + def get_user_authorized_client(user_authorized_client_id, opts = {}) + data, _status_code, _headers = get_user_authorized_client_with_http_info(user_authorized_client_id, opts) + data + end + + # Get a user authorized client. + # + # Get a single OAuth2 client authorization for the current user. + # + # @param user_authorized_client_id [String] The ID of the user authorized client. + # @param opts [Hash] the optional parameters + # @return [Array<(UserAuthorizedClientResponse, Integer, Hash)>] UserAuthorizedClientResponse data, response status code and response headers + def get_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.get_user_authorized_client ...' + end + # verify the required parameter 'user_authorized_client_id' is set + if @api_client.config.client_side_validation && user_authorized_client_id.nil? + fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling UserAuthorizedClientsAPI.get_user_authorized_client" + end + # resource path + local_var_path = '/api/v2/user_authorized_clients/{user_authorized_client_id}'.sub('{user_authorized_client_id}', CGI.escape(user_authorized_client_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UserAuthorizedClientResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_user_authorized_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#get_user_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List user authorized clients. + # + # @see #list_user_authorized_clients_with_http_info + def list_user_authorized_clients(opts = {}) + data, _status_code, _headers = list_user_authorized_clients_with_http_info(opts) + data + end + + # List user authorized clients. + # + # Get a list of all OAuth2 clients authorized by the current user. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [String] :filter Filter results by client name, app title, or app description. + # @option opts [String] :filter_disabled Filter results by the user-level disabled status. + # @option opts [String] :include Comma-separated list of related resources to include. Options: `oauth2_client`, `oauth2_client.app`. + # @return [Array<(UserAuthorizedClientsResponse, Integer, Hash)>] UserAuthorizedClientsResponse data, response status code and response headers + def list_user_authorized_clients_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.list_user_authorized_clients ...' + end + # resource path + local_var_path = '/api/v2/user_authorized_clients' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UserAuthorizedClientsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_user_authorized_clients, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#list_user_authorized_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List user authorized clients. + # + # Provide a paginated version of {#list_user_authorized_clients}, returning all items. + # + # To use it you need to use a block: list_user_authorized_clients_with_pagination { |item| p item } + # + # @yield [UserAuthorizedClientData] Paginated items + def list_user_authorized_clients_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_user_authorized_clients(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + end +end diff --git a/lib/datadog_api_client/v2/api/users_api.rb b/lib/datadog_api_client/v2/api/users_api.rb index 489e0c333b7d..1ee09a053885 100644 --- a/lib/datadog_api_client/v2/api/users_api.rb +++ b/lib/datadog_api_client/v2/api/users_api.rb @@ -490,6 +490,72 @@ def get_user_with_http_info(user_id, opts = {}) return data, status_code, headers end + # Get identity provider overrides for a user. + # + # @see #get_user_identity_providers_with_http_info + def get_user_identity_providers(user_id, opts = {}) + data, _status_code, _headers = get_user_identity_providers_with_http_info(user_id, opts) + data + end + + # 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 [String] The ID of the user. + # @param opts [Hash] the optional parameters + # @return [Array<(UserOverrideIdentityProvidersResponse, Integer, Hash)>] UserOverrideIdentityProvidersResponse data, response status code and response headers + def get_user_identity_providers_with_http_info(user_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersAPI.get_user_identity_providers ...' + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersAPI.get_user_identity_providers" + end + # resource path + local_var_path = '/api/v2/users/{user_id}/identity_providers'.sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UserOverrideIdentityProvidersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_user_identity_providers, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersAPI#get_user_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a user organization. # # @see #list_user_organizations_with_http_info @@ -931,5 +997,79 @@ def update_user_with_http_info(user_id, body, opts = {}) end return data, status_code, headers end + + # Update identity provider overrides for a user. + # + # @see #update_user_identity_providers_with_http_info + def update_user_identity_providers(user_id, body, opts = {}) + update_user_identity_providers_with_http_info(user_id, body, opts) + nil + end + + # 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 [String] The ID of the user. + # @param body [UpdateUserIdentityProvidersRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_user_identity_providers_with_http_info(user_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsersAPI.update_user_identity_providers ...' + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersAPI.update_user_identity_providers" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UsersAPI.update_user_identity_providers" + end + # resource path + local_var_path = '/api/v2/users/{user_id}/relationships/identity_providers'.sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_user_identity_providers, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UsersAPI#update_user_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/attach_linear_issue_request.rb b/lib/datadog_api_client/v2/models/attach_linear_issue_request.rb new file mode 100644 index 000000000000..727785db1cea --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_linear_issue_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for attaching security findings to a Linear issue. + class AttachLinearIssueRequest + include BaseGenericModel + + # Data of the Linear issue to attach security findings to. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AttachLinearIssueRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachLinearIssueRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_linear_issue_request_data.rb b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data.rb new file mode 100644 index 000000000000..32dc29369c9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Linear issue to attach security findings to. + class AttachLinearIssueRequestData + include BaseGenericModel + + # Attributes of the Linear issue to attach security findings to. + attr_reader :attributes + + # Relationships of the Linear issue to attach security findings to. + attr_reader :relationships + + # Linear issues resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AttachLinearIssueRequestDataAttributes', + :'relationships' => :'AttachLinearIssueRequestDataRelationships', + :'type' => :'LinearIssuesDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachLinearIssueRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_attributes.rb new file mode 100644 index 000000000000..d39fd27dc77e --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the Linear issue to attach security findings to. + class AttachLinearIssueRequestDataAttributes + include BaseGenericModel + + # URL of the Linear issue to attach security findings to. + attr_reader :linear_issue_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'linear_issue_url' => :'linear_issue_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'linear_issue_url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachLinearIssueRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'linear_issue_url') + self.linear_issue_url = attributes[:'linear_issue_url'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @linear_issue_url.nil? + true + end + + # Custom attribute writer method with validation + # @param linear_issue_url [Object] Object to be assigned + # @!visibility private + def linear_issue_url=(linear_issue_url) + if linear_issue_url.nil? + fail ArgumentError, 'invalid value for "linear_issue_url", linear_issue_url cannot be nil.' + end + @linear_issue_url = linear_issue_url + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + linear_issue_url == o.linear_issue_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [linear_issue_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_relationships.rb new file mode 100644 index 000000000000..9a99db54b70a --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_linear_issue_request_data_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the Linear issue to attach security findings to. + class AttachLinearIssueRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachLinearIssueRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_linear_issue_request_array.rb b/lib/datadog_api_client/v2/models/create_linear_issue_request_array.rb new file mode 100644 index 000000000000..f5152040796e --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_linear_issue_request_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List of requests to create Linear issues for security findings. + class CreateLinearIssueRequestArray + include BaseGenericModel + + # Array of Linear issue creation request data objects. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateLinearIssueRequestArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_linear_issue_request_data.rb b/lib/datadog_api_client/v2/models/create_linear_issue_request_data.rb new file mode 100644 index 000000000000..568554c5d068 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_linear_issue_request_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Linear issue to create. + class CreateLinearIssueRequestData + include BaseGenericModel + + # Attributes of the Linear issue to create. + attr_accessor :attributes + + # Relationships of the Linear issue to create. + attr_accessor :relationships + + # Linear issues resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateLinearIssueRequestDataAttributes', + :'relationships' => :'CreateLinearIssueRequestDataRelationships', + :'type' => :'LinearIssuesDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateLinearIssueRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_linear_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_linear_issue_request_data_attributes.rb new file mode 100644 index 000000000000..3acce9c7bb01 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_linear_issue_request_data_attributes.rb @@ -0,0 +1,157 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the Linear issue to create. + class CreateLinearIssueRequestDataAttributes + include BaseGenericModel + + # Unique identifier of the Datadog user assigned to the Linear issue. + attr_accessor :assignee_id + + # Description of the Linear issue. If not provided, the description will be automatically generated. + attr_accessor :description + + # Linear label IDs to set on the created issue. + attr_accessor :label_ids + + # Unique identifier of the Linear project to pin the issue to. If not provided, the issue is not associated with a Linear project. + attr_accessor :linear_project_id + + # Case priority + attr_accessor :priority + + # Title of the Linear issue. If not provided, the title will be automatically generated. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id', + :'description' => :'description', + :'label_ids' => :'label_ids', + :'linear_project_id' => :'linear_project_id', + :'priority' => :'priority', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'String', + :'description' => :'String', + :'label_ids' => :'Array', + :'linear_project_id' => :'String', + :'priority' => :'CasePriority', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateLinearIssueRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignee_id') + self.assignee_id = attributes[:'assignee_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'label_ids') + if (value = attributes[:'label_ids']).is_a?(Array) + self.label_ids = value + end + end + + if attributes.key?(:'linear_project_id') + self.linear_project_id = attributes[:'linear_project_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee_id == o.assignee_id && + description == o.description && + label_ids == o.label_ids && + linear_project_id == o.linear_project_id && + priority == o.priority && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id, description, label_ids, linear_project_id, priority, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_linear_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/create_linear_issue_request_data_relationships.rb new file mode 100644 index 000000000000..8d3e1243828e --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_linear_issue_request_data_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the Linear issue to create. + class CreateLinearIssueRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateLinearIssueRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb b/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb index f86051e50df2..a66cefdbfb4f 100644 --- a/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb +++ b/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb @@ -27,8 +27,8 @@ class DORADeploymentObjectAttributes # Environment name to where the service was deployed. attr_accessor :env - # Unix timestamp when the deployment finished. - attr_reader :finished_at + # The time when the deployment finished. + attr_accessor :finished_at # Git info returned by DORA Metrics events. attr_accessor :git @@ -36,7 +36,7 @@ class DORADeploymentObjectAttributes # Service name. attr_reader :service - # Unix timestamp when the deployment started. + # The time when the deployment started. attr_reader :started_at # Name of the team owning the deployed service. @@ -68,10 +68,10 @@ def self.openapi_types { :'custom_tags' => :'Array', :'env' => :'String', - :'finished_at' => :'Integer', + :'finished_at' => :'Time', :'git' => :'DORAGitInfoResponse', :'service' => :'String', - :'started_at' => :'Integer', + :'started_at' => :'Time', :'team' => :'String', :'version' => :'String' } @@ -142,22 +142,11 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @finished_at.nil? return false if @service.nil? return false if @started_at.nil? true end - # Custom attribute writer method with validation - # @param finished_at [Object] Object to be assigned - # @!visibility private - def finished_at=(finished_at) - if finished_at.nil? - fail ArgumentError, 'invalid value for "finished_at", finished_at cannot be nil.' - end - @finished_at = finished_at - end - # Custom attribute writer method with validation # @param service [Object] Object to be assigned # @!visibility private diff --git a/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb b/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb index 9a3294c34d22..42a556e9ac52 100644 --- a/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb +++ b/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb @@ -27,7 +27,7 @@ class DORAIncidentObjectAttributes # Environment name that was impacted by the incident. attr_accessor :env - # Unix timestamp when the incident finished. + # The time when the incident finished. attr_accessor :finished_at # Git info for DORA Metrics events. @@ -42,8 +42,8 @@ class DORAIncidentObjectAttributes # Incident severity. attr_accessor :severity - # Unix timestamp when the incident started. - attr_reader :started_at + # The time when the incident started. + attr_accessor :started_at # Name of the team owning the services impacted. attr_accessor :team @@ -76,12 +76,12 @@ def self.openapi_types { :'custom_tags' => :'Array', :'env' => :'String', - :'finished_at' => :'Integer', + :'finished_at' => :'Time', :'git' => :'DORAGitInfo', :'name' => :'String', :'services' => :'Array', :'severity' => :'String', - :'started_at' => :'Integer', + :'started_at' => :'Time', :'team' => :'String', :'version' => :'String' } @@ -158,24 +158,6 @@ def initialize(attributes = {}) end end - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @started_at.nil? - true - end - - # Custom attribute writer method with validation - # @param started_at [Object] Object to be assigned - # @!visibility private - def started_at=(started_at) - if started_at.nil? - fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' - end - @started_at = started_at - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb b/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb new file mode 100644 index 000000000000..cbd2312c2b2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_v3_api_spec_interface.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The API definition. + module EntityV3APISpecInterface + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'EntityV3APISpecInterfaceFileRef', + :'EntityV3APISpecInterfaceDefinition' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb index 6fcda4848d0b..983294c71e06 100644 --- a/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb @@ -54,6 +54,9 @@ class FindingCaseResponseDataAttributes # Key of the case. attr_accessor :key + # Linear issue associated with the case. + attr_accessor :linear_issue + # Timestamp of when the case was last modified. attr_accessor :modified_at @@ -95,6 +98,7 @@ def self.attribute_map :'insights' => :'insights', :'jira_issue' => :'jira_issue', :'key' => :'key', + :'linear_issue' => :'linear_issue', :'modified_at' => :'modified_at', :'priority' => :'priority', :'servicenow_ticket' => :'servicenow_ticket', @@ -121,6 +125,7 @@ def self.openapi_types :'insights' => :'Array', :'jira_issue' => :'FindingJiraIssue', :'key' => :'String', + :'linear_issue' => :'FindingLinearIssue', :'modified_at' => :'Time', :'priority' => :'String', :'servicenow_ticket' => :'FindingServiceNowTicket', @@ -196,6 +201,10 @@ def initialize(attributes = {}) self.key = attributes[:'key'] end + if attributes.key?(:'linear_issue') + self.linear_issue = attributes[:'linear_issue'] + end + if attributes.key?(:'modified_at') self.modified_at = attributes[:'modified_at'] end @@ -266,6 +275,7 @@ def ==(o) insights == o.insights && jira_issue == o.jira_issue && key == o.key && + linear_issue == o.linear_issue && modified_at == o.modified_at && priority == o.priority && servicenow_ticket == o.servicenow_ticket && @@ -281,7 +291,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [archived_at, assigned_to, attributes, closed_at, created_at, creation_source, description, due_date, insights, jira_issue, key, modified_at, priority, servicenow_ticket, status, status_group, status_name, title, type, additional_properties].hash + [archived_at, assigned_to, attributes, closed_at, created_at, creation_source, description, due_date, insights, jira_issue, key, linear_issue, modified_at, priority, servicenow_ticket, status, status_group, status_name, title, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/finding_linear_issue.rb b/lib/datadog_api_client/v2/models/finding_linear_issue.rb new file mode 100644 index 000000000000..551a521294dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_linear_issue.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Linear issue associated with the case. + class FindingLinearIssue + include BaseGenericModel + + # Error message if the Linear issue creation failed. + attr_accessor :error_message + + # Result of the Linear issue creation. + attr_accessor :result + + # Status of the Linear issue creation. Can be "COMPLETED" if the Linear issue was created successfully, or "FAILED" if the Linear issue creation failed. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error_message' => :'error_message', + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error_message' => :'String', + :'result' => :'FindingLinearIssueResult', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingLinearIssue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_message == o.error_message && + result == o.result && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error_message, result, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_linear_issue_result.rb b/lib/datadog_api_client/v2/models/finding_linear_issue_result.rb new file mode 100644 index 000000000000..c5b00c4876a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_linear_issue_result.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Result of the Linear issue creation. + class FindingLinearIssueResult + include BaseGenericModel + + # Account ID of the Linear workspace. + attr_accessor :account_id + + # Unique identifier of the Linear issue. + attr_accessor :issue_id + + # Key of the Linear issue. + attr_accessor :issue_key + + # Team ID of the Linear issue. + attr_accessor :team_id + + # URL of the Linear issue. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'issue_id' => :'issue_id', + :'issue_key' => :'issue_key', + :'team_id' => :'team_id', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'issue_id' => :'String', + :'issue_key' => :'String', + :'team_id' => :'String', + :'url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingLinearIssueResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'issue_id') + self.issue_id = attributes[:'issue_id'] + end + + if attributes.key?(:'issue_key') + self.issue_key = attributes[:'issue_key'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + issue_id == o.issue_id && + issue_key == o.issue_key && + team_id == o.team_id && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, issue_id, issue_key, team_id, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_attributes.rb b/lib/datadog_api_client/v2/models/identity_provider_attributes.rb new file mode 100644 index 000000000000..789d3781672e --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an organization identity provider. + class IdentityProviderAttributes + include BaseGenericModel + + # The authentication method used by this identity provider. + attr_reader :authentication_method + + # Whether this identity provider is enabled for the organization. + attr_reader :enabled + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication_method' => :'authentication_method', + :'enabled' => :'enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication_method' => :'String', + :'enabled' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'authentication_method') + self.authentication_method = attributes[:'authentication_method'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @authentication_method.nil? + return false if @enabled.nil? + true + end + + # Custom attribute writer method with validation + # @param authentication_method [Object] Object to be assigned + # @!visibility private + def authentication_method=(authentication_method) + if authentication_method.nil? + fail ArgumentError, 'invalid value for "authentication_method", authentication_method cannot be nil.' + end + @authentication_method = authentication_method + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + authentication_method == o.authentication_method && + enabled == o.enabled && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication_method, enabled, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_data.rb b/lib/datadog_api_client/v2/models/identity_provider_data.rb new file mode 100644 index 000000000000..b59fd0a2ae51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object representing an organization identity provider. + class IdentityProviderData + include BaseGenericModel + + # Attributes of an organization identity provider. + attr_reader :attributes + + # The unique identifier of the identity provider. + attr_reader :id + + # The resource type for identity providers. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IdentityProviderAttributes', + :'id' => :'String', + :'type' => :'IdentityProviderType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_response.rb b/lib/datadog_api_client/v2/models/identity_provider_response.rb new file mode 100644 index 000000000000..a39921f36102 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single organization identity provider. + class IdentityProviderResponse + include BaseGenericModel + + # Data object representing an organization identity provider. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IdentityProviderData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_type.rb b/lib/datadog_api_client/v2/models/identity_provider_type.rb new file mode 100644 index 000000000000..e4929c85e525 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for identity providers. + class IdentityProviderType + include BaseEnumModel + + IDENTITY_PROVIDERS = "identity_providers".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_update_attributes.rb b/lib/datadog_api_client/v2/models/identity_provider_update_attributes.rb new file mode 100644 index 000000000000..07f185a29051 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_update_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an organization identity provider. + class IdentityProviderUpdateAttributes + include BaseGenericModel + + # Whether to enable or disable this identity provider for the organization. + attr_reader :enabled + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @enabled.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_update_data.rb b/lib/datadog_api_client/v2/models/identity_provider_update_data.rb new file mode 100644 index 000000000000..9d82b486de61 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating an organization identity provider. + class IdentityProviderUpdateData + include BaseGenericModel + + # Attributes for updating an organization identity provider. + attr_reader :attributes + + # The unique identifier of the identity provider to update. + attr_reader :id + + # The resource type for identity providers. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IdentityProviderUpdateAttributes', + :'id' => :'String', + :'type' => :'IdentityProviderType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_provider_update_request.rb b/lib/datadog_api_client/v2/models/identity_provider_update_request.rb new file mode 100644 index 000000000000..004ff875af00 --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_provider_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating an organization identity provider. + class IdentityProviderUpdateRequest + include BaseGenericModel + + # Data object for updating an organization identity provider. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IdentityProviderUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProviderUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/identity_providers_response.rb b/lib/datadog_api_client/v2/models/identity_providers_response.rb new file mode 100644 index 000000000000..9965b964eb7b --- /dev/null +++ b/lib/datadog_api_client/v2/models/identity_providers_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of identity providers for an organization. + class IdentityProvidersResponse + include BaseGenericModel + + # List of organization identity provider data objects. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IdentityProvidersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/linear_issues_data_type.rb b/lib/datadog_api_client/v2/models/linear_issues_data_type.rb new file mode 100644 index 000000000000..fbfcd72a56b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/linear_issues_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Linear issues resource type. + class LinearIssuesDataType + include BaseEnumModel + + LINEAR_ISSUES = "linear_issues".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_attributes.rb b/lib/datadog_api_client/v2/models/org_authorized_client_attributes.rb new file mode 100644 index 000000000000..9477b942737f --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_attributes.rb @@ -0,0 +1,162 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an org authorized client. + class OrgAuthorizedClientAttributes + include BaseGenericModel + + # Whether the organization has disabled this client. + attr_reader :disabled + + # The date and time this client was last exercised. + attr_accessor :last_exercised + + # The number of users in the organization who have authorized this client. + attr_reader :user_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'disabled' => :'disabled', + :'last_exercised' => :'last_exercised', + :'user_count' => :'user_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'disabled' => :'Boolean', + :'last_exercised' => :'Time', + :'user_count' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last_exercised', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'disabled') + self.disabled = attributes[:'disabled'] + end + + if attributes.key?(:'last_exercised') + self.last_exercised = attributes[:'last_exercised'] + end + + if attributes.key?(:'user_count') + self.user_count = attributes[:'user_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @disabled.nil? + return false if @user_count.nil? + true + end + + # Custom attribute writer method with validation + # @param disabled [Object] Object to be assigned + # @!visibility private + def disabled=(disabled) + if disabled.nil? + fail ArgumentError, 'invalid value for "disabled", disabled cannot be nil.' + end + @disabled = disabled + end + + # Custom attribute writer method with validation + # @param user_count [Object] Object to be assigned + # @!visibility private + def user_count=(user_count) + if user_count.nil? + fail ArgumentError, 'invalid value for "user_count", user_count cannot be nil.' + end + @user_count = user_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + disabled == o.disabled && + last_exercised == o.last_exercised && + user_count == o.user_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [disabled, last_exercised, user_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_data.rb b/lib/datadog_api_client/v2/models/org_authorized_client_data.rb new file mode 100644 index 000000000000..473b9681b6d8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object representing an org authorized client. + class OrgAuthorizedClientData + include BaseGenericModel + + # Attributes of an org authorized client. + attr_reader :attributes + + # The unique identifier of the org authorized client. + attr_reader :id + + # Relationships for an org authorized client. + attr_reader :relationships + + # The resource type for org authorized clients. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgAuthorizedClientAttributes', + :'id' => :'String', + :'relationships' => :'OrgAuthorizedClientRelationships', + :'type' => :'OrgAuthorizedClientType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client.rb new file mode 100644 index 000000000000..c80044108ff5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the OAuth2 client for this org authorized client. + class OrgAuthorizedClientRelationshipOAuth2Client + include BaseGenericModel + + # Data identifying the OAuth2 client associated with this org authorized client. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgAuthorizedClientRelationshipOAuth2ClientData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationshipOAuth2Client` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data.rb new file mode 100644 index 000000000000..45ea7fa4baa0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data identifying the OAuth2 client associated with this org authorized client. + class OrgAuthorizedClientRelationshipOAuth2ClientData + include BaseGenericModel + + # The ID of the OAuth2 client. + attr_reader :id + + # OAuth2 client resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'OrgAuthorizedClientRelationshipOAuth2ClientDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationshipOAuth2ClientData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data_type.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data_type.rb new file mode 100644 index 000000000000..fd94f4697bd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_o_auth2_client_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth2 client resource type. + class OrgAuthorizedClientRelationshipOAuth2ClientDataType + include BaseEnumModel + + OAUTH2_CLIENTS = "oauth2_clients".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients.rb new file mode 100644 index 000000000000..47c336dcec96 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the user authorized clients for this org authorized client. + class OrgAuthorizedClientRelationshipUserAuthorizedClients + include BaseGenericModel + + # List of user authorized client relationship data objects. + attr_reader :data + + # Links for the user authorized clients relationship. + attr_reader :links + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationshipUserAuthorizedClients` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data.rb new file mode 100644 index 000000000000..f1664e715c5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data identifying a user authorized client. + class OrgAuthorizedClientRelationshipUserAuthorizedClientsData + include BaseGenericModel + + # The ID of the user authorized client. + attr_reader :id + + # User authorized client resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationshipUserAuthorizedClientsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data_type.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data_type.rb new file mode 100644 index 000000000000..99bdc4cfefcc --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User authorized client resource type. + class OrgAuthorizedClientRelationshipUserAuthorizedClientsDataType + include BaseEnumModel + + USER_AUTHORIZED_CLIENTS = "user_authorized_clients".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_links.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_links.rb new file mode 100644 index 000000000000..98d4f18292ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationship_user_authorized_clients_links.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Links for the user authorized clients relationship. + class OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks + include BaseGenericModel + + # Link to the user authorized clients for this org authorized client. + attr_reader :related + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'related' => :'related' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'related' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationshipUserAuthorizedClientsLinks` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'related') + self.related = attributes[:'related'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @related.nil? + true + end + + # Custom attribute writer method with validation + # @param related [Object] Object to be assigned + # @!visibility private + def related=(related) + if related.nil? + fail ArgumentError, 'invalid value for "related", related cannot be nil.' + end + @related = related + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + related == o.related && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [related, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_relationships.rb b/lib/datadog_api_client/v2/models/org_authorized_client_relationships.rb new file mode 100644 index 000000000000..17eeec0c7bcf --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an org authorized client. + class OrgAuthorizedClientRelationships + include BaseGenericModel + + # Relationship to the OAuth2 client for this org authorized client. + attr_reader :oauth2_client + + # Relationship to the user authorized clients for this org authorized client. + attr_reader :user_authorized_clients + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oauth2_client' => :'oauth2_client', + :'user_authorized_clients' => :'user_authorized_clients' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oauth2_client' => :'OrgAuthorizedClientRelationshipOAuth2Client', + :'user_authorized_clients' => :'OrgAuthorizedClientRelationshipUserAuthorizedClients' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oauth2_client') + self.oauth2_client = attributes[:'oauth2_client'] + end + + if attributes.key?(:'user_authorized_clients') + self.user_authorized_clients = attributes[:'user_authorized_clients'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @oauth2_client.nil? + return false if @user_authorized_clients.nil? + true + end + + # Custom attribute writer method with validation + # @param oauth2_client [Object] Object to be assigned + # @!visibility private + def oauth2_client=(oauth2_client) + if oauth2_client.nil? + fail ArgumentError, 'invalid value for "oauth2_client", oauth2_client cannot be nil.' + end + @oauth2_client = oauth2_client + end + + # Custom attribute writer method with validation + # @param user_authorized_clients [Object] Object to be assigned + # @!visibility private + def user_authorized_clients=(user_authorized_clients) + if user_authorized_clients.nil? + fail ArgumentError, 'invalid value for "user_authorized_clients", user_authorized_clients cannot be nil.' + end + @user_authorized_clients = user_authorized_clients + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oauth2_client == o.oauth2_client && + user_authorized_clients == o.user_authorized_clients && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oauth2_client, user_authorized_clients, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_response.rb b/lib/datadog_api_client/v2/models/org_authorized_client_response.rb new file mode 100644 index 000000000000..4adeb2b7ae95 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single org authorized client. + class OrgAuthorizedClientResponse + include BaseGenericModel + + # Data object representing an org authorized client. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgAuthorizedClientData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_type.rb b/lib/datadog_api_client/v2/models/org_authorized_client_type.rb new file mode 100644 index 000000000000..ec01638e269d --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for org authorized clients. + class OrgAuthorizedClientType + include BaseEnumModel + + ORG_AUTHORIZED_CLIENTS = "org_authorized_clients".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_update_attributes.rb b/lib/datadog_api_client/v2/models/org_authorized_client_update_attributes.rb new file mode 100644 index 000000000000..bfea82714f03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_update_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an org authorized client. + class OrgAuthorizedClientUpdateAttributes + include BaseGenericModel + + # Whether to disable or enable this client for the organization. + attr_accessor :disabled + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'disabled' => :'disabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'disabled' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'disabled') + self.disabled = attributes[:'disabled'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + disabled == o.disabled && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [disabled, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_update_data.rb b/lib/datadog_api_client/v2/models/org_authorized_client_update_data.rb new file mode 100644 index 000000000000..3a9a08af91eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_update_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating an org authorized client. + class OrgAuthorizedClientUpdateData + include BaseGenericModel + + # Attributes for updating an org authorized client. + attr_accessor :attributes + + # The unique identifier of the org authorized client to update. + attr_reader :id + + # The resource type for org authorized clients. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgAuthorizedClientUpdateAttributes', + :'id' => :'String', + :'type' => :'OrgAuthorizedClientType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_update_request.rb b/lib/datadog_api_client/v2/models/org_authorized_client_update_request.rb new file mode 100644 index 000000000000..c4cae60fab4f --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating an org authorized client. + class OrgAuthorizedClientUpdateRequest + include BaseGenericModel + + # Data object for updating an org authorized client. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgAuthorizedClientUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_client_user_authorizations_sort.rb b/lib/datadog_api_client/v2/models/org_authorized_client_user_authorizations_sort.rb new file mode 100644 index 000000000000..8480da86208d --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_client_user_authorizations_sort.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Field to sort user authorizations by. + class OrgAuthorizedClientUserAuthorizationsSort + include BaseEnumModel + + USER_NAME = "user.name".freeze + USER_EMAIL = "user.email".freeze + OAUTH2_CLIENT_NAME = "oauth2_client.name".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_authorized_clients_response.rb b/lib/datadog_api_client/v2/models/org_authorized_clients_response.rb new file mode 100644 index 000000000000..bb7590b48d8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_authorized_clients_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of org authorized clients. + class OrgAuthorizedClientsResponse + include BaseGenericModel + + # List of org authorized client data objects. + attr_reader :data + + # Object describing meta attributes of response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ResponseMetaAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgAuthorizedClientsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_user_identity_providers_request.rb b/lib/datadog_api_client/v2/models/update_user_identity_providers_request.rb new file mode 100644 index 000000000000..10b7b86da89c --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_user_identity_providers_request.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for setting identity provider overrides for a user. + class UpdateUserIdentityProvidersRequest + include BaseGenericModel + + # List of identity provider resource identifiers for a relationship update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateUserIdentityProvidersRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_attributes.rb b/lib/datadog_api_client/v2/models/user_authorized_client_attributes.rb new file mode 100644 index 000000000000..72e951960ce2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_attributes.rb @@ -0,0 +1,204 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a user authorized client. + class UserAuthorizedClientAttributes + include BaseGenericModel + + # The date and time this authorization was created. + attr_reader :created_at + + # Whether the user has disabled this authorization. + attr_reader :disabled + + # The date and time this authorization was last exercised. + attr_accessor :last_exercised + + # The date and time this authorization was last modified. + attr_reader :modified_at + + # Whether the organization has disabled this authorization. + attr_reader :org_disabled + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'disabled' => :'disabled', + :'last_exercised' => :'last_exercised', + :'modified_at' => :'modified_at', + :'org_disabled' => :'org_disabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'disabled' => :'Boolean', + :'last_exercised' => :'Time', + :'modified_at' => :'Time', + :'org_disabled' => :'Boolean' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last_exercised', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'disabled') + self.disabled = attributes[:'disabled'] + end + + if attributes.key?(:'last_exercised') + self.last_exercised = attributes[:'last_exercised'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'org_disabled') + self.org_disabled = attributes[:'org_disabled'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @disabled.nil? + return false if @modified_at.nil? + return false if @org_disabled.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param disabled [Object] Object to be assigned + # @!visibility private + def disabled=(disabled) + if disabled.nil? + fail ArgumentError, 'invalid value for "disabled", disabled cannot be nil.' + end + @disabled = disabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param org_disabled [Object] Object to be assigned + # @!visibility private + def org_disabled=(org_disabled) + if org_disabled.nil? + fail ArgumentError, 'invalid value for "org_disabled", org_disabled cannot be nil.' + end + @org_disabled = org_disabled + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + disabled == o.disabled && + last_exercised == o.last_exercised && + modified_at == o.modified_at && + org_disabled == o.org_disabled && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, disabled, last_exercised, modified_at, org_disabled, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_data.rb b/lib/datadog_api_client/v2/models/user_authorized_client_data.rb new file mode 100644 index 000000000000..c24da44dde25 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object representing a user authorized client. + class UserAuthorizedClientData + include BaseGenericModel + + # Attributes of a user authorized client. + attr_reader :attributes + + # The unique identifier of the user authorized client. + attr_reader :id + + # Relationships for a user authorized client. + attr_reader :relationships + + # The resource type for user authorized clients. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UserAuthorizedClientAttributes', + :'id' => :'String', + :'relationships' => :'UserAuthorizedClientRelationships', + :'type' => :'UserAuthorizedClientType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client.rb new file mode 100644 index 000000000000..da1712e964f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the OAuth2 client that was authorized. + class UserAuthorizedClientRelationshipOAuth2Client + include BaseGenericModel + + # Data identifying the OAuth2 client that was authorized. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UserAuthorizedClientRelationshipOAuth2ClientData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipOAuth2Client` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data.rb new file mode 100644 index 000000000000..42ba1d318f38 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data identifying the OAuth2 client that was authorized. + class UserAuthorizedClientRelationshipOAuth2ClientData + include BaseGenericModel + + # The ID of the OAuth2 client. + attr_reader :id + + # OAuth2 client resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserAuthorizedClientRelationshipOAuth2ClientDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipOAuth2ClientData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data_type.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data_type.rb new file mode 100644 index 000000000000..54c244a53348 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_o_auth2_client_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth2 client resource type. + class UserAuthorizedClientRelationshipOAuth2ClientDataType + include BaseEnumModel + + OAUTH2_CLIENTS = "oauth2_clients".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data.rb new file mode 100644 index 000000000000..4931237b0f9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data identifying a scope granted to the OAuth2 client. + class UserAuthorizedClientRelationshipScopeData + include BaseGenericModel + + # The identifier of the scope. + attr_reader :id + + # Scope resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserAuthorizedClientRelationshipScopeDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipScopeData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data_type.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data_type.rb new file mode 100644 index 000000000000..a8fd26781ee1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scope_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scope resource type. + class UserAuthorizedClientRelationshipScopeDataType + include BaseEnumModel + + SCOPES = "scopes".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scopes.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scopes.rb new file mode 100644 index 000000000000..b95204a0d79d --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_scopes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the scopes granted to the OAuth2 client. + class UserAuthorizedClientRelationshipScopes + include BaseGenericModel + + # List of scope relationship data objects. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipScopes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user.rb new file mode 100644 index 000000000000..b1ef2da75a0e --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the user who granted this authorization. + class UserAuthorizedClientRelationshipUser + include BaseGenericModel + + # Data identifying the user who granted this authorization. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UserAuthorizedClientRelationshipUserData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data.rb new file mode 100644 index 000000000000..8737fa0e0082 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data identifying the user who granted this authorization. + class UserAuthorizedClientRelationshipUserData + include BaseGenericModel + + # The ID of the user. + attr_reader :id + + # User resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserAuthorizedClientRelationshipUserDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationshipUserData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data_type.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data_type.rb new file mode 100644 index 000000000000..5964c86513c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationship_user_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User resource type. + class UserAuthorizedClientRelationshipUserDataType + include BaseEnumModel + + USERS = "users".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_relationships.rb b/lib/datadog_api_client/v2/models/user_authorized_client_relationships.rb new file mode 100644 index 000000000000..92cc4b7c503b --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_relationships.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a user authorized client. + class UserAuthorizedClientRelationships + include BaseGenericModel + + # Relationship to the OAuth2 client that was authorized. + attr_reader :oauth2_client + + # Relationship to the scopes granted to the OAuth2 client. + attr_reader :scopes + + # Relationship to the user who granted this authorization. + attr_reader :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oauth2_client' => :'oauth2_client', + :'scopes' => :'scopes', + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oauth2_client' => :'UserAuthorizedClientRelationshipOAuth2Client', + :'scopes' => :'UserAuthorizedClientRelationshipScopes', + :'user' => :'UserAuthorizedClientRelationshipUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oauth2_client') + self.oauth2_client = attributes[:'oauth2_client'] + end + + if attributes.key?(:'scopes') + self.scopes = attributes[:'scopes'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @oauth2_client.nil? + return false if @scopes.nil? + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param oauth2_client [Object] Object to be assigned + # @!visibility private + def oauth2_client=(oauth2_client) + if oauth2_client.nil? + fail ArgumentError, 'invalid value for "oauth2_client", oauth2_client cannot be nil.' + end + @oauth2_client = oauth2_client + end + + # Custom attribute writer method with validation + # @param scopes [Object] Object to be assigned + # @!visibility private + def scopes=(scopes) + if scopes.nil? + fail ArgumentError, 'invalid value for "scopes", scopes cannot be nil.' + end + @scopes = scopes + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oauth2_client == o.oauth2_client && + scopes == o.scopes && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oauth2_client, scopes, user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_response.rb b/lib/datadog_api_client/v2/models/user_authorized_client_response.rb new file mode 100644 index 000000000000..ddc319a52735 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single user authorized client. + class UserAuthorizedClientResponse + include BaseGenericModel + + # Data object representing a user authorized client. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UserAuthorizedClientData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_client_type.rb b/lib/datadog_api_client/v2/models/user_authorized_client_type.rb new file mode 100644 index 000000000000..92547a812f14 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_client_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for user authorized clients. + class UserAuthorizedClientType + include BaseEnumModel + + USER_AUTHORIZED_CLIENTS = "user_authorized_clients".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_authorized_clients_response.rb b/lib/datadog_api_client/v2/models/user_authorized_clients_response.rb new file mode 100644 index 000000000000..7329e4e72b45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_authorized_clients_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of user authorized clients. + class UserAuthorizedClientsResponse + include BaseGenericModel + + # List of user authorized client data objects. + attr_reader :data + + # Object describing meta attributes of response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ResponseMetaAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserAuthorizedClientsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_override_identity_provider_attributes.rb b/lib/datadog_api_client/v2/models/user_override_identity_provider_attributes.rb new file mode 100644 index 000000000000..49c6637e194b --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_override_identity_provider_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an identity provider override for a user. + class UserOverrideIdentityProviderAttributes + include BaseGenericModel + + # The authentication method used by this identity provider. + attr_reader :authentication_method + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'authentication_method' => :'authentication_method' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'authentication_method' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserOverrideIdentityProviderAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'authentication_method') + self.authentication_method = attributes[:'authentication_method'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @authentication_method.nil? + true + end + + # Custom attribute writer method with validation + # @param authentication_method [Object] Object to be assigned + # @!visibility private + def authentication_method=(authentication_method) + if authentication_method.nil? + fail ArgumentError, 'invalid value for "authentication_method", authentication_method cannot be nil.' + end + @authentication_method = authentication_method + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + authentication_method == o.authentication_method && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [authentication_method, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_override_identity_provider_data.rb b/lib/datadog_api_client/v2/models/user_override_identity_provider_data.rb new file mode 100644 index 000000000000..a72f6f90f0bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_override_identity_provider_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object representing a user identity provider override. + class UserOverrideIdentityProviderData + include BaseGenericModel + + # Attributes of an identity provider override for a user. + attr_reader :attributes + + # The unique identifier of the identity provider. + attr_reader :id + + # The resource type for identity providers. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UserOverrideIdentityProviderAttributes', + :'id' => :'String', + :'type' => :'UserOverrideIdentityProviderDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserOverrideIdentityProviderData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_override_identity_provider_data_type.rb b/lib/datadog_api_client/v2/models/user_override_identity_provider_data_type.rb new file mode 100644 index 000000000000..a98c7dbbf080 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_override_identity_provider_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for identity providers. + class UserOverrideIdentityProviderDataType + include BaseEnumModel + + IDENTITY_PROVIDERS = "identity_providers".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_override_identity_providers_response.rb b/lib/datadog_api_client/v2/models/user_override_identity_providers_response.rb new file mode 100644 index 000000000000..3475322f70aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_override_identity_providers_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a user's identity provider overrides. + class UserOverrideIdentityProvidersResponse + include BaseGenericModel + + # List of user identity provider override data objects. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserOverrideIdentityProvidersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data.rb b/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data.rb new file mode 100644 index 000000000000..fc82b2f83ab0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource identifier for an identity provider in a relationship update. + class UserRelationshipIdentityProviderData + include BaseGenericModel + + # The unique identifier of the identity provider. + attr_reader :id + + # The resource type for identity providers. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserRelationshipIdentityProviderDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserRelationshipIdentityProviderData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data_type.rb b/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data_type.rb new file mode 100644 index 000000000000..59bd38f8429a --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_relationship_identity_provider_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for identity providers. + class UserRelationshipIdentityProviderDataType + include BaseEnumModel + + IDENTITY_PROVIDERS = "identity_providers".freeze + end +end