diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce0ea5b8443f..5c3583f640a4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -814,28 +814,6 @@ components: required: false schema: $ref: "#/components/schemas/IncidentSearchSortOrder" - IncidentServiceIDPathParameter: - description: The ID of the incident service. - in: path - name: service_id - required: true - schema: - type: string - IncidentServiceIncludeQueryParameter: - description: Specifies which types of related objects should be included in the response. - in: query - name: "include" - required: false - schema: - $ref: "#/components/schemas/IncidentRelatedObject" - IncidentServiceSearchQueryParameter: - description: A search query that filters services by name. - in: query - name: "filter" - required: false - schema: - example: "ExampleServiceName" - type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -39935,6 +39913,64 @@ components: type: string x-enum-varnames: - INCIDENTS_GLOBAL_SETTINGS + GlobalOrg: + description: Organization information for a global organization association. + properties: + name: + description: The name of the organization. + example: Example Org + type: string + public_id: + description: The public identifier of the organization. + example: abcdef12345 + nullable: true + type: string + subdomain: + description: The subdomain used to access the organization, if configured. + example: example + nullable: true + type: string + uuid: + description: The UUID of the organization. + example: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + format: uuid + type: string + required: + - uuid + - name + type: object + GlobalOrgAttributes: + description: Attributes of an organization associated with the authenticated user. + properties: + org: + $ref: "#/components/schemas/GlobalOrg" + redirect_url: + description: The login URL used to switch into the organization, if available. + example: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + nullable: true + type: string + source_region: + description: The source region of the organization. + example: us1.prod.dog + type: string + user: + $ref: "#/components/schemas/GlobalOrgUser" + required: + - user + - org + - source_region + type: object + GlobalOrgData: + description: An organization associated with the authenticated user. + properties: + attributes: + $ref: "#/components/schemas/GlobalOrgAttributes" + type: + $ref: "#/components/schemas/GlobalOrgType" + required: + - type + - attributes + type: object GlobalOrgIdentifier: description: A unique identifier for an organization including its site. properties: @@ -39951,6 +39987,99 @@ components: - org_uuid - org_site type: object + GlobalOrgType: + description: The resource type for global user organizations. + enum: [global_user_orgs] + example: global_user_orgs + type: string + x-enum-varnames: + - GLOBAL_USER_ORGS + GlobalOrgUser: + description: User information for a global organization association. + properties: + handle: + description: The handle of the user. + example: user@example.com + type: string + uuid: + description: The UUID of the user. + example: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + format: uuid + type: string + required: + - uuid + - handle + type: object + GlobalOrgsLinks: + description: Pagination links. + properties: + next: + description: Link to the next page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + type: string + type: object + GlobalOrgsMeta: + description: Response metadata object. + properties: + page: + $ref: "#/components/schemas/GlobalOrgsMetaPage" + type: object + GlobalOrgsMetaPage: + description: Paging attributes. + properties: + cursor: + description: The cursor used to get the current results, if any. + example: "" + type: string + limit: + description: Number of results returned. + example: 100 + format: int32 + maximum: 1000 + type: integer + next_cursor: + description: The cursor used to get the next results, if any. + example: next-page + nullable: true + type: string + prev_cursor: + description: The cursor used to get the previous results, if any. + nullable: true + type: string + type: + $ref: "#/components/schemas/GlobalOrgsMetaPageType" + type: object + GlobalOrgsMetaPageType: + description: Type of global orgs pagination. + enum: [cursor] + example: cursor + type: string + x-enum-varnames: + - CURSOR + GlobalOrgsResponse: + description: Response containing organizations across regions for the authenticated user. + properties: + data: + description: Organizations across regions for the authenticated user. + items: + $ref: "#/components/schemas/GlobalOrgData" + type: array + links: + $ref: "#/components/schemas/GlobalOrgsLinks" + meta: + $ref: "#/components/schemas/GlobalOrgsMeta" + required: + - data + type: object GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. properties: @@ -43499,161 +43628,6 @@ components: x-enum-varnames: - CREATED_ASCENDING - CREATED_DESCENDING - IncidentServiceCreateAttributes: - description: The incident service's attributes for a create request. - properties: - name: - description: Name of the incident service. - example: "an example service name" - type: string - required: - - name - type: object - IncidentServiceCreateData: - description: Incident Service payload for create requests. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceCreateAttributes" - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - type - type: object - IncidentServiceCreateRequest: - description: Create request with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceCreateData" - required: - - data - type: object - IncidentServiceIncludedItems: - description: An object related to an incident service which is present in the included payload. - oneOf: - - $ref: "#/components/schemas/User" - IncidentServiceRelationships: - description: The incident service's relationships. - properties: - created_by: - $ref: "#/components/schemas/RelationshipToUser" - last_modified_by: - $ref: "#/components/schemas/RelationshipToUser" - readOnly: true - type: object - IncidentServiceResponse: - description: Response with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceResponseData" - included: - description: Included objects from relationships. - items: - $ref: "#/components/schemas/IncidentServiceIncludedItems" - readOnly: true - type: array - required: - - data - type: object - IncidentServiceResponseAttributes: - description: The incident service's attributes from a response. - properties: - created: - description: Timestamp of when the incident service was created. - format: date-time - readOnly: true - type: string - modified: - description: Timestamp of when the incident service was modified. - format: date-time - readOnly: true - type: string - name: - description: Name of the incident service. - example: "service name" - type: string - type: object - IncidentServiceResponseData: - description: Incident Service data from responses. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceResponseAttributes" - id: - description: The incident service's ID. - example: "00000000-0000-0000-0000-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - id - - type - type: object - IncidentServiceType: - default: services - description: Incident service resource type. - enum: - - services - example: services - type: string - x-enum-varnames: - - SERVICES - IncidentServiceUpdateAttributes: - description: The incident service's attributes for an update request. - properties: - name: - description: Name of the incident service. - example: "an example service name" - type: string - required: - - name - type: object - IncidentServiceUpdateData: - description: Incident Service payload for update requests. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceUpdateAttributes" - id: - description: The incident service's ID. - example: "00000000-0000-0000-0000-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - type - type: object - IncidentServiceUpdateRequest: - description: Update request with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceUpdateData" - required: - - data - type: object - IncidentServicesResponse: - description: Response with a list of incident service payloads. - properties: - data: - description: An array of incident services. - example: [{"id": "00000000-0000-0000-0000-000000000000", "type": "services"}] - items: - $ref: "#/components/schemas/IncidentServiceResponseData" - type: array - included: - description: Included related resources which the user requested. - items: - $ref: "#/components/schemas/IncidentServiceIncludedItems" - readOnly: true - type: array - meta: - $ref: "#/components/schemas/IncidentResponseMeta" - required: - - data - type: "object" IncidentSeverity: description: The incident severity. enum: @@ -61237,6 +61211,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineDedupeProcessor" - $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessor" - $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsV2Processor" - $ref: "#/components/schemas/ObservabilityPipelineOcsfMapperProcessor" - $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessor" - $ref: "#/components/schemas/ObservabilityPipelineParseJSONProcessor" @@ -62376,6 +62351,50 @@ components: type: string x-enum-varnames: - GENERATE_DATADOG_METRICS + ObservabilityPipelineGenerateMetricsV2Processor: + description: |- + The `generate_metrics` processor creates custom metrics from logs. + Metrics can be counters, gauges, or distributions and optionally grouped by log fields. + The generated metrics must be routed to a metrics destination using the input `.metrics`. + + **Supported pipeline types:** logs + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used to reference this component in other parts of the pipeline. + example: generate-metrics-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor targets. + example: "service:my-service" + type: string + metrics: + description: Configuration for generating individual metrics. + items: + $ref: "#/components/schemas/ObservabilityPipelineGeneratedMetric" + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsV2ProcessorType" + required: + - id + - type + - enabled + type: object + x-pipeline-types: [logs] + ObservabilityPipelineGenerateMetricsV2ProcessorType: + default: generate_metrics + description: The processor type. Always `generate_metrics`. + enum: + - generate_metrics + example: generate_metrics + type: string + x-enum-varnames: + - GENERATE_METRICS ObservabilityPipelineGeneratedMetric: description: |- Defines a log-based custom metric, including its name, type, filter, value computation strategy, @@ -129714,6 +129733,94 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/global_orgs: + get: + description: |- + Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + operationId: ListGlobalOrgs + parameters: + - description: The handle of the authenticated user. + in: query + name: user_handle + required: true + schema: + example: user@example.com + type: string + - description: Maximum number of results returned. + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: |- + String to query the next page of results. + This key is provided with each valid response from the API in `meta.page.next_cursor`. + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + org: + name: Example Org + public_id: abcdef12345 + subdomain: example + uuid: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + redirect_url: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + source_region: us1.prod.dog + user: + handle: user@example.com + uuid: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + type: global_user_orgs + links: + next: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + self: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + meta: + page: + cursor: "" + limit: 100 + next_cursor: next-page + type: cursor + schema: + $ref: "#/components/schemas/GlobalOrgsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_read + summary: List global orgs + tags: + - Organizations + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.next_cursor + limitParam: page[limit] + resultsPath: data + "x-permission": + operator: OR + permissions: + - user_access_read /api/v2/hamr: get: description: |- @@ -172241,123 +172348,6 @@ paths: operator: OR permissions: - service_account_write - /api/v2/services: - get: - deprecated: true - description: >- - Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services. - operationId: ListIncidentServices - parameters: - - $ref: "#/components/parameters/IncidentServiceIncludeQueryParameter" - - $ref: "#/components/parameters/PageSize" - - $ref: "#/components/parameters/PageOffset" - - $ref: "#/components/parameters/IncidentServiceSearchQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000002 - type: services - schema: - $ref: "#/components/schemas/IncidentServicesResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get a list of all incident services - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. - post: - deprecated: true - description: Creates a new incident service. - operationId: CreateIncidentService - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: an example service name - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: services - schema: - $ref: "#/components/schemas/IncidentServiceCreateRequest" - description: Incident Service Payload. - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000001 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: CREATED - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Create a new incident service - tags: - - Incident Services - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. /api/v2/services/definitions: get: description: Get a list of all service definitions from the Datadog Service Catalog. @@ -172570,159 +172560,6 @@ paths: operator: OR permissions: - apm_service_catalog_read - /api/v2/services/{service_id}: - delete: - deprecated: true - description: Deletes an existing incident service. - operationId: DeleteIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - responses: - "204": - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Delete an existing incident service - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. - get: - deprecated: true - description: |- - Get details of an incident service. If the `include[users]` query parameter is provided, - the included attribute will contain the users related to these incident services. - operationId: GetIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - - $ref: "#/components/parameters/IncidentServiceIncludeQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000004 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get details of an incident service - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. - patch: - deprecated: true - description: >- - Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update. - operationId: UpdateIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: an example service name - id: 00000000-0000-0000-0000-000000000000 - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: services - schema: - $ref: "#/components/schemas/IncidentServiceUpdateRequest" - description: Incident Service Payload. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000003 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Update an existing incident service - tags: - - Incident Services - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. /api/v2/siem-historical-detections/histsignals: get: description: List hist signals. @@ -186682,8 +186519,6 @@ tags: This is an enterprise-only feature. Request access by contacting Datadog support, or see the [IP Allowlist page](https://docs.datadoghq.com/account_management/org_settings/ip_allowlist/) for more information. name: IP Allowlist - - description: Create, update, delete, and retrieve services which can be associated with incidents. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. - name: Incident Services - description: Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents - description: |- diff --git a/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen b/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen deleted file mode 100644 index 1ed50bd7167c..000000000000 --- a/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:29.760Z \ No newline at end of file diff --git a/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.yml b/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.yml deleted file mode 100644 index 6582ebd67683..000000000000 --- a/cassettes/features/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.yml +++ /dev/null @@ -1,40 +0,0 @@ -http_interactions: -- recorded_at: Thu, 12 May 2022 09:51:29 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_a_new_incident_service_returns_CREATED_response-1652349089"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/services - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"aa4526fd-8084-58a0-bd52-164cd7f1a51e","attributes":{"name":"Test-Create_a_new_incident_service_returns_CREATED_response-1652349089","created":"2022-05-12T09:51:30.250528+00:00","modified":"2022-05-12T09:51:30.250528+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 201 - message: Created -- recorded_at: Thu, 12 May 2022 09:51:29 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/aa4526fd-8084-58a0-bd52-164cd7f1a51e - 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/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen b/cassettes/features/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen deleted file mode 100644 index 6a8b97d928a6..000000000000 --- a/cassettes/features/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:30.710Z \ No newline at end of file diff --git a/cassettes/features/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.yml b/cassettes/features/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.yml deleted file mode 100644 index 5eccf9018d31..000000000000 --- a/cassettes/features/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.yml +++ /dev/null @@ -1,56 +0,0 @@ -http_interactions: -- recorded_at: Thu, 12 May 2022 09:51:30 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Delete_an_existing_incident_service_returns_OK_response-1652349090"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/services - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"9f42d0e5-438a-5808-bb84-01ede3c065fb","attributes":{"name":"Test-Delete_an_existing_incident_service_returns_OK_response-1652349090","created":"2022-05-12T09:51:31.181927+00:00","modified":"2022-05-12T09:51:31.181927+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 201 - message: Created -- recorded_at: Thu, 12 May 2022 09:51:30 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/9f42d0e5-438a-5808-bb84-01ede3c065fb - response: - body: - encoding: UTF-8 - string: '' - headers: {} - status: - code: 204 - message: No Content -- recorded_at: Thu, 12 May 2022 09:51:30 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/9f42d0e5-438a-5808-bb84-01ede3c065fb - 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/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen b/cassettes/features/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen deleted file mode 100644 index fe0e8ff0de3d..000000000000 --- a/cassettes/features/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:32.124Z \ No newline at end of file diff --git a/cassettes/features/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.yml b/cassettes/features/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.yml deleted file mode 100644 index 7106508ea36b..000000000000 --- a/cassettes/features/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.yml +++ /dev/null @@ -1,58 +0,0 @@ -http_interactions: -- recorded_at: Thu, 12 May 2022 09:51:32 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/services - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"84fc985e-fd2b-5e37-b627-eee699786658","attributes":{"name":"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092","created":"2022-05-12T09:51:32.548997+00:00","modified":"2022-05-12T09:51:32.548997+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 201 - message: Created -- recorded_at: Thu, 12 May 2022 09:51:32 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/services?filter=Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092 - response: - body: - encoding: UTF-8 - string: '{"meta":{"sort":"ASC","pagination":{"total":7805,"size":1,"next_offset":1,"offset":0},"total":7805},"data":[{"type":"services","id":"84fc985e-fd2b-5e37-b627-eee699786658","attributes":{"name":"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092","created":"2022-05-12T09:51:32.548997+00:00","modified":"2022-05-12T09:51:32.548997+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}]}' - headers: - Content-Type: - - application/json - status: - code: 200 - message: OK -- recorded_at: Thu, 12 May 2022 09:51:32 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/84fc985e-fd2b-5e37-b627-eee699786658 - 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/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen b/cassettes/features/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen deleted file mode 100644 index 44bfb4331905..000000000000 --- a/cassettes/features/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:33.610Z \ No newline at end of file diff --git a/cassettes/features/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.yml b/cassettes/features/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.yml deleted file mode 100644 index d53efcd72f22..000000000000 --- a/cassettes/features/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.yml +++ /dev/null @@ -1,58 +0,0 @@ -http_interactions: -- recorded_at: Thu, 12 May 2022 09:51:33 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/services - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"e7c6527e-95ff-5ab1-b151-ba4f786038c0","attributes":{"name":"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093","created":"2022-05-12T09:51:34.184497+00:00","modified":"2022-05-12T09:51:34.184497+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 201 - message: Created -- recorded_at: Thu, 12 May 2022 09:51:33 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/services/e7c6527e-95ff-5ab1-b151-ba4f786038c0 - response: - body: - encoding: UTF-8 - string: '{"data":{"type":"services","id":"e7c6527e-95ff-5ab1-b151-ba4f786038c0","attributes":{"name":"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093","created":"2022-05-12T09:51:34.184497+00:00","modified":"2022-05-12T09:51:34.184497+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 200 - message: OK -- recorded_at: Thu, 12 May 2022 09:51:33 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/e7c6527e-95ff-5ab1-b151-ba4f786038c0 - 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/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen b/cassettes/features/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen deleted file mode 100644 index 45de6e2ecb2e..000000000000 --- a/cassettes/features/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:35.154Z \ No newline at end of file diff --git a/cassettes/features/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.yml b/cassettes/features/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.yml deleted file mode 100644 index 193971f1e09e..000000000000 --- a/cassettes/features/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.yml +++ /dev/null @@ -1,62 +0,0 @@ -http_interactions: -- recorded_at: Thu, 12 May 2022 09:51:35 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Update_an_existing_incident_service_returns_OK_response-1652349095"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/services - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"f9f4467a-1e31-5513-83b8-ca6c4287a9b3","attributes":{"name":"Test-Update_an_existing_incident_service_returns_OK_response-1652349095","created":"2022-05-12T09:51:35.599056+00:00","modified":"2022-05-12T09:51:35.599056+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 201 - message: Created -- recorded_at: Thu, 12 May 2022 09:51:35 GMT - request: - body: - encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Update_an_existing_incident_service_returns_OK_response-1652349095-updated"},"type":"services"}}' - headers: - Accept: - - application/json - Content-Type: - - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/services/f9f4467a-1e31-5513-83b8-ca6c4287a9b3 - response: - body: - encoding: UTF-8 - string: '{"included":[{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"name":null,"handle":"frog@datadoghq.com","created_at":"2019-10-02T08:15:39.795051+00:00","modified_at":"2020-06-15T12:33:12.884459+00:00","email":"frog@datadoghq.com","icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro","title":null,"verified":true,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}],"data":{"type":"services","id":"f9f4467a-1e31-5513-83b8-ca6c4287a9b3","attributes":{"name":"Test-Update_an_existing_incident_service_returns_OK_response-1652349095-updated","created":"2022-05-12T09:51:35.599056+00:00","modified":"2022-05-12T09:51:36.165537+00:00"},"relationships":{"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}}' - headers: - Content-Type: - - application/json - status: - code: 200 - message: OK -- recorded_at: Thu, 12 May 2022 09:51:35 GMT - request: - body: null - headers: - Accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/services/f9f4467a-1e31-5513-83b8-ca6c4287a9b3 - response: - body: - encoding: UTF-8 - string: '' - headers: {} - status: - code: 204 - message: No Content -recorded_with: VCR 6.0.0 diff --git a/examples/v2/incident-services/CreateIncidentService.rb b/examples/v2/incident-services/CreateIncidentService.rb deleted file mode 100644 index 5df5604c0f71..000000000000 --- a/examples/v2/incident-services/CreateIncidentService.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Create a new incident service returns "CREATED" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_incident_service".to_sym] = true -end -api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new - -body = DatadogAPIClient::V2::IncidentServiceCreateRequest.new({ - data: DatadogAPIClient::V2::IncidentServiceCreateData.new({ - type: DatadogAPIClient::V2::IncidentServiceType::SERVICES, - attributes: DatadogAPIClient::V2::IncidentServiceCreateAttributes.new({ - name: "Example-Incident-Service", - }), - }), -}) -p api_instance.create_incident_service(body) diff --git a/examples/v2/incident-services/DeleteIncidentService.rb b/examples/v2/incident-services/DeleteIncidentService.rb deleted file mode 100644 index a7059599a0bb..000000000000 --- a/examples/v2/incident-services/DeleteIncidentService.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Delete an existing incident service returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.delete_incident_service".to_sym] = true -end -api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new - -# there is a valid "service" in the system -SERVICE_DATA_ID = ENV["SERVICE_DATA_ID"] -api_instance.delete_incident_service(SERVICE_DATA_ID) diff --git a/examples/v2/incident-services/GetIncidentService.rb b/examples/v2/incident-services/GetIncidentService.rb deleted file mode 100644 index 3ce37aa5f619..000000000000 --- a/examples/v2/incident-services/GetIncidentService.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Get details of an incident service returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_incident_service".to_sym] = true -end -api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new - -# there is a valid "service" in the system -SERVICE_DATA_ID = ENV["SERVICE_DATA_ID"] -p api_instance.get_incident_service(SERVICE_DATA_ID) diff --git a/examples/v2/incident-services/ListIncidentServices.rb b/examples/v2/incident-services/ListIncidentServices.rb deleted file mode 100644 index 839ce4b6b09a..000000000000 --- a/examples/v2/incident-services/ListIncidentServices.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Get a list of all incident services returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_incident_services".to_sym] = true -end -api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new - -# there is a valid "service" in the system -SERVICE_DATA_ATTRIBUTES_NAME = ENV["SERVICE_DATA_ATTRIBUTES_NAME"] -opts = { - filter: SERVICE_DATA_ATTRIBUTES_NAME, -} -p api_instance.list_incident_services(opts) diff --git a/examples/v2/incident-services/UpdateIncidentService.rb b/examples/v2/incident-services/UpdateIncidentService.rb deleted file mode 100644 index 38d526f27ca9..000000000000 --- a/examples/v2/incident-services/UpdateIncidentService.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Update an existing incident service returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.update_incident_service".to_sym] = true -end -api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new - -# there is a valid "service" in the system -SERVICE_DATA_ATTRIBUTES_NAME = ENV["SERVICE_DATA_ATTRIBUTES_NAME"] -SERVICE_DATA_ID = ENV["SERVICE_DATA_ID"] - -body = DatadogAPIClient::V2::IncidentServiceUpdateRequest.new({ - data: DatadogAPIClient::V2::IncidentServiceUpdateData.new({ - type: DatadogAPIClient::V2::IncidentServiceType::SERVICES, - attributes: DatadogAPIClient::V2::IncidentServiceUpdateAttributes.new({ - name: "service name-updated", - }), - }), -}) -p api_instance.update_incident_service(SERVICE_DATA_ID, body) diff --git a/examples/v2/organizations/ListGlobalOrgs.rb b/examples/v2/organizations/ListGlobalOrgs.rb new file mode 100644 index 000000000000..043d2405c695 --- /dev/null +++ b/examples/v2/organizations/ListGlobalOrgs.rb @@ -0,0 +1,5 @@ +# List global orgs returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new +p api_instance.list_global_orgs("user@example.com") diff --git a/examples/v2/organizations/ListGlobalOrgs_465966063.rb b/examples/v2/organizations/ListGlobalOrgs_465966063.rb new file mode 100644 index 000000000000..611f7b866305 --- /dev/null +++ b/examples/v2/organizations/ListGlobalOrgs_465966063.rb @@ -0,0 +1,5 @@ +# List global orgs returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new +api_instance.list_global_orgs_with_pagination("user@example.com") { |item| puts item } diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 99d25ebd4aab..e7a9cabb15f7 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3215,6 +3215,34 @@ "form_id" => "UUID", "body" => "UpsertAndPublishFormVersionRequest", }, + "v2.ListGlobalOrgs" => { + "user_handle" => "String", + "page_limit" => "Integer", + "page_cursor" => "String", + }, + "v2.ListOrgs" => { + "filter_name" => "String", + }, + "v2.UpdateOrgSamlConfigurations" => { + "body" => "OrgSAMLPreferencesUpdateRequest", + }, + "v2.GetOrgConfig" => { + "org_config_name" => "String", + }, + "v2.UpdateOrgConfig" => { + "org_config_name" => "String", + "body" => "OrgConfigWriteRequest", + }, + "v2.UploadIdPMetadata" => { + "idp_file" => "File", + }, + "v2.GetSAMLConfiguration" => { + "saml_config_uuid" => "String", + }, + "v2.UpdateSAMLConfiguration" => { + "saml_config_uuid" => "String", + "body" => "SAMLConfigurationUpdateRequest", + }, "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, @@ -4335,29 +4363,6 @@ "v2.ResolveOnCallPage" => { "page_id" => "UUID", }, - "v2.ListOrgs" => { - "filter_name" => "String", - }, - "v2.UpdateOrgSamlConfigurations" => { - "body" => "OrgSAMLPreferencesUpdateRequest", - }, - "v2.GetOrgConfig" => { - "org_config_name" => "String", - }, - "v2.UpdateOrgConfig" => { - "org_config_name" => "String", - "body" => "OrgConfigWriteRequest", - }, - "v2.UploadIdPMetadata" => { - "idp_file" => "File", - }, - "v2.GetSAMLConfiguration" => { - "saml_config_uuid" => "String", - }, - "v2.UpdateSAMLConfiguration" => { - "saml_config_uuid" => "String", - "body" => "SAMLConfigurationUpdateRequest", - }, "v2.DisableCustomerOrg" => { "body" => "CustomerOrgDisableRequest", }, @@ -5180,26 +5185,6 @@ "app_key_id" => "String", "body" => "ApplicationKeyUpdateRequest", }, - "v2.ListIncidentServices" => { - "include" => "IncidentRelatedObject", - "page_size" => "Integer", - "page_offset" => "Integer", - "filter" => "String", - }, - "v2.CreateIncidentService" => { - "body" => "IncidentServiceCreateRequest", - }, - "v2.DeleteIncidentService" => { - "service_id" => "String", - }, - "v2.GetIncidentService" => { - "service_id" => "String", - "include" => "IncidentRelatedObject", - }, - "v2.UpdateIncidentService" => { - "service_id" => "String", - "body" => "IncidentServiceUpdateRequest", - }, "v2.ListServiceDefinitions" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index 6b90cd6f6578..fb03c29c0572 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1496,18 +1496,6 @@ "tag": "Service Accounts", "operationId": "CreateServiceAccountApplicationKey" }, - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\"\n },\n \"type\": \"services\"\n }\n}" - } - ], - "step": "there is a valid \"service\" in the system", - "key": "service", - "tag": "Incident Services", - "operationId": "CreateIncidentService" - }, { "parameters": [ { diff --git a/features/v2/incident_services.feature b/features/v2/incident_services.feature deleted file mode 100644 index eb5e5716d424..000000000000 --- a/features/v2/incident_services.feature +++ /dev/null @@ -1,146 +0,0 @@ -@endpoint(incident-services) @endpoint(incident-services-v2) -Feature: Incident Services - Create, update, delete, and retrieve services which can be associated with - incidents. See the [Incident Management - page](https://docs.datadoghq.com/service_management/incident_management/) - for more information. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "IncidentServices" API - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident service returns "Bad Request" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"attributes": {"name": "an example service name"}, "type": "services"}} - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/incident-app - Scenario: Create a new incident service returns "CREATED" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"type": "services", "attributes": {"name": "{{ unique }}"}}} - When the request is sent - Then the response status is 201 CREATED - And the response "data.attributes.name" is equal to "{{ unique }}" - And the response "data.type" is equal to "services" - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident service returns "Not Found" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"attributes": {"name": "an example service name"}, "type": "services"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "Bad Request" response - Given operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "Not Found" response - Given operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "OK" response - Given there is a valid "service" in the system - And operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "service.data.id" - When the request is sent - Then the response status is 204 OK - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "Bad Request" response - Given operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "Not Found" response - Given operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "OK" response - Given there is a valid "service" in the system - And operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - And request contains "filter" parameter from "service.data.attributes.name" - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].attributes.name" has the same value as "service.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident service returns "Bad Request" response - Given operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident service returns "Not Found" response - Given operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get details of an incident service returns "OK" response - Given there is a valid "service" in the system - And operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "service.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data.id" is equal to "{{service.data.id}}" - And the response "data.type" is equal to "services" - And the response "data.attributes.name" has the same value as "service.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident service returns "Bad Request" response - Given operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "an example service name"}, "id": "00000000-0000-0000-0000-000000000000", "type": "services"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident service returns "Not Found" response - Given operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "an example service name"}, "id": "00000000-0000-0000-0000-000000000000", "type": "services"}} - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Update an existing incident service returns "OK" response - Given there is a valid "service" in the system - And operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "service.data.id" - And body with value {"data": {"type": "services", "attributes": {"name": "{{ service.data.attributes.name }}-updated"}}} - When the request is sent - Then the response status is 200 OK - And the response "data.id" is equal to "{{service.data.id}}" - And the response "data.type" is equal to "services" - And the response "data.attributes.name" is equal to "{{ service.data.attributes.name }}-updated" diff --git a/features/v2/organizations.feature b/features/v2/organizations.feature index 01706fd55851..217e7bd2e259 100644 --- a/features/v2/organizations.feature +++ b/features/v2/organizations.feature @@ -61,6 +61,27 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "Bad Request" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "OK" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login @with-pagination + Scenario: List global orgs returns "OK" response with pagination + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: List your managed organizations returns "OK" response Given new "ListOrgs" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3a15f0b470c5..7b182ad052fe 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2756,6 +2756,12 @@ "type": "idempotent" } }, + "ListGlobalOrgs": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": { @@ -7762,25 +7768,6 @@ "type": "idempotent" } }, - "ListIncidentServices": { - "tag": "Incident Services", - "undo": { - "type": "safe" - } - }, - "CreateIncidentService": { - "tag": "Incident Services", - "undo": { - "operationId": "DeleteIncidentService", - "parameters": [ - { - "name": "service_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, "ListServiceDefinitions": { "tag": "Service Definition", "undo": { @@ -7812,24 +7799,6 @@ "type": "safe" } }, - "DeleteIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "idempotent" - } - }, - "GetIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "safe" - } - }, - "UpdateIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "idempotent" - } - }, "ListSecurityMonitoringHistsignals": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7308303b392a..1810246766cc 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -454,6 +454,7 @@ def initialize "v2.update_form": false, "v2.upsert_and_publish_form_version": false, "v2.upsert_form_version": false, + "v2.update_org_saml_configurations": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, "v2.delete_entity_integration_config": false, @@ -566,7 +567,6 @@ def initialize "v2.get_scopes_restriction": false, "v2.register_o_auth_client": false, "v2.upsert_scopes_restriction": false, - "v2.update_org_saml_configurations": false, "v2.disable_customer_org": false, "v2.bulk_update_org_group_memberships": false, "v2.create_org_group": false, @@ -617,11 +617,6 @@ def initialize "v2.create_scorecard_outcomes_batch": false, "v2.get_entity_risk_score": false, "v2.list_entity_risk_scores": false, - "v2.create_incident_service": false, - "v2.delete_incident_service": false, - "v2.get_incident_service": false, - "v2.list_incident_services": false, - "v2.update_incident_service": false, "v2.create_slo_report_job": false, "v2.get_slo_report": false, "v2.get_slo_report_job_status": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a49231cc9f2e..01075bebd96d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3440,7 +3440,17 @@ def overrides "v2.global_incident_settings_request" => "GlobalIncidentSettingsRequest", "v2.global_incident_settings_response" => "GlobalIncidentSettingsResponse", "v2.global_incident_settings_type" => "GlobalIncidentSettingsType", + "v2.global_org" => "GlobalOrg", + "v2.global_org_attributes" => "GlobalOrgAttributes", + "v2.global_org_data" => "GlobalOrgData", "v2.global_org_identifier" => "GlobalOrgIdentifier", + "v2.global_orgs_links" => "GlobalOrgsLinks", + "v2.global_orgs_meta" => "GlobalOrgsMeta", + "v2.global_orgs_meta_page" => "GlobalOrgsMetaPage", + "v2.global_orgs_meta_page_type" => "GlobalOrgsMetaPageType", + "v2.global_orgs_response" => "GlobalOrgsResponse", + "v2.global_org_type" => "GlobalOrgType", + "v2.global_org_user" => "GlobalOrgUser", "v2.global_variable_data" => "GlobalVariableData", "v2.global_variable_json_patch_request" => "GlobalVariableJsonPatchRequest", "v2.global_variable_json_patch_request_data" => "GlobalVariableJsonPatchRequestData", @@ -3665,19 +3675,6 @@ def overrides "v2.incident_search_response_user_facet_data" => "IncidentSearchResponseUserFacetData", "v2.incident_search_results_type" => "IncidentSearchResultsType", "v2.incident_search_sort_order" => "IncidentSearchSortOrder", - "v2.incident_service_create_attributes" => "IncidentServiceCreateAttributes", - "v2.incident_service_create_data" => "IncidentServiceCreateData", - "v2.incident_service_create_request" => "IncidentServiceCreateRequest", - "v2.incident_service_included_items" => "IncidentServiceIncludedItems", - "v2.incident_service_relationships" => "IncidentServiceRelationships", - "v2.incident_service_response" => "IncidentServiceResponse", - "v2.incident_service_response_attributes" => "IncidentServiceResponseAttributes", - "v2.incident_service_response_data" => "IncidentServiceResponseData", - "v2.incident_services_response" => "IncidentServicesResponse", - "v2.incident_service_type" => "IncidentServiceType", - "v2.incident_service_update_attributes" => "IncidentServiceUpdateAttributes", - "v2.incident_service_update_data" => "IncidentServiceUpdateData", - "v2.incident_service_update_request" => "IncidentServiceUpdateRequest", "v2.incident_severity" => "IncidentSeverity", "v2.incidents_response" => "IncidentsResponse", "v2.incident_timeline_cell_create_attributes" => "IncidentTimelineCellCreateAttributes", @@ -4858,6 +4855,8 @@ def overrides "v2.observability_pipeline_generated_metric_metric_type" => "ObservabilityPipelineGeneratedMetricMetricType", "v2.observability_pipeline_generate_metrics_processor" => "ObservabilityPipelineGenerateMetricsProcessor", "v2.observability_pipeline_generate_metrics_processor_type" => "ObservabilityPipelineGenerateMetricsProcessorType", + "v2.observability_pipeline_generate_metrics_v2_processor" => "ObservabilityPipelineGenerateMetricsV2Processor", + "v2.observability_pipeline_generate_metrics_v2_processor_type" => "ObservabilityPipelineGenerateMetricsV2ProcessorType", "v2.observability_pipeline_google_chronicle_destination" => "ObservabilityPipelineGoogleChronicleDestination", "v2.observability_pipeline_google_chronicle_destination_encoding" => "ObservabilityPipelineGoogleChronicleDestinationEncoding", "v2.observability_pipeline_google_chronicle_destination_type" => "ObservabilityPipelineGoogleChronicleDestinationType", @@ -7685,7 +7684,6 @@ def overrides "v2.gcp_integration_api" => "GCPIntegrationAPI", "v2.google_chat_integration_api" => "GoogleChatIntegrationAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", - "v2.incident_services_api" => "IncidentServicesAPI", "v2.incidents_api" => "IncidentsAPI", "v2.integrations_api" => "IntegrationsAPI", "v2.ip_allowlist_api" => "IPAllowlistAPI", diff --git a/lib/datadog_api_client/v2/api/incident_services_api.rb b/lib/datadog_api_client/v2/api/incident_services_api.rb deleted file mode 100644 index 9af1b9169d99..000000000000 --- a/lib/datadog_api_client/v2/api/incident_services_api.rb +++ /dev/null @@ -1,419 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'cgi' - -module DatadogAPIClient::V2 - class IncidentServicesAPI - attr_accessor :api_client - - def initialize(api_client = DatadogAPIClient::APIClient.default) - @api_client = api_client - end - - # Create a new incident service. - # - # @see #create_incident_service_with_http_info - def create_incident_service(body, opts = {}) - data, _status_code, _headers = create_incident_service_with_http_info(body, opts) - data - end - - # Create a new incident service. - # - # Creates a new incident service. - # - # @deprecated This API is deprecated. - # - # @param body [IncidentServiceCreateRequest] Incident Service Payload. - # @param opts [Hash] the optional parameters - # @return [Array<(IncidentServiceResponse, Integer, Hash)>] IncidentServiceResponse data, response status code and response headers - def create_incident_service_with_http_info(body, opts = {}) - warn "[DEPRECATION] `CreateIncidentService` is deprecated." - unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_service".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_service") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_service")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentServicesAPI.create_incident_service ...' - 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 IncidentServicesAPI.create_incident_service" - end - # resource path - local_var_path = '/api/v2/services' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'IncidentServiceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :create_incident_service, - :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: IncidentServicesAPI#create_incident_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete an existing incident service. - # - # @see #delete_incident_service_with_http_info - def delete_incident_service(service_id, opts = {}) - delete_incident_service_with_http_info(service_id, opts) - nil - end - - # Delete an existing incident service. - # - # Deletes an existing incident service. - # - # @deprecated This API is deprecated. - # - # @param service_id [String] The ID of the incident service. - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_service_with_http_info(service_id, opts = {}) - warn "[DEPRECATION] `DeleteIncidentService` is deprecated." - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_service".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_service") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_service")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentServicesAPI.delete_incident_service ...' - end - # verify the required parameter 'service_id' is set - if @api_client.config.client_side_validation && service_id.nil? - fail ArgumentError, "Missing the required parameter 'service_id' when calling IncidentServicesAPI.delete_incident_service" - end - # resource path - local_var_path = '/api/v2/services/{service_id}'.sub('{service_id}', CGI.escape(service_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :delete_incident_service, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentServicesAPI#delete_incident_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get details of an incident service. - # - # @see #get_incident_service_with_http_info - def get_incident_service(service_id, opts = {}) - data, _status_code, _headers = get_incident_service_with_http_info(service_id, opts) - data - end - - # Get details of an incident service. - # - # Get details of an incident service. If the `include[users]` query parameter is provided, - # the included attribute will contain the users related to these incident services. - # - # @deprecated This API is deprecated. - # - # @param service_id [String] The ID of the incident service. - # @param opts [Hash] the optional parameters - # @option opts [IncidentRelatedObject] :include Specifies which types of related objects should be included in the response. - # @return [Array<(IncidentServiceResponse, Integer, Hash)>] IncidentServiceResponse data, response status code and response headers - def get_incident_service_with_http_info(service_id, opts = {}) - warn "[DEPRECATION] `GetIncidentService` is deprecated." - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_service".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_service") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_service")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentServicesAPI.get_incident_service ...' - end - # verify the required parameter 'service_id' is set - if @api_client.config.client_side_validation && service_id.nil? - fail ArgumentError, "Missing the required parameter 'service_id' when calling IncidentServicesAPI.get_incident_service" - end - allowable_values = ['users', 'attachments'] - if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) - fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/api/v2/services/{service_id}'.sub('{service_id}', CGI.escape(service_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']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'IncidentServiceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :get_incident_service, - :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: IncidentServicesAPI#get_incident_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get a list of all incident services. - # - # @see #list_incident_services_with_http_info - def list_incident_services(opts = {}) - data, _status_code, _headers = list_incident_services_with_http_info(opts) - data - end - - # Get a list of all incident services. - # - # Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services. - # - # @deprecated This API is deprecated. - # - # @param opts [Hash] the optional parameters - # @option opts [IncidentRelatedObject] :include Specifies which types of related objects should be included in the response. - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. - # @option opts [String] :filter A search query that filters services by name. - # @return [Array<(IncidentServicesResponse, Integer, Hash)>] IncidentServicesResponse data, response status code and response headers - def list_incident_services_with_http_info(opts = {}) - warn "[DEPRECATION] `ListIncidentServices` is deprecated." - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_services".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_services") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_services")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentServicesAPI.list_incident_services ...' - end - allowable_values = ['users', 'attachments'] - if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) - fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/api/v2/services' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'IncidentServicesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :list_incident_services, - :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: IncidentServicesAPI#list_incident_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update an existing incident service. - # - # @see #update_incident_service_with_http_info - def update_incident_service(service_id, body, opts = {}) - data, _status_code, _headers = update_incident_service_with_http_info(service_id, body, opts) - data - end - - # Update an existing incident service. - # - # Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update. - # - # @deprecated This API is deprecated. - # - # @param service_id [String] The ID of the incident service. - # @param body [IncidentServiceUpdateRequest] Incident Service Payload. - # @param opts [Hash] the optional parameters - # @return [Array<(IncidentServiceResponse, Integer, Hash)>] IncidentServiceResponse data, response status code and response headers - def update_incident_service_with_http_info(service_id, body, opts = {}) - warn "[DEPRECATION] `UpdateIncidentService` is deprecated." - unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_service".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_service") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_service")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentServicesAPI.update_incident_service ...' - end - # verify the required parameter 'service_id' is set - if @api_client.config.client_side_validation && service_id.nil? - fail ArgumentError, "Missing the required parameter 'service_id' when calling IncidentServicesAPI.update_incident_service" - 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 IncidentServicesAPI.update_incident_service" - end - # resource path - local_var_path = '/api/v2/services/{service_id}'.sub('{service_id}', CGI.escape(service_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'IncidentServiceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :update_incident_service, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentServicesAPI#update_incident_service\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/organizations_api.rb b/lib/datadog_api_client/v2/api/organizations_api.rb index 180b9c517cee..c23657cac9b4 100644 --- a/lib/datadog_api_client/v2/api/organizations_api.rb +++ b/lib/datadog_api_client/v2/api/organizations_api.rb @@ -153,6 +153,103 @@ def get_saml_configuration_with_http_info(saml_config_uuid, opts = {}) return data, status_code, headers end + # List global orgs. + # + # @see #list_global_orgs_with_http_info + def list_global_orgs(user_handle, opts = {}) + data, _status_code, _headers = list_global_orgs_with_http_info(user_handle, opts) + data + end + + # List global orgs. + # + # Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + # + # @param user_handle [String] The handle of the authenticated user. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_limit Maximum number of results returned. + # @option opts [String] :page_cursor String to query the next page of results. This key is provided with each valid response from the API in `meta.page.next_cursor`. + # @return [Array<(GlobalOrgsResponse, Integer, Hash)>] GlobalOrgsResponse data, response status code and response headers + def list_global_orgs_with_http_info(user_handle, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsAPI.list_global_orgs ...' + end + # verify the required parameter 'user_handle' is set + if @api_client.config.client_side_validation && user_handle.nil? + fail ArgumentError, "Missing the required parameter 'user_handle' when calling OrganizationsAPI.list_global_orgs" + end + if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling OrganizationsAPI.list_global_orgs, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling OrganizationsAPI.list_global_orgs, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/global_orgs' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'user_handle'] = user_handle + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].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] || 'GlobalOrgsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_global_orgs, + :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: OrganizationsAPI#list_global_orgs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List global orgs. + # + # Provide a paginated version of {#list_global_orgs}, returning all items. + # + # To use it you need to use a block: list_global_orgs_with_pagination { |item| p item } + # + # @yield [GlobalOrgData] Paginated items + def list_global_orgs_with_pagination(user_handle, opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_limit", 100) + @api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size) + while true do + response = list_global_orgs(user_handle, opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length == 0 + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_cursor", String, @api_client.get_attribute_from_path(response, "meta.page.next_cursor")) + end + end + # List Org Configs. # # @see #list_org_configs_with_http_info diff --git a/lib/datadog_api_client/v2/models/incident_service_create_attributes.rb b/lib/datadog_api_client/v2/models/global_org.rb similarity index 66% rename from lib/datadog_api_client/v2/models/incident_service_create_attributes.rb rename to lib/datadog_api_client/v2/models/global_org.rb index da1240072701..aa88f880a2a5 100644 --- a/lib/datadog_api_client/v2/models/incident_service_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/global_org.rb @@ -17,20 +17,32 @@ require 'time' module DatadogAPIClient::V2 - # The incident service's attributes for a create request. - class IncidentServiceCreateAttributes + # Organization information for a global organization association. + class GlobalOrg include BaseGenericModel - # Name of the incident service. + # The name of the organization. attr_reader :name + # The public identifier of the organization. + attr_accessor :public_id + + # The subdomain used to access the organization, if configured. + attr_accessor :subdomain + + # The UUID of the organization. + attr_reader :uuid + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { - :'name' => :'name' + :'name' => :'name', + :'public_id' => :'public_id', + :'subdomain' => :'subdomain', + :'uuid' => :'uuid' } end @@ -38,16 +50,28 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'name' => :'String' + :'name' => :'String', + :'public_id' => :'String', + :'subdomain' => :'String', + :'uuid' => :'UUID' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'public_id', + :'subdomain', + ]) + 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::IncidentServiceCreateAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrg` initialize method" end self.additional_properties = {} @@ -63,6 +87,18 @@ def initialize(attributes = {}) if attributes.key?(:'name') self.name = attributes[:'name'] end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + + if attributes.key?(:'subdomain') + self.subdomain = attributes[:'subdomain'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end end # Check to see if the all the properties in the model are valid @@ -70,6 +106,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @name.nil? + return false if @uuid.nil? true end @@ -83,6 +120,16 @@ def name=(name) @name = name end + # Custom attribute writer method with validation + # @param uuid [Object] Object to be assigned + # @!visibility private + def uuid=(uuid) + if uuid.nil? + fail ArgumentError, 'invalid value for "uuid", uuid cannot be nil.' + end + @uuid = uuid + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -110,6 +157,9 @@ def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && + public_id == o.public_id && + subdomain == o.subdomain && + uuid == o.uuid && additional_properties == o.additional_properties end @@ -117,7 +167,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [name, additional_properties].hash + [name, public_id, subdomain, uuid, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/global_org_attributes.rb b/lib/datadog_api_client/v2/models/global_org_attributes.rb new file mode 100644 index 000000000000..96c1a998ae81 --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_org_attributes.rb @@ -0,0 +1,183 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an organization associated with the authenticated user. + class GlobalOrgAttributes + include BaseGenericModel + + # Organization information for a global organization association. + attr_reader :org + + # The login URL used to switch into the organization, if available. + attr_accessor :redirect_url + + # The source region of the organization. + attr_reader :source_region + + # User information for a global organization association. + attr_reader :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'org' => :'org', + :'redirect_url' => :'redirect_url', + :'source_region' => :'source_region', + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'org' => :'GlobalOrg', + :'redirect_url' => :'String', + :'source_region' => :'String', + :'user' => :'GlobalOrgUser' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'redirect_url', + ]) + 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::GlobalOrgAttributes` 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?(:'org') + self.org = attributes[:'org'] + end + + if attributes.key?(:'redirect_url') + self.redirect_url = attributes[:'redirect_url'] + end + + if attributes.key?(:'source_region') + self.source_region = attributes[:'source_region'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @org.nil? + return false if @source_region.nil? + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param org [Object] Object to be assigned + # @!visibility private + def org=(org) + if org.nil? + fail ArgumentError, 'invalid value for "org", org cannot be nil.' + end + @org = org + end + + # Custom attribute writer method with validation + # @param source_region [Object] Object to be assigned + # @!visibility private + def source_region=(source_region) + if source_region.nil? + fail ArgumentError, 'invalid value for "source_region", source_region cannot be nil.' + end + @source_region = source_region + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + org == o.org && + redirect_url == o.redirect_url && + source_region == o.source_region && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [org, redirect_url, source_region, user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_create_data.rb b/lib/datadog_api_client/v2/models/global_org_data.rb similarity index 80% rename from lib/datadog_api_client/v2/models/incident_service_create_data.rb rename to lib/datadog_api_client/v2/models/global_org_data.rb index 35e600d4d15e..4db3c75e7c1c 100644 --- a/lib/datadog_api_client/v2/models/incident_service_create_data.rb +++ b/lib/datadog_api_client/v2/models/global_org_data.rb @@ -17,17 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Incident Service payload for create requests. - class IncidentServiceCreateData + # An organization associated with the authenticated user. + class GlobalOrgData include BaseGenericModel - # The incident service's attributes for a create request. - attr_accessor :attributes + # Attributes of an organization associated with the authenticated user. + attr_reader :attributes - # The incident service's relationships. - attr_accessor :relationships - - # Incident service resource type. + # The resource type for global user organizations. attr_reader :type attr_accessor :additional_properties @@ -37,7 +34,6 @@ class IncidentServiceCreateData def self.attribute_map { :'attributes' => :'attributes', - :'relationships' => :'relationships', :'type' => :'type' } end @@ -46,9 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'IncidentServiceCreateAttributes', - :'relationships' => :'IncidentServiceRelationships', - :'type' => :'IncidentServiceType' + :'attributes' => :'GlobalOrgAttributes', + :'type' => :'GlobalOrgType' } end @@ -57,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceCreateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgData` initialize method" end self.additional_properties = {} @@ -74,10 +69,6 @@ def initialize(attributes = {}) self.attributes = attributes[:'attributes'] end - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] - end - if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -87,10 +78,21 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @attributes.nil? return false if @type.nil? true end + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + # Custom attribute writer method with validation # @param type [Object] Object to be assigned # @!visibility private @@ -128,7 +130,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && attributes == o.attributes && - relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -137,7 +138,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, relationships, type, additional_properties].hash + [attributes, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/global_org_type.rb b/lib/datadog_api_client/v2/models/global_org_type.rb new file mode 100644 index 000000000000..c6db59d7f362 --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_org_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for global user organizations. + class GlobalOrgType + include BaseEnumModel + + GLOBAL_USER_ORGS = "global_user_orgs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_response.rb b/lib/datadog_api_client/v2/models/global_org_user.rb similarity index 70% rename from lib/datadog_api_client/v2/models/incident_service_response.rb rename to lib/datadog_api_client/v2/models/global_org_user.rb index 302485f615d5..59060fb7994e 100644 --- a/lib/datadog_api_client/v2/models/incident_service_response.rb +++ b/lib/datadog_api_client/v2/models/global_org_user.rb @@ -17,15 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # Response with an incident service payload. - class IncidentServiceResponse + # User information for a global organization association. + class GlobalOrgUser include BaseGenericModel - # Incident Service data from responses. - attr_reader :data + # The handle of the user. + attr_reader :handle - # Included objects from relationships. - attr_accessor :included + # The UUID of the user. + attr_reader :uuid attr_accessor :additional_properties @@ -33,8 +33,8 @@ class IncidentServiceResponse # @!visibility private def self.attribute_map { - :'data' => :'data', - :'included' => :'included' + :'handle' => :'handle', + :'uuid' => :'uuid' } end @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'IncidentServiceResponseData', - :'included' => :'Array' + :'handle' => :'String', + :'uuid' => :'UUID' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgUser` initialize method" end self.additional_properties = {} @@ -65,14 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'data') - self.data = attributes[:'data'] + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] end - if attributes.key?(:'included') - if (value = attributes[:'included']).is_a?(Array) - self.included = value - end + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] end end @@ -80,18 +78,29 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @data.nil? + return false if @handle.nil? + return false if @uuid.nil? true end # Custom attribute writer method with validation - # @param data [Object] Object to be assigned + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param uuid [Object] Object to be assigned # @!visibility private - def data=(data) - if data.nil? - fail ArgumentError, 'invalid value for "data", data cannot be nil.' + def uuid=(uuid) + if uuid.nil? + fail ArgumentError, 'invalid value for "uuid", uuid cannot be nil.' end - @data = data + @uuid = uuid end # Returns the object in the form of hash, with additionalProperties support. @@ -120,8 +129,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - data == o.data && - included == o.included && + handle == o.handle && + uuid == o.uuid && additional_properties == o.additional_properties end @@ -129,7 +138,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, included, additional_properties].hash + [handle, uuid, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_service_update_attributes.rb b/lib/datadog_api_client/v2/models/global_orgs_links.rb similarity index 72% rename from lib/datadog_api_client/v2/models/incident_service_update_attributes.rb rename to lib/datadog_api_client/v2/models/global_orgs_links.rb index ba05b5a8c2d5..ec97d29998fe 100644 --- a/lib/datadog_api_client/v2/models/incident_service_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/global_orgs_links.rb @@ -17,12 +17,18 @@ require 'time' module DatadogAPIClient::V2 - # The incident service's attributes for an update request. - class IncidentServiceUpdateAttributes + # Pagination links. + class GlobalOrgsLinks include BaseGenericModel - # Name of the incident service. - attr_reader :name + # Link to the next page. + attr_accessor :_next + + # Link to the previous page. + attr_accessor :prev + + # Link to the current page. + attr_accessor :_self attr_accessor :additional_properties @@ -30,7 +36,9 @@ class IncidentServiceUpdateAttributes # @!visibility private def self.attribute_map { - :'name' => :'name' + :'_next' => :'next', + :'prev' => :'prev', + :'_self' => :'self' } end @@ -38,16 +46,27 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'name' => :'String' + :'_next' => :'String', + :'prev' => :'String', + :'_self' => :'String' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'_next', + :'prev', + ]) + 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::IncidentServiceUpdateAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgsLinks` initialize method" end self.additional_properties = {} @@ -60,27 +79,17 @@ def initialize(attributes = {}) end } - if attributes.key?(:'name') - self.name = attributes[:'name'] + if attributes.key?(:'_next') + self._next = attributes[:'_next'] 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 @name.nil? - true - end + if attributes.key?(:'prev') + self.prev = attributes[:'prev'] + end - # Custom attribute writer method with validation - # @param name [Object] Object to be assigned - # @!visibility private - def name=(name) - if name.nil? - fail ArgumentError, 'invalid value for "name", name cannot be nil.' + if attributes.key?(:'_self') + self._self = attributes[:'_self'] end - @name = name end # Returns the object in the form of hash, with additionalProperties support. @@ -109,7 +118,9 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name && + _next == o._next && + prev == o.prev && + _self == o._self && additional_properties == o.additional_properties end @@ -117,7 +128,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [name, additional_properties].hash + [_next, prev, _self, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_service_relationships.rb b/lib/datadog_api_client/v2/models/global_orgs_meta.rb similarity index 75% rename from lib/datadog_api_client/v2/models/incident_service_relationships.rb rename to lib/datadog_api_client/v2/models/global_orgs_meta.rb index 5397d03e127d..6da5567d6e30 100644 --- a/lib/datadog_api_client/v2/models/incident_service_relationships.rb +++ b/lib/datadog_api_client/v2/models/global_orgs_meta.rb @@ -17,15 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # The incident service's relationships. - class IncidentServiceRelationships + # Response metadata object. + class GlobalOrgsMeta include BaseGenericModel - # Relationship to user. - attr_accessor :created_by - - # Relationship to user. - attr_accessor :last_modified_by + # Paging attributes. + attr_accessor :page attr_accessor :additional_properties @@ -33,8 +30,7 @@ class IncidentServiceRelationships # @!visibility private def self.attribute_map { - :'created_by' => :'created_by', - :'last_modified_by' => :'last_modified_by' + :'page' => :'page' } end @@ -42,8 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'created_by' => :'RelationshipToUser', - :'last_modified_by' => :'RelationshipToUser' + :'page' => :'GlobalOrgsMetaPage' } end @@ -52,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceRelationships` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgsMeta` initialize method" end self.additional_properties = {} @@ -65,12 +60,8 @@ def initialize(attributes = {}) end } - if attributes.key?(:'created_by') - self.created_by = attributes[:'created_by'] - end - - if attributes.key?(:'last_modified_by') - self.last_modified_by = attributes[:'last_modified_by'] + if attributes.key?(:'page') + self.page = attributes[:'page'] end end @@ -100,8 +91,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - created_by == o.created_by && - last_modified_by == o.last_modified_by && + page == o.page && additional_properties == o.additional_properties end @@ -109,7 +99,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_by, last_modified_by, additional_properties].hash + [page, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_service_response_data.rb b/lib/datadog_api_client/v2/models/global_orgs_meta_page.rb similarity index 62% rename from lib/datadog_api_client/v2/models/incident_service_response_data.rb rename to lib/datadog_api_client/v2/models/global_orgs_meta_page.rb index 9fc515c3d7f8..a6484ef1e230 100644 --- a/lib/datadog_api_client/v2/models/incident_service_response_data.rb +++ b/lib/datadog_api_client/v2/models/global_orgs_meta_page.rb @@ -17,21 +17,24 @@ require 'time' module DatadogAPIClient::V2 - # Incident Service data from responses. - class IncidentServiceResponseData + # Paging attributes. + class GlobalOrgsMetaPage include BaseGenericModel - # The incident service's attributes from a response. - attr_accessor :attributes + # The cursor used to get the current results, if any. + attr_accessor :cursor - # The incident service's ID. - attr_reader :id + # Number of results returned. + attr_reader :limit - # The incident service's relationships. - attr_accessor :relationships + # The cursor used to get the next results, if any. + attr_accessor :next_cursor - # Incident service resource type. - attr_reader :type + # The cursor used to get the previous results, if any. + attr_accessor :prev_cursor + + # Type of global orgs pagination. + attr_accessor :type attr_accessor :additional_properties @@ -39,9 +42,10 @@ class IncidentServiceResponseData # @!visibility private def self.attribute_map { - :'attributes' => :'attributes', - :'id' => :'id', - :'relationships' => :'relationships', + :'cursor' => :'cursor', + :'limit' => :'limit', + :'next_cursor' => :'next_cursor', + :'prev_cursor' => :'prev_cursor', :'type' => :'type' } end @@ -50,19 +54,29 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'IncidentServiceResponseAttributes', - :'id' => :'String', - :'relationships' => :'IncidentServiceRelationships', - :'type' => :'IncidentServiceType' + :'cursor' => :'String', + :'limit' => :'Integer', + :'next_cursor' => :'String', + :'prev_cursor' => :'String', + :'type' => :'GlobalOrgsMetaPageType' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_cursor', + :'prev_cursor', + ]) + 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::IncidentServiceResponseData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgsMetaPage` initialize method" end self.additional_properties = {} @@ -75,16 +89,20 @@ def initialize(attributes = {}) end } - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] + if attributes.key?(:'cursor') + self.cursor = attributes[:'cursor'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] end - if attributes.key?(:'id') - self.id = attributes[:'id'] + if attributes.key?(:'next_cursor') + self.next_cursor = attributes[:'next_cursor'] end - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] + if attributes.key?(:'prev_cursor') + self.prev_cursor = attributes[:'prev_cursor'] end if attributes.key?(:'type') @@ -96,29 +114,18 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @id.nil? - return false if @type.nil? + return false if !@limit.nil? && @limit > 1000 true end # Custom attribute writer method with validation - # @param id [Object] Object to be assigned - # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' - end - @id = id - end - - # Custom attribute writer method with validation - # @param type [Object] Object to be assigned + # @param limit [Object] Object to be assigned # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' + def limit=(limit) + if !limit.nil? && limit > 1000 + fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 1000.' end - @type = type + @limit = limit end # Returns the object in the form of hash, with additionalProperties support. @@ -147,9 +154,10 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - attributes == o.attributes && - id == o.id && - relationships == o.relationships && + cursor == o.cursor && + limit == o.limit && + next_cursor == o.next_cursor && + prev_cursor == o.prev_cursor && type == o.type && additional_properties == o.additional_properties end @@ -158,7 +166,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, relationships, type, additional_properties].hash + [cursor, limit, next_cursor, prev_cursor, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_service_type.rb b/lib/datadog_api_client/v2/models/global_orgs_meta_page_type.rb similarity index 85% rename from lib/datadog_api_client/v2/models/incident_service_type.rb rename to lib/datadog_api_client/v2/models/global_orgs_meta_page_type.rb index 9bf573f411c2..2d2d8d8feb7a 100644 --- a/lib/datadog_api_client/v2/models/incident_service_type.rb +++ b/lib/datadog_api_client/v2/models/global_orgs_meta_page_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # Incident service resource type. - class IncidentServiceType + # Type of global orgs pagination. + class GlobalOrgsMetaPageType include BaseEnumModel - SERVICES = "services".freeze + CURSOR = "cursor".freeze end end diff --git a/lib/datadog_api_client/v2/models/incident_services_response.rb b/lib/datadog_api_client/v2/models/global_orgs_response.rb similarity index 81% rename from lib/datadog_api_client/v2/models/incident_services_response.rb rename to lib/datadog_api_client/v2/models/global_orgs_response.rb index 9fb2a714ef98..c4236c62750e 100644 --- a/lib/datadog_api_client/v2/models/incident_services_response.rb +++ b/lib/datadog_api_client/v2/models/global_orgs_response.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Response with a list of incident service payloads. - class IncidentServicesResponse + # Response containing organizations across regions for the authenticated user. + class GlobalOrgsResponse include BaseGenericModel - # An array of incident services. + # Organizations across regions for the authenticated user. attr_reader :data - # Included related resources which the user requested. - attr_accessor :included + # Pagination links. + attr_accessor :links - # The metadata object containing pagination metadata. + # Response metadata object. attr_accessor :meta attr_accessor :additional_properties @@ -37,7 +37,7 @@ class IncidentServicesResponse def self.attribute_map { :'data' => :'data', - :'included' => :'included', + :'links' => :'links', :'meta' => :'meta' } end @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array', - :'included' => :'Array', - :'meta' => :'IncidentResponseMeta' + :'data' => :'Array', + :'links' => :'GlobalOrgsLinks', + :'meta' => :'GlobalOrgsMeta' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServicesResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GlobalOrgsResponse` initialize method" end self.additional_properties = {} @@ -76,10 +76,8 @@ def initialize(attributes = {}) end end - if attributes.key?(:'included') - if (value = attributes[:'included']).is_a?(Array) - self.included = value - end + if attributes.key?(:'links') + self.links = attributes[:'links'] end if attributes.key?(:'meta') @@ -132,7 +130,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && - included == o.included && + links == o.links && meta == o.meta && additional_properties == o.additional_properties end @@ -141,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, included, meta, additional_properties].hash + [data, links, meta, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_service_create_request.rb b/lib/datadog_api_client/v2/models/incident_service_create_request.rb deleted file mode 100644 index 550e93d7e4a3..000000000000 --- a/lib/datadog_api_client/v2/models/incident_service_create_request.rb +++ /dev/null @@ -1,123 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Create request with an incident service payload. - class IncidentServiceCreateRequest - include BaseGenericModel - - # Incident Service payload for create requests. - 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' => :'IncidentServiceCreateData' - } - 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::IncidentServiceCreateRequest` 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/incident_service_included_items.rb b/lib/datadog_api_client/v2/models/incident_service_included_items.rb deleted file mode 100644 index 59a739d17c1f..000000000000 --- a/lib/datadog_api_client/v2/models/incident_service_included_items.rb +++ /dev/null @@ -1,62 +0,0 @@ -=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 - # An object related to an incident service which is present in the included payload. - module IncidentServiceIncludedItems - class << self - include BaseOneOfModel - include BaseOneOfModelNoDiscriminator - - # List of class defined in oneOf (OpenAPI v3) - def openapi_one_of - [ - :'User' - ] - end - # Builds the object - # @param data [Mixed] Data to be matched against the list of oneOf items - # @return [Object] Returns the model or the data itself - def build(data) - # Go through the list of oneOf items and attempt to identify the appropriate one. - # Note: - # - We do not attempt to check whether exactly one item matches. - # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) - # due to the way the deserialization is made in the base_object template (it just casts without verifying). - # - TODO: scalar values are de facto behaving as if they were nullable. - # - TODO: logging when debugging is set. - openapi_one_of.each do |klass| - begin - next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed - return typed_data if typed_data - rescue # rescue all errors so we keep iterating even if the current item lookup raises - end - end - - if openapi_one_of.include?(:AnyType) - data - else - self._unparsed = true - DatadogAPIClient::UnparsedObject.new(data) - end - end - end - end -end diff --git a/lib/datadog_api_client/v2/models/incident_service_response_attributes.rb b/lib/datadog_api_client/v2/models/incident_service_response_attributes.rb deleted file mode 100644 index 5788c6fc7095..000000000000 --- a/lib/datadog_api_client/v2/models/incident_service_response_attributes.rb +++ /dev/null @@ -1,125 +0,0 @@ -=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 incident service's attributes from a response. - class IncidentServiceResponseAttributes - include BaseGenericModel - - # Timestamp of when the incident service was created. - attr_accessor :created - - # Timestamp of when the incident service was modified. - attr_accessor :modified - - # Name of the incident service. - attr_accessor :name - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'created' => :'created', - :'modified' => :'modified', - :'name' => :'name' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'created' => :'Time', - :'modified' => :'Time', - :'name' => :'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::IncidentServiceResponseAttributes` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'modified') - self.modified = attributes[:'modified'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - 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 && - created == o.created && - modified == o.modified && - name == o.name && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [created, modified, name, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/incident_service_update_request.rb b/lib/datadog_api_client/v2/models/incident_service_update_request.rb deleted file mode 100644 index c670ab9196ad..000000000000 --- a/lib/datadog_api_client/v2/models/incident_service_update_request.rb +++ /dev/null @@ -1,123 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Update request with an incident service payload. - class IncidentServiceUpdateRequest - include BaseGenericModel - - # Incident Service payload for update requests. - 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' => :'IncidentServiceUpdateData' - } - 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::IncidentServiceUpdateRequest` 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/observability_pipeline_config_processor_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb index 402c3e6e483b..2dacb572fc85 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb @@ -35,6 +35,7 @@ def openapi_one_of :'ObservabilityPipelineDedupeProcessor', :'ObservabilityPipelineEnrichmentTableProcessor', :'ObservabilityPipelineGenerateMetricsProcessor', + :'ObservabilityPipelineGenerateMetricsV2Processor', :'ObservabilityPipelineOcsfMapperProcessor', :'ObservabilityPipelineParseGrokProcessor', :'ObservabilityPipelineParseJSONProcessor', diff --git a/lib/datadog_api_client/v2/models/incident_service_update_data.rb b/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor.rb similarity index 55% rename from lib/datadog_api_client/v2/models/incident_service_update_data.rb rename to lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor.rb index 056e95c9b0e2..edbf7209aede 100644 --- a/lib/datadog_api_client/v2/models/incident_service_update_data.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor.rb @@ -17,20 +17,30 @@ require 'time' module DatadogAPIClient::V2 - # Incident Service payload for update requests. - class IncidentServiceUpdateData + # The `generate_metrics` processor creates custom metrics from logs. + # Metrics can be counters, gauges, or distributions and optionally grouped by log fields. + # The generated metrics must be routed to a metrics destination using the input `.metrics`. + # + # **Supported pipeline types:** logs + class ObservabilityPipelineGenerateMetricsV2Processor include BaseGenericModel - # The incident service's attributes for an update request. - attr_accessor :attributes + # The display name for a component. + attr_accessor :display_name - # The incident service's ID. - attr_accessor :id + # Indicates whether the processor is enabled. + attr_reader :enabled - # The incident service's relationships. - attr_accessor :relationships + # The unique identifier for this component. Used to reference this component in other parts of the pipeline. + attr_reader :id - # Incident service resource type. + # A Datadog search query used to determine which logs this processor targets. + attr_accessor :include + + # Configuration for generating individual metrics. + attr_accessor :metrics + + # The processor type. Always `generate_metrics`. attr_reader :type attr_accessor :additional_properties @@ -39,9 +49,11 @@ class IncidentServiceUpdateData # @!visibility private def self.attribute_map { - :'attributes' => :'attributes', + :'display_name' => :'display_name', + :'enabled' => :'enabled', :'id' => :'id', - :'relationships' => :'relationships', + :'include' => :'include', + :'metrics' => :'metrics', :'type' => :'type' } end @@ -50,10 +62,12 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'IncidentServiceUpdateAttributes', + :'display_name' => :'String', + :'enabled' => :'Boolean', :'id' => :'String', - :'relationships' => :'IncidentServiceRelationships', - :'type' => :'IncidentServiceType' + :'include' => :'String', + :'metrics' => :'Array', + :'type' => :'ObservabilityPipelineGenerateMetricsV2ProcessorType' } end @@ -62,7 +76,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceUpdateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineGenerateMetricsV2Processor` initialize method" end self.additional_properties = {} @@ -75,16 +89,26 @@ def initialize(attributes = {}) end } - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] end if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'metrics') + if (value = attributes[:'metrics']).is_a?(Array) + self.metrics = value + end end if attributes.key?(:'type') @@ -96,10 +120,32 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @enabled.nil? + return false if @id.nil? return false if @type.nil? true end + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # 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 @@ -136,9 +182,11 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - attributes == o.attributes && + display_name == o.display_name && + enabled == o.enabled && id == o.id && - relationships == o.relationships && + include == o.include && + metrics == o.metrics && type == o.type && additional_properties == o.additional_properties end @@ -147,7 +195,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, relationships, type, additional_properties].hash + [display_name, enabled, id, include, metrics, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor_type.rb new file mode 100644 index 000000000000..9195e43a0c2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_v2_processor_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The processor type. Always `generate_metrics`. + class ObservabilityPipelineGenerateMetricsV2ProcessorType + include BaseEnumModel + + GENERATE_METRICS = "generate_metrics".freeze + end +end