diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d58e01cad06e..0040506a5547 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -34701,7 +34701,7 @@ paths: description: |- Validate the monitor provided in the request. - **Note**: Log monitors require an unscoped App Key. + **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. operationId: ValidateMonitor requestBody: content: @@ -35061,7 +35061,10 @@ paths: - monitors_read /api/v1/monitor/{monitor_id}/validate: post: - description: Validate the monitor provided in the request. + description: |- + Validate the monitor provided in the request. + + **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. operationId: ValidateExistingMonitor parameters: - description: The ID of the monitor diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b536eb592f6e..b4cbd81ddfad 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1096,6 +1096,13 @@ components: required: true schema: type: string + OpsgenieAccountIDPathParameter: + description: The UUID of the Opsgenie account. + in: path + name: account_id + required: true + schema: + type: string OpsgenieServiceIDPathParameter: description: The UUID of the service. in: path @@ -1720,6 +1727,13 @@ components: required: true schema: type: string + StatuspageUrlSettingIDPathParameter: + description: The UUID of the Statuspage URL setting. + in: path + name: statuspage_url_setting_id + required: true + schema: + type: string TagKey: description: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, `kubernetes/instance`). in: path @@ -1770,6 +1784,21 @@ components: required: true schema: type: string + WebhooksAuthMethodIDPathParameter: + description: The UUID of the auth method. + in: path + name: auth_method_id + required: true + schema: + type: string + WebhooksAuthMethodInclude: + description: Comma-separated list of relationships to include in the response. + explode: true + in: query + name: include + required: false + schema: + $ref: "#/components/schemas/WebhooksAuthMethodProtocol" WorkflowId: description: The ID of the workflow. in: path @@ -62089,6 +62118,129 @@ components: format: binary type: string type: object + OpsgenieAccountCreateAttributes: + description: The Opsgenie account attributes for a create request. + properties: + api_key: + description: The Opsgenie API key for your Opsgenie account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + region: + $ref: "#/components/schemas/OpsgenieServiceRegionType" + required: + - api_key + - region + type: object + OpsgenieAccountCreateData: + description: Opsgenie account data for a create request. + properties: + attributes: + $ref: "#/components/schemas/OpsgenieAccountCreateAttributes" + type: + $ref: "#/components/schemas/OpsgenieAccountType" + required: + - type + - attributes + type: object + OpsgenieAccountCreateRequest: + description: Create request for an Opsgenie account. + properties: + data: + $ref: "#/components/schemas/OpsgenieAccountCreateData" + required: + - data + type: object + OpsgenieAccountResponse: + description: Response containing an Opsgenie account. + properties: + data: + $ref: "#/components/schemas/OpsgenieAccountResponseData" + required: + - data + type: object + OpsgenieAccountResponseAttributes: + description: The attributes from an Opsgenie account response. + properties: + region: + $ref: "#/components/schemas/OpsgenieServiceRegionType" + type: object + OpsgenieAccountResponseData: + description: Opsgenie account data from a response. + properties: + attributes: + $ref: "#/components/schemas/OpsgenieAccountResponseAttributes" + id: + description: The ID of the Opsgenie account. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/OpsgenieAccountType" + required: + - id + - type + - attributes + type: object + OpsgenieAccountType: + default: opsgenie-account + description: Opsgenie account resource type. + enum: + - opsgenie-account + example: opsgenie-account + type: string + x-enum-varnames: + - OPSGENIE_ACCOUNT + OpsgenieAccountUpdateAttributes: + description: The Opsgenie account attributes for an update request. + properties: + api_key: + description: The Opsgenie API key for your Opsgenie account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + region: + $ref: "#/components/schemas/OpsgenieServiceRegionType" + type: object + OpsgenieAccountUpdateData: + description: Opsgenie account data for an update request. + properties: + attributes: + $ref: "#/components/schemas/OpsgenieAccountUpdateAttributes" + id: + description: The ID of the Opsgenie account. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/OpsgenieAccountType" + required: + - id + - type + - attributes + type: object + OpsgenieAccountUpdateRequest: + description: Update request for an Opsgenie account. + properties: + data: + $ref: "#/components/schemas/OpsgenieAccountUpdateData" + required: + - data + type: object + OpsgenieAccountsResponse: + description: Response with a list of Opsgenie accounts. + properties: + data: + description: An array of Opsgenie accounts. + example: [{"attributes": {"region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}, {"attributes": {"region": "eu"}, "id": "0d2937f1-b561-44fa-914a-99910f848014", "type": "opsgenie-account"}] + items: + $ref: "#/components/schemas/OpsgenieAccountResponseData" + type: array + required: + - data + type: object OpsgenieServiceCreateAttributes: description: The Opsgenie service attributes for a create request. properties: @@ -84645,6 +84797,235 @@ components: type: string x-enum-varnames: - USERS + StatuspageAccountCreateAttributes: + description: The Statuspage account attributes for a create request. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + required: + - api_key + type: object + StatuspageAccountCreateData: + description: Statuspage account data for a create request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountCreateAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountCreateRequest: + description: Create request for a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountCreateData" + required: + - data + type: object + StatuspageAccountResponse: + description: Response containing a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountResponseData" + required: + - data + type: object + StatuspageAccountResponseAttributes: + description: The attributes from a Statuspage account response. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. The value is always returned masked. + example: "*****" + type: string + type: object + StatuspageAccountResponseData: + description: Statuspage account data from a response. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountResponseAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountType: + default: statuspage-account + description: Statuspage account resource type. + enum: + - statuspage-account + example: statuspage-account + type: string + x-enum-varnames: + - STATUSPAGE_ACCOUNT + StatuspageAccountUpdateAttributes: + description: The Statuspage account attributes for an update request. + properties: + api_key: + description: The Statuspage API key for your Statuspage account. + example: "00000000-0000-0000-0000-000000000000" + minLength: 1 + type: string + type: object + StatuspageAccountUpdateData: + description: Statuspage account data for an update request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageAccountUpdateAttributes" + type: + $ref: "#/components/schemas/StatuspageAccountType" + required: + - type + - attributes + type: object + StatuspageAccountUpdateRequest: + description: Update request for a Statuspage account. + properties: + data: + $ref: "#/components/schemas/StatuspageAccountUpdateData" + required: + - data + type: object + StatuspageUrlSettingCreateAttributes: + description: The Statuspage URL setting attributes for a create request. + properties: + custom_tags: + description: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + minLength: 1 + type: string + url: + description: The Statuspage URL to monitor. Must be a `status.io` or `statuspage.com` URL. + example: "https://example.statuspage.io" + minLength: 1 + type: string + required: + - url + - custom_tags + type: object + StatuspageUrlSettingCreateData: + description: Statuspage URL setting data for a create request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingCreateAttributes" + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - type + - attributes + type: object + StatuspageUrlSettingCreateRequest: + description: Create request for a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingCreateData" + required: + - data + type: object + StatuspageUrlSettingResponse: + description: Response containing a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingResponseData" + required: + - data + type: object + StatuspageUrlSettingResponseAttributes: + description: The attributes from a Statuspage URL setting response. + properties: + custom_tags: + description: Comma-separated list of custom tags applied to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + type: string + url: + description: The Statuspage URL being monitored. + example: "https://example.statuspage.io" + type: string + type: object + StatuspageUrlSettingResponseData: + description: Statuspage URL setting data from a response. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingResponseAttributes" + id: + description: The ID of the Statuspage URL setting. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - id + - type + - attributes + type: object + StatuspageUrlSettingType: + default: statuspage-url-setting + description: Statuspage URL setting resource type. + enum: + - statuspage-url-setting + example: statuspage-url-setting + type: string + x-enum-varnames: + - STATUSPAGE_URL_SETTING + StatuspageUrlSettingUpdateAttributes: + description: The Statuspage URL setting attributes for an update request. + properties: + custom_tags: + description: Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + example: "team:collaboration-integrations,env:prod" + minLength: 1 + type: string + url: + description: The Statuspage URL to monitor. + example: "https://example.statuspage.io" + minLength: 1 + type: string + type: object + StatuspageUrlSettingUpdateData: + description: Statuspage URL setting data for an update request. + properties: + attributes: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateAttributes" + id: + description: The ID of the Statuspage URL setting. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/StatuspageUrlSettingType" + required: + - id + - type + - attributes + type: object + StatuspageUrlSettingUpdateRequest: + description: Update request for a Statuspage URL setting. + properties: + data: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateData" + required: + - data + type: object + StatuspageUrlSettingsResponse: + description: Response with a list of Statuspage URL settings. + properties: + data: + description: An array of Statuspage URL settings. + example: [{"attributes": {"custom_tags": "team:collaboration-integrations", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}] + items: + $ref: "#/components/schemas/StatuspageUrlSettingResponseData" + type: array + required: + - data + type: object Step: description: A Step is a sub-component of a workflow. Each Step performs an action. properties: @@ -95966,6 +96347,277 @@ components: $ref: "#/components/schemas/WebIntegrationAccountResponseData" type: array type: object + WebhooksAuthMethodAttributes: + description: Attributes of a webhooks auth method. + properties: + protocol: + $ref: "#/components/schemas/WebhooksAuthMethodProtocol" + type: object + WebhooksAuthMethodProtocol: + description: Authentication protocol used by the auth method. + enum: + - oauth2-client-credentials + example: oauth2-client-credentials + type: string + x-enum-varnames: + - OAUTH2_CLIENT_CREDENTIALS + WebhooksAuthMethodRelationships: + description: Relationships of a webhooks auth method to its protocol-specific resource. + properties: + oauth2-client-credentials: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsRelationship" + type: object + WebhooksAuthMethodResponseData: + description: Webhooks auth method data from a response. + properties: + attributes: + $ref: "#/components/schemas/WebhooksAuthMethodAttributes" + id: + description: The ID of the auth method. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + type: string + relationships: + $ref: "#/components/schemas/WebhooksAuthMethodRelationships" + type: + $ref: "#/components/schemas/WebhooksAuthMethodType" + required: + - id + - type + - attributes + type: object + WebhooksAuthMethodType: + default: webhooks-auth-method + description: Webhooks auth method resource type. + enum: + - webhooks-auth-method + example: webhooks-auth-method + type: string + x-enum-varnames: + - WEBHOOKS_AUTH_METHOD + WebhooksAuthMethodsResponse: + description: Response containing a list of webhooks auth methods. + properties: + data: + description: An array of webhooks auth methods. + items: + $ref: "#/components/schemas/WebhooksAuthMethodResponseData" + type: array + included: + description: Resources related to the auth methods, included when requested via the `include` query parameter. + items: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponseData" + type: array + required: + - data + type: object + WebhooksOAuth2ClientCredentialsCreateAttributes: + description: OAuth2 client credentials attributes for a create request. + properties: + access_token_url: + description: URL of the OAuth2 access token endpoint. + example: "https://example.com/oauth/token" + maxLength: 2048 + minLength: 1 + type: string + audience: + description: The intended audience for the OAuth2 access token. + example: "https://api.example.com" + maxLength: 2048 + minLength: 1 + nullable: true + type: string + client_id: + description: The OAuth2 client ID issued by the authorization server. + example: "my-client-id" + maxLength: 2048 + minLength: 1 + type: string + client_secret: + description: |- + The OAuth2 client secret issued by the authorization server. + Write-only; never returned by the API. + example: "my-client-secret" + maxLength: 2048 + minLength: 1 + type: string + name: + description: Human-readable name for this auth method. Must be unique within your organization. + example: "my-oauth2-auth" + maxLength: 100 + minLength: 1 + type: string + scope: + description: Space-separated list of OAuth2 scopes to request. + example: "read:webhooks write:webhooks" + maxLength: 2048 + minLength: 1 + nullable: true + type: string + required: + - name + - access_token_url + - client_id + - client_secret + type: object + WebhooksOAuth2ClientCredentialsCreateData: + description: OAuth2 client credentials data for a create request. + properties: + attributes: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsCreateAttributes" + type: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsType" + required: + - type + - attributes + type: object + WebhooksOAuth2ClientCredentialsCreateRequest: + description: Create request for an OAuth2 client credentials auth method. + properties: + data: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsCreateData" + required: + - data + type: object + WebhooksOAuth2ClientCredentialsRelationship: + description: Relationship pointing to the OAuth2 client credentials resource for this auth method. + properties: + data: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsRelationshipData" + type: object + WebhooksOAuth2ClientCredentialsRelationshipData: + description: Relationship data referencing an OAuth2 client credentials resource. + properties: + id: + description: The ID of the OAuth2 client credentials resource. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + type: string + type: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsType" + type: object + WebhooksOAuth2ClientCredentialsResponse: + description: Response containing an OAuth2 client credentials auth method. + properties: + data: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponseData" + required: + - data + type: object + WebhooksOAuth2ClientCredentialsResponseAttributes: + description: OAuth2 client credentials attributes returned by the API. The `client_secret` is never echoed. + properties: + access_token_url: + description: URL of the OAuth2 access token endpoint. + example: "https://example.com/oauth/token" + type: string + audience: + description: The intended audience for the OAuth2 access token. + example: "https://api.example.com" + nullable: true + type: string + client_id: + description: The OAuth2 client ID issued by the authorization server. + example: "my-client-id" + type: string + name: + description: Human-readable name for this auth method. + example: "my-oauth2-auth" + type: string + protocol: + $ref: "#/components/schemas/WebhooksAuthMethodProtocol" + scope: + description: Space-separated list of OAuth2 scopes to request. + example: "read:webhooks write:webhooks" + nullable: true + type: string + type: object + WebhooksOAuth2ClientCredentialsResponseData: + description: OAuth2 client credentials data from a response. + properties: + attributes: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponseAttributes" + id: + description: The ID of the OAuth2 client credentials auth method. + example: "596da4af-0563-4097-90ff-07230c3f9db3" + type: string + type: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsType" + required: + - id + - type + - attributes + type: object + WebhooksOAuth2ClientCredentialsType: + default: webhooks-auth-method-oauth2-client-credentials + description: OAuth2 client credentials resource type. + enum: + - webhooks-auth-method-oauth2-client-credentials + example: webhooks-auth-method-oauth2-client-credentials + type: string + x-enum-varnames: + - WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS + WebhooksOAuth2ClientCredentialsUpdateAttributes: + description: OAuth2 client credentials attributes for an update request. + properties: + access_token_url: + description: URL of the OAuth2 access token endpoint. + example: "https://example.com/oauth/token" + maxLength: 2048 + minLength: 1 + type: string + audience: + description: The intended audience for the OAuth2 access token. + example: "https://api.example.com" + maxLength: 2048 + minLength: 1 + nullable: true + type: string + client_id: + description: The OAuth2 client ID issued by the authorization server. + example: "my-client-id" + maxLength: 2048 + minLength: 1 + type: string + client_secret: + description: |- + The OAuth2 client secret issued by the authorization server. + Write-only; never returned by the API. + example: "my-client-secret" + maxLength: 2048 + minLength: 1 + type: string + name: + description: Human-readable name for this auth method. + example: "my-oauth2-auth" + maxLength: 100 + minLength: 1 + type: string + scope: + description: Space-separated list of OAuth2 scopes to request. + example: "read:webhooks write:webhooks" + maxLength: 2048 + minLength: 1 + nullable: true + type: string + type: object + WebhooksOAuth2ClientCredentialsUpdateData: + description: OAuth2 client credentials data for an update request. + properties: + attributes: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsUpdateAttributes" + type: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsType" + required: + - type + - attributes + type: object + WebhooksOAuth2ClientCredentialsUpdateRequest: + description: Update request for an OAuth2 client credentials auth method. + properties: + data: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsUpdateData" + required: + - data + type: object Weekday: description: A day of the week. enum: @@ -125697,6 +126349,161 @@ paths: summary: Update tenancy config tags: - OCI Integration + /api/v2/integration/opsgenie/accounts: + get: + description: Get a list of all Opsgenie accounts from the Datadog Opsgenie integration. + operationId: ListOpsgenieAccounts + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + region: us + id: 00000000-0000-0000-0000-000000000001 + type: opsgenie-account + schema: + $ref: "#/components/schemas/OpsgenieAccountsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Opsgenie accounts + tags: + - Opsgenie Integration + "x-permission": + operator: OR + permissions: + - integrations_read + post: + description: Create a new Opsgenie account in the Datadog Opsgenie integration. + operationId: CreateOpsgenieAccount + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + region: us + type: opsgenie-account + schema: + $ref: "#/components/schemas/OpsgenieAccountCreateRequest" + description: Opsgenie account payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + region: us + id: 00000000-0000-0000-0000-000000000002 + type: opsgenie-account + schema: + $ref: "#/components/schemas/OpsgenieAccountResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a new Opsgenie account + tags: + - Opsgenie Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/opsgenie/accounts/{account_id}: + delete: + description: Delete a single Opsgenie account from the Datadog Opsgenie integration. + operationId: DeleteOpsgenieAccount + parameters: + - $ref: "#/components/parameters/OpsgenieAccountIDPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an Opsgenie account + tags: + - Opsgenie Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + patch: + description: Update a single Opsgenie account in the Datadog Opsgenie integration. + operationId: UpdateOpsgenieAccount + parameters: + - $ref: "#/components/parameters/OpsgenieAccountIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + region: us + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: opsgenie-account + schema: + $ref: "#/components/schemas/OpsgenieAccountUpdateRequest" + description: Opsgenie account payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + region: us + id: 00000000-0000-0000-0000-000000000003 + type: opsgenie-account + schema: + $ref: "#/components/schemas/OpsgenieAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + $ref: "#/components/responses/UnprocessableEntityResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an Opsgenie account + tags: + - Opsgenie Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. @@ -126309,6 +127116,533 @@ paths: summary: List ServiceNow users tags: - ServiceNow Integration + /api/v2/integration/statuspage/account: + delete: + description: Delete the Statuspage account configured for your organization. + operationId: DeleteStatuspageAccount + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete the Statuspage account + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + get: + description: Get the Statuspage account configured for your organization. + operationId: GetStatuspageAccount + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the Statuspage account + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - integrations_read + patch: + description: Update the Statuspage account configured for your organization. + operationId: UpdateStatuspageAccount + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountUpdateRequest" + description: Statuspage account payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update the Statuspage account + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + post: + description: |- + Create a Statuspage account for your organization. Only one Statuspage + account can be configured per organization. + operationId: CreateStatuspageAccount + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: 00000000-0000-0000-0000-000000000000 + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountCreateRequest" + description: Statuspage account payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "*****" + type: statuspage-account + schema: + $ref: "#/components/schemas/StatuspageAccountResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create the Statuspage account + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/statuspage/url_settings: + get: + description: Get all Statuspage URL settings configured for your organization. + operationId: ListStatuspageUrlSettings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000001 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Statuspage URL settings + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - integrations_read + post: + description: Create a Statuspage URL setting for your organization. + operationId: CreateStatuspageUrlSetting + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingCreateRequest" + description: Statuspage URL setting payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000002 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a Statuspage URL setting + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}: + delete: + description: Delete a single Statuspage URL setting from your organization. + operationId: DeleteStatuspageUrlSetting + parameters: + - $ref: "#/components/parameters/StatuspageUrlSettingIDPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a Statuspage URL setting + tags: + - Statuspage Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + patch: + description: Update a single Statuspage URL setting in your organization. + operationId: UpdateStatuspageUrlSetting + parameters: + - $ref: "#/components/parameters/StatuspageUrlSettingIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingUpdateRequest" + description: Statuspage URL setting payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom_tags: "team:collaboration-integrations" + url: "https://example.statuspage.io" + id: 00000000-0000-0000-0000-000000000003 + type: statuspage-url-setting + schema: + $ref: "#/components/schemas/StatuspageUrlSettingResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a Statuspage URL setting + tags: + - Statuspage Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/webhooks/configuration/auth-method: + get: + description: |- + Get a list of all auth methods configured for the Webhooks integration in + your organization. + operationId: GetAllAuthMethods + parameters: + - $ref: "#/components/parameters/WebhooksAuthMethodInclude" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + protocol: oauth2-client-credentials + id: 00000000-0000-0000-0000-000000000001 + relationships: + oauth2-client-credentials: + data: + id: 00000000-0000-0000-0000-000000000001 + type: webhooks-auth-method-oauth2-client-credentials + type: webhooks-auth-method + schema: + $ref: "#/components/schemas/WebhooksAuthMethodsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all auth methods + tags: + - Webhooks Integration + "x-permission": + operator: OR + permissions: + - integrations_read + /api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials: + post: + description: |- + Create a new OAuth2 client credentials auth method for the Webhooks + integration. The `client_secret` is stored securely and never returned. + operationId: CreateOAuth2ClientCredentials + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + access_token_url: https://example.com/oauth/token + audience: https://api.example.com + client_id: my-client-id + client_secret: my-client-secret + name: my-oauth2-auth + scope: read:webhooks write:webhooks + type: webhooks-auth-method-oauth2-client-credentials + schema: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsCreateRequest" + description: OAuth2 client credentials payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + access_token_url: https://example.com/oauth/token + audience: https://api.example.com + client_id: my-client-id + name: my-oauth2-auth + protocol: oauth2-client-credentials + scope: read:webhooks write:webhooks + id: 00000000-0000-0000-0000-000000000002 + type: webhooks-auth-method-oauth2-client-credentials + schema: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create an OAuth2 client credentials auth method + tags: + - Webhooks Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations + /api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials/{auth_method_id}: + delete: + description: Delete an OAuth2 client credentials auth method by ID. + operationId: DeleteOAuth2ClientCredentials + parameters: + - $ref: "#/components/parameters/WebhooksAuthMethodIDPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an OAuth2 client credentials auth method + tags: + - Webhooks Integration + "x-permission": + operator: OR + permissions: + - manage_integrations + get: + description: Get a single OAuth2 client credentials auth method by ID. + operationId: GetOAuth2ClientCredentials + parameters: + - $ref: "#/components/parameters/WebhooksAuthMethodIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + access_token_url: https://example.com/oauth/token + audience: https://api.example.com + client_id: my-client-id + name: my-oauth2-auth + protocol: oauth2-client-credentials + scope: read:webhooks write:webhooks + id: 00000000-0000-0000-0000-000000000003 + type: webhooks-auth-method-oauth2-client-credentials + schema: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an OAuth2 client credentials auth method + tags: + - Webhooks Integration + "x-permission": + operator: OR + permissions: + - integrations_read + patch: + description: Update an existing OAuth2 client credentials auth method. + operationId: UpdateOAuth2ClientCredentials + parameters: + - $ref: "#/components/parameters/WebhooksAuthMethodIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-oauth2-auth-renamed + type: webhooks-auth-method-oauth2-client-credentials + schema: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsUpdateRequest" + description: OAuth2 client credentials payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + access_token_url: https://example.com/oauth/token + audience: https://api.example.com + client_id: my-client-id + name: my-oauth2-auth-renamed + protocol: oauth2-client-credentials + scope: read:webhooks write:webhooks + id: 00000000-0000-0000-0000-000000000004 + type: webhooks-auth-method-oauth2-client-credentials + schema: + $ref: "#/components/schemas/WebhooksOAuth2ClientCredentialsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an OAuth2 client credentials auth method + tags: + - Webhooks Integration + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - manage_integrations /api/v2/integrations: get: operationId: ListIntegrations @@ -137285,6 +138619,12 @@ paths: name: tags schema: type: string + - description: Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter. + example: "(client_team:networks OR client_team:platform) AND server_service:hucklebuck" + in: query + name: query + schema: + type: string - description: The number of connections to be returned. The maximum value is 7500. The default is 100. in: query name: limit @@ -137346,6 +138686,12 @@ paths: name: tags schema: type: string + - description: Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter. + example: "(client_team:networks OR client_team:platform) AND server_service:hucklebuck" + in: query + name: query + schema: + type: string - description: The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100. in: query name: limit @@ -171706,6 +173052,12 @@ tags: name: Static Analysis - description: Manage your status pages and communicate service disruptions to stakeholders via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages + - description: |- + Configure your [Datadog Statuspage integration](https://docs.datadoghq.com/integrations/statuspage/) + directly through the Datadog API. + externalDocs: + url: https://docs.datadoghq.com/api/latest/statuspage-integration + name: Statuspage Integration - description: |- Enable Storage Management for S3 buckets, GCS buckets, and Azure containers. Each configuration registers the destination that holds inventory reports for the storage being monitored. name: Storage Management @@ -171746,6 +173098,12 @@ tags: Manage web integration accounts programmatically through the Datadog API. See the [Web Integrations page](https://app.datadoghq.com/integrations) for more information. name: Web Integrations + - description: |- + Configure your [Datadog Webhooks integration](https://docs.datadoghq.com/integrations/webhooks/) + directly through the Datadog API. + externalDocs: + url: https://docs.datadoghq.com/api/latest/webhooks-integration + name: Webhooks Integration - description: |- Create, read, update, and delete saved widgets. Widgets are reusable visualization components stored independently from any dashboard or notebook, diff --git a/examples/v2/opsgenie-integration/CreateOpsgenieAccount.rb b/examples/v2/opsgenie-integration/CreateOpsgenieAccount.rb new file mode 100644 index 000000000000..fdd0193d161b --- /dev/null +++ b/examples/v2/opsgenie-integration/CreateOpsgenieAccount.rb @@ -0,0 +1,15 @@ +# Create a new Opsgenie account returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new + +body = DatadogAPIClient::V2::OpsgenieAccountCreateRequest.new({ + data: DatadogAPIClient::V2::OpsgenieAccountCreateData.new({ + attributes: DatadogAPIClient::V2::OpsgenieAccountCreateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + region: DatadogAPIClient::V2::OpsgenieServiceRegionType::US, + }), + type: DatadogAPIClient::V2::OpsgenieAccountType::OPSGENIE_ACCOUNT, + }), +}) +p api_instance.create_opsgenie_account(body) diff --git a/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.rb b/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.rb new file mode 100644 index 000000000000..c87ac19690af --- /dev/null +++ b/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.rb @@ -0,0 +1,5 @@ +# Delete an Opsgenie account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new +api_instance.delete_opsgenie_account("account_id") diff --git a/examples/v2/opsgenie-integration/ListOpsgenieAccounts.rb b/examples/v2/opsgenie-integration/ListOpsgenieAccounts.rb new file mode 100644 index 000000000000..35e5cada8d12 --- /dev/null +++ b/examples/v2/opsgenie-integration/ListOpsgenieAccounts.rb @@ -0,0 +1,5 @@ +# Get all Opsgenie accounts returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new +p api_instance.list_opsgenie_accounts() diff --git a/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.rb b/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.rb new file mode 100644 index 000000000000..d30e72fde9d2 --- /dev/null +++ b/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.rb @@ -0,0 +1,16 @@ +# Update an Opsgenie account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new + +body = DatadogAPIClient::V2::OpsgenieAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::OpsgenieAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::OpsgenieAccountUpdateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + region: DatadogAPIClient::V2::OpsgenieServiceRegionType::US, + }), + id: "596da4af-0563-4097-90ff-07230c3f9db3", + type: DatadogAPIClient::V2::OpsgenieAccountType::OPSGENIE_ACCOUNT, + }), +}) +p api_instance.update_opsgenie_account("account_id", body) diff --git a/examples/v2/statuspage-integration/CreateStatuspageAccount.rb b/examples/v2/statuspage-integration/CreateStatuspageAccount.rb new file mode 100644 index 000000000000..a820b52dd959 --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageAccount.rb @@ -0,0 +1,14 @@ +# Create the Statuspage account returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageAccountCreateRequest.new({ + data: DatadogAPIClient::V2::StatuspageAccountCreateData.new({ + attributes: DatadogAPIClient::V2::StatuspageAccountCreateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + }), + type: DatadogAPIClient::V2::StatuspageAccountType::STATUSPAGE_ACCOUNT, + }), +}) +p api_instance.create_statuspage_account(body) diff --git a/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb new file mode 100644 index 000000000000..5b1a3a9b239b --- /dev/null +++ b/examples/v2/statuspage-integration/CreateStatuspageUrlSetting.rb @@ -0,0 +1,15 @@ +# Create a Statuspage URL setting returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageUrlSettingCreateRequest.new({ + data: DatadogAPIClient::V2::StatuspageUrlSettingCreateData.new({ + attributes: DatadogAPIClient::V2::StatuspageUrlSettingCreateAttributes.new({ + custom_tags: "team:collaboration-integrations,env:prod", + url: "https://example.statuspage.io", + }), + type: DatadogAPIClient::V2::StatuspageUrlSettingType::STATUSPAGE_URL_SETTING, + }), +}) +p api_instance.create_statuspage_url_setting(body) diff --git a/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb b/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb new file mode 100644 index 000000000000..4b61b71273d1 --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageAccount.rb @@ -0,0 +1,5 @@ +# Delete the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +api_instance.delete_statuspage_account() diff --git a/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb new file mode 100644 index 000000000000..1d6f2fb0d756 --- /dev/null +++ b/examples/v2/statuspage-integration/DeleteStatuspageUrlSetting.rb @@ -0,0 +1,5 @@ +# Delete a Statuspage URL setting returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +api_instance.delete_statuspage_url_setting("statuspage_url_setting_id") diff --git a/examples/v2/statuspage-integration/GetStatuspageAccount.rb b/examples/v2/statuspage-integration/GetStatuspageAccount.rb new file mode 100644 index 000000000000..0d5712920236 --- /dev/null +++ b/examples/v2/statuspage-integration/GetStatuspageAccount.rb @@ -0,0 +1,5 @@ +# Get the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +p api_instance.get_statuspage_account() diff --git a/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb new file mode 100644 index 000000000000..958b44495bc8 --- /dev/null +++ b/examples/v2/statuspage-integration/ListStatuspageUrlSettings.rb @@ -0,0 +1,5 @@ +# Get all Statuspage URL settings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new +p api_instance.list_statuspage_url_settings() diff --git a/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb b/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb new file mode 100644 index 000000000000..23bfd7842bf5 --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageAccount.rb @@ -0,0 +1,14 @@ +# Update the Statuspage account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageAccountUpdateRequest.new({ + data: DatadogAPIClient::V2::StatuspageAccountUpdateData.new({ + attributes: DatadogAPIClient::V2::StatuspageAccountUpdateAttributes.new({ + api_key: "00000000-0000-0000-0000-000000000000", + }), + type: DatadogAPIClient::V2::StatuspageAccountType::STATUSPAGE_ACCOUNT, + }), +}) +p api_instance.update_statuspage_account(body) diff --git a/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb new file mode 100644 index 000000000000..9af250b1aba6 --- /dev/null +++ b/examples/v2/statuspage-integration/UpdateStatuspageUrlSetting.rb @@ -0,0 +1,16 @@ +# Update a Statuspage URL setting returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatuspageIntegrationAPI.new + +body = DatadogAPIClient::V2::StatuspageUrlSettingUpdateRequest.new({ + data: DatadogAPIClient::V2::StatuspageUrlSettingUpdateData.new({ + attributes: DatadogAPIClient::V2::StatuspageUrlSettingUpdateAttributes.new({ + custom_tags: "team:collaboration-integrations,env:prod", + url: "https://example.statuspage.io", + }), + id: "596da4af-0563-4097-90ff-07230c3f9db3", + type: DatadogAPIClient::V2::StatuspageUrlSettingType::STATUSPAGE_URL_SETTING, + }), +}) +p api_instance.update_statuspage_url_setting("statuspage_url_setting_id", body) diff --git a/examples/v2/webhooks-integration/CreateOAuth2ClientCredentials.rb b/examples/v2/webhooks-integration/CreateOAuth2ClientCredentials.rb new file mode 100644 index 000000000000..a068d2861bfd --- /dev/null +++ b/examples/v2/webhooks-integration/CreateOAuth2ClientCredentials.rb @@ -0,0 +1,19 @@ +# Create an OAuth2 client credentials auth method returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new + +body = DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateRequest.new({ + data: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateData.new({ + attributes: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsCreateAttributes.new({ + access_token_url: "https://example.com/oauth/token", + audience: "https://api.example.com", + client_id: "my-client-id", + client_secret: "my-client-secret", + name: "my-oauth2-auth", + scope: "read:webhooks write:webhooks", + }), + type: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsType::WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS, + }), +}) +p api_instance.create_o_auth2_client_credentials(body) diff --git a/examples/v2/webhooks-integration/DeleteOAuth2ClientCredentials.rb b/examples/v2/webhooks-integration/DeleteOAuth2ClientCredentials.rb new file mode 100644 index 000000000000..83c2578a6b27 --- /dev/null +++ b/examples/v2/webhooks-integration/DeleteOAuth2ClientCredentials.rb @@ -0,0 +1,5 @@ +# Delete an OAuth2 client credentials auth method returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new +api_instance.delete_o_auth2_client_credentials("auth_method_id") diff --git a/examples/v2/webhooks-integration/GetAllAuthMethods.rb b/examples/v2/webhooks-integration/GetAllAuthMethods.rb new file mode 100644 index 000000000000..e9d8a4d56fe1 --- /dev/null +++ b/examples/v2/webhooks-integration/GetAllAuthMethods.rb @@ -0,0 +1,5 @@ +# Get all auth methods returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new +p api_instance.get_all_auth_methods() diff --git a/examples/v2/webhooks-integration/GetOAuth2ClientCredentials.rb b/examples/v2/webhooks-integration/GetOAuth2ClientCredentials.rb new file mode 100644 index 000000000000..4592e2b6e606 --- /dev/null +++ b/examples/v2/webhooks-integration/GetOAuth2ClientCredentials.rb @@ -0,0 +1,5 @@ +# Get an OAuth2 client credentials auth method returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new +p api_instance.get_o_auth2_client_credentials("auth_method_id") diff --git a/examples/v2/webhooks-integration/UpdateOAuth2ClientCredentials.rb b/examples/v2/webhooks-integration/UpdateOAuth2ClientCredentials.rb new file mode 100644 index 000000000000..c01ad48b5885 --- /dev/null +++ b/examples/v2/webhooks-integration/UpdateOAuth2ClientCredentials.rb @@ -0,0 +1,19 @@ +# Update an OAuth2 client credentials auth method returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WebhooksIntegrationAPI.new + +body = DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateRequest.new({ + data: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateData.new({ + attributes: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsUpdateAttributes.new({ + access_token_url: "https://example.com/oauth/token", + audience: "https://api.example.com", + client_id: "my-client-id", + client_secret: "my-client-secret", + name: "my-oauth2-auth", + scope: "read:webhooks write:webhooks", + }), + type: DatadogAPIClient::V2::WebhooksOAuth2ClientCredentialsType::WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS, + }), +}) +p api_instance.update_o_auth2_client_credentials("auth_method_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index ead43f1928b4..5f9a7353fd42 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3468,6 +3468,16 @@ "tenancy_ocid" => "String", "body" => "UpdateTenancyConfigRequest", }, + "v2.CreateOpsgenieAccount" => { + "body" => "OpsgenieAccountCreateRequest", + }, + "v2.DeleteOpsgenieAccount" => { + "account_id" => "String", + }, + "v2.UpdateOpsgenieAccount" => { + "account_id" => "String", + "body" => "OpsgenieAccountUpdateRequest", + }, "v2.CreateOpsgenieService" => { "body" => "OpsgenieServiceCreateRequest", }, @@ -3503,6 +3513,38 @@ "v2.ListServiceNowUsers" => { "instance_id" => "UUID", }, + "v2.UpdateStatuspageAccount" => { + "body" => "StatuspageAccountUpdateRequest", + }, + "v2.CreateStatuspageAccount" => { + "body" => "StatuspageAccountCreateRequest", + }, + "v2.CreateStatuspageUrlSetting" => { + "body" => "StatuspageUrlSettingCreateRequest", + }, + "v2.DeleteStatuspageUrlSetting" => { + "statuspage_url_setting_id" => "String", + }, + "v2.UpdateStatuspageUrlSetting" => { + "statuspage_url_setting_id" => "String", + "body" => "StatuspageUrlSettingUpdateRequest", + }, + "v2.GetAllAuthMethods" => { + "include" => "WebhooksAuthMethodProtocol", + }, + "v2.CreateOAuth2ClientCredentials" => { + "body" => "WebhooksOAuth2ClientCredentialsCreateRequest", + }, + "v2.DeleteOAuth2ClientCredentials" => { + "auth_method_id" => "String", + }, + "v2.GetOAuth2ClientCredentials" => { + "auth_method_id" => "String", + }, + "v2.UpdateOAuth2ClientCredentials" => { + "auth_method_id" => "String", + "body" => "WebhooksOAuth2ClientCredentialsUpdateRequest", + }, "v2.CreateCloudflareAccount" => { "body" => "CloudflareAccountCreateRequest", }, @@ -3941,6 +3983,7 @@ "to" => "Integer", "group_by" => "String", "tags" => "String", + "query" => "String", "limit" => "Integer", }, "v2.GetAggregatedDns" => { @@ -3948,6 +3991,7 @@ "to" => "Integer", "group_by" => "String", "tags" => "String", + "query" => "String", "limit" => "Integer", }, "v2.DeleteScopesRestriction" => { diff --git a/features/v2/given.json b/features/v2/given.json index 24058ecf5e1d..63f710c0e919 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -674,6 +674,18 @@ "tag": "Microsoft Teams Integration", "operationId": "CreateWorkflowsWebhookHandle" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"api_key\": \"00000000-0000-0000-0000-000000000000\",\n \"region\": \"us\"\n },\n \"type\": \"opsgenie-account\"\n }\n}" + } + ], + "step": "there is a valid \"opsgenie_account\" in the system", + "key": "opsgenie_account", + "tag": "Opsgenie Integration", + "operationId": "CreateOpsgenieAccount" + }, { "parameters": [ { @@ -686,6 +698,42 @@ "tag": "Opsgenie Integration", "operationId": "CreateOpsgenieService" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"api_key\": \"00000000-0000-0000-0000-000000000000\"\n },\n \"type\": \"statuspage-account\"\n }\n}" + } + ], + "step": "there is a valid \"statuspage_account\" in the system", + "key": "statuspage_account", + "tag": "Statuspage Integration", + "operationId": "CreateStatuspageAccount" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"url\": \"https://example.statuspage.io\",\n \"custom_tags\": \"team:collaboration-integrations\"\n },\n \"type\": \"statuspage-url-setting\"\n }\n}" + } + ], + "step": "there is a valid \"statuspage_url_setting\" in the system", + "key": "statuspage_url_setting", + "tag": "Statuspage Integration", + "operationId": "CreateStatuspageUrlSetting" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"access_token_url\": \"https://example.com/oauth/token\",\n \"client_id\": \"my-client-id\",\n \"client_secret\": \"my-client-secret\"\n },\n \"type\": \"webhooks-auth-method-oauth2-client-credentials\"\n }\n}" + } + ], + "step": "there is a valid \"webhooks_oauth2_client_credentials\" in the system", + "key": "webhooks_oauth2_client_credentials", + "tag": "Webhooks Integration", + "operationId": "CreateOAuth2ClientCredentials" + }, { "parameters": [ { diff --git a/features/v2/opsgenie_integration.feature b/features/v2/opsgenie_integration.feature index 5df3907ac035..453d4a302775 100644 --- a/features/v2/opsgenie_integration.feature +++ b/features/v2/opsgenie_integration.feature @@ -9,6 +9,20 @@ Feature: Opsgenie Integration And a valid "appKeyAuth" key in the system And an instance of "OpsgenieIntegration" API + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a new Opsgenie account returns "Bad Request" response + Given new "CreateOpsgenieAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "type": "opsgenie-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a new Opsgenie account returns "CREATED" response + Given new "CreateOpsgenieAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "type": "opsgenie-account"}} + When the request is sent + Then the response status is 201 CREATED + @skip @team:Datadog/collaboration-integrations Scenario: Create a new service object returns "Bad Request" response Given new "CreateOpsgenieService" request @@ -54,6 +68,27 @@ Feature: Opsgenie Integration When the request is sent Then the response status is 204 OK + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete an Opsgenie account returns "Bad Request" response + Given new "DeleteOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete an Opsgenie account returns "Not Found" response + Given new "DeleteOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete an Opsgenie account returns "OK" response + Given new "DeleteOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @generated @skip @team:Datadog/collaboration-integrations Scenario: Get a single service object returns "Bad Request" response Given new "GetOpsgenieService" request @@ -85,6 +120,12 @@ Feature: Opsgenie Integration And the response "data.attributes.name" has the same value as "opsgenie_service.data.attributes.name" And the response "data.attributes.region" is equal to "us" + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all Opsgenie accounts returns "OK" response + Given new "ListOpsgenieAccounts" request + When the request is sent + Then the response status is 200 OK + @team:Datadog/collaboration-integrations Scenario: Get all service objects returns "OK" response Given there is a valid "opsgenie_service" in the system @@ -127,3 +168,35 @@ Feature: Opsgenie Integration Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ opsgenie_service.data.attributes.name }}--updated" And the response "data.attributes.region" is equal to "eu" + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an Opsgenie account returns "Bad Request" response + Given new "UpdateOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an Opsgenie account returns "Not Found" response + Given new "UpdateOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an Opsgenie account returns "OK" response + Given new "UpdateOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an Opsgenie account returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateOpsgenieAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. diff --git a/features/v2/statuspage_integration.feature b/features/v2/statuspage_integration.feature new file mode 100644 index 000000000000..453997ce7dc9 --- /dev/null +++ b/features/v2/statuspage_integration.feature @@ -0,0 +1,168 @@ +@endpoint(statuspage-integration) @endpoint(statuspage-integration-v2) +Feature: Statuspage Integration + Configure your [Datadog Statuspage + integration](https://docs.datadoghq.com/integrations/statuspage/) directly + through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "StatuspageIntegration" API + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "Bad Request" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "CREATED" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create a Statuspage URL setting returns "Conflict" response + Given new "CreateStatuspageUrlSetting" request + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "Bad Request" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "CREATED" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create the Statuspage account returns "Conflict" response + Given new "CreateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "Bad Request" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "Not Found" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete a Statuspage URL setting returns "OK" response + Given new "DeleteStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "Bad Request" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "Not Found" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete the Statuspage account returns "OK" response + Given new "DeleteStatuspageAccount" request + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all Statuspage URL settings returns "Not Found" response + Given new "ListStatuspageUrlSettings" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all Statuspage URL settings returns "OK" response + Given new "ListStatuspageUrlSettings" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get the Statuspage account returns "Not Found" response + Given new "GetStatuspageAccount" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get the Statuspage account returns "OK" response + Given new "GetStatuspageAccount" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Bad Request" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Conflict" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "Not Found" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update a Statuspage URL setting returns "OK" response + Given new "UpdateStatuspageUrlSetting" request + And request contains "statuspage_url_setting_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"custom_tags": "team:collaboration-integrations,env:prod", "url": "https://example.statuspage.io"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "statuspage-url-setting"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "Bad Request" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "Not Found" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update the Statuspage account returns "OK" response + Given new "UpdateStatuspageAccount" request + And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000"}, "type": "statuspage-account"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 1cf6850b021f..3e68f5928426 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3456,6 +3456,37 @@ "type": "idempotent" } }, + "ListOpsgenieAccounts": { + "tag": "Opsgenie Integration", + "undo": { + "type": "safe" + } + }, + "CreateOpsgenieAccount": { + "tag": "Opsgenie Integration", + "undo": { + "operationId": "DeleteOpsgenieAccount", + "parameters": [ + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOpsgenieAccount": { + "tag": "Opsgenie Integration", + "undo": { + "type": "idempotent" + } + }, + "UpdateOpsgenieAccount": { + "tag": "Opsgenie Integration", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": { @@ -3554,6 +3585,99 @@ "type": "safe" } }, + "DeleteStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "GetStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "safe" + } + }, + "UpdateStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "CreateStatuspageAccount": { + "tag": "Statuspage Integration", + "undo": { + "operationId": "DeleteStatuspageAccount", + "type": "unsafe" + } + }, + "ListStatuspageUrlSettings": { + "tag": "Statuspage Integration", + "undo": { + "type": "safe" + } + }, + "CreateStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "operationId": "DeleteStatuspageUrlSetting", + "parameters": [ + { + "name": "statuspage_url_setting_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "UpdateStatuspageUrlSetting": { + "tag": "Statuspage Integration", + "undo": { + "type": "idempotent" + } + }, + "GetAllAuthMethods": { + "tag": "Webhooks Integration", + "undo": { + "type": "safe" + } + }, + "CreateOAuth2ClientCredentials": { + "tag": "Webhooks Integration", + "undo": { + "operationId": "DeleteOAuth2ClientCredentials", + "parameters": [ + { + "name": "auth_method_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOAuth2ClientCredentials": { + "tag": "Webhooks Integration", + "undo": { + "type": "idempotent" + } + }, + "GetOAuth2ClientCredentials": { + "tag": "Webhooks Integration", + "undo": { + "type": "safe" + } + }, + "UpdateOAuth2ClientCredentials": { + "tag": "Webhooks Integration", + "undo": { + "type": "idempotent" + } + }, "ListIntegrations": { "tag": "Integrations", "undo": { diff --git a/features/v2/webhooks_integration.feature b/features/v2/webhooks_integration.feature new file mode 100644 index 000000000000..c97a2d403753 --- /dev/null +++ b/features/v2/webhooks_integration.feature @@ -0,0 +1,97 @@ +@endpoint(webhooks-integration) @endpoint(webhooks-integration-v2) +Feature: Webhooks Integration + Configure your [Datadog Webhooks + integration](https://docs.datadoghq.com/integrations/webhooks/) directly + through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "WebhooksIntegration" API + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create an OAuth2 client credentials auth method returns "Bad Request" response + Given new "CreateOAuth2ClientCredentials" request + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create an OAuth2 client credentials auth method returns "CREATED" response + Given new "CreateOAuth2ClientCredentials" request + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create an OAuth2 client credentials auth method returns "Conflict" response + Given new "CreateOAuth2ClientCredentials" request + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete an OAuth2 client credentials auth method returns "Not Found" response + Given new "DeleteOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete an OAuth2 client credentials auth method returns "OK" response + Given new "DeleteOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get all auth methods returns "OK" response + Given new "GetAllAuthMethods" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get an OAuth2 client credentials auth method returns "Not Found" response + Given new "GetOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get an OAuth2 client credentials auth method returns "OK" response + Given new "GetOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an OAuth2 client credentials auth method returns "Bad Request" response + Given new "UpdateOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an OAuth2 client credentials auth method returns "Conflict" response + Given new "UpdateOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an OAuth2 client credentials auth method returns "Not Found" response + Given new "UpdateOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update an OAuth2 client credentials auth method returns "OK" response + Given new "UpdateOAuth2ClientCredentials" request + And request contains "auth_method_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"access_token_url": "https://example.com/oauth/token", "audience": "https://api.example.com", "client_id": "my-client-id", "client_secret": "my-client-secret", "name": "my-oauth2-auth", "scope": "read:webhooks write:webhooks"}, "type": "webhooks-auth-method-oauth2-client-credentials"}} + When the request is sent + Then the response status is 200 OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3d3b731b933a..4c22cc490df5 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4879,6 +4879,17 @@ def overrides "v2.open_ai_integration_update" => "OpenAIIntegrationUpdate", "v2.open_api_endpoint" => "OpenAPIEndpoint", "v2.open_api_file" => "OpenAPIFile", + "v2.opsgenie_account_create_attributes" => "OpsgenieAccountCreateAttributes", + "v2.opsgenie_account_create_data" => "OpsgenieAccountCreateData", + "v2.opsgenie_account_create_request" => "OpsgenieAccountCreateRequest", + "v2.opsgenie_account_response" => "OpsgenieAccountResponse", + "v2.opsgenie_account_response_attributes" => "OpsgenieAccountResponseAttributes", + "v2.opsgenie_account_response_data" => "OpsgenieAccountResponseData", + "v2.opsgenie_accounts_response" => "OpsgenieAccountsResponse", + "v2.opsgenie_account_type" => "OpsgenieAccountType", + "v2.opsgenie_account_update_attributes" => "OpsgenieAccountUpdateAttributes", + "v2.opsgenie_account_update_data" => "OpsgenieAccountUpdateData", + "v2.opsgenie_account_update_request" => "OpsgenieAccountUpdateRequest", "v2.opsgenie_service_create_attributes" => "OpsgenieServiceCreateAttributes", "v2.opsgenie_service_create_data" => "OpsgenieServiceCreateData", "v2.opsgenie_service_create_request" => "OpsgenieServiceCreateRequest", @@ -6325,6 +6336,16 @@ def overrides "v2.statsig_integration_type" => "StatsigIntegrationType", "v2.statsig_integration_update" => "StatsigIntegrationUpdate", "v2.status_page" => "StatusPage", + "v2.statuspage_account_create_attributes" => "StatuspageAccountCreateAttributes", + "v2.statuspage_account_create_data" => "StatuspageAccountCreateData", + "v2.statuspage_account_create_request" => "StatuspageAccountCreateRequest", + "v2.statuspage_account_response" => "StatuspageAccountResponse", + "v2.statuspage_account_response_attributes" => "StatuspageAccountResponseAttributes", + "v2.statuspage_account_response_data" => "StatuspageAccountResponseData", + "v2.statuspage_account_type" => "StatuspageAccountType", + "v2.statuspage_account_update_attributes" => "StatuspageAccountUpdateAttributes", + "v2.statuspage_account_update_data" => "StatuspageAccountUpdateData", + "v2.statuspage_account_update_request" => "StatuspageAccountUpdateRequest", "v2.status_page_array" => "StatusPageArray", "v2.status_page_array_included" => "StatusPageArrayIncluded", "v2.status_page_as_included" => "StatusPageAsIncluded", @@ -6380,6 +6401,17 @@ def overrides "v2.status_pages_user" => "StatusPagesUser", "v2.status_pages_user_attributes" => "StatusPagesUserAttributes", "v2.status_pages_user_type" => "StatusPagesUserType", + "v2.statuspage_url_setting_create_attributes" => "StatuspageUrlSettingCreateAttributes", + "v2.statuspage_url_setting_create_data" => "StatuspageUrlSettingCreateData", + "v2.statuspage_url_setting_create_request" => "StatuspageUrlSettingCreateRequest", + "v2.statuspage_url_setting_response" => "StatuspageUrlSettingResponse", + "v2.statuspage_url_setting_response_attributes" => "StatuspageUrlSettingResponseAttributes", + "v2.statuspage_url_setting_response_data" => "StatuspageUrlSettingResponseData", + "v2.statuspage_url_settings_response" => "StatuspageUrlSettingsResponse", + "v2.statuspage_url_setting_type" => "StatuspageUrlSettingType", + "v2.statuspage_url_setting_update_attributes" => "StatuspageUrlSettingUpdateAttributes", + "v2.statuspage_url_setting_update_data" => "StatuspageUrlSettingUpdateData", + "v2.statuspage_url_setting_update_request" => "StatuspageUrlSettingUpdateRequest", "v2.step" => "Step", "v2.step_display" => "StepDisplay", "v2.step_display_bounds" => "StepDisplayBounds", @@ -7059,6 +7091,24 @@ def overrides "v2.watcher_data" => "WatcherData", "v2.watcher_data_attributes" => "WatcherDataAttributes", "v2.watcher_data_type" => "WatcherDataType", + "v2.webhooks_auth_method_attributes" => "WebhooksAuthMethodAttributes", + "v2.webhooks_auth_method_protocol" => "WebhooksAuthMethodProtocol", + "v2.webhooks_auth_method_relationships" => "WebhooksAuthMethodRelationships", + "v2.webhooks_auth_method_response_data" => "WebhooksAuthMethodResponseData", + "v2.webhooks_auth_methods_response" => "WebhooksAuthMethodsResponse", + "v2.webhooks_auth_method_type" => "WebhooksAuthMethodType", + "v2.webhooks_o_auth2_client_credentials_create_attributes" => "WebhooksOAuth2ClientCredentialsCreateAttributes", + "v2.webhooks_o_auth2_client_credentials_create_data" => "WebhooksOAuth2ClientCredentialsCreateData", + "v2.webhooks_o_auth2_client_credentials_create_request" => "WebhooksOAuth2ClientCredentialsCreateRequest", + "v2.webhooks_o_auth2_client_credentials_relationship" => "WebhooksOAuth2ClientCredentialsRelationship", + "v2.webhooks_o_auth2_client_credentials_relationship_data" => "WebhooksOAuth2ClientCredentialsRelationshipData", + "v2.webhooks_o_auth2_client_credentials_response" => "WebhooksOAuth2ClientCredentialsResponse", + "v2.webhooks_o_auth2_client_credentials_response_attributes" => "WebhooksOAuth2ClientCredentialsResponseAttributes", + "v2.webhooks_o_auth2_client_credentials_response_data" => "WebhooksOAuth2ClientCredentialsResponseData", + "v2.webhooks_o_auth2_client_credentials_type" => "WebhooksOAuth2ClientCredentialsType", + "v2.webhooks_o_auth2_client_credentials_update_attributes" => "WebhooksOAuth2ClientCredentialsUpdateAttributes", + "v2.webhooks_o_auth2_client_credentials_update_data" => "WebhooksOAuth2ClientCredentialsUpdateData", + "v2.webhooks_o_auth2_client_credentials_update_request" => "WebhooksOAuth2ClientCredentialsUpdateRequest", "v2.web_integration_account_create_request" => "WebIntegrationAccountCreateRequest", "v2.web_integration_account_create_request_attributes" => "WebIntegrationAccountCreateRequestAttributes", "v2.web_integration_account_create_request_data" => "WebIntegrationAccountCreateRequestData", @@ -7252,6 +7302,7 @@ def overrides "v2.spans_metrics_api" => "SpansMetricsAPI", "v2.static_analysis_api" => "StaticAnalysisAPI", "v2.status_pages_api" => "StatusPagesAPI", + "v2.statuspage_integration_api" => "StatuspageIntegrationAPI", "v2.storage_management_api" => "StorageManagementAPI", "v2.synthetics_api" => "SyntheticsAPI", "v2.teams_api" => "TeamsAPI", @@ -7259,6 +7310,7 @@ def overrides "v2.usage_metering_api" => "UsageMeteringAPI", "v2.users_api" => "UsersAPI", "v2.web_integrations_api" => "WebIntegrationsAPI", + "v2.webhooks_integration_api" => "WebhooksIntegrationAPI", "v2.widgets_api" => "WidgetsAPI", "v2.workflow_automation_api" => "WorkflowAutomationAPI" } diff --git a/lib/datadog_api_client/v1/api/monitors_api.rb b/lib/datadog_api_client/v1/api/monitors_api.rb index 551358b1273a..d8d6b74c09bc 100644 --- a/lib/datadog_api_client/v1/api/monitors_api.rb +++ b/lib/datadog_api_client/v1/api/monitors_api.rb @@ -849,6 +849,8 @@ def validate_existing_monitor(monitor_id, body, opts = {}) # # Validate the monitor provided in the request. # + # **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. + # # @param monitor_id [Integer] The ID of the monitor # @param body [Monitor] Monitor request object # @param opts [Hash] the optional parameters @@ -921,7 +923,7 @@ def validate_monitor(body, opts = {}) # # Validate the monitor provided in the request. # - # **Note**: Log monitors require an unscoped App Key. + # **Note**: Log monitors require an unscoped App Key and `logs_read_data` permission. # # @param body [Monitor] Monitor request object # @param opts [Hash] the optional parameters diff --git a/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb b/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb index b1fe4c93ee44..dcacf1852809 100644 --- a/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_network_monitoring_api.rb @@ -40,6 +40,7 @@ def get_aggregated_connections(opts = {}) # @option opts [Integer] :to Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`. # @option opts [String] :group_by Comma-separated list of fields to group connections by. The maximum number of group_by(s) is 10. # @option opts [String] :tags Comma-separated list of tags to filter connections by. + # @option opts [String] :query Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter. # @option opts [Integer] :limit The number of connections to be returned. The maximum value is 7500. The default is 100. # @return [Array<(SingleAggregatedConnectionResponseArray, Integer, Hash)>] SingleAggregatedConnectionResponseArray data, response status code and response headers def get_aggregated_connections_with_http_info(opts = {}) @@ -62,6 +63,7 @@ def get_aggregated_connections_with_http_info(opts = {}) query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil? query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters @@ -116,6 +118,7 @@ def get_aggregated_dns(opts = {}) # @option opts [Integer] :to Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither `from` nor `to` are provided, the query window is `[now - 15m, now]`. # @option opts [String] :group_by Comma-separated list of fields to group DNS traffic by. The server side defaults to `network.dns_query` if unspecified. `server_ungrouped` may be used if groups are not desired. The maximum number of group_by(s) is 10. # @option opts [String] :tags Comma-separated list of tags to filter DNS traffic by. + # @option opts [String] :query Free-form search query using AND/OR/NOT operators, wildcards, and parentheses. When provided, takes precedence over the `tags` parameter. # @option opts [Integer] :limit The number of aggregated DNS entries to be returned. The maximum value is 7500. The default is 100. # @return [Array<(SingleAggregatedDnsResponseArray, Integer, Hash)>] SingleAggregatedDnsResponseArray data, response status code and response headers def get_aggregated_dns_with_http_info(opts = {}) @@ -138,6 +141,7 @@ def get_aggregated_dns_with_http_info(opts = {}) query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil? query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters diff --git a/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb b/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb index f89024119f80..fcd4b00f53b7 100644 --- a/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb +++ b/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb @@ -23,6 +23,73 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create a new Opsgenie account. + # + # @see #create_opsgenie_account_with_http_info + def create_opsgenie_account(body, opts = {}) + data, _status_code, _headers = create_opsgenie_account_with_http_info(body, opts) + data + end + + # Create a new Opsgenie account. + # + # Create a new Opsgenie account in the Datadog Opsgenie integration. + # + # @param body [OpsgenieAccountCreateRequest] Opsgenie account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(OpsgenieAccountResponse, Integer, Hash)>] OpsgenieAccountResponse data, response status code and response headers + def create_opsgenie_account_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OpsgenieIntegrationAPI.create_opsgenie_account ...' + 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 OpsgenieIntegrationAPI.create_opsgenie_account" + end + # resource path + local_var_path = '/api/v2/integration/opsgenie/accounts' + + # 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] || 'OpsgenieAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_opsgenie_account, + :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: OpsgenieIntegrationAPI#create_opsgenie_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a new service object. # # @see #create_opsgenie_service_with_http_info @@ -90,6 +157,71 @@ def create_opsgenie_service_with_http_info(body, opts = {}) return data, status_code, headers end + # Delete an Opsgenie account. + # + # @see #delete_opsgenie_account_with_http_info + def delete_opsgenie_account(account_id, opts = {}) + delete_opsgenie_account_with_http_info(account_id, opts) + nil + end + + # Delete an Opsgenie account. + # + # Delete a single Opsgenie account from the Datadog Opsgenie integration. + # + # @param account_id [String] The UUID of the Opsgenie account. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_opsgenie_account_with_http_info(account_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OpsgenieIntegrationAPI.delete_opsgenie_account ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling OpsgenieIntegrationAPI.delete_opsgenie_account" + end + # resource path + local_var_path = '/api/v2/integration/opsgenie/accounts/{account_id}'.sub('{account_id}', CGI.escape(account_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] + + new_options = opts.merge( + :operation => :delete_opsgenie_account, + :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: OpsgenieIntegrationAPI#delete_opsgenie_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a single service object. # # @see #delete_opsgenie_service_with_http_info @@ -220,6 +352,66 @@ def get_opsgenie_service_with_http_info(integration_service_id, opts = {}) return data, status_code, headers end + # Get all Opsgenie accounts. + # + # @see #list_opsgenie_accounts_with_http_info + def list_opsgenie_accounts(opts = {}) + data, _status_code, _headers = list_opsgenie_accounts_with_http_info(opts) + data + end + + # Get all Opsgenie accounts. + # + # Get a list of all Opsgenie accounts from the Datadog Opsgenie integration. + # + # @param opts [Hash] the optional parameters + # @return [Array<(OpsgenieAccountsResponse, Integer, Hash)>] OpsgenieAccountsResponse data, response status code and response headers + def list_opsgenie_accounts_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OpsgenieIntegrationAPI.list_opsgenie_accounts ...' + end + # resource path + local_var_path = '/api/v2/integration/opsgenie/accounts' + + # 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] || 'OpsgenieAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_opsgenie_accounts, + :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: OpsgenieIntegrationAPI#list_opsgenie_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all service objects. # # @see #list_opsgenie_services_with_http_info @@ -280,6 +472,78 @@ def list_opsgenie_services_with_http_info(opts = {}) return data, status_code, headers end + # Update an Opsgenie account. + # + # @see #update_opsgenie_account_with_http_info + def update_opsgenie_account(account_id, body, opts = {}) + data, _status_code, _headers = update_opsgenie_account_with_http_info(account_id, body, opts) + data + end + + # Update an Opsgenie account. + # + # Update a single Opsgenie account in the Datadog Opsgenie integration. + # + # @param account_id [String] The UUID of the Opsgenie account. + # @param body [OpsgenieAccountUpdateRequest] Opsgenie account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(OpsgenieAccountResponse, Integer, Hash)>] OpsgenieAccountResponse data, response status code and response headers + def update_opsgenie_account_with_http_info(account_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OpsgenieIntegrationAPI.update_opsgenie_account ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling OpsgenieIntegrationAPI.update_opsgenie_account" + 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 OpsgenieIntegrationAPI.update_opsgenie_account" + end + # resource path + local_var_path = '/api/v2/integration/opsgenie/accounts/{account_id}'.sub('{account_id}', CGI.escape(account_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] || 'OpsgenieAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_opsgenie_account, + :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: OpsgenieIntegrationAPI#update_opsgenie_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a single service object. # # @see #update_opsgenie_service_with_http_info diff --git a/lib/datadog_api_client/v2/api/statuspage_integration_api.rb b/lib/datadog_api_client/v2/api/statuspage_integration_api.rb new file mode 100644 index 000000000000..03aebf206375 --- /dev/null +++ b/lib/datadog_api_client/v2/api/statuspage_integration_api.rb @@ -0,0 +1,545 @@ +=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 StatuspageIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create the Statuspage account. + # + # @see #create_statuspage_account_with_http_info + def create_statuspage_account(body, opts = {}) + data, _status_code, _headers = create_statuspage_account_with_http_info(body, opts) + data + end + + # Create the Statuspage account. + # + # Create a Statuspage account for your organization. Only one Statuspage + # account can be configured per organization. + # + # @param body [StatuspageAccountCreateRequest] Statuspage account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def create_statuspage_account_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.create_statuspage_account ...' + 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 StatuspageIntegrationAPI.create_statuspage_account" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_statuspage_account, + :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: StatuspageIntegrationAPI#create_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a Statuspage URL setting. + # + # @see #create_statuspage_url_setting_with_http_info + def create_statuspage_url_setting(body, opts = {}) + data, _status_code, _headers = create_statuspage_url_setting_with_http_info(body, opts) + data + end + + # Create a Statuspage URL setting. + # + # Create a Statuspage URL setting for your organization. + # + # @param body [StatuspageUrlSettingCreateRequest] Statuspage URL setting payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingResponse, Integer, Hash)>] StatuspageUrlSettingResponse data, response status code and response headers + def create_statuspage_url_setting_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.create_statuspage_url_setting ...' + 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 StatuspageIntegrationAPI.create_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings' + + # 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] || 'StatuspageUrlSettingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_statuspage_url_setting, + :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: StatuspageIntegrationAPI#create_statuspage_url_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete the Statuspage account. + # + # @see #delete_statuspage_account_with_http_info + def delete_statuspage_account(opts = {}) + delete_statuspage_account_with_http_info(opts) + nil + end + + # Delete the Statuspage account. + # + # Delete the Statuspage account configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_statuspage_account_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.delete_statuspage_account ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] + + new_options = opts.merge( + :operation => :delete_statuspage_account, + :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: StatuspageIntegrationAPI#delete_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Statuspage URL setting. + # + # @see #delete_statuspage_url_setting_with_http_info + def delete_statuspage_url_setting(statuspage_url_setting_id, opts = {}) + delete_statuspage_url_setting_with_http_info(statuspage_url_setting_id, opts) + nil + end + + # Delete a Statuspage URL setting. + # + # Delete a single Statuspage URL setting from your organization. + # + # @param statuspage_url_setting_id [String] The UUID of the Statuspage URL setting. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_statuspage_url_setting_with_http_info(statuspage_url_setting_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.delete_statuspage_url_setting ...' + end + # verify the required parameter 'statuspage_url_setting_id' is set + if @api_client.config.client_side_validation && statuspage_url_setting_id.nil? + fail ArgumentError, "Missing the required parameter 'statuspage_url_setting_id' when calling StatuspageIntegrationAPI.delete_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}'.sub('{statuspage_url_setting_id}', CGI.escape(statuspage_url_setting_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] + + new_options = opts.merge( + :operation => :delete_statuspage_url_setting, + :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: StatuspageIntegrationAPI#delete_statuspage_url_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the Statuspage account. + # + # @see #get_statuspage_account_with_http_info + def get_statuspage_account(opts = {}) + data, _status_code, _headers = get_statuspage_account_with_http_info(opts) + data + end + + # Get the Statuspage account. + # + # Get the Statuspage account configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def get_statuspage_account_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.get_statuspage_account ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_statuspage_account, + :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: StatuspageIntegrationAPI#get_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all Statuspage URL settings. + # + # @see #list_statuspage_url_settings_with_http_info + def list_statuspage_url_settings(opts = {}) + data, _status_code, _headers = list_statuspage_url_settings_with_http_info(opts) + data + end + + # Get all Statuspage URL settings. + # + # Get all Statuspage URL settings configured for your organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingsResponse, Integer, Hash)>] StatuspageUrlSettingsResponse data, response status code and response headers + def list_statuspage_url_settings_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.list_statuspage_url_settings ...' + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings' + + # 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] || 'StatuspageUrlSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_statuspage_url_settings, + :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: StatuspageIntegrationAPI#list_statuspage_url_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update the Statuspage account. + # + # @see #update_statuspage_account_with_http_info + def update_statuspage_account(body, opts = {}) + data, _status_code, _headers = update_statuspage_account_with_http_info(body, opts) + data + end + + # Update the Statuspage account. + # + # Update the Statuspage account configured for your organization. + # + # @param body [StatuspageAccountUpdateRequest] Statuspage account payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageAccountResponse, Integer, Hash)>] StatuspageAccountResponse data, response status code and response headers + def update_statuspage_account_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.update_statuspage_account ...' + 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 StatuspageIntegrationAPI.update_statuspage_account" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/account' + + # 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] || 'StatuspageAccountResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_statuspage_account, + :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: StatuspageIntegrationAPI#update_statuspage_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a Statuspage URL setting. + # + # @see #update_statuspage_url_setting_with_http_info + def update_statuspage_url_setting(statuspage_url_setting_id, body, opts = {}) + data, _status_code, _headers = update_statuspage_url_setting_with_http_info(statuspage_url_setting_id, body, opts) + data + end + + # Update a Statuspage URL setting. + # + # Update a single Statuspage URL setting in your organization. + # + # @param statuspage_url_setting_id [String] The UUID of the Statuspage URL setting. + # @param body [StatuspageUrlSettingUpdateRequest] Statuspage URL setting payload. + # @param opts [Hash] the optional parameters + # @return [Array<(StatuspageUrlSettingResponse, Integer, Hash)>] StatuspageUrlSettingResponse data, response status code and response headers + def update_statuspage_url_setting_with_http_info(statuspage_url_setting_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatuspageIntegrationAPI.update_statuspage_url_setting ...' + end + # verify the required parameter 'statuspage_url_setting_id' is set + if @api_client.config.client_side_validation && statuspage_url_setting_id.nil? + fail ArgumentError, "Missing the required parameter 'statuspage_url_setting_id' when calling StatuspageIntegrationAPI.update_statuspage_url_setting" + 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 StatuspageIntegrationAPI.update_statuspage_url_setting" + end + # resource path + local_var_path = '/api/v2/integration/statuspage/url_settings/{statuspage_url_setting_id}'.sub('{statuspage_url_setting_id}', CGI.escape(statuspage_url_setting_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] || 'StatuspageUrlSettingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_statuspage_url_setting, + :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: StatuspageIntegrationAPI#update_statuspage_url_setting\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/webhooks_integration_api.rb b/lib/datadog_api_client/v2/api/webhooks_integration_api.rb new file mode 100644 index 000000000000..bf89844dff1a --- /dev/null +++ b/lib/datadog_api_client/v2/api/webhooks_integration_api.rb @@ -0,0 +1,363 @@ +=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 WebhooksIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create an OAuth2 client credentials auth method. + # + # @see #create_o_auth2_client_credentials_with_http_info + def create_o_auth2_client_credentials(body, opts = {}) + data, _status_code, _headers = create_o_auth2_client_credentials_with_http_info(body, opts) + data + end + + # Create an OAuth2 client credentials auth method. + # + # Create a new OAuth2 client credentials auth method for the Webhooks + # integration. The `client_secret` is stored securely and never returned. + # + # @param body [WebhooksOAuth2ClientCredentialsCreateRequest] OAuth2 client credentials payload. + # @param opts [Hash] the optional parameters + # @return [Array<(WebhooksOAuth2ClientCredentialsResponse, Integer, Hash)>] WebhooksOAuth2ClientCredentialsResponse data, response status code and response headers + def create_o_auth2_client_credentials_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebhooksIntegrationAPI.create_o_auth2_client_credentials ...' + 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 WebhooksIntegrationAPI.create_o_auth2_client_credentials" + end + # resource path + local_var_path = '/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials' + + # 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] || 'WebhooksOAuth2ClientCredentialsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_o_auth2_client_credentials, + :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: WebhooksIntegrationAPI#create_o_auth2_client_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an OAuth2 client credentials auth method. + # + # @see #delete_o_auth2_client_credentials_with_http_info + def delete_o_auth2_client_credentials(auth_method_id, opts = {}) + delete_o_auth2_client_credentials_with_http_info(auth_method_id, opts) + nil + end + + # Delete an OAuth2 client credentials auth method. + # + # Delete an OAuth2 client credentials auth method by ID. + # + # @param auth_method_id [String] The UUID of the auth method. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_o_auth2_client_credentials_with_http_info(auth_method_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebhooksIntegrationAPI.delete_o_auth2_client_credentials ...' + end + # verify the required parameter 'auth_method_id' is set + if @api_client.config.client_side_validation && auth_method_id.nil? + fail ArgumentError, "Missing the required parameter 'auth_method_id' when calling WebhooksIntegrationAPI.delete_o_auth2_client_credentials" + end + # resource path + local_var_path = '/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials/{auth_method_id}'.sub('{auth_method_id}', CGI.escape(auth_method_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] + + new_options = opts.merge( + :operation => :delete_o_auth2_client_credentials, + :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: WebhooksIntegrationAPI#delete_o_auth2_client_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all auth methods. + # + # @see #get_all_auth_methods_with_http_info + def get_all_auth_methods(opts = {}) + data, _status_code, _headers = get_all_auth_methods_with_http_info(opts) + data + end + + # Get all auth methods. + # + # Get a list of all auth methods configured for the Webhooks integration in + # your organization. + # + # @param opts [Hash] the optional parameters + # @option opts [WebhooksAuthMethodProtocol] :include Comma-separated list of relationships to include in the response. + # @return [Array<(WebhooksAuthMethodsResponse, Integer, Hash)>] WebhooksAuthMethodsResponse data, response status code and response headers + def get_all_auth_methods_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebhooksIntegrationAPI.get_all_auth_methods ...' + end + allowable_values = ['oauth2-client-credentials'] + if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) + fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/integration/webhooks/configuration/auth-method' + + # query parameters + query_params = opts[:query_params] || {} + 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] || 'WebhooksAuthMethodsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_all_auth_methods, + :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: WebhooksIntegrationAPI#get_all_auth_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an OAuth2 client credentials auth method. + # + # @see #get_o_auth2_client_credentials_with_http_info + def get_o_auth2_client_credentials(auth_method_id, opts = {}) + data, _status_code, _headers = get_o_auth2_client_credentials_with_http_info(auth_method_id, opts) + data + end + + # Get an OAuth2 client credentials auth method. + # + # Get a single OAuth2 client credentials auth method by ID. + # + # @param auth_method_id [String] The UUID of the auth method. + # @param opts [Hash] the optional parameters + # @return [Array<(WebhooksOAuth2ClientCredentialsResponse, Integer, Hash)>] WebhooksOAuth2ClientCredentialsResponse data, response status code and response headers + def get_o_auth2_client_credentials_with_http_info(auth_method_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebhooksIntegrationAPI.get_o_auth2_client_credentials ...' + end + # verify the required parameter 'auth_method_id' is set + if @api_client.config.client_side_validation && auth_method_id.nil? + fail ArgumentError, "Missing the required parameter 'auth_method_id' when calling WebhooksIntegrationAPI.get_o_auth2_client_credentials" + end + # resource path + local_var_path = '/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials/{auth_method_id}'.sub('{auth_method_id}', CGI.escape(auth_method_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] || 'WebhooksOAuth2ClientCredentialsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_o_auth2_client_credentials, + :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: WebhooksIntegrationAPI#get_o_auth2_client_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an OAuth2 client credentials auth method. + # + # @see #update_o_auth2_client_credentials_with_http_info + def update_o_auth2_client_credentials(auth_method_id, body, opts = {}) + data, _status_code, _headers = update_o_auth2_client_credentials_with_http_info(auth_method_id, body, opts) + data + end + + # Update an OAuth2 client credentials auth method. + # + # Update an existing OAuth2 client credentials auth method. + # + # @param auth_method_id [String] The UUID of the auth method. + # @param body [WebhooksOAuth2ClientCredentialsUpdateRequest] OAuth2 client credentials payload. + # @param opts [Hash] the optional parameters + # @return [Array<(WebhooksOAuth2ClientCredentialsResponse, Integer, Hash)>] WebhooksOAuth2ClientCredentialsResponse data, response status code and response headers + def update_o_auth2_client_credentials_with_http_info(auth_method_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WebhooksIntegrationAPI.update_o_auth2_client_credentials ...' + end + # verify the required parameter 'auth_method_id' is set + if @api_client.config.client_side_validation && auth_method_id.nil? + fail ArgumentError, "Missing the required parameter 'auth_method_id' when calling WebhooksIntegrationAPI.update_o_auth2_client_credentials" + 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 WebhooksIntegrationAPI.update_o_auth2_client_credentials" + end + # resource path + local_var_path = '/api/v2/integration/webhooks/configuration/auth-method/oauth2-client-credentials/{auth_method_id}'.sub('{auth_method_id}', CGI.escape(auth_method_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] || 'WebhooksOAuth2ClientCredentialsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_o_auth2_client_credentials, + :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: WebhooksIntegrationAPI#update_o_auth2_client_credentials\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/opsgenie_account_create_attributes.rb b/lib/datadog_api_client/v2/models/opsgenie_account_create_attributes.rb new file mode 100644 index 000000000000..360f7440cf8b --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_create_attributes.rb @@ -0,0 +1,148 @@ +=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 Opsgenie account attributes for a create request. + class OpsgenieAccountCreateAttributes + include BaseGenericModel + + # The Opsgenie API key for your Opsgenie account. + attr_reader :api_key + + # The region for the Opsgenie service. + attr_reader :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'region' => :'OpsgenieServiceRegionType' + } + 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::OpsgenieAccountCreateAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + 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 @api_key.nil? + return false if @api_key.to_s.length < 1 + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + if api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + 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 && + api_key == o.api_key && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/opsgenie_account_create_data.rb b/lib/datadog_api_client/v2/models/opsgenie_account_create_data.rb new file mode 100644 index 000000000000..46d481488bc0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_create_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 + # Opsgenie account data for a create request. + class OpsgenieAccountCreateData + include BaseGenericModel + + # The Opsgenie account attributes for a create request. + attr_reader :attributes + + # Opsgenie account 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OpsgenieAccountCreateAttributes', + :'type' => :'OpsgenieAccountType' + } + 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::OpsgenieAccountCreateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/opsgenie_account_create_request.rb b/lib/datadog_api_client/v2/models/opsgenie_account_create_request.rb new file mode 100644 index 000000000000..56e2355d2d8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_create_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 + # Create request for an Opsgenie account. + class OpsgenieAccountCreateRequest + include BaseGenericModel + + # Opsgenie account data for a create request. + 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' => :'OpsgenieAccountCreateData' + } + 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::OpsgenieAccountCreateRequest` 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/opsgenie_account_response.rb b/lib/datadog_api_client/v2/models/opsgenie_account_response.rb new file mode 100644 index 000000000000..d880f23c583a --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_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 an Opsgenie account. + class OpsgenieAccountResponse + include BaseGenericModel + + # Opsgenie account data from a response. + 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' => :'OpsgenieAccountResponseData' + } + 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::OpsgenieAccountResponse` 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/opsgenie_account_response_attributes.rb b/lib/datadog_api_client/v2/models/opsgenie_account_response_attributes.rb new file mode 100644 index 000000000000..4e1286ed8329 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_response_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 + # The attributes from an Opsgenie account response. + class OpsgenieAccountResponseAttributes + include BaseGenericModel + + # The region for the Opsgenie service. + attr_accessor :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'region' => :'OpsgenieServiceRegionType' + } + 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::OpsgenieAccountResponseAttributes` 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?(:'region') + self.region = attributes[:'region'] + 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 && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/opsgenie_account_response_data.rb b/lib/datadog_api_client/v2/models/opsgenie_account_response_data.rb new file mode 100644 index 000000000000..5b08c01052b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_response_data.rb @@ -0,0 +1,173 @@ +=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 + # Opsgenie account data from a response. + class OpsgenieAccountResponseData + include BaseGenericModel + + # The attributes from an Opsgenie account response. + attr_reader :attributes + + # The ID of the Opsgenie account. + attr_reader :id + + # Opsgenie account 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', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OpsgenieAccountResponseAttributes', + :'id' => :'String', + :'type' => :'OpsgenieAccountType' + } + 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::OpsgenieAccountResponseData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/opsgenie_account_type.rb b/lib/datadog_api_client/v2/models/opsgenie_account_type.rb new file mode 100644 index 000000000000..b988d7397a7d --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_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 + # Opsgenie account resource type. + class OpsgenieAccountType + include BaseEnumModel + + OPSGENIE_ACCOUNT = "opsgenie-account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/opsgenie_account_update_attributes.rb b/lib/datadog_api_client/v2/models/opsgenie_account_update_attributes.rb new file mode 100644 index 000000000000..2ca4a649dadb --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_update_attributes.rb @@ -0,0 +1,133 @@ +=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 Opsgenie account attributes for an update request. + class OpsgenieAccountUpdateAttributes + include BaseGenericModel + + # The Opsgenie API key for your Opsgenie account. + attr_reader :api_key + + # The region for the Opsgenie service. + attr_accessor :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'region' => :'OpsgenieServiceRegionType' + } + 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::OpsgenieAccountUpdateAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + 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 !@api_key.nil? && @api_key.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if !api_key.nil? && api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + 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 && + api_key == o.api_key && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/opsgenie_account_update_data.rb b/lib/datadog_api_client/v2/models/opsgenie_account_update_data.rb new file mode 100644 index 000000000000..dec5ec3e59e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_update_data.rb @@ -0,0 +1,173 @@ +=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 + # Opsgenie account data for an update request. + class OpsgenieAccountUpdateData + include BaseGenericModel + + # The Opsgenie account attributes for an update request. + attr_reader :attributes + + # The ID of the Opsgenie account. + attr_reader :id + + # Opsgenie account 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', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OpsgenieAccountUpdateAttributes', + :'id' => :'String', + :'type' => :'OpsgenieAccountType' + } + 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::OpsgenieAccountUpdateData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/opsgenie_account_update_request.rb b/lib/datadog_api_client/v2/models/opsgenie_account_update_request.rb new file mode 100644 index 000000000000..413e4bb62dc8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_account_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 + # Update request for an Opsgenie account. + class OpsgenieAccountUpdateRequest + include BaseGenericModel + + # Opsgenie account data for an update request. + 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' => :'OpsgenieAccountUpdateData' + } + 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::OpsgenieAccountUpdateRequest` 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/opsgenie_accounts_response.rb b/lib/datadog_api_client/v2/models/opsgenie_accounts_response.rb new file mode 100644 index 000000000000..afa9fd4449a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/opsgenie_accounts_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 with a list of Opsgenie accounts. + class OpsgenieAccountsResponse + include BaseGenericModel + + # An array of Opsgenie accounts. + 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::OpsgenieAccountsResponse` 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/statuspage_account_create_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_attributes.rb new file mode 100644 index 000000000000..6242895c54e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_create_attributes.rb @@ -0,0 +1,127 @@ +=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 Statuspage account attributes for a create request. + class StatuspageAccountCreateAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. + attr_reader :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountCreateAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + 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 @api_key.nil? + return false if @api_key.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + if api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + 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 && + api_key == o.api_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_create_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_data.rb new file mode 100644 index 000000000000..7a9d21a26557 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_create_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 + # Statuspage account data for a create request. + class StatuspageAccountCreateData + include BaseGenericModel + + # The Statuspage account attributes for a create request. + attr_reader :attributes + + # Statuspage account 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageAccountCreateAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountCreateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_create_request.rb b/lib/datadog_api_client/v2/models/statuspage_account_create_request.rb new file mode 100644 index 000000000000..f6404fdf73ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_create_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 + # Create request for a Statuspage account. + class StatuspageAccountCreateRequest + include BaseGenericModel + + # Statuspage account data for a create request. + 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' => :'StatuspageAccountCreateData' + } + 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::StatuspageAccountCreateRequest` 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/statuspage_account_response.rb b/lib/datadog_api_client/v2/models/statuspage_account_response.rb new file mode 100644 index 000000000000..7195707f25ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_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 Statuspage account. + class StatuspageAccountResponse + include BaseGenericModel + + # Statuspage account data from a response. + 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' => :'StatuspageAccountResponseData' + } + 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::StatuspageAccountResponse` 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/statuspage_account_response_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_response_attributes.rb new file mode 100644 index 000000000000..5523c117ec5b --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_response_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 + # The attributes from a Statuspage account response. + class StatuspageAccountResponseAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. The value is always returned masked. + attr_accessor :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountResponseAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + 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 && + api_key == o.api_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_response_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_response_data.rb new file mode 100644 index 000000000000..aee96b952d62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_response_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 + # Statuspage account data from a response. + class StatuspageAccountResponseData + include BaseGenericModel + + # The attributes from a Statuspage account response. + attr_reader :attributes + + # Statuspage account 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageAccountResponseAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountResponseData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_type.rb b/lib/datadog_api_client/v2/models/statuspage_account_type.rb new file mode 100644 index 000000000000..9243dcd2abe6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_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 + # Statuspage account resource type. + class StatuspageAccountType + include BaseEnumModel + + STATUSPAGE_ACCOUNT = "statuspage-account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_update_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_attributes.rb new file mode 100644 index 000000000000..2b5945ea5a05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_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 + # The Statuspage account attributes for an update request. + class StatuspageAccountUpdateAttributes + include BaseGenericModel + + # The Statuspage API key for your Statuspage account. + attr_reader :api_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'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::StatuspageAccountUpdateAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + 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 !@api_key.nil? && @api_key.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if !api_key.nil? && api_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "api_key", the character length must be great than or equal to 1.' + end + @api_key = api_key + 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 && + api_key == o.api_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_update_data.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_data.rb new file mode 100644 index 000000000000..49dba68086b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_update_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 + # Statuspage account data for an update request. + class StatuspageAccountUpdateData + include BaseGenericModel + + # The Statuspage account attributes for an update request. + attr_reader :attributes + + # Statuspage account 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageAccountUpdateAttributes', + :'type' => :'StatuspageAccountType' + } + 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::StatuspageAccountUpdateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_account_update_request.rb b/lib/datadog_api_client/v2/models/statuspage_account_update_request.rb new file mode 100644 index 000000000000..30bcbca20622 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_account_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 + # Update request for a Statuspage account. + class StatuspageAccountUpdateRequest + include BaseGenericModel + + # Statuspage account data for an update request. + 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' => :'StatuspageAccountUpdateData' + } + 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::StatuspageAccountUpdateRequest` 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/statuspage_url_setting_create_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_attributes.rb new file mode 100644 index 000000000000..c49ae261efd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_attributes.rb @@ -0,0 +1,152 @@ +=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 Statuspage URL setting attributes for a create request. + class StatuspageUrlSettingCreateAttributes + include BaseGenericModel + + # Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + attr_reader :custom_tags + + # The Statuspage URL to monitor. Must be a `status.io` or `statuspage.com` URL. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'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::StatuspageUrlSettingCreateAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + end + + if attributes.key?(:'url') + self.url = attributes[:'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 @custom_tags.nil? + return false if @custom_tags.to_s.length < 1 + return false if @url.nil? + return false if @url.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param custom_tags [Object] Object to be assigned + # @!visibility private + def custom_tags=(custom_tags) + if custom_tags.nil? + fail ArgumentError, 'invalid value for "custom_tags", custom_tags cannot be nil.' + end + if custom_tags.to_s.length < 1 + fail ArgumentError, 'invalid value for "custom_tags", the character length must be great than or equal to 1.' + end + @custom_tags = custom_tags + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + if url.to_s.length < 1 + fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.' + end + @url = 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 && + custom_tags == o.custom_tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_create_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_data.rb new file mode 100644 index 000000000000..c3475e899930 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_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 + # Statuspage URL setting data for a create request. + class StatuspageUrlSettingCreateData + include BaseGenericModel + + # The Statuspage URL setting attributes for a create request. + attr_reader :attributes + + # Statuspage URL setting 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageUrlSettingCreateAttributes', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingCreateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_create_request.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_request.rb new file mode 100644 index 000000000000..51e669c8663a --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_create_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 + # Create request for a Statuspage URL setting. + class StatuspageUrlSettingCreateRequest + include BaseGenericModel + + # Statuspage URL setting data for a create request. + 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' => :'StatuspageUrlSettingCreateData' + } + 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::StatuspageUrlSettingCreateRequest` 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/statuspage_url_setting_response.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response.rb new file mode 100644 index 000000000000..b393c88b72c2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 Statuspage URL setting. + class StatuspageUrlSettingResponse + include BaseGenericModel + + # Statuspage URL setting data from a response. + 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' => :'StatuspageUrlSettingResponseData' + } + 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::StatuspageUrlSettingResponse` 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/statuspage_url_setting_response_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_attributes.rb new file mode 100644 index 000000000000..402d21f06fc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_attributes.rb @@ -0,0 +1,115 @@ +=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 attributes from a Statuspage URL setting response. + class StatuspageUrlSettingResponseAttributes + include BaseGenericModel + + # Comma-separated list of custom tags applied to events generated from this Statuspage URL. + attr_accessor :custom_tags + + # The Statuspage URL being monitored. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'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::StatuspageUrlSettingResponseAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + 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 && + custom_tags == o.custom_tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb new file mode 100644 index 000000000000..b0214e88e4b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_response_data.rb @@ -0,0 +1,173 @@ +=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 + # Statuspage URL setting data from a response. + class StatuspageUrlSettingResponseData + include BaseGenericModel + + # The attributes from a Statuspage URL setting response. + attr_reader :attributes + + # The ID of the Statuspage URL setting. + attr_reader :id + + # Statuspage URL setting 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', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageUrlSettingResponseAttributes', + :'id' => :'String', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingResponseData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/statuspage_url_setting_type.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_type.rb new file mode 100644 index 000000000000..ed518dffa406 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Statuspage URL setting resource type. + class StatuspageUrlSettingType + include BaseEnumModel + + STATUSPAGE_URL_SETTING = "statuspage-url-setting".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_update_attributes.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_attributes.rb new file mode 100644 index 000000000000..5cf128b3fd38 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_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 + # The Statuspage URL setting attributes for an update request. + class StatuspageUrlSettingUpdateAttributes + include BaseGenericModel + + # Comma-separated list of custom tags to apply to events generated from this Statuspage URL. + attr_reader :custom_tags + + # The Statuspage URL to monitor. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'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::StatuspageUrlSettingUpdateAttributes` 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?(:'custom_tags') + self.custom_tags = attributes[:'custom_tags'] + end + + if attributes.key?(:'url') + self.url = attributes[:'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 !@custom_tags.nil? && @custom_tags.to_s.length < 1 + return false if !@url.nil? && @url.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param custom_tags [Object] Object to be assigned + # @!visibility private + def custom_tags=(custom_tags) + if !custom_tags.nil? && custom_tags.to_s.length < 1 + fail ArgumentError, 'invalid value for "custom_tags", the character length must be great than or equal to 1.' + end + @custom_tags = custom_tags + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if !url.nil? && url.to_s.length < 1 + fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.' + end + @url = 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 && + custom_tags == o.custom_tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb new file mode 100644 index 000000000000..41ab6a96e06a --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_data.rb @@ -0,0 +1,173 @@ +=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 + # Statuspage URL setting data for an update request. + class StatuspageUrlSettingUpdateData + include BaseGenericModel + + # The Statuspage URL setting attributes for an update request. + attr_reader :attributes + + # The ID of the Statuspage URL setting. + attr_reader :id + + # Statuspage URL setting 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', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'StatuspageUrlSettingUpdateAttributes', + :'id' => :'String', + :'type' => :'StatuspageUrlSettingType' + } + 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::StatuspageUrlSettingUpdateData` 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 @id.to_s.length > 100 + return false if @id.to_s.length < 1 + 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 + if id.to_s.length > 100 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.' + end + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + 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/statuspage_url_setting_update_request.rb b/lib/datadog_api_client/v2/models/statuspage_url_setting_update_request.rb new file mode 100644 index 000000000000..b6b5c5df4217 --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_setting_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 + # Update request for a Statuspage URL setting. + class StatuspageUrlSettingUpdateRequest + include BaseGenericModel + + # Statuspage URL setting data for an update request. + 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' => :'StatuspageUrlSettingUpdateData' + } + 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::StatuspageUrlSettingUpdateRequest` 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/statuspage_url_settings_response.rb b/lib/datadog_api_client/v2/models/statuspage_url_settings_response.rb new file mode 100644 index 000000000000..59ca4bf9185d --- /dev/null +++ b/lib/datadog_api_client/v2/models/statuspage_url_settings_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 with a list of Statuspage URL settings. + class StatuspageUrlSettingsResponse + include BaseGenericModel + + # An array of Statuspage URL settings. + 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::StatuspageUrlSettingsResponse` 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/webhooks_auth_method_attributes.rb b/lib/datadog_api_client/v2/models/webhooks_auth_method_attributes.rb new file mode 100644 index 000000000000..5440fd79ebfe --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_method_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 of a webhooks auth method. + class WebhooksAuthMethodAttributes + include BaseGenericModel + + # Authentication protocol used by the auth method. + attr_accessor :protocol + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'protocol' => :'protocol' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'protocol' => :'WebhooksAuthMethodProtocol' + } + 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::WebhooksAuthMethodAttributes` 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?(:'protocol') + self.protocol = attributes[:'protocol'] + 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 && + protocol == o.protocol && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [protocol, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_auth_method_protocol.rb b/lib/datadog_api_client/v2/models/webhooks_auth_method_protocol.rb new file mode 100644 index 000000000000..9e1e9c90df6c --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_method_protocol.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 + # Authentication protocol used by the auth method. + class WebhooksAuthMethodProtocol + include BaseEnumModel + + OAUTH2_CLIENT_CREDENTIALS = "oauth2-client-credentials".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_auth_method_relationships.rb b/lib/datadog_api_client/v2/models/webhooks_auth_method_relationships.rb new file mode 100644 index 000000000000..536588516823 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_method_relationships.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 + # Relationships of a webhooks auth method to its protocol-specific resource. + class WebhooksAuthMethodRelationships + include BaseGenericModel + + # Relationship pointing to the OAuth2 client credentials resource for this auth method. + attr_accessor :oauth2_client_credentials + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oauth2_client_credentials' => :'oauth2-client-credentials' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oauth2_client_credentials' => :'WebhooksOAuth2ClientCredentialsRelationship' + } + 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::WebhooksAuthMethodRelationships` 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_credentials') + self.oauth2_client_credentials = attributes[:'oauth2_client_credentials'] + 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 && + oauth2_client_credentials == o.oauth2_client_credentials && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oauth2_client_credentials, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_auth_method_response_data.rb b/lib/datadog_api_client/v2/models/webhooks_auth_method_response_data.rb new file mode 100644 index 000000000000..24319509480f --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_method_response_data.rb @@ -0,0 +1,175 @@ +=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 + # Webhooks auth method data from a response. + class WebhooksAuthMethodResponseData + include BaseGenericModel + + # Attributes of a webhooks auth method. + attr_reader :attributes + + # The ID of the auth method. + attr_reader :id + + # Relationships of a webhooks auth method to its protocol-specific resource. + attr_accessor :relationships + + # Webhooks auth method 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', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WebhooksAuthMethodAttributes', + :'id' => :'String', + :'relationships' => :'WebhooksAuthMethodRelationships', + :'type' => :'WebhooksAuthMethodType' + } + 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::WebhooksAuthMethodResponseData` 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 @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 && + 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/webhooks_auth_method_type.rb b/lib/datadog_api_client/v2/models/webhooks_auth_method_type.rb new file mode 100644 index 000000000000..3b604f326887 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_method_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 + # Webhooks auth method resource type. + class WebhooksAuthMethodType + include BaseEnumModel + + WEBHOOKS_AUTH_METHOD = "webhooks-auth-method".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_auth_methods_response.rb b/lib/datadog_api_client/v2/models/webhooks_auth_methods_response.rb new file mode 100644 index 000000000000..759bb20957af --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_auth_methods_response.rb @@ -0,0 +1,137 @@ +=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 webhooks auth methods. + class WebhooksAuthMethodsResponse + include BaseGenericModel + + # An array of webhooks auth methods. + attr_reader :data + + # Resources related to the auth methods, included when requested via the `include` query parameter. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'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::WebhooksAuthMethodsResponse` 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?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = 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 && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_attributes.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_attributes.rb new file mode 100644 index 000000000000..9117e789a5bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_attributes.rb @@ -0,0 +1,278 @@ +=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 credentials attributes for a create request. + class WebhooksOAuth2ClientCredentialsCreateAttributes + include BaseGenericModel + + # URL of the OAuth2 access token endpoint. + attr_reader :access_token_url + + # The intended audience for the OAuth2 access token. + attr_reader :audience + + # The OAuth2 client ID issued by the authorization server. + attr_reader :client_id + + # The OAuth2 client secret issued by the authorization server. + # Write-only; never returned by the API. + attr_reader :client_secret + + # Human-readable name for this auth method. Must be unique within your organization. + attr_reader :name + + # Space-separated list of OAuth2 scopes to request. + attr_reader :scope + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_token_url' => :'access_token_url', + :'audience' => :'audience', + :'client_id' => :'client_id', + :'client_secret' => :'client_secret', + :'name' => :'name', + :'scope' => :'scope' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_token_url' => :'String', + :'audience' => :'String', + :'client_id' => :'String', + :'client_secret' => :'String', + :'name' => :'String', + :'scope' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'audience', + :'scope', + ]) + 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::WebhooksOAuth2ClientCredentialsCreateAttributes` 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?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'audience') + self.audience = attributes[:'audience'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'client_secret') + self.client_secret = attributes[:'client_secret'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + 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 @access_token_url.nil? + return false if @access_token_url.to_s.length > 2048 + return false if @access_token_url.to_s.length < 1 + return false if !@audience.nil? && @audience.to_s.length > 2048 + return false if !@audience.nil? && @audience.to_s.length < 1 + return false if @client_id.nil? + return false if @client_id.to_s.length > 2048 + return false if @client_id.to_s.length < 1 + return false if @client_secret.nil? + return false if @client_secret.to_s.length > 2048 + return false if @client_secret.to_s.length < 1 + return false if @name.nil? + return false if @name.to_s.length > 100 + return false if @name.to_s.length < 1 + return false if !@scope.nil? && @scope.to_s.length > 2048 + return false if !@scope.nil? && @scope.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param access_token_url [Object] Object to be assigned + # @!visibility private + def access_token_url=(access_token_url) + if access_token_url.nil? + fail ArgumentError, 'invalid value for "access_token_url", access_token_url cannot be nil.' + end + if access_token_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "access_token_url", the character length must be smaller than or equal to 2048.' + end + if access_token_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "access_token_url", the character length must be great than or equal to 1.' + end + @access_token_url = access_token_url + end + + # Custom attribute writer method with validation + # @param audience [Object] Object to be assigned + # @!visibility private + def audience=(audience) + if !audience.nil? && audience.to_s.length > 2048 + fail ArgumentError, 'invalid value for "audience", the character length must be smaller than or equal to 2048.' + end + if !audience.nil? && audience.to_s.length < 1 + fail ArgumentError, 'invalid value for "audience", the character length must be great than or equal to 1.' + end + @audience = audience + end + + # Custom attribute writer method with validation + # @param client_id [Object] Object to be assigned + # @!visibility private + def client_id=(client_id) + if client_id.nil? + fail ArgumentError, 'invalid value for "client_id", client_id cannot be nil.' + end + if client_id.to_s.length > 2048 + fail ArgumentError, 'invalid value for "client_id", the character length must be smaller than or equal to 2048.' + end + if client_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "client_id", the character length must be great than or equal to 1.' + end + @client_id = client_id + end + + # Custom attribute writer method with validation + # @param client_secret [Object] Object to be assigned + # @!visibility private + def client_secret=(client_secret) + if client_secret.nil? + fail ArgumentError, 'invalid value for "client_secret", client_secret cannot be nil.' + end + if client_secret.to_s.length > 2048 + fail ArgumentError, 'invalid value for "client_secret", the character length must be smaller than or equal to 2048.' + end + if client_secret.to_s.length < 1 + fail ArgumentError, 'invalid value for "client_secret", the character length must be great than or equal to 1.' + end + @client_secret = client_secret + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param scope [Object] Object to be assigned + # @!visibility private + def scope=(scope) + if !scope.nil? && scope.to_s.length > 2048 + fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 2048.' + end + if !scope.nil? && scope.to_s.length < 1 + fail ArgumentError, 'invalid value for "scope", the character length must be great than or equal to 1.' + end + @scope = scope + 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 && + access_token_url == o.access_token_url && + audience == o.audience && + client_id == o.client_id && + client_secret == o.client_secret && + name == o.name && + scope == o.scope && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_token_url, audience, client_id, client_secret, name, scope, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_data.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_data.rb new file mode 100644 index 000000000000..d9b7f19a8389 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_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 + # OAuth2 client credentials data for a create request. + class WebhooksOAuth2ClientCredentialsCreateData + include BaseGenericModel + + # OAuth2 client credentials attributes for a create request. + attr_reader :attributes + + # OAuth2 client credentials 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WebhooksOAuth2ClientCredentialsCreateAttributes', + :'type' => :'WebhooksOAuth2ClientCredentialsType' + } + 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::WebhooksOAuth2ClientCredentialsCreateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_request.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_request.rb new file mode 100644 index 000000000000..a6585a9e145a --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_create_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 + # Create request for an OAuth2 client credentials auth method. + class WebhooksOAuth2ClientCredentialsCreateRequest + include BaseGenericModel + + # OAuth2 client credentials data for a create request. + 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' => :'WebhooksOAuth2ClientCredentialsCreateData' + } + 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::WebhooksOAuth2ClientCredentialsCreateRequest` 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/webhooks_o_auth2_client_credentials_relationship.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_relationship.rb new file mode 100644 index 000000000000..e182878c7ec6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_relationship.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 + # Relationship pointing to the OAuth2 client credentials resource for this auth method. + class WebhooksOAuth2ClientCredentialsRelationship + include BaseGenericModel + + # Relationship data referencing an OAuth2 client credentials resource. + attr_accessor :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' => :'WebhooksOAuth2ClientCredentialsRelationshipData' + } + 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::WebhooksOAuth2ClientCredentialsRelationship` 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 + + # 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/webhooks_o_auth2_client_credentials_relationship_data.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_relationship_data.rb new file mode 100644 index 000000000000..2497658eae39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_relationship_data.rb @@ -0,0 +1,115 @@ +=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 data referencing an OAuth2 client credentials resource. + class WebhooksOAuth2ClientCredentialsRelationshipData + include BaseGenericModel + + # The ID of the OAuth2 client credentials resource. + attr_accessor :id + + # OAuth2 client credentials resource type. + attr_accessor :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' => :'WebhooksOAuth2ClientCredentialsType' + } + 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::WebhooksOAuth2ClientCredentialsRelationshipData` 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 + + # 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/webhooks_o_auth2_client_credentials_response.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response.rb new file mode 100644 index 000000000000..107e8e8e867f --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_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 an OAuth2 client credentials auth method. + class WebhooksOAuth2ClientCredentialsResponse + include BaseGenericModel + + # OAuth2 client credentials data from a response. + 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' => :'WebhooksOAuth2ClientCredentialsResponseData' + } + 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::WebhooksOAuth2ClientCredentialsResponse` 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/webhooks_o_auth2_client_credentials_response_attributes.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response_attributes.rb new file mode 100644 index 000000000000..7ea2b7e7003f --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response_attributes.rb @@ -0,0 +1,164 @@ +=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 credentials attributes returned by the API. The `client_secret` is never echoed. + class WebhooksOAuth2ClientCredentialsResponseAttributes + include BaseGenericModel + + # URL of the OAuth2 access token endpoint. + attr_accessor :access_token_url + + # The intended audience for the OAuth2 access token. + attr_accessor :audience + + # The OAuth2 client ID issued by the authorization server. + attr_accessor :client_id + + # Human-readable name for this auth method. + attr_accessor :name + + # Authentication protocol used by the auth method. + attr_accessor :protocol + + # Space-separated list of OAuth2 scopes to request. + attr_accessor :scope + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_token_url' => :'access_token_url', + :'audience' => :'audience', + :'client_id' => :'client_id', + :'name' => :'name', + :'protocol' => :'protocol', + :'scope' => :'scope' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_token_url' => :'String', + :'audience' => :'String', + :'client_id' => :'String', + :'name' => :'String', + :'protocol' => :'WebhooksAuthMethodProtocol', + :'scope' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'audience', + :'scope', + ]) + 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::WebhooksOAuth2ClientCredentialsResponseAttributes` 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?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'audience') + self.audience = attributes[:'audience'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'protocol') + self.protocol = attributes[:'protocol'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + 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 && + access_token_url == o.access_token_url && + audience == o.audience && + client_id == o.client_id && + name == o.name && + protocol == o.protocol && + scope == o.scope && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_token_url, audience, client_id, name, protocol, scope, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response_data.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response_data.rb new file mode 100644 index 000000000000..a92e8ff06cef --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_response_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 + # OAuth2 client credentials data from a response. + class WebhooksOAuth2ClientCredentialsResponseData + include BaseGenericModel + + # OAuth2 client credentials attributes returned by the API. The `client_secret` is never echoed. + attr_reader :attributes + + # The ID of the OAuth2 client credentials auth method. + attr_reader :id + + # OAuth2 client credentials 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', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WebhooksOAuth2ClientCredentialsResponseAttributes', + :'id' => :'String', + :'type' => :'WebhooksOAuth2ClientCredentialsType' + } + 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::WebhooksOAuth2ClientCredentialsResponseData` 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/webhooks_o_auth2_client_credentials_type.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_type.rb new file mode 100644 index 000000000000..75ed02728ad2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_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 credentials resource type. + class WebhooksOAuth2ClientCredentialsType + include BaseEnumModel + + WEBHOOKS_AUTH_METHOD_OAUTH2_CLIENT_CREDENTIALS = "webhooks-auth-method-oauth2-client-credentials".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_attributes.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_attributes.rb new file mode 100644 index 000000000000..d2611dc70024 --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_attributes.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 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth2 client credentials attributes for an update request. + class WebhooksOAuth2ClientCredentialsUpdateAttributes + include BaseGenericModel + + # URL of the OAuth2 access token endpoint. + attr_reader :access_token_url + + # The intended audience for the OAuth2 access token. + attr_reader :audience + + # The OAuth2 client ID issued by the authorization server. + attr_reader :client_id + + # The OAuth2 client secret issued by the authorization server. + # Write-only; never returned by the API. + attr_reader :client_secret + + # Human-readable name for this auth method. + attr_reader :name + + # Space-separated list of OAuth2 scopes to request. + attr_reader :scope + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_token_url' => :'access_token_url', + :'audience' => :'audience', + :'client_id' => :'client_id', + :'client_secret' => :'client_secret', + :'name' => :'name', + :'scope' => :'scope' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_token_url' => :'String', + :'audience' => :'String', + :'client_id' => :'String', + :'client_secret' => :'String', + :'name' => :'String', + :'scope' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'audience', + :'scope', + ]) + 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::WebhooksOAuth2ClientCredentialsUpdateAttributes` 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?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'audience') + self.audience = attributes[:'audience'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'client_secret') + self.client_secret = attributes[:'client_secret'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + 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 !@access_token_url.nil? && @access_token_url.to_s.length > 2048 + return false if !@access_token_url.nil? && @access_token_url.to_s.length < 1 + return false if !@audience.nil? && @audience.to_s.length > 2048 + return false if !@audience.nil? && @audience.to_s.length < 1 + return false if !@client_id.nil? && @client_id.to_s.length > 2048 + return false if !@client_id.nil? && @client_id.to_s.length < 1 + return false if !@client_secret.nil? && @client_secret.to_s.length > 2048 + return false if !@client_secret.nil? && @client_secret.to_s.length < 1 + return false if !@name.nil? && @name.to_s.length > 100 + return false if !@name.nil? && @name.to_s.length < 1 + return false if !@scope.nil? && @scope.to_s.length > 2048 + return false if !@scope.nil? && @scope.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param access_token_url [Object] Object to be assigned + # @!visibility private + def access_token_url=(access_token_url) + if !access_token_url.nil? && access_token_url.to_s.length > 2048 + fail ArgumentError, 'invalid value for "access_token_url", the character length must be smaller than or equal to 2048.' + end + if !access_token_url.nil? && access_token_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "access_token_url", the character length must be great than or equal to 1.' + end + @access_token_url = access_token_url + end + + # Custom attribute writer method with validation + # @param audience [Object] Object to be assigned + # @!visibility private + def audience=(audience) + if !audience.nil? && audience.to_s.length > 2048 + fail ArgumentError, 'invalid value for "audience", the character length must be smaller than or equal to 2048.' + end + if !audience.nil? && audience.to_s.length < 1 + fail ArgumentError, 'invalid value for "audience", the character length must be great than or equal to 1.' + end + @audience = audience + end + + # Custom attribute writer method with validation + # @param client_id [Object] Object to be assigned + # @!visibility private + def client_id=(client_id) + if !client_id.nil? && client_id.to_s.length > 2048 + fail ArgumentError, 'invalid value for "client_id", the character length must be smaller than or equal to 2048.' + end + if !client_id.nil? && client_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "client_id", the character length must be great than or equal to 1.' + end + @client_id = client_id + end + + # Custom attribute writer method with validation + # @param client_secret [Object] Object to be assigned + # @!visibility private + def client_secret=(client_secret) + if !client_secret.nil? && client_secret.to_s.length > 2048 + fail ArgumentError, 'invalid value for "client_secret", the character length must be smaller than or equal to 2048.' + end + if !client_secret.nil? && client_secret.to_s.length < 1 + fail ArgumentError, 'invalid value for "client_secret", the character length must be great than or equal to 1.' + end + @client_secret = client_secret + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + if !name.nil? && name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param scope [Object] Object to be assigned + # @!visibility private + def scope=(scope) + if !scope.nil? && scope.to_s.length > 2048 + fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 2048.' + end + if !scope.nil? && scope.to_s.length < 1 + fail ArgumentError, 'invalid value for "scope", the character length must be great than or equal to 1.' + end + @scope = scope + 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 && + access_token_url == o.access_token_url && + audience == o.audience && + client_id == o.client_id && + client_secret == o.client_secret && + name == o.name && + scope == o.scope && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_token_url, audience, client_id, client_secret, name, scope, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_data.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_data.rb new file mode 100644 index 000000000000..3231985b335b --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_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 + # OAuth2 client credentials data for an update request. + class WebhooksOAuth2ClientCredentialsUpdateData + include BaseGenericModel + + # OAuth2 client credentials attributes for an update request. + attr_reader :attributes + + # OAuth2 client credentials 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WebhooksOAuth2ClientCredentialsUpdateAttributes', + :'type' => :'WebhooksOAuth2ClientCredentialsType' + } + 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::WebhooksOAuth2ClientCredentialsUpdateData` 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?(:'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 @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 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_request.rb b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_update_request.rb new file mode 100644 index 000000000000..e9e26b474b5c --- /dev/null +++ b/lib/datadog_api_client/v2/models/webhooks_o_auth2_client_credentials_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 + # Update request for an OAuth2 client credentials auth method. + class WebhooksOAuth2ClientCredentialsUpdateRequest + include BaseGenericModel + + # OAuth2 client credentials data for an update request. + 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' => :'WebhooksOAuth2ClientCredentialsUpdateData' + } + 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::WebhooksOAuth2ClientCredentialsUpdateRequest` 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