diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a04387a6880b..5808b5f79644 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15600,6 +15600,98 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostTagDescription: + description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionAttributes" + id: + description: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - id + - type + type: object + CostTagDescriptionAttributes: + description: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key. + example: aws + type: string + created_at: + description: Timestamp when the description was created, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + source: + $ref: "#/components/schemas/CostTagDescriptionSource" + tag_key: + description: The tag key this description applies to. + example: account_id + type: string + updated_at: + description: Timestamp when the description was last updated, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + required: + - cloud + - created_at + - description + - source + - tag_key + - updated_at + type: object + CostTagDescriptionSource: + description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + enum: + - human + - ai_generated + - datadog + example: human + type: string + x-enum-varnames: + - HUMAN + - AI_GENERATED + - DATADOG + CostTagDescriptionType: + default: cost_tag_description + description: Type of the Cloud Cost Management tag description resource. + enum: + - cost_tag_description + example: cost_tag_description + type: string + x-enum-varnames: + - COST_TAG_DESCRIPTION + CostTagDescriptionsResponse: + description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. + example: + data: + - attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + properties: + data: + description: List of tag key descriptions. + items: + $ref: "#/components/schemas/CostTagDescription" + type: array + required: + - data + type: object CoverageSummaryAttributes: description: Attributes object for code coverage summary response. properties: @@ -15967,6 +16059,161 @@ components: example: Postmortem-IR-123 type: string type: object + CreateBackfilledDegradationRequest: + description: Request object for creating a backfilled degradation. + example: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31.038001628Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: Root cause identified as a misconfigured deployment. + started_at: "2026-04-27T14:07:31.038001628Z" + status: identified + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved and API is operating normally. + started_at: "2026-04-27T14:37:31.038001628Z" + status: resolved + type: degradations + properties: + data: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestData" + type: object + CreateBackfilledDegradationRequestData: + description: The data object for creating a backfilled degradation. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchDegradationRequestDataType" + required: + - type + type: object + CreateBackfilledDegradationRequestDataAttributes: + description: The supported attributes for creating a backfilled degradation. + properties: + title: + description: The title of the backfilled degradation. + example: "" + type: string + updates: + description: The list of status updates describing the timeline of the degradation. + items: + $ref: "#/components/schemas/CreateBackfilledDegradationRequestDataAttributesUpdatesItems" + type: array + required: + - title + - updates + type: object + CreateBackfilledDegradationRequestDataAttributesUpdatesItems: + description: A backfilled degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesComponentsAffectedItems" + type: array + description: + description: A description of the update. + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - started_at + - status + type: object + CreateBackfilledMaintenanceRequest: + description: Request object for creating a backfilled maintenance. + example: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31.038003786Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed successfully. + started_at: "2026-04-27T14:37:31.038003786Z" + status: completed + type: maintenances + properties: + data: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestData" + type: object + CreateBackfilledMaintenanceRequestData: + description: The data object for creating a backfilled maintenance. + properties: + attributes: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributes" + type: + $ref: "#/components/schemas/PatchMaintenanceRequestDataType" + required: + - type + type: object + CreateBackfilledMaintenanceRequestDataAttributes: + description: The supported attributes for creating a backfilled maintenance. + properties: + title: + description: The title of the backfilled maintenance. + example: "" + type: string + updates: + description: "The list of updates. Exactly two updates are required: the start (`in_progress`) and the end (`completed`)." + items: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems" + maxItems: 2 + minItems: 2 + type: array + required: + - title + - updates + type: object + CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems: + description: A backfilled maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesComponentsAffectedItems" + type: array + description: + description: A description of the update. + example: "" + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - components_affected + - description + - started_at + - status + type: object CreateCampaignRequest: description: Request to create a new campaign. properties: @@ -16448,6 +16695,10 @@ components: description: The title of the degradation. example: Elevated API Latency type: string + updates: + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItems" + type: array required: - components_affected - status @@ -16485,6 +16736,48 @@ components: - IDENTIFIED - MONITORING - RESOLVED + CreateDegradationRequestDataAttributesUpdatesItems: + description: A degradation update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + example: "" + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateDegradationRequestDataAttributesStatus" + required: + - components_affected + - description + - started_at + - status + type: object + CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a degradation update. + properties: + id: + description: The ID of the component. Must be a component of type `component`. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/StatusPagesComponentDataAttributesStatus" + required: + - id + - status + type: object CreateDeploymentGateParams: description: Parameters for creating a deployment gate. properties: @@ -16853,6 +17146,10 @@ components: description: The title of the maintenance. example: "API Maintenance" type: string + updates: + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItems" + type: array required: - components_affected - title @@ -16880,6 +17177,58 @@ components: - id - status type: object + CreateMaintenanceRequestDataAttributesUpdatesItems: + description: A maintenance update entry. + properties: + components_affected: + description: The components affected. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems" + type: array + description: + description: A description of the update. + example: "" + type: string + started_at: + description: Timestamp of when the update occurred. + example: "" + format: date-time + type: string + status: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesUpdatesItemsStatus" + required: + - components_affected + - description + - started_at + - status + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems: + description: A component affected by a maintenance update. + properties: + id: + description: The ID of the component. Must be a component of type `component`. + example: "" + type: string + name: + description: The name of the component. + readOnly: true + type: string + status: + $ref: "#/components/schemas/PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus" + required: + - id + - status + type: object + CreateMaintenanceRequestDataAttributesUpdatesItemsStatus: + description: The status of a maintenance update. + enum: + - in_progress + - completed + example: in_progress + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED CreateNotificationChannelAttributes: description: Attributes for creating an on-call notification channel. properties: @@ -82384,6 +82733,77 @@ components: description: The title of the event. example: "The event title" type: string + ValidateAPIKeyResponse: + description: Response object for the API and application key validation status check. + properties: + status: + $ref: "#/components/schemas/ValidateAPIKeyStatus" + required: + - status + type: object + ValidateAPIKeyStatus: + description: Status of the validation. Always `ok` when both the API key and the application key are valid. + enum: + - ok + example: ok + type: string + x-enum-varnames: + - OK + ValidateV2Attributes: + description: Attributes of the API key validation response. + properties: + api_key_id: + description: The UUID of the API key. + example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" + type: string + api_key_scopes: + description: List of scope names associated with the API key. + example: + - "remote_config_read" + items: + type: string + type: array + valid: + description: Whether the API key is valid. + example: true + type: boolean + required: + - valid + - api_key_scopes + - api_key_id + type: object + ValidateV2Data: + description: Data object containing the API key validation result. + properties: + attributes: + $ref: "#/components/schemas/ValidateV2Attributes" + id: + description: The UUID of the organization associated with the API key. + example: "550e8400-e29b-41d4-a716-446655440000" + type: string + type: + $ref: "#/components/schemas/ValidateV2Type" + required: + - id + - type + - attributes + type: object + ValidateV2Response: + description: Response for the API key validation endpoint. + properties: + data: + $ref: "#/components/schemas/ValidateV2Data" + required: + - data + type: object + ValidateV2Type: + description: Resource type for the API key validation response. + enum: + - validate_v2 + example: validate_v2 + type: string + x-enum-varnames: + - ValidateV2 ValidationError: description: Represents a single validation error, including a human-readable title and metadata. properties: @@ -96749,6 +97169,57 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions: + get: + description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + operationId: ListCostTagDescriptions + parameters: + - description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag descriptions + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost_by_tag/active_billing_dimensions: get: description: |- @@ -138252,6 +138723,85 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/degradations/backfill: + post: + description: Creates a backfilled degradation with predefined updates. + operationId: CreateBackfilledDegradation + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past API Outage + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: degraded + description: We detected elevated error rates in the API. + started_at: "2026-04-27T13:37:31Z" + status: investigating + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: The issue has been resolved. + started_at: "2026-04-27T14:37:31Z" + status: resolved + type: degradations + schema: + $ref: "#/components/schemas/CreateBackfilledDegradationRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + created_at: "2026-04-27T13:37:31+00:00" + description: The issue has been resolved. + modified_at: "2026-04-27T14:37:31+00:00" + status: resolved + title: Past API Outage + updates: [] + id: 00000000-0000-0000-0000-000000000010 + type: degradations + schema: + $ref: "#/components/schemas/Degradation" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled degradation + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write /api/v2/statuspages/{page_id}/degradations/{degradation_id}: delete: description: Deletes a degradation by its ID. @@ -138515,6 +139065,84 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/maintenances/backfill: + post: + description: Creates a backfilled maintenance with predefined updates. + operationId: CreateBackfilledMaintenance + parameters: + - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." + in: query + name: include + schema: + type: string + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + title: Past Database Maintenance + updates: + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: maintenance + description: Database maintenance is in progress. + started_at: "2026-04-27T13:37:31Z" + status: in_progress + - components_affected: + - id: 1234abcd-12ab-34cd-56ef-123456abcdef + status: operational + description: Database maintenance has been completed. + started_at: "2026-04-27T14:37:31Z" + status: completed + type: maintenances + schema: + $ref: "#/components/schemas/CreateBackfilledMaintenanceRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_date: "2026-04-27T14:37:31+00:00" + completed_description: "" + components_affected: [] + in_progress_description: "" + scheduled_description: "" + start_date: "2026-04-27T13:37:31+00:00" + status: completed + title: Past Database Maintenance + id: 00000000-0000-0000-0000-000000000015 + type: maintenances + schema: + $ref: "#/components/schemas/Maintenance" + description: Created + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create backfilled maintenance + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write /api/v2/statuspages/{page_id}/maintenances/{maintenance_id}: get: description: Retrieves a specific maintenance by its ID. @@ -145073,6 +145701,89 @@ paths: operator: OR permissions: - teams_read + /api/v2/validate: + get: + description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes. + operationId: Validate + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" + api_key_scopes: + - "remote_config_read" + valid: true + id: "550e8400-e29b-41d4-a716-446655440000" + type: "validate_v2" + schema: + $ref: "#/components/schemas/ValidateV2Response" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + summary: Validate API key + tags: + - Key Management + "x-permission": + operator: OPEN + permissions: [] + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/validate_keys: + get: + description: |- + Check that the API key and application key used for the request are both valid. + Returns `{"status": "ok"}` on success, `401` or `403` otherwise. Useful as a + lightweight authentication probe before issuing other API calls that require + full credentials. + operationId: ValidateAPIKey + responses: + "200": + content: + application/json: + examples: + default: + value: + status: ok + schema: + $ref: "#/components/schemas/ValidateAPIKeyResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Validate API and application keys + tags: + - Key Management + "x-permission": + operator: OPEN + permissions: [] /api/v2/web-integrations/{integration_name}/accounts: get: description: List accounts for a given web integration. diff --git a/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.frozen b/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.frozen new file mode 100644 index 000000000000..29a31337fe4e --- /dev/null +++ b/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-05-04T14:30:13.862Z \ No newline at end of file diff --git a/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.yml b/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.yml new file mode 100644 index 000000000000..2865530facfd --- /dev/null +++ b/cassettes/features/v2/status_pages/Create-backfilled-degradation-returns-Created-response.yml @@ -0,0 +1,88 @@ +http_interactions: +- recorded_at: Mon, 04 May 2026 14:30:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"2aea4cad6466d9b2","name":"A + Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a8c9f5bc-864f-4984-8420-736468d76baf","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5f67ec78-bc7f-4930-91ae-b29b64e4440e","name":"Application","type":"group","position":0,"components":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","type":"component","status":"operational","position":0},{"id":"6eba0779-8989-43e2-994d-56d244a4ffac","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-05-04T14:30:15.791383Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"2aea4cad6466d9b2","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-05-04T14:30:15.791383Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/a8c9f5bc-864f-4984-8420-736468d76baf/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 04 May 2026 14:30:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"title":"Past API Outage","updates":[{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"degraded"}],"description":"We + detected elevated error rates in the API.","started_at":"2026-05-04T13:30:13.862Z","status":"investigating"},{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"degraded"}],"description":"Root + cause identified as a misconfigured deployment.","started_at":"2026-05-04T14:00:13.862Z","status":"identified"},{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","status":"operational"}],"description":"The + issue has been resolved and API is operating normally.","started_at":"2026-05-04T14:30:13.862Z","status":"resolved"}]},"type":"degradations"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/backfill + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"6d4e1a6f-df56-4178-88c3-f950b9da3f95","type":"degradations","attributes":{"components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"operational"}],"created_at":"2026-05-04T13:30:13.862Z","description":"The + issue has been resolved and API is operating normally.","modified_at":"2026-05-04T14:30:16.509023Z","status":"resolved","title":"Past + API Outage","updates":[{"id":"7acc1fa8-556f-4fa8-978a-58f5c19bcc6d","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T13:30:13.862Z","status":"investigating","description":"We + detected elevated error rates in the API.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"degraded"}]},{"id":"e927896e-cd9e-4c1a-bf41-427ce44e8372","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T14:00:13.862Z","status":"identified","description":"Root + cause identified as a misconfigured deployment.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"degraded"}]},{"id":"82326cfc-b8f7-4276-bde4-d023d5958541","created_at":"2026-05-04T14:30:16.509023Z","modified_at":"2026-05-04T14:30:16.509023Z","started_at":"2026-05-04T14:30:13.862Z","status":"resolved","description":"The + issue has been resolved and API is operating normally.","components_affected":[{"id":"b2e9cb5e-57d3-4c32-9ed2-f2883441ca75","name":"Login","status":"operational"}]}]},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"status_page":{"data":{"id":"a8c9f5bc-864f-4984-8420-736468d76baf","type":"status_pages"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 04 May 2026 14:30:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf/degradations/6d4e1a6f-df56-4178-88c3-f950b9da3f95 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 04 May 2026 14:30:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/statuspages/a8c9f5bc-864f-4984-8420-736468d76baf + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.frozen b/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.frozen new file mode 100644 index 000000000000..ddbc04f32e45 --- /dev/null +++ b/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-05-04T14:30:17.282Z \ No newline at end of file diff --git a/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.yml b/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.yml new file mode 100644 index 000000000000..ac9ce8e2d733 --- /dev/null +++ b/cassettes/features/v2/status_pages/Create-backfilled-maintenance-returns-Created-response.yml @@ -0,0 +1,71 @@ +http_interactions: +- recorded_at: Mon, 04 May 2026 14:30:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"29b08dd63fb635d7","name":"A + Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"bbf96c2c-48cf-4951-96d2-f5b503c93c49","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"b7d32c93-3ab3-4d77-af3b-541a45eb3553","name":"Application","type":"group","position":0,"components":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","type":"component","status":"operational","position":0},{"id":"b99b72d3-4df4-4242-82d9-ebb96c301c8d","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-05-04T14:30:17.408759Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"29b08dd63fb635d7","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-05-04T14:30:17.408759Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 04 May 2026 14:30:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"title":"Past Database Maintenance","updates":[{"components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","status":"maintenance"}],"description":"Database + maintenance is in progress.","started_at":"2026-05-04T13:30:17.282Z","status":"in_progress"},{"components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","status":"operational"}],"description":"Database + maintenance has been completed successfully.","started_at":"2026-05-04T14:30:17.282Z","status":"completed"}]},"type":"maintenances"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49/maintenances/backfill + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1f1ccbc5-14dd-45e2-9e81-b767b4d342f0","type":"maintenances","attributes":{"completed_date":"2026-05-04T14:30:17.282Z","completed_description":"Database + maintenance has been completed successfully.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"operational"}],"in_progress_description":"Database + maintenance is in progress.","modified_at":"2026-05-04T14:30:17.979727Z","published_date":"2026-05-04T13:30:17.282Z","scheduled_description":"","start_date":"2026-05-04T13:30:17.282Z","status":"completed","title":"Past + Database Maintenance","updates":[{"id":"56f63654-5c40-4eed-8af0-dd53a7bb251c","created_at":"2026-05-04T14:30:17.979727Z","modified_at":"2026-05-04T14:30:17.979727Z","started_at":"2026-05-04T13:30:17.282Z","manual_transition":false,"status":"in_progress","description":"Database + maintenance is in progress.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"maintenance"}]},{"id":"7e2dd268-c76e-4186-9a2c-b7ca7039485b","created_at":"2026-05-04T14:30:17.979727Z","modified_at":"2026-05-04T14:30:17.979727Z","started_at":"2026-05-04T14:30:17.282Z","manual_transition":false,"status":"completed","description":"Database + maintenance has been completed successfully.","components_affected":[{"id":"02c0c5d4-6735-45c8-a184-4a6d5b746793","name":"Login","status":"operational"}]}]},"relationships":{"created_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"last_modified_by_user":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"status_page":{"data":{"id":"bbf96c2c-48cf-4951-96d2-f5b503c93c49","type":"status_pages"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 04 May 2026 14:30:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/statuspages/bbf96c2c-48cf-4951-96d2-f5b503c93c49 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb b/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb new file mode 100644 index 000000000000..3224f087a600 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb @@ -0,0 +1,5 @@ +# List Cloud Cost Management tag descriptions returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_descriptions() diff --git a/examples/v2/key-management/Validate.rb b/examples/v2/key-management/Validate.rb new file mode 100644 index 000000000000..9f58de31d3a5 --- /dev/null +++ b/examples/v2/key-management/Validate.rb @@ -0,0 +1,8 @@ +# Validate API key returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.validate".to_sym] = true +end +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new +p api_instance.validate() diff --git a/examples/v2/key-management/ValidateAPIKey.rb b/examples/v2/key-management/ValidateAPIKey.rb new file mode 100644 index 000000000000..c679db7e97d6 --- /dev/null +++ b/examples/v2/key-management/ValidateAPIKey.rb @@ -0,0 +1,5 @@ +# Validate API and application keys returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new +p api_instance.validate_api_key() diff --git a/examples/v2/status-pages/CreateBackfilledDegradation.rb b/examples/v2/status-pages/CreateBackfilledDegradation.rb new file mode 100644 index 000000000000..3b665ca368e9 --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledDegradation.rb @@ -0,0 +1,53 @@ +# Create backfilled degradation returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatusPagesAPI.new + +# there is a valid "status_page" in the system +STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"] +STATUS_PAGE_DATA_ID = ENV["STATUS_PAGE_DATA_ID"] + +body = DatadogAPIClient::V2::CreateBackfilledDegradationRequest.new({ + data: DatadogAPIClient::V2::CreateBackfilledDegradationRequestData.new({ + attributes: DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributes.new({ + title: "Past API Outage", + updates: [ + DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({ + components_affected: [ + DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({ + id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::DEGRADED, + }), + ], + description: "We detected elevated error rates in the API.", + started_at: (Time.now + -1 * 3600), + status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::INVESTIGATING, + }), + DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({ + components_affected: [ + DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({ + id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::DEGRADED, + }), + ], + description: "Root cause identified as a misconfigured deployment.", + started_at: (Time.now + -30 * 60), + status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::IDENTIFIED, + }), + DatadogAPIClient::V2::CreateBackfilledDegradationRequestDataAttributesUpdatesItems.new({ + components_affected: [ + DatadogAPIClient::V2::CreateDegradationRequestDataAttributesComponentsAffectedItems.new({ + id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status: DatadogAPIClient::V2::StatusPagesComponentDataAttributesStatus::OPERATIONAL, + }), + ], + description: "The issue has been resolved and API is operating normally.", + started_at: Time.now, + status: DatadogAPIClient::V2::CreateDegradationRequestDataAttributesStatus::RESOLVED, + }), + ], + }), + type: DatadogAPIClient::V2::PatchDegradationRequestDataType::DEGRADATIONS, + }), +}) +p api_instance.create_backfilled_degradation(STATUS_PAGE_DATA_ID, body) diff --git a/examples/v2/status-pages/CreateBackfilledMaintenance.rb b/examples/v2/status-pages/CreateBackfilledMaintenance.rb new file mode 100644 index 000000000000..2691c7728e38 --- /dev/null +++ b/examples/v2/status-pages/CreateBackfilledMaintenance.rb @@ -0,0 +1,42 @@ +# Create backfilled maintenance returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatusPagesAPI.new + +# there is a valid "status_page" in the system +STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID = ENV["STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID"] +STATUS_PAGE_DATA_ID = ENV["STATUS_PAGE_DATA_ID"] + +body = DatadogAPIClient::V2::CreateBackfilledMaintenanceRequest.new({ + data: DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestData.new({ + attributes: DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributes.new({ + title: "Past Database Maintenance", + updates: [ + DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.new({ + components_affected: [ + DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesComponentsAffectedItems.new({ + id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status: DatadogAPIClient::V2::PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::MAINTENANCE, + }), + ], + description: "Database maintenance is in progress.", + started_at: (Time.now + -1 * 3600), + status: DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::IN_PROGRESS, + }), + DatadogAPIClient::V2::CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems.new({ + components_affected: [ + DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesComponentsAffectedItems.new({ + id: STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_COMPONENTS_0_ID, + status: DatadogAPIClient::V2::PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus::OPERATIONAL, + }), + ], + description: "Database maintenance has been completed successfully.", + started_at: Time.now, + status: DatadogAPIClient::V2::CreateMaintenanceRequestDataAttributesUpdatesItemsStatus::COMPLETED, + }), + ], + }), + type: DatadogAPIClient::V2::PatchMaintenanceRequestDataType::MAINTENANCES, + }), +}) +p api_instance.create_backfilled_maintenance(STATUS_PAGE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index dfd972fe94af..31b4961848f6 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2185,6 +2185,9 @@ "cloud_account_id" => "Integer", "body" => "GCPUsageCostConfigPatchRequest", }, + "v2.ListCostTagDescriptions" => { + "filter_cloud" => "String", + }, "v2.CreateTagPipelinesRuleset" => { "body" => "CreateRulesetRequest", }, @@ -4288,6 +4291,11 @@ "include" => "String", "body" => "CreateDegradationRequest", }, + "v2.CreateBackfilledDegradation" => { + "include" => "String", + "page_id" => "UUID", + "body" => "CreateBackfilledDegradationRequest", + }, "v2.DeleteDegradation" => { "page_id" => "UUID", "degradation_id" => "UUID", @@ -4310,6 +4318,11 @@ "include" => "String", "body" => "CreateMaintenanceRequest", }, + "v2.CreateBackfilledMaintenance" => { + "include" => "String", + "page_id" => "UUID", + "body" => "CreateBackfilledMaintenanceRequest", + }, "v2.GetMaintenance" => { "page_id" => "UUID", "maintenance_id" => "UUID", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 1e9f5de20c20..bf9f695d40eb 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -319,6 +319,12 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag descriptions returns "OK" response + Given new "ListCostTagDescriptions" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" request diff --git a/features/v2/key_management.feature b/features/v2/key_management.feature index 365c53ed7c27..b27f150393b8 100644 --- a/features/v2/key_management.feature +++ b/features/v2/key_management.feature @@ -9,19 +9,20 @@ Feature: Key Management Background: Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system And an instance of "KeyManagement" API @generated @skip @team:DataDog/credentials-management Scenario: Create a personal access token returns "Bad Request" response - Given new "CreatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "CreatePersonalAccessToken" request And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "My Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create a personal access token returns "Created" response - Given new "CreatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "CreatePersonalAccessToken" request And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"], "expires_at": "{{ timeISO('now+365d') }}"}}} When the request is sent Then the response status is 201 Created @@ -32,14 +33,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an API key returns "Bad Request" response - Given new "CreateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateAPIKey" request And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "type": "api_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an API key returns "Created" response - Given new "CreateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateAPIKey" request And body with value {"data": {"type": "api_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -48,7 +51,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Create an Application key with scopes for current user returns "Created" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}}} When the request is sent Then the response status is 201 Created @@ -57,14 +61,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Bad Request" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "type": "application_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Created" response - Given new "CreateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -73,7 +79,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Delete an API key returns "No Content" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "DeleteAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -81,14 +88,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an API key returns "Not Found" response - Given new "DeleteAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "No Content" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -96,14 +105,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "Not Found" response - Given new "DeleteCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key returns "No Content" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -111,14 +122,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key returns "Not Found" response - Given new "DeleteApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Bad Request" response - Given new "UpdateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -126,7 +139,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Not Found" response - Given new "UpdateAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -134,7 +148,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an API key returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" And body with value {"data": {"type": "api_keys", "id": "{{ api_key.data.id }}", "attributes": {"name": "{{ unique }}"}}} @@ -146,7 +161,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Bad Request" response - Given new "UpdateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -154,7 +170,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Not Found" response - Given new "UpdateCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -162,7 +179,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -174,7 +192,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Bad Request" response - Given new "UpdateApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -182,7 +201,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Not Found" response - Given new "UpdateApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -190,7 +210,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -202,14 +223,16 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get API key returns "Not Found" response - Given new "GetAPIKey" request + Given a valid "appKeyAuth" key in the system + And new "GetAPIKey" request And request contains "api_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get API key returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "GetAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -220,14 +243,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response - Given new "GetPersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get a personal access token returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -237,13 +262,15 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all API keys returns "Bad Request" response - Given new "ListAPIKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListAPIKeys" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all API keys returns "OK" response - Given there is a valid "api_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "api_key" in the system And new "ListAPIKeys" request And request contains "filter" parameter from "api_key.data.attributes.name" When the request is sent @@ -253,19 +280,22 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Bad Request" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Not Found" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "OK" response - Given new "ListCurrentUserApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 200 OK And the response "data[0].type" is equal to "application_keys" @@ -273,19 +303,22 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Bad Request" response - Given new "ListApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Not Found" response - Given new "ListApplicationKeys" request + Given a valid "appKeyAuth" key in the system + And new "ListApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "ListApplicationKeys" request When the request is sent Then the response status is 200 OK @@ -294,13 +327,15 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "Bad Request" response - Given new "ListPersonalAccessTokens" request + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "ListPersonalAccessTokens" request When the request is sent Then the response status is 200 OK @@ -308,21 +343,24 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get an application key returns "Bad Request" response - Given new "GetApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get an application key returns "Not Found" response - Given new "GetApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetApplicationKey" request And request contains "app_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get an application key returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "GetApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -333,14 +371,16 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "Not Found" response - Given new "GetCurrentUserApplicationKey" request + Given a valid "appKeyAuth" key in the system + And new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter with value "incorrectId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "OK" response - Given there is a valid "application_key" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "application_key" in the system And new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -353,7 +393,8 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "No Content" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -361,14 +402,16 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response - Given new "RevokePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response - Given new "UpdatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -376,7 +419,8 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response - Given new "UpdatePersonalAccessToken" request + Given a valid "appKeyAuth" key in the system + And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -384,10 +428,25 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Update a personal access token returns "OK" response - Given there is a valid "personal_access_token" in the system + Given a valid "appKeyAuth" key in the system + And there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ unique }}-updated" + + @generated @skip @team:DataDog/identity-platform + Scenario: Validate API and application keys returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ValidateAPIKey" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/identity-platform + Scenario: Validate API key returns "OK" response + Given operation "Validate" enabled + And new "Validate" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/status_pages.feature b/features/v2/status_pages.feature index 2a4cb273a61d..4e671f186dea 100644 --- a/features/v2/status_pages.feature +++ b/features/v2/status_pages.feature @@ -10,6 +10,26 @@ Feature: Status Pages And a valid "appKeyAuth" key in the system And an instance of "StatusPages" API + @team:DataDog/incident-app + Scenario: Create backfilled degradation returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledDegradation" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past API Outage", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "We detected elevated error rates in the API.", "started_at": "{{ timeISO('now - 1h') }}", "status": "investigating"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "degraded"}], "description": "Root cause identified as a misconfigured deployment.", "started_at": "{{ timeISO('now - 30m') }}", "status": "identified"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "The issue has been resolved and API is operating normally.", "started_at": "{{ timeISO('now') }}", "status": "resolved"}]}, "type": "degradations"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past API Outage" + + @team:DataDog/incident-app + Scenario: Create backfilled maintenance returns "Created" response + Given there is a valid "status_page" in the system + And new "CreateBackfilledMaintenance" request + And request contains "page_id" parameter from "status_page.data.id" + And body with value {"data": {"attributes": {"title": "Past Database Maintenance", "updates": [{"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "maintenance"}], "description": "Database maintenance is in progress.", "started_at": "{{ timeISO('now - 1h') }}", "status": "in_progress"}, {"components_affected": [{"id": "{{ status_page.data.attributes.components[0].components[0].id }}", "status": "operational"}], "description": "Database maintenance has been completed successfully.", "started_at": "{{ timeISO('now') }}", "status": "completed"}]}, "type": "maintenances"}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.title" is equal to "Past Database Maintenance" + @team:DataDog/incident-app Scenario: Create component returns "Created" response Given there is a valid "status_page" in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index aaeb20e65bbc..1ca1c2309ae4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1470,6 +1470,12 @@ "type": "safe" } }, + "ListCostTagDescriptions": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": { @@ -6411,6 +6417,23 @@ "type": "unsafe" } }, + "CreateBackfilledDegradation": { + "tag": "Status Pages", + "undo": { + "operationId": "DeleteDegradation", + "parameters": [ + { + "name": "page_id", + "source": "data.relationships.status_page.data.id" + }, + { + "name": "degradation_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "DeleteDegradation": { "tag": "Status Pages", "undo": { @@ -6435,6 +6458,12 @@ "type": "safe" } }, + "CreateBackfilledMaintenance": { + "tag": "Status Pages", + "undo": { + "type": "safe" + } + }, "GetMaintenance": { "tag": "Status Pages", "undo": { @@ -7134,6 +7163,18 @@ "type": "safe" } }, + "Validate": { + "tag": "Key Management", + "undo": { + "type": "safe" + } + }, + "ValidateAPIKey": { + "tag": "Key Management", + "undo": { + "type": "safe" + } + }, "ListWebIntegrationAccounts": { "tag": "Web Integrations", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 51e51306afaa..d12e66a43601 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -237,6 +237,7 @@ def initialize "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, "v2.anonymize_users": false, + "v2.validate": false, "v2.create_open_api": false, "v2.delete_open_api": false, "v2.get_open_api": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 392c822b590f..c8a70ed3c2fc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1988,6 +1988,11 @@ def overrides "v2.cost_by_org_attributes" => "CostByOrgAttributes", "v2.cost_by_org_response" => "CostByOrgResponse", "v2.cost_by_org_type" => "CostByOrgType", + "v2.cost_tag_description" => "CostTagDescription", + "v2.cost_tag_description_attributes" => "CostTagDescriptionAttributes", + "v2.cost_tag_description_source" => "CostTagDescriptionSource", + "v2.cost_tag_descriptions_response" => "CostTagDescriptionsResponse", + "v2.cost_tag_description_type" => "CostTagDescriptionType", "v2.coverage_summary_attributes" => "CoverageSummaryAttributes", "v2.coverage_summary_codeowner_stats" => "CoverageSummaryCodeownerStats", "v2.coverage_summary_data" => "CoverageSummaryData", @@ -2013,6 +2018,14 @@ def overrides "v2.create_attachment_request_data" => "CreateAttachmentRequestData", "v2.create_attachment_request_data_attributes" => "CreateAttachmentRequestDataAttributes", "v2.create_attachment_request_data_attributes_attachment" => "CreateAttachmentRequestDataAttributesAttachment", + "v2.create_backfilled_degradation_request" => "CreateBackfilledDegradationRequest", + "v2.create_backfilled_degradation_request_data" => "CreateBackfilledDegradationRequestData", + "v2.create_backfilled_degradation_request_data_attributes" => "CreateBackfilledDegradationRequestDataAttributes", + "v2.create_backfilled_degradation_request_data_attributes_updates_items" => "CreateBackfilledDegradationRequestDataAttributesUpdatesItems", + "v2.create_backfilled_maintenance_request" => "CreateBackfilledMaintenanceRequest", + "v2.create_backfilled_maintenance_request_data" => "CreateBackfilledMaintenanceRequestData", + "v2.create_backfilled_maintenance_request_data_attributes" => "CreateBackfilledMaintenanceRequestDataAttributes", + "v2.create_backfilled_maintenance_request_data_attributes_updates_items" => "CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems", "v2.create_campaign_request" => "CreateCampaignRequest", "v2.create_campaign_request_attributes" => "CreateCampaignRequestAttributes", "v2.create_campaign_request_data" => "CreateCampaignRequestData", @@ -2044,6 +2057,8 @@ def overrides "v2.create_degradation_request_data_attributes" => "CreateDegradationRequestDataAttributes", "v2.create_degradation_request_data_attributes_components_affected_items" => "CreateDegradationRequestDataAttributesComponentsAffectedItems", "v2.create_degradation_request_data_attributes_status" => "CreateDegradationRequestDataAttributesStatus", + "v2.create_degradation_request_data_attributes_updates_items" => "CreateDegradationRequestDataAttributesUpdatesItems", + "v2.create_degradation_request_data_attributes_updates_items_components_affected_items" => "CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems", "v2.create_deployment_gate_params" => "CreateDeploymentGateParams", "v2.create_deployment_gate_params_data" => "CreateDeploymentGateParamsData", "v2.create_deployment_gate_params_data_attributes" => "CreateDeploymentGateParamsDataAttributes", @@ -2069,6 +2084,9 @@ def overrides "v2.create_maintenance_request_data" => "CreateMaintenanceRequestData", "v2.create_maintenance_request_data_attributes" => "CreateMaintenanceRequestDataAttributes", "v2.create_maintenance_request_data_attributes_components_affected_items" => "CreateMaintenanceRequestDataAttributesComponentsAffectedItems", + "v2.create_maintenance_request_data_attributes_updates_items" => "CreateMaintenanceRequestDataAttributesUpdatesItems", + "v2.create_maintenance_request_data_attributes_updates_items_components_affected_items" => "CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems", + "v2.create_maintenance_request_data_attributes_updates_items_status" => "CreateMaintenanceRequestDataAttributesUpdatesItemsStatus", "v2.create_notification_channel_attributes" => "CreateNotificationChannelAttributes", "v2.create_notification_channel_config" => "CreateNotificationChannelConfig", "v2.create_notification_channel_data" => "CreateNotificationChannelData", @@ -6276,6 +6294,12 @@ def overrides "v2.v2_event_attributes" => "V2EventAttributes", "v2.v2_event_attributes_attributes" => "V2EventAttributesAttributes", "v2.v2_event_response" => "V2EventResponse", + "v2.validate_api_key_response" => "ValidateAPIKeyResponse", + "v2.validate_api_key_status" => "ValidateAPIKeyStatus", + "v2.validate_v2_attributes" => "ValidateV2Attributes", + "v2.validate_v2_data" => "ValidateV2Data", + "v2.validate_v2_response" => "ValidateV2Response", + "v2.validate_v2_type" => "ValidateV2Type", "v2.validation_error" => "ValidationError", "v2.validation_error_meta" => "ValidationErrorMeta", "v2.validation_response" => "ValidationResponse", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 5079560bba90..02ae0914469b 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -1580,6 +1580,68 @@ def list_cost_oci_configs_with_http_info(opts = {}) return data, status_code, headers end + # List Cloud Cost Management tag descriptions. + # + # @see #list_cost_tag_descriptions_with_http_info + def list_cost_tag_descriptions(opts = {}) + data, _status_code, _headers = list_cost_tag_descriptions_with_http_info(opts) + data + end + + # List Cloud Cost Management tag descriptions. + # + # List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_cloud Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + # @return [Array<(CostTagDescriptionsResponse, Integer, Hash)>] CostTagDescriptionsResponse data, response status code and response headers + def list_cost_tag_descriptions_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_descriptions ...' + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[cloud]'] = opts[:'filter_cloud'] if !opts[:'filter_cloud'].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] || 'CostTagDescriptionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_descriptions, + :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: CloudCostManagementAPI#list_cost_tag_descriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List custom allocation rules. # # @see #list_custom_allocation_rules_with_http_info diff --git a/lib/datadog_api_client/v2/api/key_management_api.rb b/lib/datadog_api_client/v2/api/key_management_api.rb index a27d81dbfd96..8f2b1f9def34 100644 --- a/lib/datadog_api_client/v2/api/key_management_api.rb +++ b/lib/datadog_api_client/v2/api/key_management_api.rb @@ -1354,5 +1354,134 @@ def update_personal_access_token_with_http_info(pat_id, body, opts = {}) end return data, status_code, headers end + + # Validate API key. + # + # @see #validate_with_http_info + def validate(opts = {}) + data, _status_code, _headers = validate_with_http_info(opts) + data + end + + # Validate API key. + # + # Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ValidateV2Response, Integer, Hash)>] ValidateV2Response data, response status code and response headers + def validate_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.validate".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.validate") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.validate")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.validate ...' + end + # resource path + local_var_path = '/api/v2/validate' + + # 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] || 'ValidateV2Response' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth] + + new_options = opts.merge( + :operation => :validate, + :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: KeyManagementAPI#validate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Validate API and application keys. + # + # @see #validate_api_key_with_http_info + def validate_api_key(opts = {}) + data, _status_code, _headers = validate_api_key_with_http_info(opts) + data + end + + # Validate API and application keys. + # + # Check that the API key and application key used for the request are both valid. + # Returns `{"status": "ok"}` on success, `401` or `403` otherwise. Useful as a + # lightweight authentication probe before issuing other API calls that require + # full credentials. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ValidateAPIKeyResponse, Integer, Hash)>] ValidateAPIKeyResponse data, response status code and response headers + def validate_api_key_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.validate_api_key ...' + end + # resource path + local_var_path = '/api/v2/validate_keys' + + # 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] || 'ValidateAPIKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :validate_api_key, + :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: KeyManagementAPI#validate_api_key\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/status_pages_api.rb b/lib/datadog_api_client/v2/api/status_pages_api.rb index d6a232025fa2..f86e498af32c 100644 --- a/lib/datadog_api_client/v2/api/status_pages_api.rb +++ b/lib/datadog_api_client/v2/api/status_pages_api.rb @@ -23,6 +23,154 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create backfilled degradation. + # + # @see #create_backfilled_degradation_with_http_info + def create_backfilled_degradation(page_id, body, opts = {}) + data, _status_code, _headers = create_backfilled_degradation_with_http_info(page_id, body, opts) + data + end + + # Create backfilled degradation. + # + # Creates a backfilled degradation with predefined updates. + # + # @param page_id [UUID] The ID of the status page. + # @param body [CreateBackfilledDegradationRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page. + # @return [Array<(Degradation, Integer, Hash)>] Degradation data, response status code and response headers + def create_backfilled_degradation_with_http_info(page_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatusPagesAPI.create_backfilled_degradation ...' + end + # verify the required parameter 'page_id' is set + if @api_client.config.client_side_validation && page_id.nil? + fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.create_backfilled_degradation" + 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 StatusPagesAPI.create_backfilled_degradation" + end + # resource path + local_var_path = '/api/v2/statuspages/{page_id}/degradations/backfill'.sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')) + + # 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']) + # 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] || 'Degradation' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_backfilled_degradation, + :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: StatusPagesAPI#create_backfilled_degradation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create backfilled maintenance. + # + # @see #create_backfilled_maintenance_with_http_info + def create_backfilled_maintenance(page_id, body, opts = {}) + data, _status_code, _headers = create_backfilled_maintenance_with_http_info(page_id, body, opts) + data + end + + # Create backfilled maintenance. + # + # Creates a backfilled maintenance with predefined updates. + # + # @param page_id [UUID] The ID of the status page. + # @param body [CreateBackfilledMaintenanceRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page. + # @return [Array<(Maintenance, Integer, Hash)>] Maintenance data, response status code and response headers + def create_backfilled_maintenance_with_http_info(page_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatusPagesAPI.create_backfilled_maintenance ...' + end + # verify the required parameter 'page_id' is set + if @api_client.config.client_side_validation && page_id.nil? + fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.create_backfilled_maintenance" + 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 StatusPagesAPI.create_backfilled_maintenance" + end + # resource path + local_var_path = '/api/v2/statuspages/{page_id}/maintenances/backfill'.sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')) + + # 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']) + # 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] || 'Maintenance' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_backfilled_maintenance, + :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: StatusPagesAPI#create_backfilled_maintenance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create component. # # @see #create_component_with_http_info diff --git a/lib/datadog_api_client/v2/models/cost_tag_description.rb b/lib/datadog_api_client/v2/models/cost_tag_description.rb new file mode 100644 index 000000000000..aa5fbb805d12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description.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 + # A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + class CostTagDescription + include BaseGenericModel + + # Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + attr_reader :attributes + + # Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific. + attr_reader :id + + # Type of the Cloud Cost Management tag description resource. + 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' => :'CostTagDescriptionAttributes', + :'id' => :'String', + :'type' => :'CostTagDescriptionType' + } + 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::CostTagDescription` 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/cost_tag_description_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_description_attributes.rb new file mode 100644 index 000000000000..88aae29956e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_attributes.rb @@ -0,0 +1,228 @@ +=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 + # Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + class CostTagDescriptionAttributes + include BaseGenericModel + + # Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key. + attr_reader :cloud + + # Timestamp when the description was created, in RFC 3339 format. + attr_reader :created_at + + # The human-readable description for the tag key. + attr_reader :description + + # Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + attr_reader :source + + # The tag key this description applies to. + attr_reader :tag_key + + # Timestamp when the description was last updated, in RFC 3339 format. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud' => :'cloud', + :'created_at' => :'created_at', + :'description' => :'description', + :'source' => :'source', + :'tag_key' => :'tag_key', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud' => :'String', + :'created_at' => :'String', + :'description' => :'String', + :'source' => :'CostTagDescriptionSource', + :'tag_key' => :'String', + :'updated_at' => :'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::CostTagDescriptionAttributes` 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?(:'cloud') + self.cloud = attributes[:'cloud'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + 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 @cloud.nil? + return false if @created_at.nil? + return false if @description.nil? + return false if @source.nil? + return false if @tag_key.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param cloud [Object] Object to be assigned + # @!visibility private + def cloud=(cloud) + if cloud.nil? + fail ArgumentError, 'invalid value for "cloud", cloud cannot be nil.' + end + @cloud = cloud + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param tag_key [Object] Object to be assigned + # @!visibility private + def tag_key=(tag_key) + if tag_key.nil? + fail ArgumentError, 'invalid value for "tag_key", tag_key cannot be nil.' + end + @tag_key = tag_key + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + 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 && + cloud == o.cloud && + created_at == o.created_at && + description == o.description && + source == o.source && + tag_key == o.tag_key && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud, created_at, description, source, tag_key, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_source.rb b/lib/datadog_api_client/v2/models/cost_tag_description_source.rb new file mode 100644 index 000000000000..e305b79aac9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_source.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + class CostTagDescriptionSource + include BaseEnumModel + + HUMAN = "human".freeze + AI_GENERATED = "ai_generated".freeze + DATADOG = "datadog".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_type.rb b/lib/datadog_api_client/v2/models/cost_tag_description_type.rb new file mode 100644 index 000000000000..7504f5fb7ff9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_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 + # Type of the Cloud Cost Management tag description resource. + class CostTagDescriptionType + include BaseEnumModel + + COST_TAG_DESCRIPTION = "cost_tag_description".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_descriptions_response.rb b/lib/datadog_api_client/v2/models/cost_tag_descriptions_response.rb new file mode 100644 index 000000000000..f9c5cf91eb85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_descriptions_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 + # List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. + class CostTagDescriptionsResponse + include BaseGenericModel + + # List of tag key descriptions. + 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::CostTagDescriptionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_backfilled_degradation_request.rb b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request.rb new file mode 100644 index 000000000000..02a0f27438f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request.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 + # Request object for creating a backfilled degradation. + class CreateBackfilledDegradationRequest + include BaseGenericModel + + # The data object for creating a backfilled degradation. + 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' => :'CreateBackfilledDegradationRequestData' + } + 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::CreateBackfilledDegradationRequest` 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/create_backfilled_degradation_request_data.rb b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data.rb new file mode 100644 index 000000000000..31e159911829 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data.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 data object for creating a backfilled degradation. + class CreateBackfilledDegradationRequestData + include BaseGenericModel + + # The supported attributes for creating a backfilled degradation. + attr_accessor :attributes + + # Degradations 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' => :'CreateBackfilledDegradationRequestDataAttributes', + :'type' => :'PatchDegradationRequestDataType' + } + 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::CreateBackfilledDegradationRequestData` 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/create_backfilled_degradation_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data_attributes.rb new file mode 100644 index 000000000000..fd2def10ee0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The supported attributes for creating a backfilled degradation. + class CreateBackfilledDegradationRequestDataAttributes + include BaseGenericModel + + # The title of the backfilled degradation. + attr_reader :title + + # The list of status updates describing the timeline of the degradation. + attr_reader :updates + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'title' => :'title', + :'updates' => :'updates' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'title' => :'String', + :'updates' => :'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::CreateBackfilledDegradationRequestDataAttributes` 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?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'updates') + if (value = attributes[:'updates']).is_a?(Array) + self.updates = 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 @title.nil? + return false if @updates.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param updates [Object] Object to be assigned + # @!visibility private + def updates=(updates) + if updates.nil? + fail ArgumentError, 'invalid value for "updates", updates cannot be nil.' + end + @updates = updates + 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 && + title == o.title && + updates == o.updates && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [title, updates, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data_attributes_updates_items.rb b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data_attributes_updates_items.rb new file mode 100644 index 000000000000..6dd948636c5c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_degradation_request_data_attributes_updates_items.rb @@ -0,0 +1,166 @@ +=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 + # A backfilled degradation update entry. + class CreateBackfilledDegradationRequestDataAttributesUpdatesItems + include BaseGenericModel + + # The components affected. + attr_accessor :components_affected + + # A description of the update. + attr_accessor :description + + # Timestamp of when the update occurred. + attr_reader :started_at + + # The status of the degradation. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'components_affected' => :'components_affected', + :'description' => :'description', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'components_affected' => :'Array', + :'description' => :'String', + :'started_at' => :'Time', + :'status' => :'CreateDegradationRequestDataAttributesStatus' + } + 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::CreateBackfilledDegradationRequestDataAttributesUpdatesItems` 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?(:'components_affected') + if (value = attributes[:'components_affected']).is_a?(Array) + self.components_affected = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @started_at.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param started_at [Object] Object to be assigned + # @!visibility private + def started_at=(started_at) + if started_at.nil? + fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' + end + @started_at = started_at + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + components_affected == o.components_affected && + description == o.description && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [components_affected, description, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request.rb b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request.rb new file mode 100644 index 000000000000..5243f9bde612 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request.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 + # Request object for creating a backfilled maintenance. + class CreateBackfilledMaintenanceRequest + include BaseGenericModel + + # The data object for creating a backfilled maintenance. + 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' => :'CreateBackfilledMaintenanceRequestData' + } + 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::CreateBackfilledMaintenanceRequest` 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/create_backfilled_maintenance_request_data.rb b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data.rb new file mode 100644 index 000000000000..0b70740962e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data.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 data object for creating a backfilled maintenance. + class CreateBackfilledMaintenanceRequestData + include BaseGenericModel + + # The supported attributes for creating a backfilled maintenance. + attr_accessor :attributes + + # Maintenances 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' => :'CreateBackfilledMaintenanceRequestDataAttributes', + :'type' => :'PatchMaintenanceRequestDataType' + } + 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::CreateBackfilledMaintenanceRequestData` 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/create_backfilled_maintenance_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes.rb new file mode 100644 index 000000000000..9d3509566a7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The supported attributes for creating a backfilled maintenance. + class CreateBackfilledMaintenanceRequestDataAttributes + include BaseGenericModel + + # The title of the backfilled maintenance. + attr_reader :title + + # The list of updates. Exactly two updates are required: the start (`in_progress`) and the end (`completed`). + attr_reader :updates + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'title' => :'title', + :'updates' => :'updates' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'title' => :'String', + :'updates' => :'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::CreateBackfilledMaintenanceRequestDataAttributes` 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?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'updates') + if (value = attributes[:'updates']).is_a?(Array) + self.updates = 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 @title.nil? + return false if @updates.nil? + return false if @updates.length > 2 + return false if @updates.length < 2 + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param updates [Object] Object to be assigned + # @!visibility private + def updates=(updates) + if updates.nil? + fail ArgumentError, 'invalid value for "updates", updates cannot be nil.' + end + if updates.length > 2 + fail ArgumentError, 'invalid value for "updates", number of items must be less than or equal to 2.' + end + if updates.length < 2 + fail ArgumentError, 'invalid value for "updates", number of items must be greater than or equal to 2.' + end + @updates = updates + 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 && + title == o.title && + updates == o.updates && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [title, updates, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes_updates_items.rb b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes_updates_items.rb new file mode 100644 index 000000000000..61301039b3e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_backfilled_maintenance_request_data_attributes_updates_items.rb @@ -0,0 +1,188 @@ +=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 + # A backfilled maintenance update entry. + class CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems + include BaseGenericModel + + # The components affected. + attr_reader :components_affected + + # A description of the update. + attr_reader :description + + # Timestamp of when the update occurred. + attr_reader :started_at + + # The status of a maintenance update. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'components_affected' => :'components_affected', + :'description' => :'description', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'components_affected' => :'Array', + :'description' => :'String', + :'started_at' => :'Time', + :'status' => :'CreateMaintenanceRequestDataAttributesUpdatesItemsStatus' + } + 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::CreateBackfilledMaintenanceRequestDataAttributesUpdatesItems` 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?(:'components_affected') + if (value = attributes[:'components_affected']).is_a?(Array) + self.components_affected = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @components_affected.nil? + return false if @description.nil? + return false if @started_at.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param components_affected [Object] Object to be assigned + # @!visibility private + def components_affected=(components_affected) + if components_affected.nil? + fail ArgumentError, 'invalid value for "components_affected", components_affected cannot be nil.' + end + @components_affected = components_affected + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param started_at [Object] Object to be assigned + # @!visibility private + def started_at=(started_at) + if started_at.nil? + fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' + end + @started_at = started_at + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + components_affected == o.components_affected && + description == o.description && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [components_affected, description, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes.rb index c58110d6e14b..969be6b4aa6f 100644 --- a/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes.rb @@ -33,6 +33,9 @@ class CreateDegradationRequestDataAttributes # The title of the degradation. attr_reader :title + # + attr_accessor :updates + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -42,7 +45,8 @@ def self.attribute_map :'components_affected' => :'components_affected', :'description' => :'description', :'status' => :'status', - :'title' => :'title' + :'title' => :'title', + :'updates' => :'updates' } end @@ -53,7 +57,8 @@ def self.openapi_types :'components_affected' => :'Array', :'description' => :'String', :'status' => :'CreateDegradationRequestDataAttributesStatus', - :'title' => :'String' + :'title' => :'String', + :'updates' => :'Array' } end @@ -92,6 +97,12 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'updates') + if (value = attributes[:'updates']).is_a?(Array) + self.updates = value + end + end end # Check to see if the all the properties in the model are valid @@ -164,6 +175,7 @@ def ==(o) description == o.description && status == o.status && title == o.title && + updates == o.updates && additional_properties == o.additional_properties end @@ -171,7 +183,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [components_affected, description, status, title, additional_properties].hash + [components_affected, description, status, title, updates, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items.rb b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items.rb new file mode 100644 index 000000000000..01bc177d6920 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items.rb @@ -0,0 +1,188 @@ +=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 + # A degradation update entry. + class CreateDegradationRequestDataAttributesUpdatesItems + include BaseGenericModel + + # The components affected. + attr_reader :components_affected + + # A description of the update. + attr_reader :description + + # Timestamp of when the update occurred. + attr_reader :started_at + + # The status of the degradation. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'components_affected' => :'components_affected', + :'description' => :'description', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'components_affected' => :'Array', + :'description' => :'String', + :'started_at' => :'Time', + :'status' => :'CreateDegradationRequestDataAttributesStatus' + } + 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::CreateDegradationRequestDataAttributesUpdatesItems` 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?(:'components_affected') + if (value = attributes[:'components_affected']).is_a?(Array) + self.components_affected = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @components_affected.nil? + return false if @description.nil? + return false if @started_at.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param components_affected [Object] Object to be assigned + # @!visibility private + def components_affected=(components_affected) + if components_affected.nil? + fail ArgumentError, 'invalid value for "components_affected", components_affected cannot be nil.' + end + @components_affected = components_affected + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param started_at [Object] Object to be assigned + # @!visibility private + def started_at=(started_at) + if started_at.nil? + fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' + end + @started_at = started_at + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + components_affected == o.components_affected && + description == o.description && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [components_affected, description, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items_components_affected_items.rb b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items_components_affected_items.rb new file mode 100644 index 000000000000..ebf2b208c099 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_degradation_request_data_attributes_updates_items_components_affected_items.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A component affected by a degradation update. + class CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems + include BaseGenericModel + + # The ID of the component. Must be a component of type `component`. + attr_reader :id + + # The name of the component. + attr_accessor :name + + # The status of the component. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'status' => :'StatusPagesComponentDataAttributesStatus' + } + 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::CreateDegradationRequestDataAttributesUpdatesItemsComponentsAffectedItems` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + name == o.name && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb index af32081d1d96..7f086663d8a6 100644 --- a/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb @@ -42,6 +42,9 @@ class CreateMaintenanceRequestDataAttributes # The title of the maintenance. attr_reader :title + # + attr_accessor :updates + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -54,7 +57,8 @@ def self.attribute_map :'in_progress_description' => :'in_progress_description', :'scheduled_description' => :'scheduled_description', :'start_date' => :'start_date', - :'title' => :'title' + :'title' => :'title', + :'updates' => :'updates' } end @@ -68,7 +72,8 @@ def self.openapi_types :'in_progress_description' => :'String', :'scheduled_description' => :'String', :'start_date' => :'Time', - :'title' => :'String' + :'title' => :'String', + :'updates' => :'Array' } end @@ -119,6 +124,12 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'updates') + if (value = attributes[:'updates']).is_a?(Array) + self.updates = value + end + end end # Check to see if the all the properties in the model are valid @@ -238,6 +249,7 @@ def ==(o) scheduled_description == o.scheduled_description && start_date == o.start_date && title == o.title && + updates == o.updates && additional_properties == o.additional_properties end @@ -245,7 +257,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [completed_date, completed_description, components_affected, in_progress_description, scheduled_description, start_date, title, additional_properties].hash + [completed_date, completed_description, components_affected, in_progress_description, scheduled_description, start_date, title, updates, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items.rb b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items.rb new file mode 100644 index 000000000000..8e1a7ae45fb6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items.rb @@ -0,0 +1,188 @@ +=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 + # A maintenance update entry. + class CreateMaintenanceRequestDataAttributesUpdatesItems + include BaseGenericModel + + # The components affected. + attr_reader :components_affected + + # A description of the update. + attr_reader :description + + # Timestamp of when the update occurred. + attr_reader :started_at + + # The status of a maintenance update. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'components_affected' => :'components_affected', + :'description' => :'description', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'components_affected' => :'Array', + :'description' => :'String', + :'started_at' => :'Time', + :'status' => :'CreateMaintenanceRequestDataAttributesUpdatesItemsStatus' + } + 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::CreateMaintenanceRequestDataAttributesUpdatesItems` 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?(:'components_affected') + if (value = attributes[:'components_affected']).is_a?(Array) + self.components_affected = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @components_affected.nil? + return false if @description.nil? + return false if @started_at.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param components_affected [Object] Object to be assigned + # @!visibility private + def components_affected=(components_affected) + if components_affected.nil? + fail ArgumentError, 'invalid value for "components_affected", components_affected cannot be nil.' + end + @components_affected = components_affected + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param started_at [Object] Object to be assigned + # @!visibility private + def started_at=(started_at) + if started_at.nil? + fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' + end + @started_at = started_at + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + components_affected == o.components_affected && + description == o.description && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [components_affected, description, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_components_affected_items.rb b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_components_affected_items.rb new file mode 100644 index 000000000000..1c12265c1c6c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_components_affected_items.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A component affected by a maintenance update. + class CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems + include BaseGenericModel + + # The ID of the component. Must be a component of type `component`. + attr_reader :id + + # The name of the component. + attr_accessor :name + + # The status of the component. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'status' => :'PatchMaintenanceRequestDataAttributesComponentsAffectedItemsStatus' + } + 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::CreateMaintenanceRequestDataAttributesUpdatesItemsComponentsAffectedItems` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + name == o.name && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_status.rb b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_status.rb new file mode 100644 index 000000000000..5d07b81ac8b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes_updates_items_status.rb @@ -0,0 +1,27 @@ +=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 status of a maintenance update. + class CreateMaintenanceRequestDataAttributesUpdatesItemsStatus + include BaseEnumModel + + IN_PROGRESS = "in_progress".freeze + COMPLETED = "completed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/validate_api_key_response.rb b/lib/datadog_api_client/v2/models/validate_api_key_response.rb new file mode 100644 index 000000000000..be4386ce7c8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_api_key_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 object for the API and application key validation status check. + class ValidateAPIKeyResponse + include BaseGenericModel + + # Status of the validation. Always `ok` when both the API key and the application key are valid. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'ValidateAPIKeyStatus' + } + 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::ValidateAPIKeyResponse` 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?(:'status') + self.status = attributes[:'status'] + 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 @status.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/validate_api_key_status.rb b/lib/datadog_api_client/v2/models/validate_api_key_status.rb new file mode 100644 index 000000000000..fa875f38029e --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_api_key_status.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 + # Status of the validation. Always `ok` when both the API key and the application key are valid. + class ValidateAPIKeyStatus + include BaseEnumModel + + OK = "ok".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/validate_v2_attributes.rb b/lib/datadog_api_client/v2/models/validate_v2_attributes.rb new file mode 100644 index 000000000000..9168fc2bc1d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_v2_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the API key validation response. + class ValidateV2Attributes + include BaseGenericModel + + # The UUID of the API key. + attr_reader :api_key_id + + # List of scope names associated with the API key. + attr_reader :api_key_scopes + + # Whether the API key is valid. + attr_reader :valid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key_id' => :'api_key_id', + :'api_key_scopes' => :'api_key_scopes', + :'valid' => :'valid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key_id' => :'String', + :'api_key_scopes' => :'Array', + :'valid' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ValidateV2Attributes` 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_id') + self.api_key_id = attributes[:'api_key_id'] + end + + if attributes.key?(:'api_key_scopes') + if (value = attributes[:'api_key_scopes']).is_a?(Array) + self.api_key_scopes = value + end + end + + if attributes.key?(:'valid') + self.valid = attributes[:'valid'] + 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_id.nil? + return false if @api_key_scopes.nil? + return false if @valid.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key_id [Object] Object to be assigned + # @!visibility private + def api_key_id=(api_key_id) + if api_key_id.nil? + fail ArgumentError, 'invalid value for "api_key_id", api_key_id cannot be nil.' + end + @api_key_id = api_key_id + end + + # Custom attribute writer method with validation + # @param api_key_scopes [Object] Object to be assigned + # @!visibility private + def api_key_scopes=(api_key_scopes) + if api_key_scopes.nil? + fail ArgumentError, 'invalid value for "api_key_scopes", api_key_scopes cannot be nil.' + end + @api_key_scopes = api_key_scopes + end + + # Custom attribute writer method with validation + # @param valid [Object] Object to be assigned + # @!visibility private + def valid=(valid) + if valid.nil? + fail ArgumentError, 'invalid value for "valid", valid cannot be nil.' + end + @valid = valid + 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_id == o.api_key_id && + api_key_scopes == o.api_key_scopes && + valid == o.valid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key_id, api_key_scopes, valid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/validate_v2_data.rb b/lib/datadog_api_client/v2/models/validate_v2_data.rb new file mode 100644 index 000000000000..ebf726e64fb1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_v2_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object containing the API key validation result. + class ValidateV2Data + include BaseGenericModel + + # Attributes of the API key validation response. + attr_reader :attributes + + # The UUID of the organization associated with the API key. + attr_reader :id + + # Resource type for the API key validation response. + 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' => :'ValidateV2Attributes', + :'id' => :'String', + :'type' => :'ValidateV2Type' + } + 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::ValidateV2Data` 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/validate_v2_response.rb b/lib/datadog_api_client/v2/models/validate_v2_response.rb new file mode 100644 index 000000000000..f63266937360 --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_v2_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 for the API key validation endpoint. + class ValidateV2Response + include BaseGenericModel + + # Data object containing the API key validation result. + 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' => :'ValidateV2Data' + } + 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::ValidateV2Response` 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/validate_v2_type.rb b/lib/datadog_api_client/v2/models/validate_v2_type.rb new file mode 100644 index 000000000000..6d3905d174f6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/validate_v2_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 + # Resource type for the API key validation response. + class ValidateV2Type + include BaseEnumModel + + ValidateV2 = "validate_v2".freeze + end +end