diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e83df8269e5f..730cce5a68f5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28854,6 +28854,64 @@ components: $ref: "#/components/schemas/GetInterfacesData" type: array type: object + GetInvestigationResponse: + description: Response for a single Bits AI investigation. + properties: + data: + $ref: "#/components/schemas/GetInvestigationResponseData" + links: + $ref: "#/components/schemas/GetInvestigationResponseLinks" + required: + - data + - links + type: object + GetInvestigationResponseData: + description: Data for the get investigation response. + properties: + attributes: + $ref: "#/components/schemas/GetInvestigationResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + GetInvestigationResponseDataAttributes: + description: Attributes of the investigation. + properties: + conclusions: + description: The conclusions drawn from the investigation. + items: + $ref: "#/components/schemas/InvestigationConclusion" + type: array + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - title + - status + - conclusions + type: object + GetInvestigationResponseLinks: + description: Links related to the investigation. + properties: + self: + description: The URL to the investigation in the Datadog app. + example: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - self + type: object GetIssueIncludeQueryParameterItem: description: Relationship object that should be included in the response. enum: @@ -34312,6 +34370,34 @@ components: - DOWN - WARNING - "OFF" + InvestigationConclusion: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + properties: + description: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + example: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + type: string + summary: + description: A summary of the finding, including affected components and timeframe. + example: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + type: string + title: + description: The title of the conclusion. + example: "High CPU usage detected on web-server-01" + type: string + required: + - title + - summary + - description + type: object + InvestigationType: + description: The resource type for investigations. + enum: + - investigation + example: investigation + type: string + x-enum-varnames: + - INVESTIGATION Issue: description: The issue matching the request. properties: @@ -37692,6 +37778,113 @@ components: description: The type of the resource. The value should always be tags. type: string type: object + ListInvestigationsResponse: + description: Response for listing investigations. + properties: + data: + description: List of investigations. + items: + $ref: "#/components/schemas/ListInvestigationsResponseData" + type: array + links: + $ref: "#/components/schemas/ListInvestigationsResponseLinks" + meta: + $ref: "#/components/schemas/ListInvestigationsResponseMeta" + required: + - data + - meta + - links + type: object + ListInvestigationsResponseData: + description: Data for an investigation list item. + properties: + attributes: + $ref: "#/components/schemas/ListInvestigationsResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + ListInvestigationsResponseDataAttributes: + description: Attributes of an investigation list item. + properties: + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - status + - title + type: object + ListInvestigationsResponseLinks: + description: Pagination links for the list investigations response. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + required: + - first + - next + - self + type: object + ListInvestigationsResponseMeta: + description: Metadata for the list investigations response. + properties: + page: + $ref: "#/components/schemas/ListInvestigationsResponseMetaPage" + required: + - page + type: object + ListInvestigationsResponseMetaPage: + description: Pagination metadata. + properties: + limit: + description: Maximum number of results per page. + example: 10 + format: int64 + type: integer + offset: + description: Offset of the current page. + example: 0 + format: int64 + type: integer + total: + description: Total number of investigations. + example: 50 + format: int64 + type: integer + required: + - total + - limit + - offset + type: object ListKindCatalogResponse: description: List kind response. properties: @@ -41050,6 +41243,28 @@ components: maxLength: 255 type: string type: object + MonitorAlertTriggerAttributes: + description: Attributes for a monitor alert trigger. + properties: + event_id: + description: The event ID associated with the monitor alert. + example: "1234567890123456789" + type: string + event_ts: + description: The timestamp of the event in Unix milliseconds. + example: 1700000000000 + format: int64 + type: integer + monitor_id: + description: The monitor ID that triggered the alert. + example: 12345678 + format: int64 + type: integer + required: + - monitor_id + - event_id + - event_ts + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -70410,6 +70625,94 @@ components: - $ref: "#/components/schemas/SlackTriggerWrapper" - $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper" - $ref: "#/components/schemas/WorkflowTriggerWrapper" + TriggerAttributes: + description: The trigger definition for starting an investigation. + properties: + monitor_alert_trigger: + $ref: "#/components/schemas/MonitorAlertTriggerAttributes" + type: + $ref: "#/components/schemas/TriggerType" + required: + - type + - monitor_alert_trigger + type: object + TriggerInvestigationRequest: + description: Request to trigger a new investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationRequestData" + required: + - data + type: object + TriggerInvestigationRequestData: + description: Data for the trigger investigation request. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationRequestDataAttributes" + type: + $ref: "#/components/schemas/TriggerInvestigationRequestType" + required: + - type + - attributes + type: object + TriggerInvestigationRequestDataAttributes: + description: Attributes for the trigger investigation request. + properties: + trigger: + $ref: "#/components/schemas/TriggerAttributes" + required: + - trigger + type: object + TriggerInvestigationRequestType: + description: The resource type for trigger investigation requests. + enum: + - trigger_investigation_request + example: trigger_investigation_request + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_REQUEST + TriggerInvestigationResponse: + description: Response after triggering an investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationResponseData" + required: + - data + type: object + TriggerInvestigationResponseData: + description: Data for the trigger investigation response. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationResponseDataAttributes" + id: + description: Unique identifier for the trigger response. + example: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: string + type: + $ref: "#/components/schemas/TriggerInvestigationResponseType" + required: + - id + - type + - attributes + type: object + TriggerInvestigationResponseDataAttributes: + description: Attributes for the trigger investigation response. + properties: + investigation_id: + description: The ID of the investigation that was created. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - investigation_id + type: object + TriggerInvestigationResponseType: + description: The resource type for trigger investigation responses. + enum: + - trigger_investigation_response + example: trigger_investigation_response + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_RESPONSE TriggerRateLimit: description: Defines a rate limit for a trigger. properties: @@ -70433,6 +70736,14 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + TriggerType: + description: The type of trigger for the investigation. + enum: + - monitor_alert_trigger + example: monitor_alert_trigger + type: string + x-enum-varnames: + - MONITOR_ALERT_TRIGGER UCConfigPair: description: The definition of `UCConfigPair` object. example: @@ -74236,6 +74547,8 @@ components: apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. billing_read: View your organization's billing information. + bits_investigations_read: View Bits AI investigations. + bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. @@ -78326,6 +78639,213 @@ paths: operator: OR permissions: - user_access_manage + /api/v2/bits-ai/investigations: + get: + description: List all Bits AI investigations for the organization. + operationId: ListInvestigations + parameters: + - description: Offset for pagination. + example: 0 + in: query + name: page[offset] + required: false + schema: + format: int64 + type: integer + - description: Maximum number of investigations to return. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 100 + type: integer + - description: Filter investigations by monitor ID. + example: 12345678 + in: query + name: filter[monitor_id] + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + first: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + next: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + self: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + meta: + page: + limit: 10 + offset: 0 + total: 50 + schema: + $ref: "#/components/schemas/ListInvestigationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: List Bits AI investigations + tags: + - Bits AI + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Trigger a new Bits AI investigation based on a monitor alert. + operationId: TriggerInvestigation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + trigger: + monitor_alert_trigger: + event_id: "1234567890123456789" + event_ts: 1700000000000 + monitor_id: 12345678 + type: monitor_alert_trigger + type: trigger_investigation_request + schema: + $ref: "#/components/schemas/TriggerInvestigationRequest" + description: Trigger investigation request body. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + investigation_id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + id: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: trigger_investigation_response + schema: + $ref: "#/components/schemas/TriggerInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_write + summary: Trigger a Bits AI investigation + tags: + - Bits AI + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - bits_investigations_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/bits-ai/investigations/{id}: + get: + description: Get a specific Bits AI investigation by ID. + operationId: GetInvestigation + parameters: + - description: The ID of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + conclusions: + - description: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + summary: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + title: "High CPU usage detected on web-server-01" + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + self: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + schema: + $ref: "#/components/schemas/GetInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: Get a Bits AI investigation + tags: + - Bits AI + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cases: get: description: >- @@ -114317,6 +114837,9 @@ tags: is used to automatically map groups of users to roles in Datadog using attributes sent from Identity Providers. Use these endpoints to manage your AuthN Mappings. name: AuthN Mappings + - description: |- + Use the Bits AI endpoints to retrieve AI-powered investigations. + name: Bits AI - description: |- Search or aggregate your CI Visibility pipeline events and send them to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information. name: CI Visibility Pipelines diff --git a/examples/v2/bits-ai/GetInvestigation.rb b/examples/v2/bits-ai/GetInvestigation.rb new file mode 100644 index 000000000000..77fd1e55a933 --- /dev/null +++ b/examples/v2/bits-ai/GetInvestigation.rb @@ -0,0 +1,8 @@ +# Get a Bits AI investigation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_investigation".to_sym] = true +end +api_instance = DatadogAPIClient::V2::BitsAIAPI.new +p api_instance.get_investigation("id") diff --git a/examples/v2/bits-ai/ListInvestigations.rb b/examples/v2/bits-ai/ListInvestigations.rb new file mode 100644 index 000000000000..6adb019d762f --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations.rb @@ -0,0 +1,8 @@ +# List Bits AI investigations returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_investigations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::BitsAIAPI.new +p api_instance.list_investigations() diff --git a/examples/v2/bits-ai/ListInvestigations_130750454.rb b/examples/v2/bits-ai/ListInvestigations_130750454.rb new file mode 100644 index 000000000000..6fc2e686b127 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations_130750454.rb @@ -0,0 +1,8 @@ +# List Bits AI investigations returns "OK" response with pagination + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_investigations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::BitsAIAPI.new +api_instance.list_investigations_with_pagination() { |item| puts item } diff --git a/examples/v2/bits-ai/TriggerInvestigation.rb b/examples/v2/bits-ai/TriggerInvestigation.rb new file mode 100644 index 000000000000..d77c8abb1998 --- /dev/null +++ b/examples/v2/bits-ai/TriggerInvestigation.rb @@ -0,0 +1,24 @@ +# Trigger a Bits AI investigation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.trigger_investigation".to_sym] = true +end +api_instance = DatadogAPIClient::V2::BitsAIAPI.new + +body = DatadogAPIClient::V2::TriggerInvestigationRequest.new({ + data: DatadogAPIClient::V2::TriggerInvestigationRequestData.new({ + attributes: DatadogAPIClient::V2::TriggerInvestigationRequestDataAttributes.new({ + trigger: DatadogAPIClient::V2::TriggerAttributes.new({ + monitor_alert_trigger: DatadogAPIClient::V2::MonitorAlertTriggerAttributes.new({ + event_id: "1234567890123456789", + event_ts: 1700000000000, + monitor_id: 12345678, + }), + type: DatadogAPIClient::V2::TriggerType::MONITOR_ALERT_TRIGGER, + }), + }), + type: DatadogAPIClient::V2::TriggerInvestigationRequestType::TRIGGER_INVESTIGATION_REQUEST, + }), +}) +p api_instance.trigger_investigation(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9c7dbfe9962b..805891ffa991 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1178,6 +1178,17 @@ "authn_mapping_id" => "String", "body" => "AuthNMappingUpdateRequest", }, + "v2.ListInvestigations" => { + "page_offset" => "Integer", + "page_limit" => "Integer", + "filter_monitor_id" => "Integer", + }, + "v2.TriggerInvestigation" => { + "body" => "TriggerInvestigationRequest", + }, + "v2.GetInvestigation" => { + "id" => "String", + }, "v2.SearchCases" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/bits_ai.feature b/features/v2/bits_ai.feature new file mode 100644 index 000000000000..bc5ec941d8fa --- /dev/null +++ b/features/v2/bits_ai.feature @@ -0,0 +1,69 @@ +@endpoint(bits-ai) @endpoint(bits-ai-v2) +Feature: Bits AI + Use the Bits AI endpoints to retrieve AI-powered investigations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "BitsAI" API + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Bad Request" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Not Found" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "OK" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "Bad Request" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "OK" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai @with-pagination + Scenario: List Bits AI investigations returns "OK" response with pagination + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "Bad Request" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "OK" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 1f11ffb7e771..f1934b08c4c2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -650,6 +650,24 @@ "type": "idempotent" } }, + "ListInvestigations": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, + "TriggerInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "unsafe" + } + }, + "GetInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, "SearchCases": { "tag": "Case Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 74df85e5c1a9..ffe0f49bff60 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,6 +208,9 @@ def initialize "v2.get_open_api": false, "v2.list_apis": false, "v2.update_open_api": false, + "v2.get_investigation": false, + "v2.list_investigations": false, + "v2.trigger_investigation": false, "v2.create_case_jira_issue": false, "v2.create_case_notebook": false, "v2.create_case_service_now_ticket": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b38f547854a2..8749c9302cbd 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2778,6 +2778,10 @@ def overrides "v2.get_finding_response" => "GetFindingResponse", "v2.get_interfaces_data" => "GetInterfacesData", "v2.get_interfaces_response" => "GetInterfacesResponse", + "v2.get_investigation_response" => "GetInvestigationResponse", + "v2.get_investigation_response_data" => "GetInvestigationResponseData", + "v2.get_investigation_response_data_attributes" => "GetInvestigationResponseDataAttributes", + "v2.get_investigation_response_links" => "GetInvestigationResponseLinks", "v2.get_issue_include_query_parameter_item" => "GetIssueIncludeQueryParameterItem", "v2.get_mapping_response" => "GetMappingResponse", "v2.get_mapping_response_data" => "GetMappingResponseData", @@ -3135,6 +3139,8 @@ def overrides "v2.integration_type" => "IntegrationType", "v2.interface_attributes" => "InterfaceAttributes", "v2.interface_attributes_status" => "InterfaceAttributesStatus", + "v2.investigation_conclusion" => "InvestigationConclusion", + "v2.investigation_type" => "InvestigationType", "v2.ip_allowlist_attributes" => "IPAllowlistAttributes", "v2.ip_allowlist_data" => "IPAllowlistData", "v2.ip_allowlist_entry" => "IPAllowlistEntry", @@ -3309,6 +3315,12 @@ def overrides "v2.list_integrations_response" => "ListIntegrationsResponse", "v2.list_interface_tags_response" => "ListInterfaceTagsResponse", "v2.list_interface_tags_response_data" => "ListInterfaceTagsResponseData", + "v2.list_investigations_response" => "ListInvestigationsResponse", + "v2.list_investigations_response_data" => "ListInvestigationsResponseData", + "v2.list_investigations_response_data_attributes" => "ListInvestigationsResponseDataAttributes", + "v2.list_investigations_response_links" => "ListInvestigationsResponseLinks", + "v2.list_investigations_response_meta" => "ListInvestigationsResponseMeta", + "v2.list_investigations_response_meta_page" => "ListInvestigationsResponseMetaPage", "v2.list_kind_catalog_response" => "ListKindCatalogResponse", "v2.list_notification_channels_response" => "ListNotificationChannelsResponse", "v2.list_on_call_notification_rules_response" => "ListOnCallNotificationRulesResponse", @@ -3620,6 +3632,7 @@ def overrides "v2.microsoft_teams_workflows_webhook_handles_response" => "MicrosoftTeamsWorkflowsWebhookHandlesResponse", "v2.microsoft_teams_workflows_webhook_handle_type" => "MicrosoftTeamsWorkflowsWebhookHandleType", "v2.microsoft_teams_workflows_webhook_response_attributes" => "MicrosoftTeamsWorkflowsWebhookResponseAttributes", + "v2.monitor_alert_trigger_attributes" => "MonitorAlertTriggerAttributes", "v2.monitor_config_policy_attribute_create_request" => "MonitorConfigPolicyAttributeCreateRequest", "v2.monitor_config_policy_attribute_edit_request" => "MonitorConfigPolicyAttributeEditRequest", "v2.monitor_config_policy_attribute_response" => "MonitorConfigPolicyAttributeResponse", @@ -5554,8 +5567,18 @@ def overrides "v2.timeseries_response_series" => "TimeseriesResponseSeries", "v2.token_type" => "TokenType", "v2.trigger" => "Trigger", + "v2.trigger_attributes" => "TriggerAttributes", + "v2.trigger_investigation_request" => "TriggerInvestigationRequest", + "v2.trigger_investigation_request_data" => "TriggerInvestigationRequestData", + "v2.trigger_investigation_request_data_attributes" => "TriggerInvestigationRequestDataAttributes", + "v2.trigger_investigation_request_type" => "TriggerInvestigationRequestType", + "v2.trigger_investigation_response" => "TriggerInvestigationResponse", + "v2.trigger_investigation_response_data" => "TriggerInvestigationResponseData", + "v2.trigger_investigation_response_data_attributes" => "TriggerInvestigationResponseDataAttributes", + "v2.trigger_investigation_response_type" => "TriggerInvestigationResponseType", "v2.trigger_rate_limit" => "TriggerRateLimit", "v2.trigger_source" => "TriggerSource", + "v2.trigger_type" => "TriggerType", "v2.uc_config_pair" => "UCConfigPair", "v2.uc_config_pair_data" => "UCConfigPairData", "v2.uc_config_pair_data_attributes" => "UCConfigPairDataAttributes", @@ -5852,6 +5875,7 @@ def overrides "v2.authn_mappings_api" => "AuthNMappingsAPI", "v2.aws_integration_api" => "AWSIntegrationAPI", "v2.aws_logs_integration_api" => "AWSLogsIntegrationAPI", + "v2.bits_ai_api" => "BitsAIAPI", "v2.case_management_api" => "CaseManagementAPI", "v2.case_management_attribute_api" => "CaseManagementAttributeAPI", "v2.case_management_type_api" => "CaseManagementTypeAPI", diff --git a/lib/datadog_api_client/v2/api/bits_ai_api.rb b/lib/datadog_api_client/v2/api/bits_ai_api.rb new file mode 100644 index 000000000000..07fde84a7ac4 --- /dev/null +++ b/lib/datadog_api_client/v2/api/bits_ai_api.rb @@ -0,0 +1,266 @@ +=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 BitsAIAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get a Bits AI investigation. + # + # @see #get_investigation_with_http_info + def get_investigation(id, opts = {}) + data, _status_code, _headers = get_investigation_with_http_info(id, opts) + data + end + + # Get a Bits AI investigation. + # + # Get a specific Bits AI investigation by ID. + # + # @param id [String] The ID of the investigation. + # @param opts [Hash] the optional parameters + # @return [Array<(GetInvestigationResponse, Integer, Hash)>] GetInvestigationResponse data, response status code and response headers + def get_investigation_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_investigation".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_investigation") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_investigation")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BitsAIAPI.get_investigation ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling BitsAIAPI.get_investigation" + end + # resource path + local_var_path = '/api/v2/bits-ai/investigations/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetInvestigationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_investigation, + :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: BitsAIAPI#get_investigation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Bits AI investigations. + # + # @see #list_investigations_with_http_info + def list_investigations(opts = {}) + data, _status_code, _headers = list_investigations_with_http_info(opts) + data + end + + # List Bits AI investigations. + # + # List all Bits AI investigations for the organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_offset Offset for pagination. + # @option opts [Integer] :page_limit Maximum number of investigations to return. + # @option opts [Integer] :filter_monitor_id Filter investigations by monitor ID. + # @return [Array<(ListInvestigationsResponse, Integer, Hash)>] ListInvestigationsResponse data, response status code and response headers + def list_investigations_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_investigations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_investigations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_investigations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BitsAIAPI.list_investigations ...' + end + if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling BitsAIAPI.list_investigations, must be smaller than or equal to 100.' + end + # resource path + local_var_path = '/api/v2/bits-ai/investigations' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'filter[monitor_id]'] = opts[:'filter_monitor_id'] if !opts[:'filter_monitor_id'].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] || 'ListInvestigationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_investigations, + :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: BitsAIAPI#list_investigations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Bits AI investigations. + # + # Provide a paginated version of {#list_investigations}, returning all items. + # + # To use it you need to use a block: list_investigations_with_pagination { |item| p item } + # + # @yield [ListInvestigationsResponseData] Paginated items + def list_investigations_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_limit", 25) + @api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size) + while true do + response = list_investigations(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # Trigger a Bits AI investigation. + # + # @see #trigger_investigation_with_http_info + def trigger_investigation(body, opts = {}) + data, _status_code, _headers = trigger_investigation_with_http_info(body, opts) + data + end + + # Trigger a Bits AI investigation. + # + # Trigger a new Bits AI investigation based on a monitor alert. + # + # @param body [TriggerInvestigationRequest] Trigger investigation request body. + # @param opts [Hash] the optional parameters + # @return [Array<(TriggerInvestigationResponse, Integer, Hash)>] TriggerInvestigationResponse data, response status code and response headers + def trigger_investigation_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.trigger_investigation".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.trigger_investigation") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.trigger_investigation")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BitsAIAPI.trigger_investigation ...' + 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 BitsAIAPI.trigger_investigation" + end + # resource path + local_var_path = '/api/v2/bits-ai/investigations' + + # 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] || 'TriggerInvestigationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :trigger_investigation, + :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: BitsAIAPI#trigger_investigation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_investigation_response.rb b/lib/datadog_api_client/v2/models/get_investigation_response.rb new file mode 100644 index 000000000000..4caf7f17585a --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_investigation_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a single Bits AI investigation. + class GetInvestigationResponse + include BaseGenericModel + + # Data for the get investigation response. + attr_reader :data + + # Links related to the investigation. + attr_reader :links + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetInvestigationResponseData', + :'links' => :'GetInvestigationResponseLinks' + } + 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::GetInvestigationResponse` 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 + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_investigation_response_data.rb b/lib/datadog_api_client/v2/models/get_investigation_response_data.rb new file mode 100644 index 000000000000..f17b29a41fc6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_investigation_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the get investigation response. + class GetInvestigationResponseData + include BaseGenericModel + + # Attributes of the investigation. + attr_reader :attributes + + # The unique identifier of the investigation. + attr_reader :id + + # The resource type for investigations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GetInvestigationResponseDataAttributes', + :'id' => :'String', + :'type' => :'InvestigationType' + } + 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::GetInvestigationResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_investigation_response_data_attributes.rb b/lib/datadog_api_client/v2/models/get_investigation_response_data_attributes.rb new file mode 100644 index 000000000000..9a5ea45e96b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_investigation_response_data_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the investigation. + class GetInvestigationResponseDataAttributes + include BaseGenericModel + + # The conclusions drawn from the investigation. + attr_reader :conclusions + + # The current status of the investigation. + attr_reader :status + + # The title of the investigation. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'conclusions' => :'conclusions', + :'status' => :'status', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'conclusions' => :'Array', + :'status' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetInvestigationResponseDataAttributes` 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?(:'conclusions') + if (value = attributes[:'conclusions']).is_a?(Array) + self.conclusions = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 @conclusions.nil? + return false if @status.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param conclusions [Object] Object to be assigned + # @!visibility private + def conclusions=(conclusions) + if conclusions.nil? + fail ArgumentError, 'invalid value for "conclusions", conclusions cannot be nil.' + end + @conclusions = conclusions + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # 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 && + conclusions == o.conclusions && + status == o.status && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [conclusions, status, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_investigation_response_links.rb b/lib/datadog_api_client/v2/models/get_investigation_response_links.rb new file mode 100644 index 000000000000..a8befce8e8d8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_investigation_response_links.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Links related to the investigation. + class GetInvestigationResponseLinks + include BaseGenericModel + + # The URL to the investigation in the Datadog app. + attr_reader :_self + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_self' => :'self' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_self' => :'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::GetInvestigationResponseLinks` 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?(:'_self') + self._self = attributes[:'_self'] + 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 @_self.nil? + true + end + + # Custom attribute writer method with validation + # @param _self [Object] Object to be assigned + # @!visibility private + def _self=(_self) + if _self.nil? + fail ArgumentError, 'invalid value for "_self", _self cannot be nil.' + end + @_self = _self + 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 && + _self == o._self && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_self, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/investigation_conclusion.rb b/lib/datadog_api_client/v2/models/investigation_conclusion.rb new file mode 100644 index 000000000000..338cd0c9fbad --- /dev/null +++ b/lib/datadog_api_client/v2/models/investigation_conclusion.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A full explanation of the finding, including root cause analysis and supporting evidence. + class InvestigationConclusion + include BaseGenericModel + + # A full explanation of the finding, including root cause analysis and supporting evidence. + attr_reader :description + + # A summary of the finding, including affected components and timeframe. + attr_reader :summary + + # The title of the conclusion. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'summary' => :'summary', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'summary' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::InvestigationConclusion` 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 @description.nil? + return false if @summary.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param summary [Object] Object to be assigned + # @!visibility private + def summary=(summary) + if summary.nil? + fail ArgumentError, 'invalid value for "summary", summary cannot be nil.' + end + @summary = summary + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # 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 && + description == o.description && + summary == o.summary && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, summary, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/investigation_type.rb b/lib/datadog_api_client/v2/models/investigation_type.rb new file mode 100644 index 000000000000..2e454d57c3dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/investigation_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 investigations. + class InvestigationType + include BaseEnumModel + + INVESTIGATION = "investigation".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response.rb b/lib/datadog_api_client/v2/models/list_investigations_response.rb new file mode 100644 index 000000000000..56735bb442e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for listing investigations. + class ListInvestigationsResponse + include BaseGenericModel + + # List of investigations. + attr_reader :data + + # Pagination links for the list investigations response. + attr_reader :links + + # Metadata for the list investigations response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'ListInvestigationsResponseLinks', + :'meta' => :'ListInvestigationsResponseMeta' + } + 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::ListInvestigationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response_data.rb b/lib/datadog_api_client/v2/models/list_investigations_response_data.rb new file mode 100644 index 000000000000..9c0bd51e9460 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for an investigation list item. + class ListInvestigationsResponseData + include BaseGenericModel + + # Attributes of an investigation list item. + attr_reader :attributes + + # The unique identifier of the investigation. + attr_reader :id + + # The resource type for investigations. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ListInvestigationsResponseDataAttributes', + :'id' => :'String', + :'type' => :'InvestigationType' + } + 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::ListInvestigationsResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response_data_attributes.rb b/lib/datadog_api_client/v2/models/list_investigations_response_data_attributes.rb new file mode 100644 index 000000000000..808f1d477be9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response_data_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an investigation list item. + class ListInvestigationsResponseDataAttributes + include BaseGenericModel + + # The current status of the investigation. + attr_reader :status + + # The title of the investigation. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListInvestigationsResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response_links.rb b/lib/datadog_api_client/v2/models/list_investigations_response_links.rb new file mode 100644 index 000000000000..6b20dec5a74a --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response_links.rb @@ -0,0 +1,194 @@ +=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 + # Pagination links for the list investigations response. + class ListInvestigationsResponseLinks + include BaseGenericModel + + # Link to the first page. + attr_reader :first + + # Link to the last page. + attr_accessor :last + + # Link to the next page. + attr_reader :_next + + # Link to the previous page. + attr_accessor :prev + + # Link to the current page. + attr_reader :_self + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first' => :'first', + :'last' => :'last', + :'_next' => :'next', + :'prev' => :'prev', + :'_self' => :'self' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first' => :'String', + :'last' => :'String', + :'_next' => :'String', + :'prev' => :'String', + :'_self' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last', + :'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::ListInvestigationsResponseLinks` 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?(:'first') + self.first = attributes[:'first'] + end + + if attributes.key?(:'last') + self.last = attributes[:'last'] + end + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + + if attributes.key?(:'prev') + self.prev = attributes[:'prev'] + end + + if attributes.key?(:'_self') + self._self = attributes[:'_self'] + 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 @first.nil? + return false if @_next.nil? + return false if @_self.nil? + true + end + + # Custom attribute writer method with validation + # @param first [Object] Object to be assigned + # @!visibility private + def first=(first) + if first.nil? + fail ArgumentError, 'invalid value for "first", first cannot be nil.' + end + @first = first + end + + # Custom attribute writer method with validation + # @param _next [Object] Object to be assigned + # @!visibility private + def _next=(_next) + if _next.nil? + fail ArgumentError, 'invalid value for "_next", _next cannot be nil.' + end + @_next = _next + end + + # Custom attribute writer method with validation + # @param _self [Object] Object to be assigned + # @!visibility private + def _self=(_self) + if _self.nil? + fail ArgumentError, 'invalid value for "_self", _self cannot be nil.' + end + @_self = _self + 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 && + first == o.first && + last == o.last && + _next == o._next && + prev == o.prev && + _self == o._self && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first, last, _next, prev, _self, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response_meta.rb b/lib/datadog_api_client/v2/models/list_investigations_response_meta.rb new file mode 100644 index 000000000000..dad0cecc98e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for the list investigations response. + class ListInvestigationsResponseMeta + include BaseGenericModel + + # Pagination metadata. + attr_reader :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'ListInvestigationsResponseMetaPage' + } + 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::ListInvestigationsResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 @page.nil? + true + end + + # Custom attribute writer method with validation + # @param page [Object] Object to be assigned + # @!visibility private + def page=(page) + if page.nil? + fail ArgumentError, 'invalid value for "page", page cannot be nil.' + end + @page = page + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_investigations_response_meta_page.rb b/lib/datadog_api_client/v2/models/list_investigations_response_meta_page.rb new file mode 100644 index 000000000000..d3999b31ef04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_investigations_response_meta_page.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata. + class ListInvestigationsResponseMetaPage + include BaseGenericModel + + # Maximum number of results per page. + attr_reader :limit + + # Offset of the current page. + attr_reader :offset + + # Total number of investigations. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'limit' => :'limit', + :'offset' => :'offset', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'limit' => :'Integer', + :'offset' => :'Integer', + :'total' => :'Integer' + } + 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::ListInvestigationsResponseMetaPage` 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?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'offset') + self.offset = attributes[:'offset'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + 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 @limit.nil? + return false if @offset.nil? + return false if @total.nil? + true + end + + # Custom attribute writer method with validation + # @param limit [Object] Object to be assigned + # @!visibility private + def limit=(limit) + if limit.nil? + fail ArgumentError, 'invalid value for "limit", limit cannot be nil.' + end + @limit = limit + end + + # Custom attribute writer method with validation + # @param offset [Object] Object to be assigned + # @!visibility private + def offset=(offset) + if offset.nil? + fail ArgumentError, 'invalid value for "offset", offset cannot be nil.' + end + @offset = offset + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + 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 && + limit == o.limit && + offset == o.offset && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [limit, offset, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_alert_trigger_attributes.rb b/lib/datadog_api_client/v2/models/monitor_alert_trigger_attributes.rb new file mode 100644 index 000000000000..d6dc81c57d45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_alert_trigger_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a monitor alert trigger. + class MonitorAlertTriggerAttributes + include BaseGenericModel + + # The event ID associated with the monitor alert. + attr_reader :event_id + + # The timestamp of the event in Unix milliseconds. + attr_reader :event_ts + + # The monitor ID that triggered the alert. + attr_reader :monitor_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'event_id' => :'event_id', + :'event_ts' => :'event_ts', + :'monitor_id' => :'monitor_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'event_id' => :'String', + :'event_ts' => :'Integer', + :'monitor_id' => :'Integer' + } + 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::MonitorAlertTriggerAttributes` 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?(:'event_id') + self.event_id = attributes[:'event_id'] + end + + if attributes.key?(:'event_ts') + self.event_ts = attributes[:'event_ts'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + 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 @event_id.nil? + return false if @event_ts.nil? + return false if @monitor_id.nil? + true + end + + # Custom attribute writer method with validation + # @param event_id [Object] Object to be assigned + # @!visibility private + def event_id=(event_id) + if event_id.nil? + fail ArgumentError, 'invalid value for "event_id", event_id cannot be nil.' + end + @event_id = event_id + end + + # Custom attribute writer method with validation + # @param event_ts [Object] Object to be assigned + # @!visibility private + def event_ts=(event_ts) + if event_ts.nil? + fail ArgumentError, 'invalid value for "event_ts", event_ts cannot be nil.' + end + @event_ts = event_ts + end + + # Custom attribute writer method with validation + # @param monitor_id [Object] Object to be assigned + # @!visibility private + def monitor_id=(monitor_id) + if monitor_id.nil? + fail ArgumentError, 'invalid value for "monitor_id", monitor_id cannot be nil.' + end + @monitor_id = monitor_id + 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 && + event_id == o.event_id && + event_ts == o.event_ts && + monitor_id == o.monitor_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [event_id, event_ts, monitor_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_attributes.rb b/lib/datadog_api_client/v2/models/trigger_attributes.rb new file mode 100644 index 000000000000..d3a4273e9c67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The trigger definition for starting an investigation. + class TriggerAttributes + include BaseGenericModel + + # Attributes for a monitor alert trigger. + attr_reader :monitor_alert_trigger + + # The type of trigger for the investigation. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'monitor_alert_trigger' => :'monitor_alert_trigger', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'monitor_alert_trigger' => :'MonitorAlertTriggerAttributes', + :'type' => :'TriggerType' + } + 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::TriggerAttributes` 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?(:'monitor_alert_trigger') + self.monitor_alert_trigger = attributes[:'monitor_alert_trigger'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @monitor_alert_trigger.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param monitor_alert_trigger [Object] Object to be assigned + # @!visibility private + def monitor_alert_trigger=(monitor_alert_trigger) + if monitor_alert_trigger.nil? + fail ArgumentError, 'invalid value for "monitor_alert_trigger", monitor_alert_trigger cannot be nil.' + end + @monitor_alert_trigger = monitor_alert_trigger + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + monitor_alert_trigger == o.monitor_alert_trigger && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [monitor_alert_trigger, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_request.rb b/lib/datadog_api_client/v2/models/trigger_investigation_request.rb new file mode 100644 index 000000000000..26b9dbf4554b --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to trigger a new investigation. + class TriggerInvestigationRequest + include BaseGenericModel + + # Data for the trigger investigation request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TriggerInvestigationRequestData' + } + 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::TriggerInvestigationRequest` 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/trigger_investigation_request_data.rb b/lib/datadog_api_client/v2/models/trigger_investigation_request_data.rb new file mode 100644 index 000000000000..f919304a9337 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the trigger investigation request. + class TriggerInvestigationRequestData + include BaseGenericModel + + # Attributes for the trigger investigation request. + attr_reader :attributes + + # The resource type for trigger investigation requests. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TriggerInvestigationRequestDataAttributes', + :'type' => :'TriggerInvestigationRequestType' + } + 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::TriggerInvestigationRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_request_data_attributes.rb b/lib/datadog_api_client/v2/models/trigger_investigation_request_data_attributes.rb new file mode 100644 index 000000000000..2e3cb199a56e --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for the trigger investigation request. + class TriggerInvestigationRequestDataAttributes + include BaseGenericModel + + # The trigger definition for starting an investigation. + attr_reader :trigger + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'trigger' => :'trigger' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'trigger' => :'TriggerAttributes' + } + 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::TriggerInvestigationRequestDataAttributes` 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?(:'trigger') + self.trigger = attributes[:'trigger'] + 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 @trigger.nil? + true + end + + # Custom attribute writer method with validation + # @param trigger [Object] Object to be assigned + # @!visibility private + def trigger=(trigger) + if trigger.nil? + fail ArgumentError, 'invalid value for "trigger", trigger cannot be nil.' + end + @trigger = trigger + 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 && + trigger == o.trigger && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [trigger, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_request_type.rb b/lib/datadog_api_client/v2/models/trigger_investigation_request_type.rb new file mode 100644 index 000000000000..529f97f6aea1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_request_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 trigger investigation requests. + class TriggerInvestigationRequestType + include BaseEnumModel + + TRIGGER_INVESTIGATION_REQUEST = "trigger_investigation_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_response.rb b/lib/datadog_api_client/v2/models/trigger_investigation_response.rb new file mode 100644 index 000000000000..068c39ad9611 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response after triggering an investigation. + class TriggerInvestigationResponse + include BaseGenericModel + + # Data for the trigger investigation response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TriggerInvestigationResponseData' + } + 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::TriggerInvestigationResponse` 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/trigger_investigation_response_data.rb b/lib/datadog_api_client/v2/models/trigger_investigation_response_data.rb new file mode 100644 index 000000000000..d12bdb49af5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the trigger investigation response. + class TriggerInvestigationResponseData + include BaseGenericModel + + # Attributes for the trigger investigation response. + attr_reader :attributes + + # Unique identifier for the trigger response. + attr_reader :id + + # The resource type for trigger investigation responses. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TriggerInvestigationResponseDataAttributes', + :'id' => :'String', + :'type' => :'TriggerInvestigationResponseType' + } + 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::TriggerInvestigationResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_response_data_attributes.rb b/lib/datadog_api_client/v2/models/trigger_investigation_response_data_attributes.rb new file mode 100644 index 000000000000..2c59a363cd1c --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_response_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for the trigger investigation response. + class TriggerInvestigationResponseDataAttributes + include BaseGenericModel + + # The ID of the investigation that was created. + attr_reader :investigation_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'investigation_id' => :'investigation_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'investigation_id' => :'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::TriggerInvestigationResponseDataAttributes` 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?(:'investigation_id') + self.investigation_id = attributes[:'investigation_id'] + 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 @investigation_id.nil? + true + end + + # Custom attribute writer method with validation + # @param investigation_id [Object] Object to be assigned + # @!visibility private + def investigation_id=(investigation_id) + if investigation_id.nil? + fail ArgumentError, 'invalid value for "investigation_id", investigation_id cannot be nil.' + end + @investigation_id = investigation_id + 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 && + investigation_id == o.investigation_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [investigation_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_investigation_response_type.rb b/lib/datadog_api_client/v2/models/trigger_investigation_response_type.rb new file mode 100644 index 000000000000..5d36152b750f --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_investigation_response_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 trigger investigation responses. + class TriggerInvestigationResponseType + include BaseEnumModel + + TRIGGER_INVESTIGATION_RESPONSE = "trigger_investigation_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/trigger_type.rb b/lib/datadog_api_client/v2/models/trigger_type.rb new file mode 100644 index 000000000000..d1a6fd55af98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/trigger_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 type of trigger for the investigation. + class TriggerType + include BaseEnumModel + + MONITOR_ALERT_TRIGGER = "monitor_alert_trigger".freeze + end +end