From f8c261d30324a7ae79f348fd2dea4df951be46ce Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 07:10:54 +0000 Subject: [PATCH 1/2] Regenerate client from commit 19ee7e6 of spec repo (#3469) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 897 ++++++++++++++++++ .../GetCSMAgentlessHostFacetInfo.rb | 8 + .../GetCSMUnifiedHostFacetInfo.rb | 8 + .../ListCSMAgentlessHostFacets.rb | 8 + .../v2/csm-settings/ListCSMAgentlessHosts.rb | 8 + .../csm-settings/ListCSMUnifiedHostFacets.rb | 8 + .../v2/csm-settings/ListCSMUnifiedHosts.rb | 8 + features/scenarios_model_mapping.rb | 20 + features/v2/csm_settings.feature | 85 ++ features/v2/undo.json | 36 + lib/datadog_api_client/configuration.rb | 6 + lib/datadog_api_client/inflector.rb | 27 + .../v2/api/csm_settings_api.rb | 478 ++++++++++ .../models/csm_agentless_host_attributes.rb | 207 ++++ .../v2/models/csm_agentless_host_data.rb | 165 ++++ .../csm_agentless_host_facet_attributes.rb | 381 ++++++++ .../models/csm_agentless_host_facet_data.rb | 165 ++++ .../models/csm_agentless_host_facet_type.rb | 26 + .../csm_agentless_host_facets_response.rb | 125 +++ .../csm_agentless_host_resource_type.rb | 29 + .../v2/models/csm_agentless_host_type.rb | 26 + .../v2/models/csm_agentless_hosts_response.rb | 146 +++ .../v2/models/csm_cloud_provider.rb | 29 + .../v2/models/csm_facet_info_type.rb | 26 + .../models/csm_host_facet_info_attributes.rb | 125 +++ .../v2/models/csm_host_facet_info_data.rb | 186 ++++ .../v2/models/csm_host_facet_info_item.rb | 144 +++ .../v2/models/csm_host_facet_info_meta.rb | 123 +++ .../v2/models/csm_host_facet_info_response.rb | 123 +++ .../v2/models/csm_settings_meta.rb | 165 ++++ .../v2/models/csm_unified_host_attributes.rb | 306 ++++++ .../v2/models/csm_unified_host_data.rb | 165 ++++ .../v2/models/csm_unified_host_facet_data.rb | 165 ++++ .../v2/models/csm_unified_host_facet_type.rb | 26 + .../csm_unified_host_facets_response.rb | 125 +++ .../v2/models/csm_unified_host_source.rb | 28 + .../v2/models/csm_unified_host_type.rb | 26 + .../v2/models/csm_unified_hosts_meta.rb | 186 ++++ .../v2/models/csm_unified_hosts_response.rb | 146 +++ 39 files changed, 4961 insertions(+) create mode 100644 examples/v2/csm-settings/GetCSMAgentlessHostFacetInfo.rb create mode 100644 examples/v2/csm-settings/GetCSMUnifiedHostFacetInfo.rb create mode 100644 examples/v2/csm-settings/ListCSMAgentlessHostFacets.rb create mode 100644 examples/v2/csm-settings/ListCSMAgentlessHosts.rb create mode 100644 examples/v2/csm-settings/ListCSMUnifiedHostFacets.rb create mode 100644 examples/v2/csm-settings/ListCSMUnifiedHosts.rb create mode 100644 features/v2/csm_settings.feature create mode 100644 lib/datadog_api_client/v2/api/csm_settings_api.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_data.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_facet_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_facet_data.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_facet_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_facets_response.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_host_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_agentless_hosts_response.rb create mode 100644 lib/datadog_api_client/v2/models/csm_cloud_provider.rb create mode 100644 lib/datadog_api_client/v2/models/csm_facet_info_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_host_facet_info_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/csm_host_facet_info_data.rb create mode 100644 lib/datadog_api_client/v2/models/csm_host_facet_info_item.rb create mode 100644 lib/datadog_api_client/v2/models/csm_host_facet_info_meta.rb create mode 100644 lib/datadog_api_client/v2/models/csm_host_facet_info_response.rb create mode 100644 lib/datadog_api_client/v2/models/csm_settings_meta.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_data.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_facet_data.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_facet_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_facets_response.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_source.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_host_type.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_hosts_meta.rb create mode 100644 lib/datadog_api_client/v2/models/csm_unified_hosts_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2d470c8f2f02..0031eb15e8d4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24816,6 +24816,189 @@ components: type: $ref: "#/components/schemas/CSMAgentsType" type: object + CsmAgentlessHostAttributes: + description: Attributes of an agentless host. + properties: + account_id: + description: The ID of the cloud account that the host belongs to. + example: "123456789012" + type: string + cloud_provider: + $ref: "#/components/schemas/CsmCloudProvider" + has_posture_management: + description: Whether CSM Misconfigurations is enabled for this host. `true` if enabled; `false` if disabled. + example: true + type: boolean + has_vulnerability_scanning: + description: Whether CSM Vulnerabilities is enabled for this host. `true` if enabled; `false` if disabled. + example: true + type: boolean + resource_type: + $ref: "#/components/schemas/CsmAgentlessHostResourceType" + required: + - account_id + - cloud_provider + - resource_type + - has_posture_management + - has_vulnerability_scanning + type: object + CsmAgentlessHostData: + description: A single agentless host resource. + properties: + attributes: + $ref: "#/components/schemas/CsmAgentlessHostAttributes" + id: + description: The resource identifier of the agentless host. + example: i-0123456789abcdef0 + type: string + type: + $ref: "#/components/schemas/CsmAgentlessHostType" + required: + - id + - type + - attributes + type: object + CsmAgentlessHostFacetAttributes: + description: Attributes of an agentless host facet. + properties: + bounded: + description: Whether the facet has a bounded set of allowed values. `true` indicates a fixed value set and `false` indicates free-form values. + example: true + type: boolean + bundled: + description: Whether the facet is bundled as part of the default facet set. `true` indicates bundled and `false` indicates custom. + example: true + type: boolean + bundledAndUsed: + description: Whether the facet is both bundled and actively used. `true` indicates in use; `false` indicates unused. + example: true + type: boolean + defaultValues: + $ref: "#/components/schemas/CsmHostFacetDefaultValues" + description: + description: A human-readable description of what the facet represents. + example: The cloud provider of the resource + type: string + editable: + description: Whether the facet can be edited by users. `true` indicates editable; `false` indicates read-only. + example: false + type: boolean + facetType: + description: The UI display type for the facet, such as `list`. + example: list + type: string + groups: + $ref: "#/components/schemas/CsmHostFacetGroups" + name: + description: The display name of the facet. + example: Cloud Provider + type: string + path: + description: The field path used when filtering by this facet. + example: cloud_provider + type: string + source: + description: The data source that provides the facet values. + example: core + type: string + type: + description: The data type of the facet values. + example: string + type: string + values: + $ref: "#/components/schemas/CsmHostFacetValues" + required: + - name + - path + - description + - groups + - bounded + - bundled + - bundledAndUsed + - defaultValues + - editable + - facetType + - source + - type + - values + type: object + CsmAgentlessHostFacetData: + description: A single agentless host facet resource. + properties: + attributes: + $ref: "#/components/schemas/CsmAgentlessHostFacetAttributes" + id: + description: The identifier of the facet, corresponding to the field path. + example: cloud_provider + type: string + type: + $ref: "#/components/schemas/CsmAgentlessHostFacetType" + required: + - id + - type + - attributes + type: object + CsmAgentlessHostFacetItems: + description: The list of available facets for agentless hosts. + items: + $ref: "#/components/schemas/CsmAgentlessHostFacetData" + type: array + CsmAgentlessHostFacetType: + default: agentless_host_facet + description: The JSON:API type for agentless host facet resources. The value should always be `agentless_host_facet`. + enum: + - agentless_host_facet + example: agentless_host_facet + type: string + x-enum-varnames: + - AGENTLESS_HOST_FACET + CsmAgentlessHostFacetsResponse: + description: The response returned when listing facets for agentless hosts. + properties: + data: + $ref: "#/components/schemas/CsmAgentlessHostFacetItems" + required: + - data + type: object + CsmAgentlessHostItems: + description: The list of agentless hosts for the current page. + items: + $ref: "#/components/schemas/CsmAgentlessHostData" + type: array + CsmAgentlessHostResourceType: + description: The type of cloud resource for an agentless host. + enum: + - aws_ec2_instance + - azure_virtual_machine_instance + - gcp_compute_instance + - oci_instance + example: aws_ec2_instance + type: string + x-enum-varnames: + - AWS_EC2_INSTANCE + - AZURE_VIRTUAL_MACHINE_INSTANCE + - GCP_COMPUTE_INSTANCE + - OCI_INSTANCE + CsmAgentlessHostType: + default: agentless_host + description: The JSON:API type for agentless host resources. The value should always be `agentless_host`. + enum: + - agentless_host + example: agentless_host + type: string + x-enum-varnames: + - AGENTLESS_HOST + CsmAgentlessHostsResponse: + description: The response returned when listing agentless hosts. + properties: + data: + $ref: "#/components/schemas/CsmAgentlessHostItems" + meta: + $ref: "#/components/schemas/CsmSettingsMeta" + required: + - data + - meta + type: object CsmAgentsAttributes: description: "A CSM Agent returned by the API." properties: @@ -24934,6 +25117,20 @@ components: data: $ref: "#/components/schemas/CsmCloudAccountsCoverageAnalysisData" type: object + CsmCloudProvider: + description: The cloud provider of a host resource. + enum: + - aws + - gcp + - azure + - oci + example: aws + type: string + x-enum-varnames: + - AWS + - GCP + - AZURE + - OCI CsmCoverageAnalysis: description: CSM Coverage Analysis. properties: @@ -24958,6 +25155,103 @@ components: format: int64 type: integer type: object + CsmFacetInfoType: + default: facet_info + description: The JSON:API type for facet info resources. The value should always be `facet_info`. + enum: + - facet_info + example: facet_info + type: string + x-enum-varnames: + - FACET_INFO + CsmHostFacetDefaultValues: + description: The list of default filter values for the facet. + example: [] + items: + type: string + type: array + CsmHostFacetGroups: + description: The list of UI groups that this facet belongs to. + example: + - agentless + items: + type: string + type: array + CsmHostFacetInfoAttributes: + description: Attributes of a facet info response, containing the value distribution for the requested facet. + properties: + items: + $ref: "#/components/schemas/CsmHostFacetInfoItems" + required: + - items + type: object + CsmHostFacetInfoData: + description: The data wrapper for a facet info response. + properties: + attributes: + $ref: "#/components/schemas/CsmHostFacetInfoAttributes" + id: + description: The identifier of the facet. + example: cloud_provider + type: string + meta: + $ref: "#/components/schemas/CsmHostFacetInfoMeta" + type: + $ref: "#/components/schemas/CsmFacetInfoType" + required: + - id + - type + - attributes + - meta + type: object + CsmHostFacetInfoItem: + description: A single value and its occurrence count for a facet. + properties: + count: + description: The number of resources with this facet value. + example: 100 + format: int64 + type: integer + value: + description: The facet value. + example: aws + type: string + required: + - value + - count + type: object + CsmHostFacetInfoItems: + description: The list of facet value entries for the current page. + items: + $ref: "#/components/schemas/CsmHostFacetInfoItem" + type: array + CsmHostFacetInfoMeta: + description: Metadata for the facet info response. + properties: + total_count: + description: The total number of distinct values for this facet. + example: 4 + format: int64 + type: integer + required: + - total_count + type: object + CsmHostFacetInfoResponse: + description: The response returned when requesting value distribution for a specific facet. + properties: + data: + $ref: "#/components/schemas/CsmHostFacetInfoData" + required: + - data + type: object + CsmHostFacetValues: + description: The list of allowed filter values for bounded facets. Empty for unbounded facets. + example: + - aws + - gcp + items: + type: string + type: array CsmHostsAndContainersCoverageAnalysisAttributes: description: CSM Hosts and Containers Coverage Analysis attributes. properties: @@ -25030,6 +25324,235 @@ components: data: $ref: "#/components/schemas/CsmServerlessCoverageAnalysisData" type: object + CsmSettingsMeta: + description: Pagination metadata for a CSM settings list response. + properties: + page_index: + description: The current page index (zero-based). + example: 0 + format: int64 + type: integer + page_size: + description: The number of resources returned per page. + example: 10 + format: int64 + type: integer + total_filtered: + description: The total number of resources matching the filter criteria. + example: 100 + format: int64 + type: integer + required: + - total_filtered + - page_index + - page_size + type: object + CsmUnifiedHostAttributes: + description: Attributes of a unified host, combining data from agent and agentless sources. + properties: + account_id: + description: The ID of the cloud account that the host belongs to. Present only when the host was discovered through agentless scanning. + example: "123456789012" + nullable: true + type: string + agent_csm_vm_containers_enabled: + description: Whether CSM Vulnerabilities is enabled for containers through the Datadog Agent. `true` if enabled; `false` if disabled. + example: false + nullable: true + type: boolean + agent_csm_vm_hosts_enabled: + description: Whether CSM Vulnerabilities is enabled for hosts through the Datadog Agent. `true` if enabled; `false` if disabled. + example: true + nullable: true + type: boolean + agent_cws_enabled: + description: Whether CSM Threats is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled. + example: false + nullable: true + type: boolean + agent_posture_management: + description: Whether CSM Misconfigurations is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled. + example: true + nullable: true + type: boolean + agent_version: + description: The version of the Datadog Agent running on this host. + example: 7.50.0 + nullable: true + type: string + agentless_posture_management: + description: Whether CSM Misconfigurations is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled. + example: false + nullable: true + type: boolean + agentless_vulnerability_scanning: + description: Whether CSM Vulnerabilities is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled. + example: true + nullable: true + type: boolean + cloud_provider: + $ref: "#/components/schemas/CsmCloudProvider" + cluster_name: + description: The name of the Kubernetes cluster the host belongs to, if applicable. + example: my-cluster + nullable: true + type: string + datadog_agent_key: + description: The Datadog Agent key associated with this host. Present only for agent-sourced hosts. + example: key123 + nullable: true + type: string + env: + description: The list of environment tags associated with this host. + example: + - prod + items: + type: string + nullable: true + type: array + host_id: + description: The internal Datadog host identifier. Present only for agent-sourced hosts. + example: 12345678 + format: int64 + nullable: true + type: integer + install_method_tool: + description: The tool used to install the Datadog Agent on this host. + example: helm + nullable: true + type: string + os: + description: The operating system of the host. Present only for agent-sourced hosts. + example: linux + nullable: true + type: string + resource_type: + $ref: "#/components/schemas/CsmAgentlessHostResourceType" + source: + $ref: "#/components/schemas/CsmUnifiedHostSource" + required: + - source + type: object + CsmUnifiedHostData: + description: A single unified host resource, combining agent and agentless data. + properties: + attributes: + $ref: "#/components/schemas/CsmUnifiedHostAttributes" + id: + description: The resource identifier of the unified host. + example: i-0123456789abcdef0 + type: string + type: + $ref: "#/components/schemas/CsmUnifiedHostType" + required: + - id + - type + - attributes + type: object + CsmUnifiedHostFacetData: + description: A single unified host facet resource. + properties: + attributes: + $ref: "#/components/schemas/CsmAgentlessHostFacetAttributes" + id: + description: The identifier of the facet, corresponding to the field path. + example: cloud_provider + type: string + type: + $ref: "#/components/schemas/CsmUnifiedHostFacetType" + required: + - id + - type + - attributes + type: object + CsmUnifiedHostFacetItems: + description: The list of available facets for unified hosts. + items: + $ref: "#/components/schemas/CsmUnifiedHostFacetData" + type: array + CsmUnifiedHostFacetType: + default: unified_host_facet + description: The JSON:API type for unified host facet resources. The value should always be `unified_host_facet`. + enum: + - unified_host_facet + example: unified_host_facet + type: string + x-enum-varnames: + - UNIFIED_HOST_FACET + CsmUnifiedHostFacetsResponse: + description: The response returned when listing facets for unified hosts. + properties: + data: + $ref: "#/components/schemas/CsmUnifiedHostFacetItems" + required: + - data + type: object + CsmUnifiedHostItems: + description: The list of unified hosts for the current page. + items: + $ref: "#/components/schemas/CsmUnifiedHostData" + type: array + CsmUnifiedHostSource: + description: The source of a unified host entry, indicating whether it was discovered via agent, agentless scanning, or both. + enum: + - agent + - agentless + - both + example: agent + type: string + x-enum-varnames: + - AGENT + - AGENTLESS + - BOTH + CsmUnifiedHostType: + default: unified_host + description: The JSON:API type for unified host resources. The value should always be `unified_host`. + enum: + - unified_host + example: unified_host + type: string + x-enum-varnames: + - UNIFIED_HOST + CsmUnifiedHostsMeta: + description: Pagination metadata for a unified hosts list response. + properties: + page_index: + description: The current page index (zero-based). + example: 0 + format: int64 + type: integer + page_size: + description: The number of hosts returned per page. + example: 10 + format: int64 + type: integer + total_filtered: + description: The total number of hosts matching the filter criteria. + example: 100 + format: int64 + type: integer + total_pages: + description: The total number of pages available. + example: 10 + format: int64 + type: integer + required: + - total_filtered + - page_index + - page_size + - total_pages + type: object + CsmUnifiedHostsResponse: + description: The response returned when listing unified hosts. + properties: + data: + $ref: "#/components/schemas/CsmUnifiedHostItems" + meta: + $ref: "#/components/schemas/CsmUnifiedHostsMeta" + required: + - data + - meta + type: object CustomAttributeConfig: description: "A custom attribute configuration that defines an organization-specific metadata field on cases. Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined select options." properties: @@ -119900,6 +120423,375 @@ paths: $ref: "#/components/responses/TooManyRequestsResponse" summary: Get all CSM Serverless Agents tags: ["CSM Agents"] + /api/v2/csm/settings/agentless_hosts: + get: + description: Get the list of agentless hosts for CSM, with optional pagination and filtering. + operationId: ListCSMAgentlessHosts + parameters: + - description: The page index for pagination (zero-based). + in: query + name: page + required: false + schema: + default: 0 + example: 0 + format: int32 + maximum: 1000000 + minimum: 0 + type: integer + - description: The number of agentless hosts to return per page. + in: query + name: size + required: false + schema: + default: 10 + example: 10 + format: int32 + maximum: 100 + minimum: 1 + type: integer + - description: A search query string to filter agentless hosts. + in: query + name: query + required: false + schema: + example: "cloud_provider:aws" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + account_id: "123456789012" + cloud_provider: aws + has_posture_management: true + has_vulnerability_scanning: true + resource_type: aws_ec2_instance + id: i-0123456789abcdef0 + type: agentless_host + meta: + page_index: 0 + page_size: 10 + total_filtered: 1 + schema: + $ref: "#/components/schemas/CsmAgentlessHostsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List agentless hosts + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/csm/settings/agentless_hosts/facet_info: + get: + description: Get the value distribution for a specific agentless host facet, with optional search and filtering. + operationId: GetCSMAgentlessHostFacetInfo + parameters: + - description: The facet identifier to retrieve value distribution for. Valid values are `resource_name`, `account_id`, `resource_type`, `cloud_provider`, `has_vulnerability_scanning`, and `has_posture_management`. + in: query + name: facet + required: true + schema: + example: cloud_provider + type: string + - description: A search string to filter the facet values. + in: query + name: search + required: false + schema: + example: aws + type: string + - description: A filter query to scope the facet value counts. + in: query + name: query + required: false + schema: + example: "cloud_provider:aws" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + items: + - count: 100 + value: aws + - count: 50 + value: gcp + id: cloud_provider + meta: + total_count: 2 + type: facet_info + schema: + $ref: "#/components/schemas/CsmHostFacetInfoResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get agentless host facet info + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/csm/settings/agentless_hosts/facets: + get: + description: Get the list of available facets for filtering agentless hosts. + operationId: ListCSMAgentlessHostFacets + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + bounded: true + bundled: true + bundledAndUsed: true + defaultValues: [] + description: The cloud provider of the resource. + editable: false + facetType: list + groups: + - agentless + name: Cloud Provider + path: cloud_provider + source: core + type: string + values: + - aws + - gcp + - azure + - oci + id: cloud_provider + type: agentless_host_facet + schema: + $ref: "#/components/schemas/CsmAgentlessHostFacetsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List agentless host facets + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/csm/settings/hosts: + get: + description: Get the list of unified hosts for CSM, combining agent and agentless host data, with optional pagination and filtering. + operationId: ListCSMUnifiedHosts + parameters: + - description: The page index for pagination (zero-based). + in: query + name: page + required: false + schema: + default: 0 + example: 0 + format: int32 + maximum: 1000000 + minimum: 0 + type: integer + - description: The number of hosts to return per page. + in: query + name: size + required: false + schema: + default: 10 + example: 10 + format: int32 + maximum: 100 + minimum: 1 + type: integer + - description: A search query string to filter unified hosts. + in: query + name: query + required: false + schema: + example: "source:agent" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + agent_cws_enabled: false + agent_posture_management: true + agent_version: 7.50.0 + datadog_agent_key: key123 + os: linux + source: agent + id: agent-host + type: unified_host + - attributes: + account_id: "123456789012" + agentless_posture_management: true + agentless_vulnerability_scanning: true + cloud_provider: aws + resource_type: aws_ec2_instance + source: agentless + id: i-0123456789abcdef0 + type: unified_host + meta: + page_index: 0 + page_size: 10 + total_filtered: 2 + total_pages: 1 + schema: + $ref: "#/components/schemas/CsmUnifiedHostsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List unified hosts + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/csm/settings/hosts/facet_info: + get: + description: Get the value distribution for a specific unified host facet, with optional search and filtering. + operationId: GetCSMUnifiedHostFacetInfo + parameters: + - description: The facet identifier to retrieve value distribution for. Valid values include `resource_name`, `account_id`, `resource_type`, `cloud_provider`, `agentless_vulnerability_scanning`, `agentless_posture_management`, `hostname`, `agent_version`, `os`, `cluster_name`, `agent_posture_management`, `agent_cws_enabled`, `agent_csm_vm_hosts_enabled`, and `agent_csm_vm_containers_enabled`. + in: query + name: facet + required: true + schema: + example: cloud_provider + type: string + - description: A search string to filter the facet values. + in: query + name: search + required: false + schema: + example: aws + type: string + - description: A filter query to scope the facet value counts. + in: query + name: query + required: false + schema: + example: "cloud_provider:aws" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + items: + - count: 100 + value: aws + - count: 50 + value: gcp + id: cloud_provider + meta: + total_count: 2 + type: facet_info + schema: + $ref: "#/components/schemas/CsmHostFacetInfoResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get unified host facet info + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/csm/settings/hosts/facets: + get: + description: Get the list of available facets for filtering unified hosts. + operationId: ListCSMUnifiedHostFacets + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + bounded: true + bundled: true + bundledAndUsed: true + defaultValues: [] + description: The cloud provider of the resource. + editable: false + facetType: list + groups: + - hosts + name: Cloud Provider + path: cloud_provider + source: core + type: string + values: + - aws + - gcp + - azure + - oci + id: cloud_provider + type: unified_host_facet + schema: + $ref: "#/components/schemas/CsmUnifiedHostFacetsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List unified host facets + tags: ["CSM Settings"] + x-unstable: |- + **Note**: This endpoint is in Preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/current_user: get: description: |- @@ -181119,6 +182011,11 @@ tags: all in a unified view for seamless collaboration and faster remediation. Go to https://docs.datadoghq.com/security/cloud_security_management to learn more. name: "CSM Coverage Analysis" + - description: |- + Datadog Cloud Security Management (CSM) Settings APIs allow you to list and filter + your cloud hosts monitored by CSM, covering both agentless and agent-based discovery. + For more information, see [Cloud Security Management](https://docs.datadoghq.com/security/cloud_security_management). + name: "CSM Settings" - description: |- Workload Protection monitors file, network, and process activity across your environment to detect real-time threats to your infrastructure. See [Workload Protection](https://docs.datadoghq.com/security/workload_protection/) for more information on setting up Workload Protection. diff --git a/examples/v2/csm-settings/GetCSMAgentlessHostFacetInfo.rb b/examples/v2/csm-settings/GetCSMAgentlessHostFacetInfo.rb new file mode 100644 index 000000000000..fabe91ae2319 --- /dev/null +++ b/examples/v2/csm-settings/GetCSMAgentlessHostFacetInfo.rb @@ -0,0 +1,8 @@ +# Get agentless host facet info returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_csm_agentless_host_facet_info".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.get_csm_agentless_host_facet_info("cloud_provider") diff --git a/examples/v2/csm-settings/GetCSMUnifiedHostFacetInfo.rb b/examples/v2/csm-settings/GetCSMUnifiedHostFacetInfo.rb new file mode 100644 index 000000000000..a3286c7e2113 --- /dev/null +++ b/examples/v2/csm-settings/GetCSMUnifiedHostFacetInfo.rb @@ -0,0 +1,8 @@ +# Get unified host facet info returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_csm_unified_host_facet_info".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.get_csm_unified_host_facet_info("cloud_provider") diff --git a/examples/v2/csm-settings/ListCSMAgentlessHostFacets.rb b/examples/v2/csm-settings/ListCSMAgentlessHostFacets.rb new file mode 100644 index 000000000000..707c3c188b69 --- /dev/null +++ b/examples/v2/csm-settings/ListCSMAgentlessHostFacets.rb @@ -0,0 +1,8 @@ +# List agentless host facets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_csm_agentless_host_facets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.list_csm_agentless_host_facets() diff --git a/examples/v2/csm-settings/ListCSMAgentlessHosts.rb b/examples/v2/csm-settings/ListCSMAgentlessHosts.rb new file mode 100644 index 000000000000..cd71b32dd8f4 --- /dev/null +++ b/examples/v2/csm-settings/ListCSMAgentlessHosts.rb @@ -0,0 +1,8 @@ +# List agentless hosts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_csm_agentless_hosts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.list_csm_agentless_hosts() diff --git a/examples/v2/csm-settings/ListCSMUnifiedHostFacets.rb b/examples/v2/csm-settings/ListCSMUnifiedHostFacets.rb new file mode 100644 index 000000000000..a43031b262e0 --- /dev/null +++ b/examples/v2/csm-settings/ListCSMUnifiedHostFacets.rb @@ -0,0 +1,8 @@ +# List unified host facets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_csm_unified_host_facets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.list_csm_unified_host_facets() diff --git a/examples/v2/csm-settings/ListCSMUnifiedHosts.rb b/examples/v2/csm-settings/ListCSMUnifiedHosts.rb new file mode 100644 index 000000000000..aa637faac9c4 --- /dev/null +++ b/examples/v2/csm-settings/ListCSMUnifiedHosts.rb @@ -0,0 +1,8 @@ +# List unified hosts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_csm_unified_hosts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMSettingsAPI.new +p api_instance.list_csm_unified_hosts() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f9c320310581..19f5f6d44b81 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2855,6 +2855,26 @@ "query" => "String", "order_direction" => "OrderDirection", }, + "v2.ListCSMAgentlessHosts" => { + "page" => "Integer", + "size" => "Integer", + "query" => "String", + }, + "v2.GetCSMAgentlessHostFacetInfo" => { + "facet" => "String", + "search" => "String", + "query" => "String", + }, + "v2.ListCSMUnifiedHosts" => { + "page" => "Integer", + "size" => "Integer", + "query" => "String", + }, + "v2.GetCSMUnifiedHostFacetInfo" => { + "facet" => "String", + "search" => "String", + "query" => "String", + }, "v2.DeleteDashboardListItems" => { "dashboard_list_id" => "Integer", "body" => "DashboardListDeleteItemsRequest", diff --git a/features/v2/csm_settings.feature b/features/v2/csm_settings.feature new file mode 100644 index 000000000000..c28ca491f301 --- /dev/null +++ b/features/v2/csm_settings.feature @@ -0,0 +1,85 @@ +@endpoint(csm-settings) @endpoint(csm-settings-v2) +Feature: CSM Settings + Datadog Cloud Security Management (CSM) Settings APIs allow you to list + and filter your cloud hosts monitored by CSM, covering both agentless and + agent-based discovery. For more information, see [Cloud Security Managemen + t](https://docs.datadoghq.com/security/cloud_security_management). + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CSMSettings" API + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get agentless host facet info returns "Bad Request" response + Given operation "GetCSMAgentlessHostFacetInfo" enabled + And new "GetCSMAgentlessHostFacetInfo" request + And request contains "facet" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get agentless host facet info returns "OK" response + Given operation "GetCSMAgentlessHostFacetInfo" enabled + And new "GetCSMAgentlessHostFacetInfo" request + And request contains "facet" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get unified host facet info returns "Bad Request" response + Given operation "GetCSMUnifiedHostFacetInfo" enabled + And new "GetCSMUnifiedHostFacetInfo" request + And request contains "facet" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get unified host facet info returns "OK" response + Given operation "GetCSMUnifiedHostFacetInfo" enabled + And new "GetCSMUnifiedHostFacetInfo" request + And request contains "facet" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List agentless host facets returns "OK" response + Given operation "ListCSMAgentlessHostFacets" enabled + And new "ListCSMAgentlessHostFacets" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List agentless hosts returns "Bad Request" response + Given operation "ListCSMAgentlessHosts" enabled + And new "ListCSMAgentlessHosts" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List agentless hosts returns "OK" response + Given operation "ListCSMAgentlessHosts" enabled + And new "ListCSMAgentlessHosts" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List unified host facets returns "OK" response + Given operation "ListCSMUnifiedHostFacets" enabled + And new "ListCSMUnifiedHostFacets" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List unified hosts returns "Bad Request" response + Given operation "ListCSMUnifiedHosts" enabled + And new "ListCSMUnifiedHosts" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List unified hosts returns "OK" response + Given operation "ListCSMUnifiedHosts" enabled + And new "ListCSMUnifiedHosts" 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 9101d0155cbe..64ba52bc401a 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2031,6 +2031,42 @@ "type": "safe" } }, + "ListCSMAgentlessHosts": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, + "GetCSMAgentlessHostFacetInfo": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, + "ListCSMAgentlessHostFacets": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, + "ListCSMUnifiedHosts": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, + "GetCSMUnifiedHostFacetInfo": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, + "ListCSMUnifiedHostFacets": { + "tag": "CSM Settings", + "undo": { + "type": "safe" + } + }, "GetCurrentUser": { "tag": "Users", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 832ee7adb038..5554d5c1e161 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -406,6 +406,12 @@ def initialize "v2.list_cost_tag_metadata_months": false, "v2.list_cost_tag_metadata_orchestrators": false, "v2.search_cost_recommendations": false, + "v2.get_csm_agentless_host_facet_info": false, + "v2.get_csm_unified_host_facet_info": false, + "v2.list_csm_agentless_host_facets": false, + "v2.list_csm_agentless_hosts": false, + "v2.list_csm_unified_host_facets": false, + "v2.list_csm_unified_hosts": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6bcb0f8a7651..bba910b9bf0f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2507,6 +2507,15 @@ def overrides "v2.create_workflow_response" => "CreateWorkflowResponse", "v2.creator" => "Creator", "v2.csm_agent_data" => "CsmAgentData", + "v2.csm_agentless_host_attributes" => "CsmAgentlessHostAttributes", + "v2.csm_agentless_host_data" => "CsmAgentlessHostData", + "v2.csm_agentless_host_facet_attributes" => "CsmAgentlessHostFacetAttributes", + "v2.csm_agentless_host_facet_data" => "CsmAgentlessHostFacetData", + "v2.csm_agentless_host_facets_response" => "CsmAgentlessHostFacetsResponse", + "v2.csm_agentless_host_facet_type" => "CsmAgentlessHostFacetType", + "v2.csm_agentless_host_resource_type" => "CsmAgentlessHostResourceType", + "v2.csm_agentless_hosts_response" => "CsmAgentlessHostsResponse", + "v2.csm_agentless_host_type" => "CsmAgentlessHostType", "v2.csm_agents_attributes" => "CsmAgentsAttributes", "v2.csm_agents_metadata" => "CSMAgentsMetadata", "v2.csm_agents_response" => "CsmAgentsResponse", @@ -2514,13 +2523,30 @@ def overrides "v2.csm_cloud_accounts_coverage_analysis_attributes" => "CsmCloudAccountsCoverageAnalysisAttributes", "v2.csm_cloud_accounts_coverage_analysis_data" => "CsmCloudAccountsCoverageAnalysisData", "v2.csm_cloud_accounts_coverage_analysis_response" => "CsmCloudAccountsCoverageAnalysisResponse", + "v2.csm_cloud_provider" => "CsmCloudProvider", "v2.csm_coverage_analysis" => "CsmCoverageAnalysis", + "v2.csm_facet_info_type" => "CsmFacetInfoType", + "v2.csm_host_facet_info_attributes" => "CsmHostFacetInfoAttributes", + "v2.csm_host_facet_info_data" => "CsmHostFacetInfoData", + "v2.csm_host_facet_info_item" => "CsmHostFacetInfoItem", + "v2.csm_host_facet_info_meta" => "CsmHostFacetInfoMeta", + "v2.csm_host_facet_info_response" => "CsmHostFacetInfoResponse", "v2.csm_hosts_and_containers_coverage_analysis_attributes" => "CsmHostsAndContainersCoverageAnalysisAttributes", "v2.csm_hosts_and_containers_coverage_analysis_data" => "CsmHostsAndContainersCoverageAnalysisData", "v2.csm_hosts_and_containers_coverage_analysis_response" => "CsmHostsAndContainersCoverageAnalysisResponse", "v2.csm_serverless_coverage_analysis_attributes" => "CsmServerlessCoverageAnalysisAttributes", "v2.csm_serverless_coverage_analysis_data" => "CsmServerlessCoverageAnalysisData", "v2.csm_serverless_coverage_analysis_response" => "CsmServerlessCoverageAnalysisResponse", + "v2.csm_settings_meta" => "CsmSettingsMeta", + "v2.csm_unified_host_attributes" => "CsmUnifiedHostAttributes", + "v2.csm_unified_host_data" => "CsmUnifiedHostData", + "v2.csm_unified_host_facet_data" => "CsmUnifiedHostFacetData", + "v2.csm_unified_host_facets_response" => "CsmUnifiedHostFacetsResponse", + "v2.csm_unified_host_facet_type" => "CsmUnifiedHostFacetType", + "v2.csm_unified_hosts_meta" => "CsmUnifiedHostsMeta", + "v2.csm_unified_host_source" => "CsmUnifiedHostSource", + "v2.csm_unified_hosts_response" => "CsmUnifiedHostsResponse", + "v2.csm_unified_host_type" => "CsmUnifiedHostType", "v2.custom_attribute_config" => "CustomAttributeConfig", "v2.custom_attribute_config_attributes_create" => "CustomAttributeConfigAttributesCreate", "v2.custom_attribute_config_create" => "CustomAttributeConfigCreate", @@ -7484,6 +7510,7 @@ def overrides "v2.containers_api" => "ContainersAPI", "v2.csm_agents_api" => "CSMAgentsAPI", "v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI", + "v2.csm_settings_api" => "CSMSettingsAPI", "v2.csm_threats_api" => "CSMThreatsAPI", "v2.customer_org_api" => "CustomerOrgAPI", "v2.dashboard_lists_api" => "DashboardListsAPI", diff --git a/lib/datadog_api_client/v2/api/csm_settings_api.rb b/lib/datadog_api_client/v2/api/csm_settings_api.rb new file mode 100644 index 000000000000..981379fa4930 --- /dev/null +++ b/lib/datadog_api_client/v2/api/csm_settings_api.rb @@ -0,0 +1,478 @@ +=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 CSMSettingsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get agentless host facet info. + # + # @see #get_csm_agentless_host_facet_info_with_http_info + def get_csm_agentless_host_facet_info(facet, opts = {}) + data, _status_code, _headers = get_csm_agentless_host_facet_info_with_http_info(facet, opts) + data + end + + # Get agentless host facet info. + # + # Get the value distribution for a specific agentless host facet, with optional search and filtering. + # + # @param facet [String] The facet identifier to retrieve value distribution for. Valid values are `resource_name`, `account_id`, `resource_type`, `cloud_provider`, `has_vulnerability_scanning`, and `has_posture_management`. + # @param opts [Hash] the optional parameters + # @option opts [String] :search A search string to filter the facet values. + # @option opts [String] :query A filter query to scope the facet value counts. + # @return [Array<(CsmHostFacetInfoResponse, Integer, Hash)>] CsmHostFacetInfoResponse data, response status code and response headers + def get_csm_agentless_host_facet_info_with_http_info(facet, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_csm_agentless_host_facet_info".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_csm_agentless_host_facet_info") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_csm_agentless_host_facet_info")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.get_csm_agentless_host_facet_info ...' + end + # verify the required parameter 'facet' is set + if @api_client.config.client_side_validation && facet.nil? + fail ArgumentError, "Missing the required parameter 'facet' when calling CSMSettingsAPI.get_csm_agentless_host_facet_info" + end + # resource path + local_var_path = '/api/v2/csm/settings/agentless_hosts/facet_info' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'facet'] = facet + query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].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] || 'CsmHostFacetInfoResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_csm_agentless_host_facet_info, + :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: CSMSettingsAPI#get_csm_agentless_host_facet_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get unified host facet info. + # + # @see #get_csm_unified_host_facet_info_with_http_info + def get_csm_unified_host_facet_info(facet, opts = {}) + data, _status_code, _headers = get_csm_unified_host_facet_info_with_http_info(facet, opts) + data + end + + # Get unified host facet info. + # + # Get the value distribution for a specific unified host facet, with optional search and filtering. + # + # @param facet [String] The facet identifier to retrieve value distribution for. Valid values include `resource_name`, `account_id`, `resource_type`, `cloud_provider`, `agentless_vulnerability_scanning`, `agentless_posture_management`, `hostname`, `agent_version`, `os`, `cluster_name`, `agent_posture_management`, `agent_cws_enabled`, `agent_csm_vm_hosts_enabled`, and `agent_csm_vm_containers_enabled`. + # @param opts [Hash] the optional parameters + # @option opts [String] :search A search string to filter the facet values. + # @option opts [String] :query A filter query to scope the facet value counts. + # @return [Array<(CsmHostFacetInfoResponse, Integer, Hash)>] CsmHostFacetInfoResponse data, response status code and response headers + def get_csm_unified_host_facet_info_with_http_info(facet, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_csm_unified_host_facet_info".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_csm_unified_host_facet_info") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_csm_unified_host_facet_info")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.get_csm_unified_host_facet_info ...' + end + # verify the required parameter 'facet' is set + if @api_client.config.client_side_validation && facet.nil? + fail ArgumentError, "Missing the required parameter 'facet' when calling CSMSettingsAPI.get_csm_unified_host_facet_info" + end + # resource path + local_var_path = '/api/v2/csm/settings/hosts/facet_info' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'facet'] = facet + query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].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] || 'CsmHostFacetInfoResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_csm_unified_host_facet_info, + :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: CSMSettingsAPI#get_csm_unified_host_facet_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List agentless host facets. + # + # @see #list_csm_agentless_host_facets_with_http_info + def list_csm_agentless_host_facets(opts = {}) + data, _status_code, _headers = list_csm_agentless_host_facets_with_http_info(opts) + data + end + + # List agentless host facets. + # + # Get the list of available facets for filtering agentless hosts. + # + # @param opts [Hash] the optional parameters + # @return [Array<(CsmAgentlessHostFacetsResponse, Integer, Hash)>] CsmAgentlessHostFacetsResponse data, response status code and response headers + def list_csm_agentless_host_facets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_agentless_host_facets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_agentless_host_facets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_agentless_host_facets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_agentless_host_facets ...' + end + # resource path + local_var_path = '/api/v2/csm/settings/agentless_hosts/facets' + + # 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] || 'CsmAgentlessHostFacetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_csm_agentless_host_facets, + :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: CSMSettingsAPI#list_csm_agentless_host_facets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List agentless hosts. + # + # @see #list_csm_agentless_hosts_with_http_info + def list_csm_agentless_hosts(opts = {}) + data, _status_code, _headers = list_csm_agentless_hosts_with_http_info(opts) + data + end + + # List agentless hosts. + # + # Get the list of agentless hosts for CSM, with optional pagination and filtering. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page The page index for pagination (zero-based). + # @option opts [Integer] :size The number of agentless hosts to return per page. + # @option opts [String] :query A search query string to filter agentless hosts. + # @return [Array<(CsmAgentlessHostsResponse, Integer, Hash)>] CsmAgentlessHostsResponse data, response status code and response headers + def list_csm_agentless_hosts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_agentless_hosts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_agentless_hosts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_agentless_hosts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_agentless_hosts ...' + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be smaller than or equal to 1000000.' + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be greater than or equal to 0.' + end + if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_agentless_hosts, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/csm/settings/agentless_hosts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].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] || 'CsmAgentlessHostsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_csm_agentless_hosts, + :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: CSMSettingsAPI#list_csm_agentless_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List unified host facets. + # + # @see #list_csm_unified_host_facets_with_http_info + def list_csm_unified_host_facets(opts = {}) + data, _status_code, _headers = list_csm_unified_host_facets_with_http_info(opts) + data + end + + # List unified host facets. + # + # Get the list of available facets for filtering unified hosts. + # + # @param opts [Hash] the optional parameters + # @return [Array<(CsmUnifiedHostFacetsResponse, Integer, Hash)>] CsmUnifiedHostFacetsResponse data, response status code and response headers + def list_csm_unified_host_facets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_unified_host_facets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_unified_host_facets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_unified_host_facets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_unified_host_facets ...' + end + # resource path + local_var_path = '/api/v2/csm/settings/hosts/facets' + + # 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] || 'CsmUnifiedHostFacetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_csm_unified_host_facets, + :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: CSMSettingsAPI#list_csm_unified_host_facets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List unified hosts. + # + # @see #list_csm_unified_hosts_with_http_info + def list_csm_unified_hosts(opts = {}) + data, _status_code, _headers = list_csm_unified_hosts_with_http_info(opts) + data + end + + # List unified hosts. + # + # Get the list of unified hosts for CSM, combining agent and agentless host data, with optional pagination and filtering. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page The page index for pagination (zero-based). + # @option opts [Integer] :size The number of hosts to return per page. + # @option opts [String] :query A search query string to filter unified hosts. + # @return [Array<(CsmUnifiedHostsResponse, Integer, Hash)>] CsmUnifiedHostsResponse data, response status code and response headers + def list_csm_unified_hosts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_csm_unified_hosts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_csm_unified_hosts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_csm_unified_hosts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMSettingsAPI.list_csm_unified_hosts ...' + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 1000000 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be smaller than or equal to 1000000.' + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be greater than or equal to 0.' + end + if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"size"]" when calling CSMSettingsAPI.list_csm_unified_hosts, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/csm/settings/hosts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].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] || 'CsmUnifiedHostsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_csm_unified_hosts, + :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: CSMSettingsAPI#list_csm_unified_hosts\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/csm_agentless_host_attributes.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_attributes.rb new file mode 100644 index 000000000000..d5b6c9dd471f --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_attributes.rb @@ -0,0 +1,207 @@ +=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 agentless host. + class CsmAgentlessHostAttributes + include BaseGenericModel + + # The ID of the cloud account that the host belongs to. + attr_reader :account_id + + # The cloud provider of a host resource. + attr_reader :cloud_provider + + # Whether CSM Misconfigurations is enabled for this host. `true` if enabled; `false` if disabled. + attr_reader :has_posture_management + + # Whether CSM Vulnerabilities is enabled for this host. `true` if enabled; `false` if disabled. + attr_reader :has_vulnerability_scanning + + # The type of cloud resource for an agentless host. + attr_reader :resource_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'cloud_provider' => :'cloud_provider', + :'has_posture_management' => :'has_posture_management', + :'has_vulnerability_scanning' => :'has_vulnerability_scanning', + :'resource_type' => :'resource_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'cloud_provider' => :'CsmCloudProvider', + :'has_posture_management' => :'Boolean', + :'has_vulnerability_scanning' => :'Boolean', + :'resource_type' => :'CsmAgentlessHostResourceType' + } + 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::CsmAgentlessHostAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'cloud_provider') + self.cloud_provider = attributes[:'cloud_provider'] + end + + if attributes.key?(:'has_posture_management') + self.has_posture_management = attributes[:'has_posture_management'] + end + + if attributes.key?(:'has_vulnerability_scanning') + self.has_vulnerability_scanning = attributes[:'has_vulnerability_scanning'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_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 @account_id.nil? + return false if @cloud_provider.nil? + return false if @has_posture_management.nil? + return false if @has_vulnerability_scanning.nil? + return false if @resource_type.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param cloud_provider [Object] Object to be assigned + # @!visibility private + def cloud_provider=(cloud_provider) + if cloud_provider.nil? + fail ArgumentError, 'invalid value for "cloud_provider", cloud_provider cannot be nil.' + end + @cloud_provider = cloud_provider + end + + # Custom attribute writer method with validation + # @param has_posture_management [Object] Object to be assigned + # @!visibility private + def has_posture_management=(has_posture_management) + if has_posture_management.nil? + fail ArgumentError, 'invalid value for "has_posture_management", has_posture_management cannot be nil.' + end + @has_posture_management = has_posture_management + end + + # Custom attribute writer method with validation + # @param has_vulnerability_scanning [Object] Object to be assigned + # @!visibility private + def has_vulnerability_scanning=(has_vulnerability_scanning) + if has_vulnerability_scanning.nil? + fail ArgumentError, 'invalid value for "has_vulnerability_scanning", has_vulnerability_scanning cannot be nil.' + end + @has_vulnerability_scanning = has_vulnerability_scanning + end + + # Custom attribute writer method with validation + # @param resource_type [Object] Object to be assigned + # @!visibility private + def resource_type=(resource_type) + if resource_type.nil? + fail ArgumentError, 'invalid value for "resource_type", resource_type cannot be nil.' + end + @resource_type = resource_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 && + account_id == o.account_id && + cloud_provider == o.cloud_provider && + has_posture_management == o.has_posture_management && + has_vulnerability_scanning == o.has_vulnerability_scanning && + resource_type == o.resource_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, cloud_provider, has_posture_management, has_vulnerability_scanning, resource_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_host_data.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_data.rb new file mode 100644 index 000000000000..5e6eb1574aa6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_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 + # A single agentless host resource. + class CsmAgentlessHostData + include BaseGenericModel + + # Attributes of an agentless host. + attr_reader :attributes + + # The resource identifier of the agentless host. + attr_reader :id + + # The JSON:API type for agentless host resources. The value should always be `agentless_host`. + 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' => :'CsmAgentlessHostAttributes', + :'id' => :'String', + :'type' => :'CsmAgentlessHostType' + } + 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::CsmAgentlessHostData` 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/csm_agentless_host_facet_attributes.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_attributes.rb new file mode 100644 index 000000000000..10d2623057ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_attributes.rb @@ -0,0 +1,381 @@ +=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 agentless host facet. + class CsmAgentlessHostFacetAttributes + include BaseGenericModel + + # Whether the facet has a bounded set of allowed values. `true` indicates a fixed value set and `false` indicates free-form values. + attr_reader :bounded + + # Whether the facet is bundled as part of the default facet set. `true` indicates bundled and `false` indicates custom. + attr_reader :bundled + + # Whether the facet is both bundled and actively used. `true` indicates in use; `false` indicates unused. + attr_reader :bundled_and_used + + # The list of default filter values for the facet. + attr_reader :default_values + + # A human-readable description of what the facet represents. + attr_reader :description + + # Whether the facet can be edited by users. `true` indicates editable; `false` indicates read-only. + attr_reader :editable + + # The UI display type for the facet, such as `list`. + attr_reader :facet_type + + # The list of UI groups that this facet belongs to. + attr_reader :groups + + # The display name of the facet. + attr_reader :name + + # The field path used when filtering by this facet. + attr_reader :path + + # The data source that provides the facet values. + attr_reader :source + + # The data type of the facet values. + attr_reader :type + + # The list of allowed filter values for bounded facets. Empty for unbounded facets. + attr_reader :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'bounded' => :'bounded', + :'bundled' => :'bundled', + :'bundled_and_used' => :'bundledAndUsed', + :'default_values' => :'defaultValues', + :'description' => :'description', + :'editable' => :'editable', + :'facet_type' => :'facetType', + :'groups' => :'groups', + :'name' => :'name', + :'path' => :'path', + :'source' => :'source', + :'type' => :'type', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'bounded' => :'Boolean', + :'bundled' => :'Boolean', + :'bundled_and_used' => :'Boolean', + :'default_values' => :'Array', + :'description' => :'String', + :'editable' => :'Boolean', + :'facet_type' => :'String', + :'groups' => :'Array', + :'name' => :'String', + :'path' => :'String', + :'source' => :'String', + :'type' => :'String', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CsmAgentlessHostFacetAttributes` 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?(:'bounded') + self.bounded = attributes[:'bounded'] + end + + if attributes.key?(:'bundled') + self.bundled = attributes[:'bundled'] + end + + if attributes.key?(:'bundled_and_used') + self.bundled_and_used = attributes[:'bundled_and_used'] + end + + if attributes.key?(:'default_values') + if (value = attributes[:'default_values']).is_a?(Array) + self.default_values = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'editable') + self.editable = attributes[:'editable'] + end + + if attributes.key?(:'facet_type') + self.facet_type = attributes[:'facet_type'] + end + + if attributes.key?(:'groups') + if (value = attributes[:'groups']).is_a?(Array) + self.groups = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @bounded.nil? + return false if @bundled.nil? + return false if @bundled_and_used.nil? + return false if @default_values.nil? + return false if @description.nil? + return false if @editable.nil? + return false if @facet_type.nil? + return false if @groups.nil? + return false if @name.nil? + return false if @path.nil? + return false if @source.nil? + return false if @type.nil? + return false if @values.nil? + true + end + + # Custom attribute writer method with validation + # @param bounded [Object] Object to be assigned + # @!visibility private + def bounded=(bounded) + if bounded.nil? + fail ArgumentError, 'invalid value for "bounded", bounded cannot be nil.' + end + @bounded = bounded + end + + # Custom attribute writer method with validation + # @param bundled [Object] Object to be assigned + # @!visibility private + def bundled=(bundled) + if bundled.nil? + fail ArgumentError, 'invalid value for "bundled", bundled cannot be nil.' + end + @bundled = bundled + end + + # Custom attribute writer method with validation + # @param bundled_and_used [Object] Object to be assigned + # @!visibility private + def bundled_and_used=(bundled_and_used) + if bundled_and_used.nil? + fail ArgumentError, 'invalid value for "bundled_and_used", bundled_and_used cannot be nil.' + end + @bundled_and_used = bundled_and_used + end + + # Custom attribute writer method with validation + # @param default_values [Object] Object to be assigned + # @!visibility private + def default_values=(default_values) + if default_values.nil? + fail ArgumentError, 'invalid value for "default_values", default_values cannot be nil.' + end + @default_values = default_values + 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 editable [Object] Object to be assigned + # @!visibility private + def editable=(editable) + if editable.nil? + fail ArgumentError, 'invalid value for "editable", editable cannot be nil.' + end + @editable = editable + end + + # Custom attribute writer method with validation + # @param facet_type [Object] Object to be assigned + # @!visibility private + def facet_type=(facet_type) + if facet_type.nil? + fail ArgumentError, 'invalid value for "facet_type", facet_type cannot be nil.' + end + @facet_type = facet_type + end + + # Custom attribute writer method with validation + # @param groups [Object] Object to be assigned + # @!visibility private + def groups=(groups) + if groups.nil? + fail ArgumentError, 'invalid value for "groups", groups cannot be nil.' + end + @groups = groups + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param path [Object] Object to be assigned + # @!visibility private + def path=(path) + if path.nil? + fail ArgumentError, 'invalid value for "path", path cannot be nil.' + end + @path = path + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param 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 + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + bounded == o.bounded && + bundled == o.bundled && + bundled_and_used == o.bundled_and_used && + default_values == o.default_values && + description == o.description && + editable == o.editable && + facet_type == o.facet_type && + groups == o.groups && + name == o.name && + path == o.path && + source == o.source && + type == o.type && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [bounded, bundled, bundled_and_used, default_values, description, editable, facet_type, groups, name, path, source, type, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_host_facet_data.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_data.rb new file mode 100644 index 000000000000..6a660f713fa2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_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 + # A single agentless host facet resource. + class CsmAgentlessHostFacetData + include BaseGenericModel + + # Attributes of an agentless host facet. + attr_reader :attributes + + # The identifier of the facet, corresponding to the field path. + attr_reader :id + + # The JSON:API type for agentless host facet resources. The value should always be `agentless_host_facet`. + 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' => :'CsmAgentlessHostFacetAttributes', + :'id' => :'String', + :'type' => :'CsmAgentlessHostFacetType' + } + 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::CsmAgentlessHostFacetData` 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/csm_agentless_host_facet_type.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_type.rb new file mode 100644 index 000000000000..5c5973628364 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_facet_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 JSON:API type for agentless host facet resources. The value should always be `agentless_host_facet`. + class CsmAgentlessHostFacetType + include BaseEnumModel + + AGENTLESS_HOST_FACET = "agentless_host_facet".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_host_facets_response.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_facets_response.rb new file mode 100644 index 000000000000..4738a841f09f --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_facets_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response returned when listing facets for agentless hosts. + class CsmAgentlessHostFacetsResponse + include BaseGenericModel + + # The list of available facets for agentless hosts. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CsmAgentlessHostFacetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_host_resource_type.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_resource_type.rb new file mode 100644 index 000000000000..3338982ba4d8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_resource_type.rb @@ -0,0 +1,29 @@ +=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 cloud resource for an agentless host. + class CsmAgentlessHostResourceType + include BaseEnumModel + + AWS_EC2_INSTANCE = "aws_ec2_instance".freeze + AZURE_VIRTUAL_MACHINE_INSTANCE = "azure_virtual_machine_instance".freeze + GCP_COMPUTE_INSTANCE = "gcp_compute_instance".freeze + OCI_INSTANCE = "oci_instance".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_host_type.rb b/lib/datadog_api_client/v2/models/csm_agentless_host_type.rb new file mode 100644 index 000000000000..333128711b8e --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_host_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 JSON:API type for agentless host resources. The value should always be `agentless_host`. + class CsmAgentlessHostType + include BaseEnumModel + + AGENTLESS_HOST = "agentless_host".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_agentless_hosts_response.rb b/lib/datadog_api_client/v2/models/csm_agentless_hosts_response.rb new file mode 100644 index 000000000000..fbcc63300a84 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_agentless_hosts_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response returned when listing agentless hosts. + class CsmAgentlessHostsResponse + include BaseGenericModel + + # The list of agentless hosts for the current page. + attr_reader :data + + # Pagination metadata for a CSM settings list response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'CsmSettingsMeta' + } + 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::CsmAgentlessHostsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_cloud_provider.rb b/lib/datadog_api_client/v2/models/csm_cloud_provider.rb new file mode 100644 index 000000000000..a1c9734ff177 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_cloud_provider.rb @@ -0,0 +1,29 @@ +=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 cloud provider of a host resource. + class CsmCloudProvider + include BaseEnumModel + + AWS = "aws".freeze + GCP = "gcp".freeze + AZURE = "azure".freeze + OCI = "oci".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_facet_info_type.rb b/lib/datadog_api_client/v2/models/csm_facet_info_type.rb new file mode 100644 index 000000000000..612bb4cc0b57 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_facet_info_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 JSON:API type for facet info resources. The value should always be `facet_info`. + class CsmFacetInfoType + include BaseEnumModel + + FACET_INFO = "facet_info".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_host_facet_info_attributes.rb b/lib/datadog_api_client/v2/models/csm_host_facet_info_attributes.rb new file mode 100644 index 000000000000..4bbb9ca0804f --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_host_facet_info_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a facet info response, containing the value distribution for the requested facet. + class CsmHostFacetInfoAttributes + include BaseGenericModel + + # The list of facet value entries for the current page. + attr_reader :items + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'items' => :'items' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'items' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CsmHostFacetInfoAttributes` 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?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @items.nil? + true + end + + # Custom attribute writer method with validation + # @param items [Object] Object to be assigned + # @!visibility private + def items=(items) + if items.nil? + fail ArgumentError, 'invalid value for "items", items cannot be nil.' + end + @items = items + 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 && + items == o.items && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [items, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_host_facet_info_data.rb b/lib/datadog_api_client/v2/models/csm_host_facet_info_data.rb new file mode 100644 index 000000000000..23befd6d9060 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_host_facet_info_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper for a facet info response. + class CsmHostFacetInfoData + include BaseGenericModel + + # Attributes of a facet info response, containing the value distribution for the requested facet. + attr_reader :attributes + + # The identifier of the facet. + attr_reader :id + + # Metadata for the facet info response. + attr_reader :meta + + # The JSON:API type for facet info resources. The value should always be `facet_info`. + 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', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CsmHostFacetInfoAttributes', + :'id' => :'String', + :'meta' => :'CsmHostFacetInfoMeta', + :'type' => :'CsmFacetInfoType' + } + 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::CsmHostFacetInfoData` 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?(:'meta') + self.meta = attributes[:'meta'] + 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 @meta.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 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 + + # 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 && + meta == o.meta && + 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, meta, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_host_facet_info_item.rb b/lib/datadog_api_client/v2/models/csm_host_facet_info_item.rb new file mode 100644 index 000000000000..9e217187fdd2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_host_facet_info_item.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 + # A single value and its occurrence count for a facet. + class CsmHostFacetInfoItem + include BaseGenericModel + + # The number of resources with this facet value. + attr_reader :count + + # The facet value. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'value' => :'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::CsmHostFacetInfoItem` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @count.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + count == o.count && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_host_facet_info_meta.rb b/lib/datadog_api_client/v2/models/csm_host_facet_info_meta.rb new file mode 100644 index 000000000000..12797774e467 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_host_facet_info_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 facet info response. + class CsmHostFacetInfoMeta + include BaseGenericModel + + # The total number of distinct values for this facet. + attr_reader :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'total_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'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::CsmHostFacetInfoMeta` 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?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @total_count.nil? + true + end + + # Custom attribute writer method with validation + # @param total_count [Object] Object to be assigned + # @!visibility private + def total_count=(total_count) + if total_count.nil? + fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' + end + @total_count = total_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_host_facet_info_response.rb b/lib/datadog_api_client/v2/models/csm_host_facet_info_response.rb new file mode 100644 index 000000000000..d9fb64e2167f --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_host_facet_info_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 + # The response returned when requesting value distribution for a specific facet. + class CsmHostFacetInfoResponse + include BaseGenericModel + + # The data wrapper for a facet info 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' => :'CsmHostFacetInfoData' + } + 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::CsmHostFacetInfoResponse` 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/csm_settings_meta.rb b/lib/datadog_api_client/v2/models/csm_settings_meta.rb new file mode 100644 index 000000000000..ef2f47602c89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_settings_meta.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 for a CSM settings list response. + class CsmSettingsMeta + include BaseGenericModel + + # The current page index (zero-based). + attr_reader :page_index + + # The number of resources returned per page. + attr_reader :page_size + + # The total number of resources matching the filter criteria. + attr_reader :total_filtered + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page_index' => :'page_index', + :'page_size' => :'page_size', + :'total_filtered' => :'total_filtered' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page_index' => :'Integer', + :'page_size' => :'Integer', + :'total_filtered' => :'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::CsmSettingsMeta` 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_index') + self.page_index = attributes[:'page_index'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'total_filtered') + self.total_filtered = attributes[:'total_filtered'] + 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_index.nil? + return false if @page_size.nil? + return false if @total_filtered.nil? + true + end + + # Custom attribute writer method with validation + # @param page_index [Object] Object to be assigned + # @!visibility private + def page_index=(page_index) + if page_index.nil? + fail ArgumentError, 'invalid value for "page_index", page_index cannot be nil.' + end + @page_index = page_index + end + + # Custom attribute writer method with validation + # @param page_size [Object] Object to be assigned + # @!visibility private + def page_size=(page_size) + if page_size.nil? + fail ArgumentError, 'invalid value for "page_size", page_size cannot be nil.' + end + @page_size = page_size + end + + # Custom attribute writer method with validation + # @param total_filtered [Object] Object to be assigned + # @!visibility private + def total_filtered=(total_filtered) + if total_filtered.nil? + fail ArgumentError, 'invalid value for "total_filtered", total_filtered cannot be nil.' + end + @total_filtered = total_filtered + 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_index == o.page_index && + page_size == o.page_size && + total_filtered == o.total_filtered && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page_index, page_size, total_filtered, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_host_attributes.rb b/lib/datadog_api_client/v2/models/csm_unified_host_attributes.rb new file mode 100644 index 000000000000..e2ccc35c14c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_attributes.rb @@ -0,0 +1,306 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a unified host, combining data from agent and agentless sources. + class CsmUnifiedHostAttributes + include BaseGenericModel + + # The ID of the cloud account that the host belongs to. Present only when the host was discovered through agentless scanning. + attr_accessor :account_id + + # Whether CSM Vulnerabilities is enabled for containers through the Datadog Agent. `true` if enabled; `false` if disabled. + attr_accessor :agent_csm_vm_containers_enabled + + # Whether CSM Vulnerabilities is enabled for hosts through the Datadog Agent. `true` if enabled; `false` if disabled. + attr_accessor :agent_csm_vm_hosts_enabled + + # Whether CSM Threats is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled. + attr_accessor :agent_cws_enabled + + # Whether CSM Misconfigurations is enabled for this host through the Datadog Agent. `true` if enabled; `false` if disabled. + attr_accessor :agent_posture_management + + # The version of the Datadog Agent running on this host. + attr_accessor :agent_version + + # Whether CSM Misconfigurations is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled. + attr_accessor :agentless_posture_management + + # Whether CSM Vulnerabilities is enabled for this host via agentless scanning. `true` if enabled; `false` if disabled. + attr_accessor :agentless_vulnerability_scanning + + # The cloud provider of a host resource. + attr_accessor :cloud_provider + + # The name of the Kubernetes cluster the host belongs to, if applicable. + attr_accessor :cluster_name + + # The Datadog Agent key associated with this host. Present only for agent-sourced hosts. + attr_accessor :datadog_agent_key + + # The list of environment tags associated with this host. + attr_accessor :env + + # The internal Datadog host identifier. Present only for agent-sourced hosts. + attr_accessor :host_id + + # The tool used to install the Datadog Agent on this host. + attr_accessor :install_method_tool + + # The operating system of the host. Present only for agent-sourced hosts. + attr_accessor :os + + # The type of cloud resource for an agentless host. + attr_accessor :resource_type + + # The source of a unified host entry, indicating whether it was discovered via agent, agentless scanning, or both. + attr_reader :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'agent_csm_vm_containers_enabled' => :'agent_csm_vm_containers_enabled', + :'agent_csm_vm_hosts_enabled' => :'agent_csm_vm_hosts_enabled', + :'agent_cws_enabled' => :'agent_cws_enabled', + :'agent_posture_management' => :'agent_posture_management', + :'agent_version' => :'agent_version', + :'agentless_posture_management' => :'agentless_posture_management', + :'agentless_vulnerability_scanning' => :'agentless_vulnerability_scanning', + :'cloud_provider' => :'cloud_provider', + :'cluster_name' => :'cluster_name', + :'datadog_agent_key' => :'datadog_agent_key', + :'env' => :'env', + :'host_id' => :'host_id', + :'install_method_tool' => :'install_method_tool', + :'os' => :'os', + :'resource_type' => :'resource_type', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'agent_csm_vm_containers_enabled' => :'Boolean', + :'agent_csm_vm_hosts_enabled' => :'Boolean', + :'agent_cws_enabled' => :'Boolean', + :'agent_posture_management' => :'Boolean', + :'agent_version' => :'String', + :'agentless_posture_management' => :'Boolean', + :'agentless_vulnerability_scanning' => :'Boolean', + :'cloud_provider' => :'CsmCloudProvider', + :'cluster_name' => :'String', + :'datadog_agent_key' => :'String', + :'env' => :'Array', + :'host_id' => :'Integer', + :'install_method_tool' => :'String', + :'os' => :'String', + :'resource_type' => :'CsmAgentlessHostResourceType', + :'source' => :'CsmUnifiedHostSource' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'account_id', + :'agent_csm_vm_containers_enabled', + :'agent_csm_vm_hosts_enabled', + :'agent_cws_enabled', + :'agent_posture_management', + :'agent_version', + :'agentless_posture_management', + :'agentless_vulnerability_scanning', + :'cluster_name', + :'datadog_agent_key', + :'env', + :'host_id', + :'install_method_tool', + :'os', + ]) + 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::CsmUnifiedHostAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'agent_csm_vm_containers_enabled') + self.agent_csm_vm_containers_enabled = attributes[:'agent_csm_vm_containers_enabled'] + end + + if attributes.key?(:'agent_csm_vm_hosts_enabled') + self.agent_csm_vm_hosts_enabled = attributes[:'agent_csm_vm_hosts_enabled'] + end + + if attributes.key?(:'agent_cws_enabled') + self.agent_cws_enabled = attributes[:'agent_cws_enabled'] + end + + if attributes.key?(:'agent_posture_management') + self.agent_posture_management = attributes[:'agent_posture_management'] + end + + if attributes.key?(:'agent_version') + self.agent_version = attributes[:'agent_version'] + end + + if attributes.key?(:'agentless_posture_management') + self.agentless_posture_management = attributes[:'agentless_posture_management'] + end + + if attributes.key?(:'agentless_vulnerability_scanning') + self.agentless_vulnerability_scanning = attributes[:'agentless_vulnerability_scanning'] + end + + if attributes.key?(:'cloud_provider') + self.cloud_provider = attributes[:'cloud_provider'] + end + + if attributes.key?(:'cluster_name') + self.cluster_name = attributes[:'cluster_name'] + end + + if attributes.key?(:'datadog_agent_key') + self.datadog_agent_key = attributes[:'datadog_agent_key'] + end + + if attributes.key?(:'env') + if (value = attributes[:'env']).is_a?(Array) + self.env = value + end + end + + if attributes.key?(:'host_id') + self.host_id = attributes[:'host_id'] + end + + if attributes.key?(:'install_method_tool') + self.install_method_tool = attributes[:'install_method_tool'] + end + + if attributes.key?(:'os') + self.os = attributes[:'os'] + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_type'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + 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 @source.nil? + true + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + agent_csm_vm_containers_enabled == o.agent_csm_vm_containers_enabled && + agent_csm_vm_hosts_enabled == o.agent_csm_vm_hosts_enabled && + agent_cws_enabled == o.agent_cws_enabled && + agent_posture_management == o.agent_posture_management && + agent_version == o.agent_version && + agentless_posture_management == o.agentless_posture_management && + agentless_vulnerability_scanning == o.agentless_vulnerability_scanning && + cloud_provider == o.cloud_provider && + cluster_name == o.cluster_name && + datadog_agent_key == o.datadog_agent_key && + env == o.env && + host_id == o.host_id && + install_method_tool == o.install_method_tool && + os == o.os && + resource_type == o.resource_type && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, agent_csm_vm_containers_enabled, agent_csm_vm_hosts_enabled, agent_cws_enabled, agent_posture_management, agent_version, agentless_posture_management, agentless_vulnerability_scanning, cloud_provider, cluster_name, datadog_agent_key, env, host_id, install_method_tool, os, resource_type, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_host_data.rb b/lib/datadog_api_client/v2/models/csm_unified_host_data.rb new file mode 100644 index 000000000000..e45c1036d3d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_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 + # A single unified host resource, combining agent and agentless data. + class CsmUnifiedHostData + include BaseGenericModel + + # Attributes of a unified host, combining data from agent and agentless sources. + attr_reader :attributes + + # The resource identifier of the unified host. + attr_reader :id + + # The JSON:API type for unified host resources. The value should always be `unified_host`. + 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' => :'CsmUnifiedHostAttributes', + :'id' => :'String', + :'type' => :'CsmUnifiedHostType' + } + 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::CsmUnifiedHostData` 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/csm_unified_host_facet_data.rb b/lib/datadog_api_client/v2/models/csm_unified_host_facet_data.rb new file mode 100644 index 000000000000..274e1955e58a --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_facet_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 + # A single unified host facet resource. + class CsmUnifiedHostFacetData + include BaseGenericModel + + # Attributes of an agentless host facet. + attr_reader :attributes + + # The identifier of the facet, corresponding to the field path. + attr_reader :id + + # The JSON:API type for unified host facet resources. The value should always be `unified_host_facet`. + 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' => :'CsmAgentlessHostFacetAttributes', + :'id' => :'String', + :'type' => :'CsmUnifiedHostFacetType' + } + 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::CsmUnifiedHostFacetData` 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/csm_unified_host_facet_type.rb b/lib/datadog_api_client/v2/models/csm_unified_host_facet_type.rb new file mode 100644 index 000000000000..518063b317af --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_facet_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 JSON:API type for unified host facet resources. The value should always be `unified_host_facet`. + class CsmUnifiedHostFacetType + include BaseEnumModel + + UNIFIED_HOST_FACET = "unified_host_facet".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_host_facets_response.rb b/lib/datadog_api_client/v2/models/csm_unified_host_facets_response.rb new file mode 100644 index 000000000000..ba6780f3e69c --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_facets_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response returned when listing facets for unified hosts. + class CsmUnifiedHostFacetsResponse + include BaseGenericModel + + # The list of available facets for unified hosts. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CsmUnifiedHostFacetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_host_source.rb b/lib/datadog_api_client/v2/models/csm_unified_host_source.rb new file mode 100644 index 000000000000..19e51ece3433 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_source.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The source of a unified host entry, indicating whether it was discovered via agent, agentless scanning, or both. + class CsmUnifiedHostSource + include BaseEnumModel + + AGENT = "agent".freeze + AGENTLESS = "agentless".freeze + BOTH = "both".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_host_type.rb b/lib/datadog_api_client/v2/models/csm_unified_host_type.rb new file mode 100644 index 000000000000..54866727f34e --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_host_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 JSON:API type for unified host resources. The value should always be `unified_host`. + class CsmUnifiedHostType + include BaseEnumModel + + UNIFIED_HOST = "unified_host".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_hosts_meta.rb b/lib/datadog_api_client/v2/models/csm_unified_hosts_meta.rb new file mode 100644 index 000000000000..c180b25f84b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_hosts_meta.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata for a unified hosts list response. + class CsmUnifiedHostsMeta + include BaseGenericModel + + # The current page index (zero-based). + attr_reader :page_index + + # The number of hosts returned per page. + attr_reader :page_size + + # The total number of hosts matching the filter criteria. + attr_reader :total_filtered + + # The total number of pages available. + attr_reader :total_pages + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page_index' => :'page_index', + :'page_size' => :'page_size', + :'total_filtered' => :'total_filtered', + :'total_pages' => :'total_pages' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page_index' => :'Integer', + :'page_size' => :'Integer', + :'total_filtered' => :'Integer', + :'total_pages' => :'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::CsmUnifiedHostsMeta` 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_index') + self.page_index = attributes[:'page_index'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'total_filtered') + self.total_filtered = attributes[:'total_filtered'] + end + + if attributes.key?(:'total_pages') + self.total_pages = attributes[:'total_pages'] + 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_index.nil? + return false if @page_size.nil? + return false if @total_filtered.nil? + return false if @total_pages.nil? + true + end + + # Custom attribute writer method with validation + # @param page_index [Object] Object to be assigned + # @!visibility private + def page_index=(page_index) + if page_index.nil? + fail ArgumentError, 'invalid value for "page_index", page_index cannot be nil.' + end + @page_index = page_index + end + + # Custom attribute writer method with validation + # @param page_size [Object] Object to be assigned + # @!visibility private + def page_size=(page_size) + if page_size.nil? + fail ArgumentError, 'invalid value for "page_size", page_size cannot be nil.' + end + @page_size = page_size + end + + # Custom attribute writer method with validation + # @param total_filtered [Object] Object to be assigned + # @!visibility private + def total_filtered=(total_filtered) + if total_filtered.nil? + fail ArgumentError, 'invalid value for "total_filtered", total_filtered cannot be nil.' + end + @total_filtered = total_filtered + end + + # Custom attribute writer method with validation + # @param total_pages [Object] Object to be assigned + # @!visibility private + def total_pages=(total_pages) + if total_pages.nil? + fail ArgumentError, 'invalid value for "total_pages", total_pages cannot be nil.' + end + @total_pages = total_pages + 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_index == o.page_index && + page_size == o.page_size && + total_filtered == o.total_filtered && + total_pages == o.total_pages && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page_index, page_size, total_filtered, total_pages, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/csm_unified_hosts_response.rb b/lib/datadog_api_client/v2/models/csm_unified_hosts_response.rb new file mode 100644 index 000000000000..9e0b03b4c525 --- /dev/null +++ b/lib/datadog_api_client/v2/models/csm_unified_hosts_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response returned when listing unified hosts. + class CsmUnifiedHostsResponse + include BaseGenericModel + + # The list of unified hosts for the current page. + attr_reader :data + + # Pagination metadata for a unified hosts list response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'CsmUnifiedHostsMeta' + } + 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::CsmUnifiedHostsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end From 2b9c2fabc413ecec792e80fc0e576d248aaad6e6 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 10:06:42 +0200 Subject: [PATCH 2/2] Regenerate client from commit eeabc00 of spec repo (#3460) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 71 ++++++++++-- lib/datadog_api_client/inflector.rb | 1 + .../v2/api/security_monitoring_api.rb | 8 +- .../v2/models/assignment_result.rb | 4 + .../notification_rules_list_response.rb | 107 ++++++++++++++++++ 5 files changed, 180 insertions(+), 11 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/notification_rules_list_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 0031eb15e8d4..134a7ef0ee8f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1985,12 +1985,7 @@ components: content: "application/json": schema: - properties: - data: - items: - $ref: "#/components/schemas/NotificationRule" - type: array - type: object + $ref: "#/components/schemas/NotificationRulesListResponse" description: The list of notification rules. PreconditionFailedResponse: content: @@ -10296,6 +10291,7 @@ components: description: HTTP-like status code describing the outcome for this finding. example: 500 format: int32 + maximum: 599 type: integer title: description: Short label describing the outcome for this finding. @@ -18064,7 +18060,8 @@ components: description: "The value of the set action" oneOf: - type: string - - type: integer + - format: int64 + type: integer - type: boolean CloudWorkloadSecurityAgentRuleActions: description: "The array of actions the rule can perform if triggered" @@ -40478,6 +40475,7 @@ components: - 4 - 5 example: 4 + format: int64 type: integer x-enum-varnames: - UNSPECIFIED @@ -58871,6 +58869,14 @@ components: data: $ref: "#/components/schemas/NotificationRule" type: object + NotificationRulesListResponse: + description: The list of notification rules. + properties: + data: + items: + $ref: "#/components/schemas/NotificationRule" + type: array + type: object NotificationRulesType: description: The rule type associated to notification rules. enum: @@ -70245,6 +70251,7 @@ components: description: Notification destinations (1=email, 2=slack, 3=in-app). items: description: Notification channel identifier (1=email, 2=slack, 3=in-app). + format: int64 type: integer type: array enabled: @@ -87522,6 +87529,7 @@ components: - 50 - 30 items: + format: int64 type: integer type: array names: @@ -110173,6 +110181,7 @@ paths: name: limit required: false schema: + format: int64 type: integer responses: "200": @@ -113317,6 +113326,7 @@ paths: required: false schema: default: 100 + format: int64 type: integer - description: Zero-based page number for pagination. in: query @@ -113324,6 +113334,7 @@ paths: required: false schema: default: 0 + format: int64 type: integer - description: "If `true`, returns timeline cells in chronological order (oldest first). Defaults to `false` (newest first)." in: query @@ -116539,6 +116550,7 @@ paths: required: false schema: example: 200 + format: int64 type: integer - description: Pagination offset. Defaults to `0`. in: query @@ -116546,6 +116558,7 @@ paths: required: false schema: example: 0 + format: int64 type: integer - description: Optional repeated cloud or SaaS provider filters, such as `aws`, `gcp`, `azure`, `Oracle`, `datadog`, `OpenAI`, or `Anthropic`. explode: true @@ -124868,6 +124881,7 @@ paths: name: limit schema: default: 100 + format: int64 maximum: 1000 minimum: 1 type: integer @@ -124877,6 +124891,7 @@ paths: name: offset schema: default: 0 + format: int64 minimum: 0 type: integer responses: @@ -125020,6 +125035,7 @@ paths: name: limit schema: default: 100 + format: int64 maximum: 1000 minimum: 1 type: integer @@ -125029,6 +125045,7 @@ paths: name: offset schema: default: 0 + format: int64 minimum: 0 type: integer responses: @@ -141878,11 +141895,13 @@ paths: in: query name: page[limit] schema: + format: int64 type: integer - description: Page offset from the start of the list (default 0). in: query name: page[offset] schema: + format: int64 type: integer - description: Substring filter on rule name. in: query @@ -143516,6 +143535,7 @@ paths: required: false schema: default: 25 + format: int64 maximum: 100 type: integer - description: Page number (1-indexed). @@ -143524,6 +143544,7 @@ paths: required: false schema: default: 1 + format: int64 type: integer responses: "200": @@ -143839,6 +143860,7 @@ paths: required: false schema: default: 25 + format: int64 maximum: 100 type: integer - description: Page number (1-indexed). @@ -143847,6 +143869,7 @@ paths: required: false schema: default: 1 + format: int64 type: integer responses: "200": @@ -154105,6 +154128,7 @@ paths: name: page[limit] schema: example: 10 + format: int64 type: integer - description: Filter by application ID. in: query @@ -156881,12 +156905,14 @@ paths: name: page[number] schema: example: 0 + format: int64 type: integer - description: Number of items per page. in: query name: page[size] schema: example: 25 + format: int64 type: integer responses: "200": @@ -156967,6 +156993,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer responses: "204": @@ -156990,6 +157017,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer responses: "200": @@ -157025,6 +157053,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer requestBody: content: @@ -157078,6 +157107,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer requestBody: content: @@ -157113,18 +157143,21 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer - description: Page number for pagination (0-indexed). in: query name: page[number] schema: example: 0 + format: int64 type: integer - description: Number of items per page. in: query name: page[size] schema: example: 25 + format: int64 type: integer responses: "200": @@ -157161,6 +157194,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer - description: Unique identifier of the session. in: path @@ -157205,6 +157239,7 @@ paths: required: true schema: example: 1234567 + format: int64 type: integer - description: Unique identifier of the session. in: path @@ -157288,6 +157323,7 @@ paths: name: max_list_size schema: example: 1048576 + format: int64 type: integer - description: Paging token for pagination. in: query @@ -157317,12 +157353,14 @@ paths: name: page[size] schema: example: 25 + format: int64 type: integer - description: Page number for pagination (0-indexed). in: query name: page[number] schema: example: 0 + format: int64 type: integer - description: Unique identifier of the session. in: path @@ -157450,6 +157488,7 @@ paths: name: page[number] schema: example: 0 + format: int64 type: integer - description: Filter by user UUID. Defaults to current user if not specified. in: query @@ -157475,6 +157514,7 @@ paths: name: page[size] schema: example: 25 + format: int64 type: integer - description: Filter by application ID. in: query @@ -158802,6 +158842,7 @@ paths: required: false schema: default: 0 + format: int64 type: integer - description: Number of scores to return. Max is 1000. in: query @@ -158809,6 +158850,7 @@ paths: required: false schema: default: 100 + format: int64 type: integer responses: "200": @@ -158916,6 +158958,7 @@ paths: name: page[limit] required: false schema: + format: int64 type: integer - description: Cursor for pagination. in: query @@ -159043,6 +159086,7 @@ paths: schema: default: 10 example: 10 + format: int64 type: integer - description: Page number to return (1-indexed). in: query @@ -159051,6 +159095,7 @@ paths: schema: default: 1 example: 1 + format: int64 type: integer - description: Query ID for pagination consistency. in: query @@ -169306,6 +169351,7 @@ paths: schema: default: 20 example: 20 + format: int64 type: integer - description: The page number to retrieve, starting from 1. in: query @@ -169313,6 +169359,7 @@ paths: schema: default: 1 example: 1 + format: int64 type: integer - description: |- Filter by service names (multiple values allowed). Required for @@ -171889,6 +171936,7 @@ paths: required: false schema: default: 0 + format: int64 type: integer - description: Pagination limit in: query @@ -171896,6 +171944,7 @@ paths: required: false schema: default: 10 + format: int64 type: integer responses: "200": @@ -172591,12 +172640,14 @@ paths: name: page[offset] schema: default: 0 + format: int64 type: integer - description: The number of status pages to return per page. in: query name: page[limit] schema: default: 50 + format: int64 type: integer - description: Filter status pages by exact domain prefix match. Returns at most one result. in: query @@ -172737,12 +172788,14 @@ paths: name: page[offset] schema: default: 0 + format: int64 type: integer - description: The number of degradations to return per page. in: query name: page[limit] schema: default: 50 + format: int64 type: integer - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." in: query @@ -172808,12 +172861,14 @@ paths: name: page[offset] schema: default: 0 + format: int64 type: integer - description: The number of maintenances to return per page. in: query name: page[limit] schema: default: 50 + format: int64 type: integer - description: "Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page." in: query @@ -181000,6 +181055,7 @@ paths: name: page[number] schema: default: 0 + format: int64 minimum: 0 type: integer - description: Number of widgets per page. @@ -181007,6 +181063,7 @@ paths: name: page[size] schema: default: 50 + format: int64 maximum: 100 type: integer responses: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bba910b9bf0f..aa9a5a15eeef 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4646,6 +4646,7 @@ def overrides "v2.notification_rule" => "NotificationRule", "v2.notification_rule_attributes" => "NotificationRuleAttributes", "v2.notification_rule_response" => "NotificationRuleResponse", + "v2.notification_rules_list_response" => "NotificationRulesListResponse", "v2.notification_rules_type" => "NotificationRulesType", "v2.notion_api_key" => "NotionAPIKey", "v2.notion_api_key_type" => "NotionAPIKeyType", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index f89fba934f5b..765c57639dc6 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -5447,7 +5447,7 @@ def get_signal_notification_rules(opts = {}) # Returns the list of notification rules for security signals. # # @param opts [Hash] the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + # @return [Array<(NotificationRulesListResponse, Integer, Hash)>] NotificationRulesListResponse data, response status code and response headers def get_signal_notification_rules_with_http_info(opts = {}) if @api_client.config.debugging @@ -5471,7 +5471,7 @@ def get_signal_notification_rules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Object' + return_type = opts[:debug_return_type] || 'NotificationRulesListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -6126,7 +6126,7 @@ def get_vulnerability_notification_rules(opts = {}) # Returns the list of notification rules for security vulnerabilities. # # @param opts [Hash] the optional parameters - # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + # @return [Array<(NotificationRulesListResponse, Integer, Hash)>] NotificationRulesListResponse data, response status code and response headers def get_vulnerability_notification_rules_with_http_info(opts = {}) if @api_client.config.debugging @@ -6150,7 +6150,7 @@ def get_vulnerability_notification_rules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Object' + return_type = opts[:debug_return_type] || 'NotificationRulesListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] diff --git a/lib/datadog_api_client/v2/models/assignment_result.rb b/lib/datadog_api_client/v2/models/assignment_result.rb index 28bb73afe628..0cedc4fd4d37 100644 --- a/lib/datadog_api_client/v2/models/assignment_result.rb +++ b/lib/datadog_api_client/v2/models/assignment_result.rb @@ -99,6 +99,7 @@ def valid? return false if @detail.nil? return false if @finding_id.nil? return false if @status.nil? + return false if @status > 599 return false if @title.nil? true end @@ -130,6 +131,9 @@ def status=(status) if status.nil? fail ArgumentError, 'invalid value for "status", status cannot be nil.' end + if status > 599 + fail ArgumentError, 'invalid value for "status", must be smaller than or equal to 599.' + end @status = status end diff --git a/lib/datadog_api_client/v2/models/notification_rules_list_response.rb b/lib/datadog_api_client/v2/models/notification_rules_list_response.rb new file mode 100644 index 000000000000..6a544142e2c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notification_rules_list_response.rb @@ -0,0 +1,107 @@ +=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 list of notification rules. + class NotificationRulesListResponse + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotificationRulesListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # 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