From 2bc640eb8bf29fd3f3fb5858bed777619c321297 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:16:09 +0000 Subject: [PATCH 1/3] Regenerate client from commit 25ad23d of spec repo (#3473) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 395 ------------------ .../v2/fleet-automation/ListFleetClusters.rb | 8 - .../ListFleetInstrumentedPods.rb | 8 - features/scenarios_model_mapping.rb | 11 - features/v2/fleet_automation.feature | 45 -- features/v2/undo.json | 12 - lib/datadog_api_client/configuration.rb | 2 - lib/datadog_api_client/inflector.rb | 9 - .../v2/api/fleet_automation_api.rb | 167 -------- .../v2/models/fleet_cluster_attributes.rb | 287 ------------- .../v2/models/fleet_clusters_response.rb | 133 ------ .../v2/models/fleet_clusters_response_data.rb | 165 -------- ...fleet_clusters_response_data_attributes.rb | 107 ----- .../v2/models/fleet_clusters_response_meta.rb | 105 ----- ...fleet_instrumented_pod_group_attributes.rb | 201 --------- .../fleet_instrumented_pods_response.rb | 123 ------ .../fleet_instrumented_pods_response_data.rb | 165 -------- ...trumented_pods_response_data_attributes.rb | 107 ----- 18 files changed, 2050 deletions(-) delete mode 100644 examples/v2/fleet-automation/ListFleetClusters.rb delete mode 100644 examples/v2/fleet-automation/ListFleetInstrumentedPods.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_cluster_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_clusters_response.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_clusters_response_data.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_clusters_response_data_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_clusters_response_meta.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_instrumented_pod_group_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_instrumented_pods_response.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data.rb delete mode 100644 lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data_attributes.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 134a7ef0ee8f..473542401e37 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -36242,155 +36242,6 @@ components: format: int64 type: integer type: object - FleetClusterAttributes: - description: Attributes of a Kubernetes cluster in the fleet. - properties: - agent_versions: - description: Datadog Agent versions running in the cluster. - items: - description: A Datadog Agent version string. - type: string - type: array - api_key_names: - description: API key names used by agents in the cluster. - items: - description: An API key name. - type: string - type: array - api_key_uuids: - description: API key UUIDs used by agents in the cluster. - items: - description: An API key UUID. - type: string - type: array - cloud_providers: - description: Cloud providers hosting the cluster. - items: - description: A cloud provider name. - type: string - type: array - cluster_name: - description: The name of the Kubernetes cluster. - example: "production-us-east-1" - type: string - enabled_products: - description: Datadog products enabled in the cluster. - items: - description: A Datadog product name. - type: string - type: array - envs: - description: Environments associated with the cluster. - items: - description: An environment name. - type: string - type: array - first_seen_at: - description: Timestamp when the cluster was first seen. - format: int64 - type: integer - install_method_tool: - description: The tool used to install agents in the cluster. - example: "helm" - type: string - node_count: - description: Total number of nodes in the cluster. - example: 25 - format: int64 - type: integer - node_count_by_status: - $ref: "#/components/schemas/FleetClusterNodeCountByStatus" - operating_systems: - description: Operating systems of nodes in the cluster. - items: - description: An operating system name. - type: string - type: array - otel_collector_distributions: - description: OpenTelemetry collector distributions in the cluster. - items: - description: An OpenTelemetry collector distribution name. - type: string - type: array - otel_collector_versions: - description: OpenTelemetry collector versions in the cluster. - items: - description: An OpenTelemetry collector version string. - type: string - type: array - pod_count_by_state: - $ref: "#/components/schemas/FleetClusterPodCountByState" - services: - description: Services running in the cluster. - items: - description: A service name. - type: string - type: array - teams: - description: Teams associated with the cluster. - items: - description: A team name. - type: string - type: array - type: object - FleetClusterNodeCountByStatus: - additionalProperties: - format: int64 - type: integer - description: Node counts grouped by status. - type: object - FleetClusterPodCountByState: - additionalProperties: - format: int64 - type: integer - description: Pod counts grouped by state. - type: object - FleetClustersResponse: - description: Response containing a paginated list of fleet clusters. - properties: - data: - $ref: "#/components/schemas/FleetClustersResponseData" - meta: - $ref: "#/components/schemas/FleetClustersResponseMeta" - required: - - data - type: object - FleetClustersResponseData: - description: The response data containing status and clusters array. - properties: - attributes: - $ref: "#/components/schemas/FleetClustersResponseDataAttributes" - id: - description: Status identifier. - example: "done" - type: string - type: - description: Resource type. - example: "status" - type: string - required: - - id - - type - - attributes - type: object - FleetClustersResponseDataAttributes: - description: Attributes of the fleet clusters response containing the list of clusters. - properties: - clusters: - description: Array of clusters matching the query criteria. - items: - $ref: "#/components/schemas/FleetClusterAttributes" - type: array - type: object - FleetClustersResponseMeta: - description: Metadata for the list of clusters response. - properties: - total_filtered_count: - description: Total number of clusters matching the filter criteria across all pages. - example: 12 - format: int64 - type: integer - type: object FleetConfigurationFile: description: A configuration file for an integration. properties: @@ -36740,93 +36591,6 @@ components: example: "postgres" type: string type: object - FleetInstrumentedPodGroupAttributes: - description: Attributes of a group of instrumented pods targeted for SSI injection. - properties: - applied_target: - additionalProperties: {} - description: The SSI injection target configuration applied to the pod group. - type: object - applied_target_name: - description: The name of the applied SSI injection target. - example: "my-injection-target" - type: string - injected_tags: - description: Tags injected into the pods by the Admission Controller. - items: - description: An injected tag string. - type: string - type: array - kube_ownerref_kind: - description: The kind of the Kubernetes owner reference. - example: "Deployment" - type: string - kube_ownerref_name: - description: The name of the Kubernetes owner reference (deployment, statefulset, etc.). - example: "inventory-service" - type: string - lib_injection_annotations: - description: Library injection annotations on the pod group. - items: - description: A library injection annotation string. - type: string - type: array - namespace: - description: The Kubernetes namespace of the pod group. - example: "default" - type: string - pod_count: - description: Total number of pods in the group. - example: 3 - format: int64 - type: integer - pod_names: - description: Names of the individual pods in the group. - items: - description: A Kubernetes pod name. - type: string - type: array - tags: - additionalProperties: - type: string - description: Additional tags associated with the pod group. - type: object - type: object - FleetInstrumentedPodsResponse: - description: Response containing instrumented pods for a Kubernetes cluster. - properties: - data: - $ref: "#/components/schemas/FleetInstrumentedPodsResponseData" - required: - - data - type: object - FleetInstrumentedPodsResponseData: - description: The response data containing the cluster name and instrumented pod groups. - properties: - attributes: - $ref: "#/components/schemas/FleetInstrumentedPodsResponseDataAttributes" - id: - description: The cluster name identifier. - example: "production-us-east-1" - type: string - type: - description: Resource type. - example: "cluster_name" - type: string - required: - - id - - type - - attributes - type: object - FleetInstrumentedPodsResponseDataAttributes: - description: Attributes of the instrumented pods response containing the list of pod groups. - properties: - groups: - description: Array of instrumented pod groups in the cluster. - items: - $ref: "#/components/schemas/FleetInstrumentedPodGroupAttributes" - type: array - type: object FleetIntegrationDetails: description: Detailed information about a single integration. properties: @@ -102989,165 +102753,6 @@ paths: x-unstable: |- This endpoint is in Preview and may introduce breaking changes. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/unstable/fleet/clusters: - get: - description: |- - Retrieve a paginated list of Kubernetes clusters in the fleet. - - This endpoint returns clusters with metadata including node counts, agent versions, - enabled products, and associated services. Use the `page_number` and `page_size` - query parameters to paginate through results. - operationId: ListFleetClusters - parameters: - - description: Page number for pagination (starts at 0). - in: query - name: page_number - required: false - schema: - default: 0 - format: int64 - minimum: 0 - type: integer - - description: Number of results per page (must be greater than 0 and less than or equal to 100). - in: query - name: page_size - required: false - schema: - default: 10 - format: int64 - maximum: 100 - minimum: 1 - type: integer - - description: Attribute to sort by. - in: query - name: sort_attribute - required: false - schema: - type: string - - description: Sort order (true for descending, false for ascending). - in: query - name: sort_descending - required: false - schema: - type: boolean - - description: Filter string for narrowing down cluster results. - example: "cluster_name:production" - in: query - name: filter - required: false - schema: - type: string - - description: Comma-separated list of tags to filter clusters. - in: query - name: tags - required: false - schema: - type: string - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - clusters: - - agent_versions: - - "7.50.0" - cluster_name: production-us-east-1 - enabled_products: - - apm - node_count: 25 - id: done - type: status - meta: - total_filtered_count: 1 - schema: - $ref: "#/components/schemas/FleetClustersResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List all fleet clusters - tags: - - Fleet Automation - "x-permission": - operator: AND - permissions: - - hosts_read - x-unstable: |- - This endpoint is in Preview and may introduce breaking changes. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/unstable/fleet/clusters/{cluster_name}/instrumented_pods: - get: - description: |- - Retrieve the list of pods targeted for Single Step Instrumentation (SSI) injection - in a specific Kubernetes cluster. - - This endpoint returns pod groups organized by owner reference (deployment, statefulset, etc.) - with their injection annotations and applied targets. Use the clusters list endpoint - to discover available cluster names. - operationId: ListFleetInstrumentedPods - parameters: - - description: The name of the Kubernetes cluster. - in: path - name: cluster_name - required: true - schema: - type: string - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - groups: - - kube_ownerref_kind: Deployment - kube_ownerref_name: inventory-service - namespace: default - pod_count: 3 - id: production-us-east-1 - type: cluster_name - schema: - $ref: "#/components/schemas/FleetInstrumentedPodsResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List instrumented pods for a cluster - tags: - - Fleet Automation - "x-permission": - operator: AND - permissions: - - hosts_read - x-unstable: |- - This endpoint is in Preview and may introduce breaking changes. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/unstable/fleet/deployments: get: description: |- diff --git a/examples/v2/fleet-automation/ListFleetClusters.rb b/examples/v2/fleet-automation/ListFleetClusters.rb deleted file mode 100644 index a988f48c953e..000000000000 --- a/examples/v2/fleet-automation/ListFleetClusters.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List all fleet clusters returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_fleet_clusters".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.list_fleet_clusters() diff --git a/examples/v2/fleet-automation/ListFleetInstrumentedPods.rb b/examples/v2/fleet-automation/ListFleetInstrumentedPods.rb deleted file mode 100644 index 83e871174767..000000000000 --- a/examples/v2/fleet-automation/ListFleetInstrumentedPods.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List instrumented pods for a cluster returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_fleet_instrumented_pods".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.list_fleet_instrumented_pods("cluster_name") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 19f5f6d44b81..adaa8488a34e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -857,17 +857,6 @@ "sort_attribute" => "String", "sort_descending" => "Boolean", }, - "v2.ListFleetClusters" => { - "page_number" => "Integer", - "page_size" => "Integer", - "sort_attribute" => "String", - "sort_descending" => "Boolean", - "filter" => "String", - "tags" => "String", - }, - "v2.ListFleetInstrumentedPods" => { - "cluster_name" => "String", - }, "v2.ListFleetDeployments" => { "page_size" => "Integer", "page_offset" => "Integer", diff --git a/features/v2/fleet_automation.feature b/features/v2/fleet_automation.feature index 3cc13c4aca34..3fede3c72f0b 100644 --- a/features/v2/fleet_automation.feature +++ b/features/v2/fleet_automation.feature @@ -232,27 +232,6 @@ Feature: Fleet Automation When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation - Scenario: List all fleet clusters returns "Bad Request" response - Given operation "ListFleetClusters" enabled - And new "ListFleetClusters" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/fleet-automation - Scenario: List all fleet clusters returns "Not Found" response - Given operation "ListFleetClusters" enabled - And new "ListFleetClusters" request - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/fleet-automation - Scenario: List all fleet clusters returns "OK" response - Given operation "ListFleetClusters" enabled - And new "ListFleetClusters" request - When the request is sent - Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation Scenario: List all fleet tracers returns "Bad Request" response Given operation "ListFleetTracers" enabled @@ -288,30 +267,6 @@ Feature: Fleet Automation When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation - Scenario: List instrumented pods for a cluster returns "Bad Request" response - Given operation "ListFleetInstrumentedPods" enabled - And new "ListFleetInstrumentedPods" request - And request contains "cluster_name" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/fleet-automation - Scenario: List instrumented pods for a cluster returns "Not Found" response - Given operation "ListFleetInstrumentedPods" enabled - And new "ListFleetInstrumentedPods" request - And request contains "cluster_name" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/fleet-automation - Scenario: List instrumented pods for a cluster returns "OK" response - Given operation "ListFleetInstrumentedPods" enabled - And new "ListFleetInstrumentedPods" request - And request contains "cluster_name" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation Scenario: List tracers for a specific agent returns "Bad Request" response Given operation "ListFleetAgentTracers" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 64ba52bc401a..f5559ae4e08b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -23,18 +23,6 @@ "type": "safe" } }, - "ListFleetClusters": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, - "ListFleetInstrumentedPods": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, "ListFleetDeployments": { "tag": "Fleet Automation", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5554d5c1e161..26f12bda74be 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -200,9 +200,7 @@ def initialize "v2.list_fleet_agents": false, "v2.list_fleet_agent_tracers": false, "v2.list_fleet_agent_versions": false, - "v2.list_fleet_clusters": false, "v2.list_fleet_deployments": false, - "v2.list_fleet_instrumented_pods": false, "v2.list_fleet_schedules": false, "v2.list_fleet_tracers": false, "v2.trigger_fleet_schedule": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index aa9a5a15eeef..86f4e3b4f535 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3201,11 +3201,6 @@ def overrides "v2.fleet_agent_version_attributes" => "FleetAgentVersionAttributes", "v2.fleet_agent_version_resource_type" => "FleetAgentVersionResourceType", "v2.fleet_agent_versions_response" => "FleetAgentVersionsResponse", - "v2.fleet_cluster_attributes" => "FleetClusterAttributes", - "v2.fleet_clusters_response" => "FleetClustersResponse", - "v2.fleet_clusters_response_data" => "FleetClustersResponseData", - "v2.fleet_clusters_response_data_attributes" => "FleetClustersResponseDataAttributes", - "v2.fleet_clusters_response_meta" => "FleetClustersResponseMeta", "v2.fleet_configuration_file" => "FleetConfigurationFile", "v2.fleet_configuration_layer" => "FleetConfigurationLayer", "v2.fleet_deployment" => "FleetDeployment", @@ -3229,10 +3224,6 @@ def overrides "v2.fleet_deployments_response" => "FleetDeploymentsResponse", "v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta", "v2.fleet_detected_integration" => "FleetDetectedIntegration", - "v2.fleet_instrumented_pod_group_attributes" => "FleetInstrumentedPodGroupAttributes", - "v2.fleet_instrumented_pods_response" => "FleetInstrumentedPodsResponse", - "v2.fleet_instrumented_pods_response_data" => "FleetInstrumentedPodsResponseData", - "v2.fleet_instrumented_pods_response_data_attributes" => "FleetInstrumentedPodsResponseDataAttributes", "v2.fleet_integration_details" => "FleetIntegrationDetails", "v2.fleet_integrations_by_status" => "FleetIntegrationsByStatus", "v2.fleet_schedule" => "FleetSchedule", diff --git a/lib/datadog_api_client/v2/api/fleet_automation_api.rb b/lib/datadog_api_client/v2/api/fleet_automation_api.rb index 81c77aff00cf..2b25997b65c8 100644 --- a/lib/datadog_api_client/v2/api/fleet_automation_api.rb +++ b/lib/datadog_api_client/v2/api/fleet_automation_api.rb @@ -928,97 +928,6 @@ def list_fleet_agent_versions_with_http_info(opts = {}) return data, status_code, headers end - # List all fleet clusters. - # - # @see #list_fleet_clusters_with_http_info - def list_fleet_clusters(opts = {}) - data, _status_code, _headers = list_fleet_clusters_with_http_info(opts) - data - end - - # List all fleet clusters. - # - # Retrieve a paginated list of Kubernetes clusters in the fleet. - # - # This endpoint returns clusters with metadata including node counts, agent versions, - # enabled products, and associated services. Use the `page_number` and `page_size` - # query parameters to paginate through results. - # - # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_number Page number for pagination (starts at 0). - # @option opts [Integer] :page_size Number of results per page (must be greater than 0 and less than or equal to 100). - # @option opts [String] :sort_attribute Attribute to sort by. - # @option opts [Boolean] :sort_descending Sort order (true for descending, false for ascending). - # @option opts [String] :filter Filter string for narrowing down cluster results. - # @option opts [String] :tags Comma-separated list of tags to filter clusters. - # @return [Array<(FleetClustersResponse, Integer, Hash)>] FleetClustersResponse data, response status code and response headers - def list_fleet_clusters_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_clusters".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_clusters") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_clusters")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_clusters ...' - end - if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 - fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_clusters, must be greater than or equal to 0.' - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_clusters, must be smaller than or equal to 100.' - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_clusters, must be greater than or equal to 1.' - end - # resource path - local_var_path = '/api/unstable/fleet/clusters' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil? - query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil? - query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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] || 'FleetClustersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] - - new_options = opts.merge( - :operation => :list_fleet_clusters, - :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: FleetAutomationAPI#list_fleet_clusters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # List all deployments. # # @see #list_fleet_deployments_with_http_info @@ -1093,82 +1002,6 @@ def list_fleet_deployments_with_http_info(opts = {}) return data, status_code, headers end - # List instrumented pods for a cluster. - # - # @see #list_fleet_instrumented_pods_with_http_info - def list_fleet_instrumented_pods(cluster_name, opts = {}) - data, _status_code, _headers = list_fleet_instrumented_pods_with_http_info(cluster_name, opts) - data - end - - # List instrumented pods for a cluster. - # - # Retrieve the list of pods targeted for Single Step Instrumentation (SSI) injection - # in a specific Kubernetes cluster. - # - # This endpoint returns pod groups organized by owner reference (deployment, statefulset, etc.) - # with their injection annotations and applied targets. Use the clusters list endpoint - # to discover available cluster names. - # - # @param cluster_name [String] The name of the Kubernetes cluster. - # @param opts [Hash] the optional parameters - # @return [Array<(FleetInstrumentedPodsResponse, Integer, Hash)>] FleetInstrumentedPodsResponse data, response status code and response headers - def list_fleet_instrumented_pods_with_http_info(cluster_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_instrumented_pods".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_instrumented_pods") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_instrumented_pods")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_instrumented_pods ...' - end - # verify the required parameter 'cluster_name' is set - if @api_client.config.client_side_validation && cluster_name.nil? - fail ArgumentError, "Missing the required parameter 'cluster_name' when calling FleetAutomationAPI.list_fleet_instrumented_pods" - end - # resource path - local_var_path = '/api/unstable/fleet/clusters/{cluster_name}/instrumented_pods'.sub('{cluster_name}', CGI.escape(cluster_name.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'FleetInstrumentedPodsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] - - new_options = opts.merge( - :operation => :list_fleet_instrumented_pods, - :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: FleetAutomationAPI#list_fleet_instrumented_pods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # List all schedules. # # @see #list_fleet_schedules_with_http_info diff --git a/lib/datadog_api_client/v2/models/fleet_cluster_attributes.rb b/lib/datadog_api_client/v2/models/fleet_cluster_attributes.rb deleted file mode 100644 index d08648e810f7..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_cluster_attributes.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes of a Kubernetes cluster in the fleet. - class FleetClusterAttributes - include BaseGenericModel - - # Datadog Agent versions running in the cluster. - attr_accessor :agent_versions - - # API key names used by agents in the cluster. - attr_accessor :api_key_names - - # API key UUIDs used by agents in the cluster. - attr_accessor :api_key_uuids - - # Cloud providers hosting the cluster. - attr_accessor :cloud_providers - - # The name of the Kubernetes cluster. - attr_accessor :cluster_name - - # Datadog products enabled in the cluster. - attr_accessor :enabled_products - - # Environments associated with the cluster. - attr_accessor :envs - - # Timestamp when the cluster was first seen. - attr_accessor :first_seen_at - - # The tool used to install agents in the cluster. - attr_accessor :install_method_tool - - # Total number of nodes in the cluster. - attr_accessor :node_count - - # Node counts grouped by status. - attr_accessor :node_count_by_status - - # Operating systems of nodes in the cluster. - attr_accessor :operating_systems - - # OpenTelemetry collector distributions in the cluster. - attr_accessor :otel_collector_distributions - - # OpenTelemetry collector versions in the cluster. - attr_accessor :otel_collector_versions - - # Pod counts grouped by state. - attr_accessor :pod_count_by_state - - # Services running in the cluster. - attr_accessor :services - - # Teams associated with the cluster. - attr_accessor :teams - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'agent_versions' => :'agent_versions', - :'api_key_names' => :'api_key_names', - :'api_key_uuids' => :'api_key_uuids', - :'cloud_providers' => :'cloud_providers', - :'cluster_name' => :'cluster_name', - :'enabled_products' => :'enabled_products', - :'envs' => :'envs', - :'first_seen_at' => :'first_seen_at', - :'install_method_tool' => :'install_method_tool', - :'node_count' => :'node_count', - :'node_count_by_status' => :'node_count_by_status', - :'operating_systems' => :'operating_systems', - :'otel_collector_distributions' => :'otel_collector_distributions', - :'otel_collector_versions' => :'otel_collector_versions', - :'pod_count_by_state' => :'pod_count_by_state', - :'services' => :'services', - :'teams' => :'teams' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'agent_versions' => :'Array', - :'api_key_names' => :'Array', - :'api_key_uuids' => :'Array', - :'cloud_providers' => :'Array', - :'cluster_name' => :'String', - :'enabled_products' => :'Array', - :'envs' => :'Array', - :'first_seen_at' => :'Integer', - :'install_method_tool' => :'String', - :'node_count' => :'Integer', - :'node_count_by_status' => :'Hash', - :'operating_systems' => :'Array', - :'otel_collector_distributions' => :'Array', - :'otel_collector_versions' => :'Array', - :'pod_count_by_state' => :'Hash', - :'services' => :'Array', - :'teams' => :'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::FleetClusterAttributes` 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?(:'agent_versions') - if (value = attributes[:'agent_versions']).is_a?(Array) - self.agent_versions = value - end - end - - if attributes.key?(:'api_key_names') - if (value = attributes[:'api_key_names']).is_a?(Array) - self.api_key_names = value - end - end - - if attributes.key?(:'api_key_uuids') - if (value = attributes[:'api_key_uuids']).is_a?(Array) - self.api_key_uuids = value - end - end - - if attributes.key?(:'cloud_providers') - if (value = attributes[:'cloud_providers']).is_a?(Array) - self.cloud_providers = value - end - end - - if attributes.key?(:'cluster_name') - self.cluster_name = attributes[:'cluster_name'] - end - - if attributes.key?(:'enabled_products') - if (value = attributes[:'enabled_products']).is_a?(Array) - self.enabled_products = value - end - end - - if attributes.key?(:'envs') - if (value = attributes[:'envs']).is_a?(Array) - self.envs = value - end - end - - if attributes.key?(:'first_seen_at') - self.first_seen_at = attributes[:'first_seen_at'] - end - - if attributes.key?(:'install_method_tool') - self.install_method_tool = attributes[:'install_method_tool'] - end - - if attributes.key?(:'node_count') - self.node_count = attributes[:'node_count'] - end - - if attributes.key?(:'node_count_by_status') - self.node_count_by_status = attributes[:'node_count_by_status'] - end - - if attributes.key?(:'operating_systems') - if (value = attributes[:'operating_systems']).is_a?(Array) - self.operating_systems = value - end - end - - if attributes.key?(:'otel_collector_distributions') - if (value = attributes[:'otel_collector_distributions']).is_a?(Array) - self.otel_collector_distributions = value - end - end - - if attributes.key?(:'otel_collector_versions') - if (value = attributes[:'otel_collector_versions']).is_a?(Array) - self.otel_collector_versions = value - end - end - - if attributes.key?(:'pod_count_by_state') - self.pod_count_by_state = attributes[:'pod_count_by_state'] - end - - if attributes.key?(:'services') - if (value = attributes[:'services']).is_a?(Array) - self.services = value - end - end - - if attributes.key?(:'teams') - if (value = attributes[:'teams']).is_a?(Array) - self.teams = 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 && - agent_versions == o.agent_versions && - api_key_names == o.api_key_names && - api_key_uuids == o.api_key_uuids && - cloud_providers == o.cloud_providers && - cluster_name == o.cluster_name && - enabled_products == o.enabled_products && - envs == o.envs && - first_seen_at == o.first_seen_at && - install_method_tool == o.install_method_tool && - node_count == o.node_count && - node_count_by_status == o.node_count_by_status && - operating_systems == o.operating_systems && - otel_collector_distributions == o.otel_collector_distributions && - otel_collector_versions == o.otel_collector_versions && - pod_count_by_state == o.pod_count_by_state && - services == o.services && - teams == o.teams && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [agent_versions, api_key_names, api_key_uuids, cloud_providers, cluster_name, enabled_products, envs, first_seen_at, install_method_tool, node_count, node_count_by_status, operating_systems, otel_collector_distributions, otel_collector_versions, pod_count_by_state, services, teams, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/fleet_clusters_response.rb b/lib/datadog_api_client/v2/models/fleet_clusters_response.rb deleted file mode 100644 index 482fd17a80cf..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_clusters_response.rb +++ /dev/null @@ -1,133 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Response containing a paginated list of fleet clusters. - class FleetClustersResponse - include BaseGenericModel - - # The response data containing status and clusters array. - attr_reader :data - - # Metadata for the list of clusters response. - attr_accessor :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' => :'FleetClustersResponseData', - :'meta' => :'FleetClustersResponseMeta' - } - 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::FleetClustersResponse` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - - if attributes.key?(:'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? - 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 && - 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/fleet_clusters_response_data.rb b/lib/datadog_api_client/v2/models/fleet_clusters_response_data.rb deleted file mode 100644 index 921c417a08c8..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_clusters_response_data.rb +++ /dev/null @@ -1,165 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The response data containing status and clusters array. - class FleetClustersResponseData - include BaseGenericModel - - # Attributes of the fleet clusters response containing the list of clusters. - attr_reader :attributes - - # Status identifier. - attr_reader :id - - # Resource type. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'attributes' => :'attributes', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'FleetClustersResponseDataAttributes', - :'id' => :'String', - :'type' => :'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::FleetClustersResponseData` 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/fleet_clusters_response_data_attributes.rb b/lib/datadog_api_client/v2/models/fleet_clusters_response_data_attributes.rb deleted file mode 100644 index 0fcdf5c56028..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_clusters_response_data_attributes.rb +++ /dev/null @@ -1,107 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes of the fleet clusters response containing the list of clusters. - class FleetClustersResponseDataAttributes - include BaseGenericModel - - # Array of clusters matching the query criteria. - attr_accessor :clusters - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'clusters' => :'clusters' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'clusters' => :'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::FleetClustersResponseDataAttributes` 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?(:'clusters') - if (value = attributes[:'clusters']).is_a?(Array) - self.clusters = 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 && - clusters == o.clusters && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [clusters, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/fleet_clusters_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_clusters_response_meta.rb deleted file mode 100644 index f75f6bc36084..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_clusters_response_meta.rb +++ /dev/null @@ -1,105 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Metadata for the list of clusters response. - class FleetClustersResponseMeta - include BaseGenericModel - - # Total number of clusters matching the filter criteria across all pages. - attr_accessor :total_filtered_count - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'total_filtered_count' => :'total_filtered_count' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'total_filtered_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::FleetClustersResponseMeta` 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_filtered_count') - self.total_filtered_count = attributes[:'total_filtered_count'] - 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 && - total_filtered_count == o.total_filtered_count && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [total_filtered_count, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/fleet_instrumented_pod_group_attributes.rb b/lib/datadog_api_client/v2/models/fleet_instrumented_pod_group_attributes.rb deleted file mode 100644 index 302439577385..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_instrumented_pod_group_attributes.rb +++ /dev/null @@ -1,201 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes of a group of instrumented pods targeted for SSI injection. - class FleetInstrumentedPodGroupAttributes - include BaseGenericModel - - # The SSI injection target configuration applied to the pod group. - attr_accessor :applied_target - - # The name of the applied SSI injection target. - attr_accessor :applied_target_name - - # Tags injected into the pods by the Admission Controller. - attr_accessor :injected_tags - - # The kind of the Kubernetes owner reference. - attr_accessor :kube_ownerref_kind - - # The name of the Kubernetes owner reference (deployment, statefulset, etc.). - attr_accessor :kube_ownerref_name - - # Library injection annotations on the pod group. - attr_accessor :lib_injection_annotations - - # The Kubernetes namespace of the pod group. - attr_accessor :namespace - - # Total number of pods in the group. - attr_accessor :pod_count - - # Names of the individual pods in the group. - attr_accessor :pod_names - - # Additional tags associated with the pod group. - attr_accessor :tags - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'applied_target' => :'applied_target', - :'applied_target_name' => :'applied_target_name', - :'injected_tags' => :'injected_tags', - :'kube_ownerref_kind' => :'kube_ownerref_kind', - :'kube_ownerref_name' => :'kube_ownerref_name', - :'lib_injection_annotations' => :'lib_injection_annotations', - :'namespace' => :'namespace', - :'pod_count' => :'pod_count', - :'pod_names' => :'pod_names', - :'tags' => :'tags' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'applied_target' => :'Hash', - :'applied_target_name' => :'String', - :'injected_tags' => :'Array', - :'kube_ownerref_kind' => :'String', - :'kube_ownerref_name' => :'String', - :'lib_injection_annotations' => :'Array', - :'namespace' => :'String', - :'pod_count' => :'Integer', - :'pod_names' => :'Array', - :'tags' => :'Hash' - } - 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::FleetInstrumentedPodGroupAttributes` 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?(:'applied_target') - self.applied_target = attributes[:'applied_target'] - end - - if attributes.key?(:'applied_target_name') - self.applied_target_name = attributes[:'applied_target_name'] - end - - if attributes.key?(:'injected_tags') - if (value = attributes[:'injected_tags']).is_a?(Array) - self.injected_tags = value - end - end - - if attributes.key?(:'kube_ownerref_kind') - self.kube_ownerref_kind = attributes[:'kube_ownerref_kind'] - end - - if attributes.key?(:'kube_ownerref_name') - self.kube_ownerref_name = attributes[:'kube_ownerref_name'] - end - - if attributes.key?(:'lib_injection_annotations') - if (value = attributes[:'lib_injection_annotations']).is_a?(Array) - self.lib_injection_annotations = value - end - end - - if attributes.key?(:'namespace') - self.namespace = attributes[:'namespace'] - end - - if attributes.key?(:'pod_count') - self.pod_count = attributes[:'pod_count'] - end - - if attributes.key?(:'pod_names') - if (value = attributes[:'pod_names']).is_a?(Array) - self.pod_names = value - end - end - - if attributes.key?(:'tags') - self.tags = attributes[:'tags'] - 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 && - applied_target == o.applied_target && - applied_target_name == o.applied_target_name && - injected_tags == o.injected_tags && - kube_ownerref_kind == o.kube_ownerref_kind && - kube_ownerref_name == o.kube_ownerref_name && - lib_injection_annotations == o.lib_injection_annotations && - namespace == o.namespace && - pod_count == o.pod_count && - pod_names == o.pod_names && - tags == o.tags && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [applied_target, applied_target_name, injected_tags, kube_ownerref_kind, kube_ownerref_name, lib_injection_annotations, namespace, pod_count, pod_names, tags, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response.rb b/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response.rb deleted file mode 100644 index cd00f6cc38b2..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response.rb +++ /dev/null @@ -1,123 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Response containing instrumented pods for a Kubernetes cluster. - class FleetInstrumentedPodsResponse - include BaseGenericModel - - # The response data containing the cluster name and instrumented pod groups. - 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' => :'FleetInstrumentedPodsResponseData' - } - 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::FleetInstrumentedPodsResponse` 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/fleet_instrumented_pods_response_data.rb b/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data.rb deleted file mode 100644 index 0a6820d97612..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data.rb +++ /dev/null @@ -1,165 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The response data containing the cluster name and instrumented pod groups. - class FleetInstrumentedPodsResponseData - include BaseGenericModel - - # Attributes of the instrumented pods response containing the list of pod groups. - attr_reader :attributes - - # The cluster name identifier. - attr_reader :id - - # Resource type. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'attributes' => :'attributes', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'FleetInstrumentedPodsResponseDataAttributes', - :'id' => :'String', - :'type' => :'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::FleetInstrumentedPodsResponseData` 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/fleet_instrumented_pods_response_data_attributes.rb b/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data_attributes.rb deleted file mode 100644 index 5475d85fb536..000000000000 --- a/lib/datadog_api_client/v2/models/fleet_instrumented_pods_response_data_attributes.rb +++ /dev/null @@ -1,107 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes of the instrumented pods response containing the list of pod groups. - class FleetInstrumentedPodsResponseDataAttributes - include BaseGenericModel - - # Array of instrumented pod groups in the cluster. - attr_accessor :groups - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'groups' => :'groups' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'groups' => :'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::FleetInstrumentedPodsResponseDataAttributes` 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?(:'groups') - if (value = attributes[:'groups']).is_a?(Array) - self.groups = 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 && - groups == o.groups && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [groups, additional_properties].hash - end - end -end From 6f09ae5ef4c9c123191bface8f0282d6215ac990 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 12:13:06 +0000 Subject: [PATCH 2/3] Regenerate client from commit cb0f041 of spec repo (#3468) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 1058 +++++++++++++++++ .../csm-ownership/CreateOwnershipFeedback.rb | 23 + .../v2/csm-ownership/GetOwnershipEvidence.rb | 8 + .../v2/csm-ownership/GetOwnershipInference.rb | 8 + .../v2/csm-ownership/ListOwnershipHistory.rb | 8 + .../ListOwnershipHistoryByOwnerType.rb | 8 + .../csm-ownership/ListOwnershipInferences.rb | 8 + features/scenarios_model_mapping.rb | 29 + features/v2/csm_ownership.feature | 165 +++ features/v2/undo.json | 36 + lib/datadog_api_client/configuration.rb | 6 + lib/datadog_api_client/inflector.rb | 31 + .../v2/api/csm_ownership_api.rb | 531 +++++++++ .../models/ownership_evidence_attributes.rb | 115 ++ .../v2/models/ownership_evidence_data.rb | 165 +++ .../v2/models/ownership_evidence_response.rb | 123 ++ .../v2/models/ownership_evidence_type.rb | 26 + .../v2/models/ownership_feedback_action.rb | 29 + .../v2/models/ownership_feedback_request.rb | 123 ++ .../ownership_feedback_request_attributes.rb | 226 ++++ .../models/ownership_feedback_request_data.rb | 144 +++ .../v2/models/ownership_feedback_response.rb | 123 ++ .../ownership_feedback_result_attributes.rb | 246 ++++ .../models/ownership_feedback_result_data.rb | 165 +++ .../models/ownership_feedback_result_type.rb | 26 + .../v2/models/ownership_feedback_type.rb | 26 + .../v2/models/ownership_history_attributes.rb | 146 +++ .../v2/models/ownership_history_data.rb | 165 +++ .../v2/models/ownership_history_item.rb | 357 ++++++ .../v2/models/ownership_history_pagination.rb | 141 +++ .../v2/models/ownership_history_response.rb | 123 ++ .../v2/models/ownership_history_type.rb | 26 + .../models/ownership_inference_attributes.rb | 303 +++++ .../v2/models/ownership_inference_data.rb | 165 +++ .../v2/models/ownership_inference_item.rb | 324 +++++ .../ownership_inference_list_attributes.rb | 125 ++ .../models/ownership_inference_list_data.rb | 165 +++ .../ownership_inference_list_response.rb | 123 ++ .../v2/models/ownership_inference_response.rb | 123 ++ .../v2/models/ownership_inference_status.rb | 30 + .../v2/models/ownership_inference_type.rb | 26 + .../v2/models/ownership_inferences_type.rb | 26 + .../v2/models/ownership_owner_type.rb | 29 + 43 files changed, 5853 insertions(+) create mode 100644 examples/v2/csm-ownership/CreateOwnershipFeedback.rb create mode 100644 examples/v2/csm-ownership/GetOwnershipEvidence.rb create mode 100644 examples/v2/csm-ownership/GetOwnershipInference.rb create mode 100644 examples/v2/csm-ownership/ListOwnershipHistory.rb create mode 100644 examples/v2/csm-ownership/ListOwnershipHistoryByOwnerType.rb create mode 100644 examples/v2/csm-ownership/ListOwnershipInferences.rb create mode 100644 features/v2/csm_ownership.feature create mode 100644 lib/datadog_api_client/v2/api/csm_ownership_api.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_evidence_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_evidence_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_evidence_response.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_evidence_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_action.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_request.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_response.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_result_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_result_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_result_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_feedback_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_item.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_pagination.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_response.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_history_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_item.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_list_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_list_data.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_response.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_status.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inference_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_inferences_type.rb create mode 100644 lib/datadog_api_client/v2/models/ownership_owner_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 473542401e37..f1a3ae34f887 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -67265,6 +67265,569 @@ components: required: - data type: object + OwnershipEvidenceAttributes: + description: The attributes of an ownership evidence response. + properties: + evidence_versions: + $ref: "#/components/schemas/OwnershipEvidenceVersions" + required: + - evidence_versions + type: object + OwnershipEvidenceData: + description: The data wrapper for an ownership evidence response. + properties: + attributes: + $ref: "#/components/schemas/OwnershipEvidenceAttributes" + id: + description: The identifier of the resource the evidence applies to. + example: test-resource + type: string + type: + $ref: "#/components/schemas/OwnershipEvidenceType" + required: + - id + - type + - attributes + type: object + OwnershipEvidenceResponse: + description: The response returned when retrieving the evidence backing an ownership inference for an owner type. + properties: + data: + $ref: "#/components/schemas/OwnershipEvidenceData" + required: + - data + type: object + OwnershipEvidenceType: + default: ownership_evidence + description: The type of the ownership evidence resource. The value should always be `ownership_evidence`. + enum: + - ownership_evidence + example: ownership_evidence + type: string + x-enum-varnames: + - OWNERSHIP_EVIDENCE + OwnershipEvidenceVersion: + additionalProperties: {} + description: A single evidence version entry describing how an inference was produced. + example: + pipeline_id: p1 + version: v3 + type: object + OwnershipEvidenceVersions: + description: The list of evidence versions associated with an inference. + example: + - pipeline_id: p1 + version: v3 + items: + $ref: "#/components/schemas/OwnershipEvidenceVersion" + nullable: true + type: array + OwnershipFeedbackAction: + description: The feedback action to apply to an inference. + enum: + - confirm + - reject + - correct + - persist + example: confirm + type: string + x-enum-varnames: + - CONFIRM + - REJECT + - CORRECT + - PERSIST + OwnershipFeedbackRequest: + description: The request body for submitting ownership feedback. + properties: + data: + $ref: "#/components/schemas/OwnershipFeedbackRequestData" + required: + - data + type: object + OwnershipFeedbackRequestAttributes: + description: The attributes of an ownership feedback request. + properties: + action: + $ref: "#/components/schemas/OwnershipFeedbackAction" + actor_handle: + description: The handle of the actor submitting the feedback. + example: user@example.com + type: string + actor_type: + description: The type of actor submitting the feedback, for example `user` or `service`. + example: user + type: string + corrected_owner_handle: + description: The corrected owner handle. Required when `action` is `correct`. + example: team-b + nullable: true + type: string + corrected_owner_type: + description: The corrected owner type. Required when `action` is `correct`. + example: team + nullable: true + type: string + inference_checksum: + description: The checksum of the inference being acted upon. Must match the current inference checksum or the request returns a conflict. + example: abc123 + type: string + reason: + description: An optional free-form reason explaining the feedback. + example: Confirmed by team lead. + nullable: true + type: string + required: + - action + - actor_handle + - actor_type + - inference_checksum + type: object + OwnershipFeedbackRequestData: + description: The data wrapper for an ownership feedback request. + properties: + attributes: + $ref: "#/components/schemas/OwnershipFeedbackRequestAttributes" + type: + $ref: "#/components/schemas/OwnershipFeedbackType" + required: + - type + - attributes + type: object + OwnershipFeedbackResponse: + description: The response returned after applying ownership feedback to an inference. + properties: + data: + $ref: "#/components/schemas/OwnershipFeedbackResultData" + required: + - data + type: object + OwnershipFeedbackResultAttributes: + description: The attributes of an ownership feedback result. + properties: + action: + $ref: "#/components/schemas/OwnershipFeedbackAction" + checksum: + description: The checksum of the inference after the feedback was applied. + example: abc123 + type: string + new_status: + $ref: "#/components/schemas/OwnershipInferenceStatus" + owner_type: + $ref: "#/components/schemas/OwnershipOwnerType" + previous_status: + $ref: "#/components/schemas/OwnershipInferenceStatus" + primary_contact_ref: + description: The primary contact reference for the inferred owner after the feedback was applied, formatted as `ref:handle/`. + example: ref:handle/team-a + nullable: true + type: string + updated_at: + description: The time when the inference was updated by the feedback. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + required: + - action + - previous_status + - new_status + - owner_type + - checksum + - updated_at + type: object + OwnershipFeedbackResultData: + description: The data wrapper for an ownership feedback result response. + properties: + attributes: + $ref: "#/components/schemas/OwnershipFeedbackResultAttributes" + id: + description: The identifier of the resource that the feedback was applied to. + example: res-1 + type: string + type: + $ref: "#/components/schemas/OwnershipFeedbackResultType" + required: + - id + - type + - attributes + type: object + OwnershipFeedbackResultType: + default: ownership_feedback_result + description: The type of the ownership feedback result resource. The value should always be `ownership_feedback_result`. + enum: + - ownership_feedback_result + example: ownership_feedback_result + type: string + x-enum-varnames: + - OWNERSHIP_FEEDBACK_RESULT + OwnershipFeedbackType: + default: ownership_feedback + description: The type of the ownership feedback request resource. The value should always be `ownership_feedback`. + enum: + - ownership_feedback + example: ownership_feedback + type: string + x-enum-varnames: + - OWNERSHIP_FEEDBACK + OwnershipHistoryAttributes: + description: The attributes of an ownership history response. + properties: + items: + $ref: "#/components/schemas/OwnershipHistoryItems" + pagination: + $ref: "#/components/schemas/OwnershipHistoryPagination" + required: + - items + - pagination + type: object + OwnershipHistoryData: + description: The data wrapper for an ownership history response. + properties: + attributes: + $ref: "#/components/schemas/OwnershipHistoryAttributes" + id: + description: The resource identifier for which history is returned. + example: res-1 + type: string + type: + $ref: "#/components/schemas/OwnershipHistoryType" + required: + - id + - type + - attributes + type: object + OwnershipHistoryItem: + description: A single ownership inference history entry. + properties: + checksum: + description: A checksum identifying the state of the inference at this point in time. + example: "" + type: string + confidence: + description: The confidence score of the inference, expressed as a numeric string with up to four decimal places. + example: "0.9000" + type: string + created_at: + description: The time this history entry was created. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + evidence_versions: + $ref: "#/components/schemas/OwnershipEvidenceVersions" + explanation: + description: A human-readable explanation of how the inference was produced. + example: "" + type: string + failed_at: + description: The time when this inference failed, if applicable. + example: "2026-01-15T10:00:00Z" + format: date-time + nullable: true + type: string + failure_reason: + description: The reason why this inference failed, if applicable. + example: missing evidence + nullable: true + type: string + id: + description: The unique identifier of the history entry. + example: 100 + format: int64 + type: integer + owner_type: + $ref: "#/components/schemas/OwnershipOwnerType" + primary_contact_ref: + description: The primary contact reference for the inferred owner, formatted as `ref:handle/`. + example: ref:handle/team-a + nullable: true + type: string + resource_id: + description: The identifier of the resource that the inference applies to. + example: res-1 + type: string + retry_schedule: + description: The scheduled retry time for a failed inference, if applicable. + example: "2026-01-15T11:00:00Z" + format: date-time + nullable: true + type: string + sources: + $ref: "#/components/schemas/OwnershipInferenceSources" + status: + $ref: "#/components/schemas/OwnershipInferenceStatus" + required: + - id + - resource_id + - owner_type + - confidence + - explanation + - evidence_versions + - sources + - checksum + - status + - created_at + type: object + OwnershipHistoryItems: + description: The list of history entries returned for this page. + items: + $ref: "#/components/schemas/OwnershipHistoryItem" + type: array + OwnershipHistoryPagination: + description: Cursor-based pagination metadata for the history response. + properties: + has_more: + description: Whether more history entries are available beyond this page. + example: false + type: boolean + next_cursor: + description: An opaque, base64-encoded cursor token. Pass it as the `cursor` query parameter to retrieve the next page. Absent or `null` when there are no further pages. + example: eyJpZCI6OTh9 + nullable: true + type: string + required: + - has_more + type: object + OwnershipHistoryResponse: + description: The response returned when listing the inference history for a resource. + properties: + data: + $ref: "#/components/schemas/OwnershipHistoryData" + required: + - data + type: object + OwnershipHistoryType: + default: ownership_history + description: The type of the ownership history resource. The value should always be `ownership_history`. + enum: + - ownership_history + example: ownership_history + type: string + x-enum-varnames: + - OWNERSHIP_HISTORY + OwnershipInferenceAttributes: + description: The attributes of a single ownership inference. + properties: + checksum: + description: A checksum that uniquely identifies the current state of the inference. Required when submitting feedback. + example: abc123 + type: string + confidence: + description: The confidence score of the inference, expressed as a numeric string with up to four decimal places. + example: "0.9500" + type: string + created_at: + description: The time when the inference was created. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + evidence_versions: + $ref: "#/components/schemas/OwnershipEvidenceVersions" + explanation: + description: A human-readable explanation of how the inference was produced. + example: High confidence match + type: string + owner_type: + $ref: "#/components/schemas/OwnershipOwnerType" + primary_contact_ref: + description: The primary contact reference for the inferred owner, formatted as `ref:handle/`. + example: ref:handle/team-a + nullable: true + type: string + sources: + $ref: "#/components/schemas/OwnershipInferenceSources" + status: + $ref: "#/components/schemas/OwnershipInferenceStatus" + updated_at: + description: The time when the inference was last updated. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + required: + - owner_type + - confidence + - explanation + - evidence_versions + - sources + - status + - checksum + - created_at + - updated_at + type: object + OwnershipInferenceData: + description: The data wrapper for a single ownership inference response. + properties: + attributes: + $ref: "#/components/schemas/OwnershipInferenceAttributes" + id: + description: The identifier of the inference, formatted as `resource_id:owner_type`. + example: test-resource:team + type: string + type: + $ref: "#/components/schemas/OwnershipInferenceType" + required: + - id + - type + - attributes + type: object + OwnershipInferenceItem: + description: A single ownership inference, scoped to a specific owner type. + properties: + checksum: + description: A checksum that uniquely identifies the current state of the inference. Required when submitting feedback. + example: abc123 + type: string + confidence: + description: The confidence score of the inference, expressed as a numeric string with up to four decimal places. + example: "0.9500" + type: string + created_at: + description: The time when the inference was created. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + evidence_versions: + $ref: "#/components/schemas/OwnershipEvidenceVersions" + explanation: + description: A human-readable explanation of how the inference was produced. + example: High confidence match + type: string + id: + description: The identifier of the inference, formatted as `resource_id:owner_type`. + example: test-resource:team + type: string + owner_type: + $ref: "#/components/schemas/OwnershipOwnerType" + primary_contact_ref: + description: The primary contact reference for the inferred owner, formatted as `ref:handle/`. + example: ref:handle/team-a + nullable: true + type: string + sources: + $ref: "#/components/schemas/OwnershipInferenceSources" + status: + $ref: "#/components/schemas/OwnershipInferenceStatus" + updated_at: + description: The time when the inference was last updated. + example: "2026-01-15T10:00:00Z" + format: date-time + type: string + required: + - id + - owner_type + - confidence + - explanation + - evidence_versions + - sources + - status + - checksum + - created_at + - updated_at + type: object + OwnershipInferenceItems: + description: The list of inferences for a resource, with one inference per owner type. + items: + $ref: "#/components/schemas/OwnershipInferenceItem" + type: array + OwnershipInferenceListAttributes: + description: The attributes of the ownership inferences collection response. + properties: + items: + $ref: "#/components/schemas/OwnershipInferenceItems" + required: + - items + type: object + OwnershipInferenceListData: + description: The data wrapper for the ownership inferences collection response. + properties: + attributes: + $ref: "#/components/schemas/OwnershipInferenceListAttributes" + id: + description: The resource identifier associated with the returned inferences. + example: test-resource + type: string + type: + $ref: "#/components/schemas/OwnershipInferencesType" + required: + - id + - type + - attributes + type: object + OwnershipInferenceListResponse: + description: The response returned when listing all current ownership inferences for a resource. + properties: + data: + $ref: "#/components/schemas/OwnershipInferenceListData" + required: + - data + type: object + OwnershipInferenceResponse: + description: The response returned when retrieving a single ownership inference for an owner type. + properties: + data: + $ref: "#/components/schemas/OwnershipInferenceData" + required: + - data + type: object + OwnershipInferenceSource: + additionalProperties: {} + description: A source describing how an inference was derived. + example: + kind: code_owners + type: object + OwnershipInferenceSources: + description: The list of sources backing an ownership inference. Empty when the inference status is not whitelisted to expose sources. + example: + - kind: code_owners + items: + $ref: "#/components/schemas/OwnershipInferenceSource" + type: array + OwnershipInferenceStatus: + description: The lifecycle status of an ownership inference. + enum: + - suggested + - persisted + - overridden + - failed + - unknown + example: suggested + type: string + x-enum-varnames: + - SUGGESTED + - PERSISTED + - OVERRIDDEN + - FAILED + - UNKNOWN + OwnershipInferenceType: + default: ownership_inference + description: The type of the ownership inference resource. The value should always be `ownership_inference`. + enum: + - ownership_inference + example: ownership_inference + type: string + x-enum-varnames: + - OWNERSHIP_INFERENCE + OwnershipInferencesType: + default: ownership_inferences + description: The type of the ownership inferences collection resource. The value should always be `ownership_inferences`. + enum: + - ownership_inferences + example: ownership_inferences + type: string + x-enum-varnames: + - OWNERSHIP_INFERENCES + OwnershipOwnerType: + description: The owner type for an ownership inference. + enum: + - user + - team + - service + - unknown + example: team + type: string + x-enum-varnames: + - USER + - TEAM + - SERVICE + - UNKNOWN PageAnnotationsAttributes: description: Attributes of the annotations on a page. properties: @@ -120041,6 +120604,494 @@ paths: $ref: "#/components/responses/TooManyRequestsResponse" summary: Get all CSM Serverless Agents tags: ["CSM Agents"] + /api/v2/csm/ownership/{resource_id}: + get: + description: Get all current ownership inferences for a resource, one per owner type (`user`, `team`, `service`, `unknown`). + operationId: ListOwnershipInferences + parameters: + - description: The identifier of the resource to retrieve ownership inferences for. + in: path + name: resource_id + required: true + schema: + example: test-resource + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + items: + - checksum: abc123 + confidence: "0.9500" + created_at: "2026-01-15T10:00:00Z" + evidence_versions: + - pipeline_id: p1 + explanation: High confidence match + id: test-resource:team + owner_type: team + primary_contact_ref: ref:handle/team-a + sources: [] + status: suggested + updated_at: "2026-01-15T10:00:00Z" + id: test-resource + type: ownership_inferences + schema: + $ref: "#/components/schemas/OwnershipInferenceListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List ownership inferences for a resource + tags: ["CSM Ownership"] + 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/ownership/{resource_id}/history: + get: + description: List inference history entries for a resource across all owner types, ordered from most recent to oldest. Uses cursor-based pagination. + operationId: ListOwnershipHistory + parameters: + - description: The identifier of the resource to retrieve inference history for. + in: path + name: resource_id + required: true + schema: + example: res-1 + type: string + - description: An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page. + in: query + name: cursor + required: false + schema: + example: eyJpZCI6OTh9 + type: string + - description: The maximum number of history entries to return per page. + in: query + name: limit + required: false + schema: + default: 25 + example: 25 + format: int32 + maximum: 100 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + items: + - checksum: "" + confidence: "0.9000" + created_at: "2026-01-15T10:00:00Z" + evidence_versions: + explanation: "" + failed_at: + failure_reason: + id: 100 + owner_type: team + primary_contact_ref: ref:handle/team-a + resource_id: res-1 + retry_schedule: + sources: [] + status: suggested + pagination: + has_more: false + next_cursor: + id: res-1 + type: ownership_history + schema: + $ref: "#/components/schemas/OwnershipHistoryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List ownership inference history for a resource + tags: ["CSM Ownership"] + 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/ownership/{resource_id}/{owner_type}: + get: + description: |- + Get the current ownership inference for a resource for a specific owner type. + + This endpoint supports ETag-based caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the inference has not changed. + operationId: GetOwnershipInference + parameters: + - description: The identifier of the resource to retrieve the ownership inference for. + in: path + name: resource_id + required: true + schema: + example: test-resource + type: string + - description: The owner type of the inference to retrieve. + in: path + name: owner_type + required: true + schema: + $ref: "#/components/schemas/OwnershipOwnerType" + - description: A previously returned `ETag` value. When supplied and the resource has not changed, the endpoint returns `304 Not Modified`. + in: header + name: If-None-Match + required: false + schema: + example: '"abc123"' + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + checksum: abc123 + confidence: "0.9500" + created_at: "2026-01-15T10:00:00Z" + evidence_versions: + - pipeline_id: p1 + explanation: High confidence match + owner_type: team + primary_contact_ref: ref:handle/team-a + sources: [] + status: suggested + updated_at: "2026-01-15T10:00:00Z" + id: test-resource:team + type: ownership_inference + schema: + $ref: "#/components/schemas/OwnershipInferenceResponse" + description: OK + headers: + Cache-Control: + description: The cache control directives applied to the response. + schema: + example: private, max-age=60 + type: string + ETag: + description: A strong validator that identifies the current state of the inference. + schema: + example: '"abc123"' + type: string + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an ownership inference by owner type + tags: ["CSM Ownership"] + 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/ownership/{resource_id}/{owner_type}/evidence: + get: + description: |- + Get the evidence versions backing the current ownership inference for a resource and owner type. + + This endpoint supports weak ETag caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the evidence has not changed. + operationId: GetOwnershipEvidence + parameters: + - description: The identifier of the resource to retrieve evidence for. + in: path + name: resource_id + required: true + schema: + example: test-resource + type: string + - description: The owner type of the inference to retrieve evidence for. + in: path + name: owner_type + required: true + schema: + $ref: "#/components/schemas/OwnershipOwnerType" + - description: A previously returned weak `ETag` value. When supplied and the evidence has not changed, the endpoint returns `304 Not Modified`. + in: header + name: If-None-Match + required: false + schema: + example: W/"f2e126916327bda8" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + evidence_versions: + - pipeline_id: p1 + version: v3 + id: test-resource + type: ownership_evidence + schema: + $ref: "#/components/schemas/OwnershipEvidenceResponse" + description: OK + headers: + ETag: + description: A weak validator that identifies the current state of the evidence. + schema: + example: W/"f2e126916327bda8" + type: string + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the evidence for an ownership inference + tags: ["CSM Ownership"] + 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/ownership/{resource_id}/{owner_type}/feedback: + post: + description: |- + Submit feedback on the current ownership inference for a resource and owner type. Valid actions are `confirm`, `reject`, `correct`, and `persist`. + + The request must include the current inference `checksum` in `inference_checksum`. If the checksum does not match the current inference state, the endpoint returns `409 Conflict`. + + When `action` is `correct`, `corrected_owner_handle` and `corrected_owner_type` are required. + operationId: CreateOwnershipFeedback + parameters: + - description: The identifier of the resource that the feedback applies to. + in: path + name: resource_id + required: true + schema: + example: res-1 + type: string + - description: The type of owner that the feedback applies to. + in: path + name: owner_type + required: true + schema: + $ref: "#/components/schemas/OwnershipOwnerType" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: confirm + actor_handle: user@example.com + actor_type: user + inference_checksum: abc123 + type: ownership_feedback + schema: + $ref: "#/components/schemas/OwnershipFeedbackRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: confirm + checksum: abc123 + new_status: suggested + owner_type: team + previous_status: suggested + primary_contact_ref: ref:handle/team-a + updated_at: "2026-01-15T10:00:00Z" + id: res-1 + type: ownership_feedback_result + schema: + $ref: "#/components/schemas/OwnershipFeedbackResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/OwnershipInferenceResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Submit feedback on an ownership inference + tags: ["CSM Ownership"] + 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/ownership/{resource_id}/{owner_type}/history: + get: + description: List inference history entries for a resource filtered by owner type, ordered from most recent to oldest. Uses cursor-based pagination. + operationId: ListOwnershipHistoryByOwnerType + parameters: + - description: The identifier of the resource to retrieve inference history for. + in: path + name: resource_id + required: true + schema: + example: res-1 + type: string + - description: The owner type to filter history by. + in: path + name: owner_type + required: true + schema: + $ref: "#/components/schemas/OwnershipOwnerType" + - description: An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page. + in: query + name: cursor + required: false + schema: + example: eyJpZCI6OTh9 + type: string + - description: The maximum number of history entries to return per page. + in: query + name: limit + required: false + schema: + default: 25 + example: 25 + format: int32 + maximum: 100 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + items: + - checksum: "" + confidence: "0.9000" + created_at: "2026-01-15T10:00:00Z" + evidence_versions: + explanation: "" + failed_at: + failure_reason: + id: 100 + owner_type: team + primary_contact_ref: ref:handle/team-a + resource_id: res-1 + retry_schedule: + sources: [] + status: suggested + pagination: + has_more: false + next_cursor: + id: res-1 + type: ownership_history + schema: + $ref: "#/components/schemas/OwnershipHistoryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List ownership history by owner type + tags: ["CSM Ownership"] + 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: get: description: Get the list of agentless hosts for CSM, with optional pagination and filtering. @@ -181673,6 +182724,13 @@ 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) Ownership infers the most likely owner + for a cloud resource by combining ownership signals from across the platform, + and lets you review the inference, inspect its evidence, and submit feedback to + persist, override, or correct the inferred owner. + For more information, see [Cloud Security Management](https://docs.datadoghq.com/security/cloud_security_management). + name: "CSM Ownership" - 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. diff --git a/examples/v2/csm-ownership/CreateOwnershipFeedback.rb b/examples/v2/csm-ownership/CreateOwnershipFeedback.rb new file mode 100644 index 000000000000..d93954695653 --- /dev/null +++ b/examples/v2/csm-ownership/CreateOwnershipFeedback.rb @@ -0,0 +1,23 @@ +# Submit feedback on an ownership inference returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ownership_feedback".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new + +body = DatadogAPIClient::V2::OwnershipFeedbackRequest.new({ + data: DatadogAPIClient::V2::OwnershipFeedbackRequestData.new({ + attributes: DatadogAPIClient::V2::OwnershipFeedbackRequestAttributes.new({ + action: DatadogAPIClient::V2::OwnershipFeedbackAction::CONFIRM, + actor_handle: "user@example.com", + actor_type: "user", + corrected_owner_handle: "team-b", + corrected_owner_type: "team", + inference_checksum: "abc123", + reason: "Confirmed by team lead.", + }), + type: DatadogAPIClient::V2::OwnershipFeedbackType::OWNERSHIP_FEEDBACK, + }), +}) +p api_instance.create_ownership_feedback("res-1", OwnershipOwnerType::TEAM, body) diff --git a/examples/v2/csm-ownership/GetOwnershipEvidence.rb b/examples/v2/csm-ownership/GetOwnershipEvidence.rb new file mode 100644 index 000000000000..13e130115777 --- /dev/null +++ b/examples/v2/csm-ownership/GetOwnershipEvidence.rb @@ -0,0 +1,8 @@ +# Get the evidence for an ownership inference returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ownership_evidence".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new +p api_instance.get_ownership_evidence("test-resource", OwnershipOwnerType::TEAM) diff --git a/examples/v2/csm-ownership/GetOwnershipInference.rb b/examples/v2/csm-ownership/GetOwnershipInference.rb new file mode 100644 index 000000000000..553e9cf59be2 --- /dev/null +++ b/examples/v2/csm-ownership/GetOwnershipInference.rb @@ -0,0 +1,8 @@ +# Get an ownership inference by owner type returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ownership_inference".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new +p api_instance.get_ownership_inference("test-resource", OwnershipOwnerType::TEAM) diff --git a/examples/v2/csm-ownership/ListOwnershipHistory.rb b/examples/v2/csm-ownership/ListOwnershipHistory.rb new file mode 100644 index 000000000000..329243ce1f97 --- /dev/null +++ b/examples/v2/csm-ownership/ListOwnershipHistory.rb @@ -0,0 +1,8 @@ +# List ownership inference history for a resource returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ownership_history".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new +p api_instance.list_ownership_history("res-1") diff --git a/examples/v2/csm-ownership/ListOwnershipHistoryByOwnerType.rb b/examples/v2/csm-ownership/ListOwnershipHistoryByOwnerType.rb new file mode 100644 index 000000000000..ba7c71ae339b --- /dev/null +++ b/examples/v2/csm-ownership/ListOwnershipHistoryByOwnerType.rb @@ -0,0 +1,8 @@ +# List ownership history by owner type returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ownership_history_by_owner_type".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new +p api_instance.list_ownership_history_by_owner_type("res-1", OwnershipOwnerType::TEAM) diff --git a/examples/v2/csm-ownership/ListOwnershipInferences.rb b/examples/v2/csm-ownership/ListOwnershipInferences.rb new file mode 100644 index 000000000000..74780cc31233 --- /dev/null +++ b/examples/v2/csm-ownership/ListOwnershipInferences.rb @@ -0,0 +1,8 @@ +# List ownership inferences for a resource returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ownership_inferences".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new +p api_instance.list_ownership_inferences("test-resource") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index adaa8488a34e..bbeab390b23f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2844,6 +2844,35 @@ "query" => "String", "order_direction" => "OrderDirection", }, + "v2.ListOwnershipInferences" => { + "resource_id" => "String", + }, + "v2.ListOwnershipHistory" => { + "resource_id" => "String", + "cursor" => "String", + "limit" => "Integer", + }, + "v2.GetOwnershipInference" => { + "resource_id" => "String", + "owner_type" => "OwnershipOwnerType", + "if_none_match" => "String", + }, + "v2.GetOwnershipEvidence" => { + "resource_id" => "String", + "owner_type" => "OwnershipOwnerType", + "if_none_match" => "String", + }, + "v2.CreateOwnershipFeedback" => { + "resource_id" => "String", + "owner_type" => "OwnershipOwnerType", + "body" => "OwnershipFeedbackRequest", + }, + "v2.ListOwnershipHistoryByOwnerType" => { + "resource_id" => "String", + "owner_type" => "OwnershipOwnerType", + "cursor" => "String", + "limit" => "Integer", + }, "v2.ListCSMAgentlessHosts" => { "page" => "Integer", "size" => "Integer", diff --git a/features/v2/csm_ownership.feature b/features/v2/csm_ownership.feature new file mode 100644 index 000000000000..58498ca15502 --- /dev/null +++ b/features/v2/csm_ownership.feature @@ -0,0 +1,165 @@ +@endpoint(csm-ownership) @endpoint(csm-ownership-v2) +Feature: CSM Ownership + Datadog Cloud Security Management (CSM) Ownership infers the most likely + owner for a cloud resource by combining ownership signals from across the + platform, and lets you review the inference, inspect its evidence, and + submit feedback to persist, override, or correct the inferred owner. For + more information, see [Cloud Security Management](https://docs.datadoghq.c + om/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 "CSMOwnership" API + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get an ownership inference by owner type returns "Bad Request" response + Given operation "GetOwnershipInference" enabled + And new "GetOwnershipInference" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" 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 an ownership inference by owner type returns "Not Found" response + Given operation "GetOwnershipInference" enabled + And new "GetOwnershipInference" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get an ownership inference by owner type returns "OK" response + Given operation "GetOwnershipInference" enabled + And new "GetOwnershipInference" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get the evidence for an ownership inference returns "Bad Request" response + Given operation "GetOwnershipEvidence" enabled + And new "GetOwnershipEvidence" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" 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 the evidence for an ownership inference returns "Not Found" response + Given operation "GetOwnershipEvidence" enabled + And new "GetOwnershipEvidence" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Get the evidence for an ownership inference returns "OK" response + Given operation "GetOwnershipEvidence" enabled + And new "GetOwnershipEvidence" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership history by owner type returns "Bad Request" response + Given operation "ListOwnershipHistoryByOwnerType" enabled + And new "ListOwnershipHistoryByOwnerType" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership history by owner type returns "OK" response + Given operation "ListOwnershipHistoryByOwnerType" enabled + And new "ListOwnershipHistoryByOwnerType" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership inference history for a resource returns "Bad Request" response + Given operation "ListOwnershipHistory" enabled + And new "ListOwnershipHistory" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership inference history for a resource returns "OK" response + Given operation "ListOwnershipHistory" enabled + And new "ListOwnershipHistory" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership inferences for a resource returns "Bad Request" response + Given operation "ListOwnershipInferences" enabled + And new "ListOwnershipInferences" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership inferences for a resource returns "Not Found" response + Given operation "ListOwnershipInferences" enabled + And new "ListOwnershipInferences" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: List ownership inferences for a resource returns "OK" response + Given operation "ListOwnershipInferences" enabled + And new "ListOwnershipInferences" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Submit feedback on an ownership inference returns "Bad Request" response + Given operation "CreateOwnershipFeedback" enabled + And new "CreateOwnershipFeedback" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Submit feedback on an ownership inference returns "Conflict" response + Given operation "CreateOwnershipFeedback" enabled + And new "CreateOwnershipFeedback" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Submit feedback on an ownership inference returns "Created" response + Given operation "CreateOwnershipFeedback" enabled + And new "CreateOwnershipFeedback" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/k9-misconfigs + Scenario: Submit feedback on an ownership inference returns "Not Found" response + Given operation "CreateOwnershipFeedback" enabled + And new "CreateOwnershipFeedback" request + And request contains "resource_id" parameter from "REPLACE.ME" + And request contains "owner_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/features/v2/undo.json b/features/v2/undo.json index f5559ae4e08b..8d4818a76334 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2019,6 +2019,42 @@ "type": "safe" } }, + "ListOwnershipInferences": { + "tag": "CSM Ownership", + "undo": { + "type": "safe" + } + }, + "ListOwnershipHistory": { + "tag": "CSM Ownership", + "undo": { + "type": "safe" + } + }, + "GetOwnershipInference": { + "tag": "CSM Ownership", + "undo": { + "type": "safe" + } + }, + "GetOwnershipEvidence": { + "tag": "CSM Ownership", + "undo": { + "type": "safe" + } + }, + "CreateOwnershipFeedback": { + "tag": "CSM Ownership", + "undo": { + "type": "idempotent" + } + }, + "ListOwnershipHistoryByOwnerType": { + "tag": "CSM Ownership", + "undo": { + "type": "safe" + } + }, "ListCSMAgentlessHosts": { "tag": "CSM Settings", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 26f12bda74be..641827571e54 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -404,6 +404,12 @@ def initialize "v2.list_cost_tag_metadata_months": false, "v2.list_cost_tag_metadata_orchestrators": false, "v2.search_cost_recommendations": false, + "v2.create_ownership_feedback": false, + "v2.get_ownership_evidence": false, + "v2.get_ownership_inference": false, + "v2.list_ownership_history": false, + "v2.list_ownership_history_by_owner_type": false, + "v2.list_ownership_inferences": false, "v2.get_csm_agentless_host_facet_info": false, "v2.get_csm_unified_host_facet_info": false, "v2.list_csm_agentless_host_facets": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 86f4e3b4f535..59d527335595 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5189,6 +5189,36 @@ def overrides "v2.output_schema_parameters" => "OutputSchemaParameters", "v2.output_schema_parameters_type" => "OutputSchemaParametersType", "v2.overwrite_allocations_request" => "OverwriteAllocationsRequest", + "v2.ownership_evidence_attributes" => "OwnershipEvidenceAttributes", + "v2.ownership_evidence_data" => "OwnershipEvidenceData", + "v2.ownership_evidence_response" => "OwnershipEvidenceResponse", + "v2.ownership_evidence_type" => "OwnershipEvidenceType", + "v2.ownership_feedback_action" => "OwnershipFeedbackAction", + "v2.ownership_feedback_request" => "OwnershipFeedbackRequest", + "v2.ownership_feedback_request_attributes" => "OwnershipFeedbackRequestAttributes", + "v2.ownership_feedback_request_data" => "OwnershipFeedbackRequestData", + "v2.ownership_feedback_response" => "OwnershipFeedbackResponse", + "v2.ownership_feedback_result_attributes" => "OwnershipFeedbackResultAttributes", + "v2.ownership_feedback_result_data" => "OwnershipFeedbackResultData", + "v2.ownership_feedback_result_type" => "OwnershipFeedbackResultType", + "v2.ownership_feedback_type" => "OwnershipFeedbackType", + "v2.ownership_history_attributes" => "OwnershipHistoryAttributes", + "v2.ownership_history_data" => "OwnershipHistoryData", + "v2.ownership_history_item" => "OwnershipHistoryItem", + "v2.ownership_history_pagination" => "OwnershipHistoryPagination", + "v2.ownership_history_response" => "OwnershipHistoryResponse", + "v2.ownership_history_type" => "OwnershipHistoryType", + "v2.ownership_inference_attributes" => "OwnershipInferenceAttributes", + "v2.ownership_inference_data" => "OwnershipInferenceData", + "v2.ownership_inference_item" => "OwnershipInferenceItem", + "v2.ownership_inference_list_attributes" => "OwnershipInferenceListAttributes", + "v2.ownership_inference_list_data" => "OwnershipInferenceListData", + "v2.ownership_inference_list_response" => "OwnershipInferenceListResponse", + "v2.ownership_inference_response" => "OwnershipInferenceResponse", + "v2.ownership_inference_status" => "OwnershipInferenceStatus", + "v2.ownership_inferences_type" => "OwnershipInferencesType", + "v2.ownership_inference_type" => "OwnershipInferenceType", + "v2.ownership_owner_type" => "OwnershipOwnerType", "v2.page_annotations_attributes" => "PageAnnotationsAttributes", "v2.page_annotations_data" => "PageAnnotationsData", "v2.page_annotations_response" => "PageAnnotationsResponse", @@ -7502,6 +7532,7 @@ def overrides "v2.containers_api" => "ContainersAPI", "v2.csm_agents_api" => "CSMAgentsAPI", "v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI", + "v2.csm_ownership_api" => "CSMOwnershipAPI", "v2.csm_settings_api" => "CSMSettingsAPI", "v2.csm_threats_api" => "CSMThreatsAPI", "v2.customer_org_api" => "CustomerOrgAPI", diff --git a/lib/datadog_api_client/v2/api/csm_ownership_api.rb b/lib/datadog_api_client/v2/api/csm_ownership_api.rb new file mode 100644 index 000000000000..a2a2cec66935 --- /dev/null +++ b/lib/datadog_api_client/v2/api/csm_ownership_api.rb @@ -0,0 +1,531 @@ +=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 CSMOwnershipAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Submit feedback on an ownership inference. + # + # @see #create_ownership_feedback_with_http_info + def create_ownership_feedback(resource_id, owner_type, body, opts = {}) + data, _status_code, _headers = create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts) + data + end + + # Submit feedback on an ownership inference. + # + # Submit feedback on the current ownership inference for a resource and owner type. Valid actions are `confirm`, `reject`, `correct`, and `persist`. + # + # The request must include the current inference `checksum` in `inference_checksum`. If the checksum does not match the current inference state, the endpoint returns `409 Conflict`. + # + # When `action` is `correct`, `corrected_owner_handle` and `corrected_owner_type` are required. + # + # @param resource_id [String] The identifier of the resource that the feedback applies to. + # @param owner_type [OwnershipOwnerType] The type of owner that the feedback applies to. + # @param body [OwnershipFeedbackRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OwnershipFeedbackResponse, Integer, Hash)>] OwnershipFeedbackResponse data, response status code and response headers + def create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ownership_feedback".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ownership_feedback") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ownership_feedback")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.create_ownership_feedback ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.create_ownership_feedback" + end + # verify the required parameter 'owner_type' is set + if @api_client.config.client_side_validation && owner_type.nil? + fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.create_ownership_feedback" + end + # verify enum value + allowable_values = ['user', 'team', 'service', 'unknown'] + if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) + fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CSMOwnershipAPI.create_ownership_feedback" + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/feedback'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OwnershipFeedbackResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_ownership_feedback, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CSMOwnershipAPI#create_ownership_feedback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the evidence for an ownership inference. + # + # @see #get_ownership_evidence_with_http_info + def get_ownership_evidence(resource_id, owner_type, opts = {}) + data, _status_code, _headers = get_ownership_evidence_with_http_info(resource_id, owner_type, opts) + data + end + + # Get the evidence for an ownership inference. + # + # Get the evidence versions backing the current ownership inference for a resource and owner type. + # + # This endpoint supports weak ETag caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the evidence has not changed. + # + # @param resource_id [String] The identifier of the resource to retrieve evidence for. + # @param owner_type [OwnershipOwnerType] The owner type of the inference to retrieve evidence for. + # @param opts [Hash] the optional parameters + # @option opts [String] :if_none_match A previously returned weak `ETag` value. When supplied and the evidence has not changed, the endpoint returns `304 Not Modified`. + # @return [Array<(OwnershipEvidenceResponse, Integer, Hash)>] OwnershipEvidenceResponse data, response status code and response headers + def get_ownership_evidence_with_http_info(resource_id, owner_type, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_evidence".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_evidence") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_evidence")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_evidence ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.get_ownership_evidence" + end + # verify the required parameter 'owner_type' is set + if @api_client.config.client_side_validation && owner_type.nil? + fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.get_ownership_evidence" + end + # verify enum value + allowable_values = ['user', 'team', 'service', 'unknown'] + if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) + fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/evidence'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OwnershipEvidenceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ownership_evidence, + :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: CSMOwnershipAPI#get_ownership_evidence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an ownership inference by owner type. + # + # @see #get_ownership_inference_with_http_info + def get_ownership_inference(resource_id, owner_type, opts = {}) + data, _status_code, _headers = get_ownership_inference_with_http_info(resource_id, owner_type, opts) + data + end + + # Get an ownership inference by owner type. + # + # Get the current ownership inference for a resource for a specific owner type. + # + # This endpoint supports ETag-based caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the inference has not changed. + # + # @param resource_id [String] The identifier of the resource to retrieve the ownership inference for. + # @param owner_type [OwnershipOwnerType] The owner type of the inference to retrieve. + # @param opts [Hash] the optional parameters + # @option opts [String] :if_none_match A previously returned `ETag` value. When supplied and the resource has not changed, the endpoint returns `304 Not Modified`. + # @return [Array<(OwnershipInferenceResponse, Integer, Hash)>] OwnershipInferenceResponse data, response status code and response headers + def get_ownership_inference_with_http_info(resource_id, owner_type, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_inference".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_inference") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_inference")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_inference ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.get_ownership_inference" + end + # verify the required parameter 'owner_type' is set + if @api_client.config.client_side_validation && owner_type.nil? + fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.get_ownership_inference" + end + # verify enum value + allowable_values = ['user', 'team', 'service', 'unknown'] + if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) + fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OwnershipInferenceResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ownership_inference, + :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: CSMOwnershipAPI#get_ownership_inference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ownership inference history for a resource. + # + # @see #list_ownership_history_with_http_info + def list_ownership_history(resource_id, opts = {}) + data, _status_code, _headers = list_ownership_history_with_http_info(resource_id, opts) + data + end + + # List ownership inference history for a resource. + # + # List inference history entries for a resource across all owner types, ordered from most recent to oldest. Uses cursor-based pagination. + # + # @param resource_id [String] The identifier of the resource to retrieve inference history for. + # @param opts [Hash] the optional parameters + # @option opts [String] :cursor An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page. + # @option opts [Integer] :limit The maximum number of history entries to return per page. + # @return [Array<(OwnershipHistoryResponse, Integer, Hash)>] OwnershipHistoryResponse data, response status code and response headers + def list_ownership_history_with_http_info(resource_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_history".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_history") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_history")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_history ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_history" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}/history'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'OwnershipHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ownership_history, + :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: CSMOwnershipAPI#list_ownership_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ownership history by owner type. + # + # @see #list_ownership_history_by_owner_type_with_http_info + def list_ownership_history_by_owner_type(resource_id, owner_type, opts = {}) + data, _status_code, _headers = list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts) + data + end + + # List ownership history by owner type. + # + # List inference history entries for a resource filtered by owner type, ordered from most recent to oldest. Uses cursor-based pagination. + # + # @param resource_id [String] The identifier of the resource to retrieve inference history for. + # @param owner_type [OwnershipOwnerType] The owner type to filter history by. + # @param opts [Hash] the optional parameters + # @option opts [String] :cursor An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page. + # @option opts [Integer] :limit The maximum number of history entries to return per page. + # @return [Array<(OwnershipHistoryResponse, Integer, Hash)>] OwnershipHistoryResponse data, response status code and response headers + def list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_history_by_owner_type".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_history_by_owner_type") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_history_by_owner_type")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_history_by_owner_type ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_history_by_owner_type" + end + # verify the required parameter 'owner_type' is set + if @api_client.config.client_side_validation && owner_type.nil? + fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.list_ownership_history_by_owner_type" + end + # verify enum value + allowable_values = ['user', 'team', 'service', 'unknown'] + if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) + fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history_by_owner_type, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history_by_owner_type, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/history'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'OwnershipHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ownership_history_by_owner_type, + :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: CSMOwnershipAPI#list_ownership_history_by_owner_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List ownership inferences for a resource. + # + # @see #list_ownership_inferences_with_http_info + def list_ownership_inferences(resource_id, opts = {}) + data, _status_code, _headers = list_ownership_inferences_with_http_info(resource_id, opts) + data + end + + # List ownership inferences for a resource. + # + # Get all current ownership inferences for a resource, one per owner type (`user`, `team`, `service`, `unknown`). + # + # @param resource_id [String] The identifier of the resource to retrieve ownership inferences for. + # @param opts [Hash] the optional parameters + # @return [Array<(OwnershipInferenceListResponse, Integer, Hash)>] OwnershipInferenceListResponse data, response status code and response headers + def list_ownership_inferences_with_http_info(resource_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_inferences".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_inferences") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_inferences")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_inferences ...' + end + # verify the required parameter 'resource_id' is set + if @api_client.config.client_side_validation && resource_id.nil? + fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_inferences" + end + # resource path + local_var_path = '/api/v2/csm/ownership/{resource_id}'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OwnershipInferenceListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ownership_inferences, + :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: CSMOwnershipAPI#list_ownership_inferences\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/ownership_evidence_attributes.rb b/lib/datadog_api_client/v2/models/ownership_evidence_attributes.rb new file mode 100644 index 000000000000..77bcad3d1053 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_evidence_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an ownership evidence response. + class OwnershipEvidenceAttributes + include BaseGenericModel + + # The list of evidence versions associated with an inference. + attr_accessor :evidence_versions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'evidence_versions' => :'evidence_versions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'evidence_versions' => :'Array>' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'evidence_versions', + ]) + 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::OwnershipEvidenceAttributes` 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?(:'evidence_versions') + if (value = attributes[:'evidence_versions']).is_a?(Array) + self.evidence_versions = 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 && + evidence_versions == o.evidence_versions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [evidence_versions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_evidence_data.rb b/lib/datadog_api_client/v2/models/ownership_evidence_data.rb new file mode 100644 index 000000000000..891ae2c88b14 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_evidence_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 + # The data wrapper for an ownership evidence response. + class OwnershipEvidenceData + include BaseGenericModel + + # The attributes of an ownership evidence response. + attr_reader :attributes + + # The identifier of the resource the evidence applies to. + attr_reader :id + + # The type of the ownership evidence resource. The value should always be `ownership_evidence`. + 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' => :'OwnershipEvidenceAttributes', + :'id' => :'String', + :'type' => :'OwnershipEvidenceType' + } + 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::OwnershipEvidenceData` 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/ownership_evidence_response.rb b/lib/datadog_api_client/v2/models/ownership_evidence_response.rb new file mode 100644 index 000000000000..4a1296449153 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_evidence_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 retrieving the evidence backing an ownership inference for an owner type. + class OwnershipEvidenceResponse + include BaseGenericModel + + # The data wrapper for an ownership evidence 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' => :'OwnershipEvidenceData' + } + 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::OwnershipEvidenceResponse` 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/ownership_evidence_type.rb b/lib/datadog_api_client/v2/models/ownership_evidence_type.rb new file mode 100644 index 000000000000..f3f659296d55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_evidence_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership evidence resource. The value should always be `ownership_evidence`. + class OwnershipEvidenceType + include BaseEnumModel + + OWNERSHIP_EVIDENCE = "ownership_evidence".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_action.rb b/lib/datadog_api_client/v2/models/ownership_feedback_action.rb new file mode 100644 index 000000000000..62d92b63c03b --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_action.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 feedback action to apply to an inference. + class OwnershipFeedbackAction + include BaseEnumModel + + CONFIRM = "confirm".freeze + REJECT = "reject".freeze + CORRECT = "correct".freeze + PERSIST = "persist".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_request.rb b/lib/datadog_api_client/v2/models/ownership_feedback_request.rb new file mode 100644 index 000000000000..c9d8584cb106 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The request body for submitting ownership feedback. + class OwnershipFeedbackRequest + include BaseGenericModel + + # The data wrapper for an ownership feedback request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OwnershipFeedbackRequestData' + } + 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::OwnershipFeedbackRequest` 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/ownership_feedback_request_attributes.rb b/lib/datadog_api_client/v2/models/ownership_feedback_request_attributes.rb new file mode 100644 index 000000000000..6328c79edaca --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_request_attributes.rb @@ -0,0 +1,226 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an ownership feedback request. + class OwnershipFeedbackRequestAttributes + include BaseGenericModel + + # The feedback action to apply to an inference. + attr_reader :action + + # The handle of the actor submitting the feedback. + attr_reader :actor_handle + + # The type of actor submitting the feedback, for example `user` or `service`. + attr_reader :actor_type + + # The corrected owner handle. Required when `action` is `correct`. + attr_accessor :corrected_owner_handle + + # The corrected owner type. Required when `action` is `correct`. + attr_accessor :corrected_owner_type + + # The checksum of the inference being acted upon. Must match the current inference checksum or the request returns a conflict. + attr_reader :inference_checksum + + # An optional free-form reason explaining the feedback. + attr_accessor :reason + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'actor_handle' => :'actor_handle', + :'actor_type' => :'actor_type', + :'corrected_owner_handle' => :'corrected_owner_handle', + :'corrected_owner_type' => :'corrected_owner_type', + :'inference_checksum' => :'inference_checksum', + :'reason' => :'reason' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'OwnershipFeedbackAction', + :'actor_handle' => :'String', + :'actor_type' => :'String', + :'corrected_owner_handle' => :'String', + :'corrected_owner_type' => :'String', + :'inference_checksum' => :'String', + :'reason' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'corrected_owner_handle', + :'corrected_owner_type', + :'reason', + ]) + 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::OwnershipFeedbackRequestAttributes` 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?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'actor_handle') + self.actor_handle = attributes[:'actor_handle'] + end + + if attributes.key?(:'actor_type') + self.actor_type = attributes[:'actor_type'] + end + + if attributes.key?(:'corrected_owner_handle') + self.corrected_owner_handle = attributes[:'corrected_owner_handle'] + end + + if attributes.key?(:'corrected_owner_type') + self.corrected_owner_type = attributes[:'corrected_owner_type'] + end + + if attributes.key?(:'inference_checksum') + self.inference_checksum = attributes[:'inference_checksum'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + 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 @action.nil? + return false if @actor_handle.nil? + return false if @actor_type.nil? + return false if @inference_checksum.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param actor_handle [Object] Object to be assigned + # @!visibility private + def actor_handle=(actor_handle) + if actor_handle.nil? + fail ArgumentError, 'invalid value for "actor_handle", actor_handle cannot be nil.' + end + @actor_handle = actor_handle + end + + # Custom attribute writer method with validation + # @param actor_type [Object] Object to be assigned + # @!visibility private + def actor_type=(actor_type) + if actor_type.nil? + fail ArgumentError, 'invalid value for "actor_type", actor_type cannot be nil.' + end + @actor_type = actor_type + end + + # Custom attribute writer method with validation + # @param inference_checksum [Object] Object to be assigned + # @!visibility private + def inference_checksum=(inference_checksum) + if inference_checksum.nil? + fail ArgumentError, 'invalid value for "inference_checksum", inference_checksum cannot be nil.' + end + @inference_checksum = inference_checksum + 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 && + action == o.action && + actor_handle == o.actor_handle && + actor_type == o.actor_type && + corrected_owner_handle == o.corrected_owner_handle && + corrected_owner_type == o.corrected_owner_type && + inference_checksum == o.inference_checksum && + reason == o.reason && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, actor_handle, actor_type, corrected_owner_handle, corrected_owner_type, inference_checksum, reason, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_request_data.rb b/lib/datadog_api_client/v2/models/ownership_feedback_request_data.rb new file mode 100644 index 000000000000..8b743d1447ab --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper for an ownership feedback request. + class OwnershipFeedbackRequestData + include BaseGenericModel + + # The attributes of an ownership feedback request. + attr_reader :attributes + + # The type of the ownership feedback request resource. The value should always be `ownership_feedback`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OwnershipFeedbackRequestAttributes', + :'type' => :'OwnershipFeedbackType' + } + 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::OwnershipFeedbackRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_response.rb b/lib/datadog_api_client/v2/models/ownership_feedback_response.rb new file mode 100644 index 000000000000..5ce00c300d91 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_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 after applying ownership feedback to an inference. + class OwnershipFeedbackResponse + include BaseGenericModel + + # The data wrapper for an ownership feedback result 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' => :'OwnershipFeedbackResultData' + } + 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::OwnershipFeedbackResponse` 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/ownership_feedback_result_attributes.rb b/lib/datadog_api_client/v2/models/ownership_feedback_result_attributes.rb new file mode 100644 index 000000000000..26f659e4e325 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_result_attributes.rb @@ -0,0 +1,246 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an ownership feedback result. + class OwnershipFeedbackResultAttributes + include BaseGenericModel + + # The feedback action to apply to an inference. + attr_reader :action + + # The checksum of the inference after the feedback was applied. + attr_reader :checksum + + # The lifecycle status of an ownership inference. + attr_reader :new_status + + # The owner type for an ownership inference. + attr_reader :owner_type + + # The lifecycle status of an ownership inference. + attr_reader :previous_status + + # The primary contact reference for the inferred owner after the feedback was applied, formatted as `ref:handle/`. + attr_accessor :primary_contact_ref + + # The time when the inference was updated by the feedback. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'checksum' => :'checksum', + :'new_status' => :'new_status', + :'owner_type' => :'owner_type', + :'previous_status' => :'previous_status', + :'primary_contact_ref' => :'primary_contact_ref', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'OwnershipFeedbackAction', + :'checksum' => :'String', + :'new_status' => :'OwnershipInferenceStatus', + :'owner_type' => :'OwnershipOwnerType', + :'previous_status' => :'OwnershipInferenceStatus', + :'primary_contact_ref' => :'String', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'primary_contact_ref', + ]) + 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::OwnershipFeedbackResultAttributes` 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?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'new_status') + self.new_status = attributes[:'new_status'] + end + + if attributes.key?(:'owner_type') + self.owner_type = attributes[:'owner_type'] + end + + if attributes.key?(:'previous_status') + self.previous_status = attributes[:'previous_status'] + end + + if attributes.key?(:'primary_contact_ref') + self.primary_contact_ref = attributes[:'primary_contact_ref'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @checksum.nil? + return false if @new_status.nil? + return false if @owner_type.nil? + return false if @previous_status.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param new_status [Object] Object to be assigned + # @!visibility private + def new_status=(new_status) + if new_status.nil? + fail ArgumentError, 'invalid value for "new_status", new_status cannot be nil.' + end + @new_status = new_status + end + + # Custom attribute writer method with validation + # @param owner_type [Object] Object to be assigned + # @!visibility private + def owner_type=(owner_type) + if owner_type.nil? + fail ArgumentError, 'invalid value for "owner_type", owner_type cannot be nil.' + end + @owner_type = owner_type + end + + # Custom attribute writer method with validation + # @param previous_status [Object] Object to be assigned + # @!visibility private + def previous_status=(previous_status) + if previous_status.nil? + fail ArgumentError, 'invalid value for "previous_status", previous_status cannot be nil.' + end + @previous_status = previous_status + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + checksum == o.checksum && + new_status == o.new_status && + owner_type == o.owner_type && + previous_status == o.previous_status && + primary_contact_ref == o.primary_contact_ref && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, checksum, new_status, owner_type, previous_status, primary_contact_ref, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_result_data.rb b/lib/datadog_api_client/v2/models/ownership_feedback_result_data.rb new file mode 100644 index 000000000000..60198704fe1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_result_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 + # The data wrapper for an ownership feedback result response. + class OwnershipFeedbackResultData + include BaseGenericModel + + # The attributes of an ownership feedback result. + attr_reader :attributes + + # The identifier of the resource that the feedback was applied to. + attr_reader :id + + # The type of the ownership feedback result resource. The value should always be `ownership_feedback_result`. + 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' => :'OwnershipFeedbackResultAttributes', + :'id' => :'String', + :'type' => :'OwnershipFeedbackResultType' + } + 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::OwnershipFeedbackResultData` 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/ownership_feedback_result_type.rb b/lib/datadog_api_client/v2/models/ownership_feedback_result_type.rb new file mode 100644 index 000000000000..3d28ffc91ae6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_result_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership feedback result resource. The value should always be `ownership_feedback_result`. + class OwnershipFeedbackResultType + include BaseEnumModel + + OWNERSHIP_FEEDBACK_RESULT = "ownership_feedback_result".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_feedback_type.rb b/lib/datadog_api_client/v2/models/ownership_feedback_type.rb new file mode 100644 index 000000000000..c41fcbd3abf3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_feedback_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership feedback request resource. The value should always be `ownership_feedback`. + class OwnershipFeedbackType + include BaseEnumModel + + OWNERSHIP_FEEDBACK = "ownership_feedback".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_history_attributes.rb b/lib/datadog_api_client/v2/models/ownership_history_attributes.rb new file mode 100644 index 000000000000..d572e70a03e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an ownership history response. + class OwnershipHistoryAttributes + include BaseGenericModel + + # The list of history entries returned for this page. + attr_reader :items + + # Cursor-based pagination metadata for the history response. + attr_reader :pagination + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'items' => :'items', + :'pagination' => :'pagination' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'items' => :'Array', + :'pagination' => :'OwnershipHistoryPagination' + } + 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::OwnershipHistoryAttributes` 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 + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + 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? + return false if @pagination.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 + + # Custom attribute writer method with validation + # @param pagination [Object] Object to be assigned + # @!visibility private + def pagination=(pagination) + if pagination.nil? + fail ArgumentError, 'invalid value for "pagination", pagination cannot be nil.' + end + @pagination = pagination + 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 && + pagination == o.pagination && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [items, pagination, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_history_data.rb b/lib/datadog_api_client/v2/models/ownership_history_data.rb new file mode 100644 index 000000000000..51717403cd88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_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 + # The data wrapper for an ownership history response. + class OwnershipHistoryData + include BaseGenericModel + + # The attributes of an ownership history response. + attr_reader :attributes + + # The resource identifier for which history is returned. + attr_reader :id + + # The type of the ownership history resource. The value should always be `ownership_history`. + 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' => :'OwnershipHistoryAttributes', + :'id' => :'String', + :'type' => :'OwnershipHistoryType' + } + 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::OwnershipHistoryData` 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/ownership_history_item.rb b/lib/datadog_api_client/v2/models/ownership_history_item.rb new file mode 100644 index 000000000000..f5bc267d1721 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_item.rb @@ -0,0 +1,357 @@ +=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 ownership inference history entry. + class OwnershipHistoryItem + include BaseGenericModel + + # A checksum identifying the state of the inference at this point in time. + attr_reader :checksum + + # The confidence score of the inference, expressed as a numeric string with up to four decimal places. + attr_reader :confidence + + # The time this history entry was created. + attr_reader :created_at + + # The list of evidence versions associated with an inference. + attr_accessor :evidence_versions + + # A human-readable explanation of how the inference was produced. + attr_reader :explanation + + # The time when this inference failed, if applicable. + attr_accessor :failed_at + + # The reason why this inference failed, if applicable. + attr_accessor :failure_reason + + # The unique identifier of the history entry. + attr_reader :id + + # The owner type for an ownership inference. + attr_reader :owner_type + + # The primary contact reference for the inferred owner, formatted as `ref:handle/`. + attr_accessor :primary_contact_ref + + # The identifier of the resource that the inference applies to. + attr_reader :resource_id + + # The scheduled retry time for a failed inference, if applicable. + attr_accessor :retry_schedule + + # The list of sources backing an ownership inference. Empty when the inference status is not whitelisted to expose sources. + attr_reader :sources + + # The lifecycle status of an ownership inference. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'checksum' => :'checksum', + :'confidence' => :'confidence', + :'created_at' => :'created_at', + :'evidence_versions' => :'evidence_versions', + :'explanation' => :'explanation', + :'failed_at' => :'failed_at', + :'failure_reason' => :'failure_reason', + :'id' => :'id', + :'owner_type' => :'owner_type', + :'primary_contact_ref' => :'primary_contact_ref', + :'resource_id' => :'resource_id', + :'retry_schedule' => :'retry_schedule', + :'sources' => :'sources', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'checksum' => :'String', + :'confidence' => :'String', + :'created_at' => :'Time', + :'evidence_versions' => :'Array>', + :'explanation' => :'String', + :'failed_at' => :'Time', + :'failure_reason' => :'String', + :'id' => :'Integer', + :'owner_type' => :'OwnershipOwnerType', + :'primary_contact_ref' => :'String', + :'resource_id' => :'String', + :'retry_schedule' => :'Time', + :'sources' => :'Array>', + :'status' => :'OwnershipInferenceStatus' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'evidence_versions', + :'failed_at', + :'failure_reason', + :'primary_contact_ref', + :'retry_schedule', + ]) + 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::OwnershipHistoryItem` 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?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'confidence') + self.confidence = attributes[:'confidence'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'evidence_versions') + if (value = attributes[:'evidence_versions']).is_a?(Array) + self.evidence_versions = value + end + end + + if attributes.key?(:'explanation') + self.explanation = attributes[:'explanation'] + end + + if attributes.key?(:'failed_at') + self.failed_at = attributes[:'failed_at'] + end + + if attributes.key?(:'failure_reason') + self.failure_reason = attributes[:'failure_reason'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner_type') + self.owner_type = attributes[:'owner_type'] + end + + if attributes.key?(:'primary_contact_ref') + self.primary_contact_ref = attributes[:'primary_contact_ref'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'retry_schedule') + self.retry_schedule = attributes[:'retry_schedule'] + end + + if attributes.key?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @checksum.nil? + return false if @confidence.nil? + return false if @created_at.nil? + return false if @explanation.nil? + return false if @id.nil? + return false if @owner_type.nil? + return false if @resource_id.nil? + return false if @sources.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param confidence [Object] Object to be assigned + # @!visibility private + def confidence=(confidence) + if confidence.nil? + fail ArgumentError, 'invalid value for "confidence", confidence cannot be nil.' + end + @confidence = confidence + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param explanation [Object] Object to be assigned + # @!visibility private + def explanation=(explanation) + if explanation.nil? + fail ArgumentError, 'invalid value for "explanation", explanation cannot be nil.' + end + @explanation = explanation + 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 owner_type [Object] Object to be assigned + # @!visibility private + def owner_type=(owner_type) + if owner_type.nil? + fail ArgumentError, 'invalid value for "owner_type", owner_type cannot be nil.' + end + @owner_type = owner_type + end + + # Custom attribute writer method with validation + # @param resource_id [Object] Object to be assigned + # @!visibility private + def resource_id=(resource_id) + if resource_id.nil? + fail ArgumentError, 'invalid value for "resource_id", resource_id cannot be nil.' + end + @resource_id = resource_id + end + + # Custom attribute writer method with validation + # @param sources [Object] Object to be assigned + # @!visibility private + def sources=(sources) + if sources.nil? + fail ArgumentError, 'invalid value for "sources", sources cannot be nil.' + end + @sources = sources + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + checksum == o.checksum && + confidence == o.confidence && + created_at == o.created_at && + evidence_versions == o.evidence_versions && + explanation == o.explanation && + failed_at == o.failed_at && + failure_reason == o.failure_reason && + id == o.id && + owner_type == o.owner_type && + primary_contact_ref == o.primary_contact_ref && + resource_id == o.resource_id && + retry_schedule == o.retry_schedule && + sources == o.sources && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [checksum, confidence, created_at, evidence_versions, explanation, failed_at, failure_reason, id, owner_type, primary_contact_ref, resource_id, retry_schedule, sources, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_history_pagination.rb b/lib/datadog_api_client/v2/models/ownership_history_pagination.rb new file mode 100644 index 000000000000..2fbe16849361 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_pagination.rb @@ -0,0 +1,141 @@ +=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 + # Cursor-based pagination metadata for the history response. + class OwnershipHistoryPagination + include BaseGenericModel + + # Whether more history entries are available beyond this page. + attr_reader :has_more + + # An opaque, base64-encoded cursor token. Pass it as the `cursor` query parameter to retrieve the next page. Absent or `null` when there are no further pages. + attr_accessor :next_cursor + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'has_more' => :'has_more', + :'next_cursor' => :'next_cursor' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'has_more' => :'Boolean', + :'next_cursor' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_cursor', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OwnershipHistoryPagination` 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?(:'has_more') + self.has_more = attributes[:'has_more'] + end + + if attributes.key?(:'next_cursor') + self.next_cursor = attributes[:'next_cursor'] + 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 @has_more.nil? + true + end + + # Custom attribute writer method with validation + # @param has_more [Object] Object to be assigned + # @!visibility private + def has_more=(has_more) + if has_more.nil? + fail ArgumentError, 'invalid value for "has_more", has_more cannot be nil.' + end + @has_more = has_more + 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 && + has_more == o.has_more && + next_cursor == o.next_cursor && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [has_more, next_cursor, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_history_response.rb b/lib/datadog_api_client/v2/models/ownership_history_response.rb new file mode 100644 index 000000000000..1b6782a628b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_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 listing the inference history for a resource. + class OwnershipHistoryResponse + include BaseGenericModel + + # The data wrapper for an ownership history 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' => :'OwnershipHistoryData' + } + 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::OwnershipHistoryResponse` 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/ownership_history_type.rb b/lib/datadog_api_client/v2/models/ownership_history_type.rb new file mode 100644 index 000000000000..158ecd88712d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_history_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership history resource. The value should always be `ownership_history`. + class OwnershipHistoryType + include BaseEnumModel + + OWNERSHIP_HISTORY = "ownership_history".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_inference_attributes.rb b/lib/datadog_api_client/v2/models/ownership_inference_attributes.rb new file mode 100644 index 000000000000..15fb0e760ad4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_attributes.rb @@ -0,0 +1,303 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a single ownership inference. + class OwnershipInferenceAttributes + include BaseGenericModel + + # A checksum that uniquely identifies the current state of the inference. Required when submitting feedback. + attr_reader :checksum + + # The confidence score of the inference, expressed as a numeric string with up to four decimal places. + attr_reader :confidence + + # The time when the inference was created. + attr_reader :created_at + + # The list of evidence versions associated with an inference. + attr_accessor :evidence_versions + + # A human-readable explanation of how the inference was produced. + attr_reader :explanation + + # The owner type for an ownership inference. + attr_reader :owner_type + + # The primary contact reference for the inferred owner, formatted as `ref:handle/`. + attr_accessor :primary_contact_ref + + # The list of sources backing an ownership inference. Empty when the inference status is not whitelisted to expose sources. + attr_reader :sources + + # The lifecycle status of an ownership inference. + attr_reader :status + + # The time when the inference was last updated. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'checksum' => :'checksum', + :'confidence' => :'confidence', + :'created_at' => :'created_at', + :'evidence_versions' => :'evidence_versions', + :'explanation' => :'explanation', + :'owner_type' => :'owner_type', + :'primary_contact_ref' => :'primary_contact_ref', + :'sources' => :'sources', + :'status' => :'status', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'checksum' => :'String', + :'confidence' => :'String', + :'created_at' => :'Time', + :'evidence_versions' => :'Array>', + :'explanation' => :'String', + :'owner_type' => :'OwnershipOwnerType', + :'primary_contact_ref' => :'String', + :'sources' => :'Array>', + :'status' => :'OwnershipInferenceStatus', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'evidence_versions', + :'primary_contact_ref', + ]) + 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::OwnershipInferenceAttributes` 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?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'confidence') + self.confidence = attributes[:'confidence'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'evidence_versions') + if (value = attributes[:'evidence_versions']).is_a?(Array) + self.evidence_versions = value + end + end + + if attributes.key?(:'explanation') + self.explanation = attributes[:'explanation'] + end + + if attributes.key?(:'owner_type') + self.owner_type = attributes[:'owner_type'] + end + + if attributes.key?(:'primary_contact_ref') + self.primary_contact_ref = attributes[:'primary_contact_ref'] + end + + if attributes.key?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @checksum.nil? + return false if @confidence.nil? + return false if @created_at.nil? + return false if @explanation.nil? + return false if @owner_type.nil? + return false if @sources.nil? + return false if @status.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param confidence [Object] Object to be assigned + # @!visibility private + def confidence=(confidence) + if confidence.nil? + fail ArgumentError, 'invalid value for "confidence", confidence cannot be nil.' + end + @confidence = confidence + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param explanation [Object] Object to be assigned + # @!visibility private + def explanation=(explanation) + if explanation.nil? + fail ArgumentError, 'invalid value for "explanation", explanation cannot be nil.' + end + @explanation = explanation + end + + # Custom attribute writer method with validation + # @param owner_type [Object] Object to be assigned + # @!visibility private + def owner_type=(owner_type) + if owner_type.nil? + fail ArgumentError, 'invalid value for "owner_type", owner_type cannot be nil.' + end + @owner_type = owner_type + end + + # Custom attribute writer method with validation + # @param sources [Object] Object to be assigned + # @!visibility private + def sources=(sources) + if sources.nil? + fail ArgumentError, 'invalid value for "sources", sources cannot be nil.' + end + @sources = sources + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + checksum == o.checksum && + confidence == o.confidence && + created_at == o.created_at && + evidence_versions == o.evidence_versions && + explanation == o.explanation && + owner_type == o.owner_type && + primary_contact_ref == o.primary_contact_ref && + sources == o.sources && + status == o.status && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [checksum, confidence, created_at, evidence_versions, explanation, owner_type, primary_contact_ref, sources, status, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_inference_data.rb b/lib/datadog_api_client/v2/models/ownership_inference_data.rb new file mode 100644 index 000000000000..115d5e270923 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_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 + # The data wrapper for a single ownership inference response. + class OwnershipInferenceData + include BaseGenericModel + + # The attributes of a single ownership inference. + attr_reader :attributes + + # The identifier of the inference, formatted as `resource_id:owner_type`. + attr_reader :id + + # The type of the ownership inference resource. The value should always be `ownership_inference`. + 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' => :'OwnershipInferenceAttributes', + :'id' => :'String', + :'type' => :'OwnershipInferenceType' + } + 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::OwnershipInferenceData` 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/ownership_inference_item.rb b/lib/datadog_api_client/v2/models/ownership_inference_item.rb new file mode 100644 index 000000000000..b447e72ccd96 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_item.rb @@ -0,0 +1,324 @@ +=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 ownership inference, scoped to a specific owner type. + class OwnershipInferenceItem + include BaseGenericModel + + # A checksum that uniquely identifies the current state of the inference. Required when submitting feedback. + attr_reader :checksum + + # The confidence score of the inference, expressed as a numeric string with up to four decimal places. + attr_reader :confidence + + # The time when the inference was created. + attr_reader :created_at + + # The list of evidence versions associated with an inference. + attr_accessor :evidence_versions + + # A human-readable explanation of how the inference was produced. + attr_reader :explanation + + # The identifier of the inference, formatted as `resource_id:owner_type`. + attr_reader :id + + # The owner type for an ownership inference. + attr_reader :owner_type + + # The primary contact reference for the inferred owner, formatted as `ref:handle/`. + attr_accessor :primary_contact_ref + + # The list of sources backing an ownership inference. Empty when the inference status is not whitelisted to expose sources. + attr_reader :sources + + # The lifecycle status of an ownership inference. + attr_reader :status + + # The time when the inference was last updated. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'checksum' => :'checksum', + :'confidence' => :'confidence', + :'created_at' => :'created_at', + :'evidence_versions' => :'evidence_versions', + :'explanation' => :'explanation', + :'id' => :'id', + :'owner_type' => :'owner_type', + :'primary_contact_ref' => :'primary_contact_ref', + :'sources' => :'sources', + :'status' => :'status', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'checksum' => :'String', + :'confidence' => :'String', + :'created_at' => :'Time', + :'evidence_versions' => :'Array>', + :'explanation' => :'String', + :'id' => :'String', + :'owner_type' => :'OwnershipOwnerType', + :'primary_contact_ref' => :'String', + :'sources' => :'Array>', + :'status' => :'OwnershipInferenceStatus', + :'updated_at' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'evidence_versions', + :'primary_contact_ref', + ]) + 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::OwnershipInferenceItem` 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?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'confidence') + self.confidence = attributes[:'confidence'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'evidence_versions') + if (value = attributes[:'evidence_versions']).is_a?(Array) + self.evidence_versions = value + end + end + + if attributes.key?(:'explanation') + self.explanation = attributes[:'explanation'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'owner_type') + self.owner_type = attributes[:'owner_type'] + end + + if attributes.key?(:'primary_contact_ref') + self.primary_contact_ref = attributes[:'primary_contact_ref'] + end + + if attributes.key?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @checksum.nil? + return false if @confidence.nil? + return false if @created_at.nil? + return false if @explanation.nil? + return false if @id.nil? + return false if @owner_type.nil? + return false if @sources.nil? + return false if @status.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param confidence [Object] Object to be assigned + # @!visibility private + def confidence=(confidence) + if confidence.nil? + fail ArgumentError, 'invalid value for "confidence", confidence cannot be nil.' + end + @confidence = confidence + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param explanation [Object] Object to be assigned + # @!visibility private + def explanation=(explanation) + if explanation.nil? + fail ArgumentError, 'invalid value for "explanation", explanation cannot be nil.' + end + @explanation = explanation + 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 owner_type [Object] Object to be assigned + # @!visibility private + def owner_type=(owner_type) + if owner_type.nil? + fail ArgumentError, 'invalid value for "owner_type", owner_type cannot be nil.' + end + @owner_type = owner_type + end + + # Custom attribute writer method with validation + # @param sources [Object] Object to be assigned + # @!visibility private + def sources=(sources) + if sources.nil? + fail ArgumentError, 'invalid value for "sources", sources cannot be nil.' + end + @sources = sources + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + checksum == o.checksum && + confidence == o.confidence && + created_at == o.created_at && + evidence_versions == o.evidence_versions && + explanation == o.explanation && + id == o.id && + owner_type == o.owner_type && + primary_contact_ref == o.primary_contact_ref && + sources == o.sources && + status == o.status && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [checksum, confidence, created_at, evidence_versions, explanation, id, owner_type, primary_contact_ref, sources, status, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_inference_list_attributes.rb b/lib/datadog_api_client/v2/models/ownership_inference_list_attributes.rb new file mode 100644 index 000000000000..971976adb3cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_list_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 + # The attributes of the ownership inferences collection response. + class OwnershipInferenceListAttributes + include BaseGenericModel + + # The list of inferences for a resource, with one inference per owner type. + 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::OwnershipInferenceListAttributes` 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/ownership_inference_list_data.rb b/lib/datadog_api_client/v2/models/ownership_inference_list_data.rb new file mode 100644 index 000000000000..b58bf747c1aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_list_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 + # The data wrapper for the ownership inferences collection response. + class OwnershipInferenceListData + include BaseGenericModel + + # The attributes of the ownership inferences collection response. + attr_reader :attributes + + # The resource identifier associated with the returned inferences. + attr_reader :id + + # The type of the ownership inferences collection resource. The value should always be `ownership_inferences`. + 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' => :'OwnershipInferenceListAttributes', + :'id' => :'String', + :'type' => :'OwnershipInferencesType' + } + 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::OwnershipInferenceListData` 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/ownership_inference_list_response.rb b/lib/datadog_api_client/v2/models/ownership_inference_list_response.rb new file mode 100644 index 000000000000..ff74bbb10e8d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_list_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 listing all current ownership inferences for a resource. + class OwnershipInferenceListResponse + include BaseGenericModel + + # The data wrapper for the ownership inferences collection 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' => :'OwnershipInferenceListData' + } + 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::OwnershipInferenceListResponse` 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/ownership_inference_response.rb b/lib/datadog_api_client/v2/models/ownership_inference_response.rb new file mode 100644 index 000000000000..9113cab9cf87 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_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 retrieving a single ownership inference for an owner type. + class OwnershipInferenceResponse + include BaseGenericModel + + # The data wrapper for a single ownership inference 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' => :'OwnershipInferenceData' + } + 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::OwnershipInferenceResponse` 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/ownership_inference_status.rb b/lib/datadog_api_client/v2/models/ownership_inference_status.rb new file mode 100644 index 000000000000..bec86debd3e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_status.rb @@ -0,0 +1,30 @@ +=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 lifecycle status of an ownership inference. + class OwnershipInferenceStatus + include BaseEnumModel + + SUGGESTED = "suggested".freeze + PERSISTED = "persisted".freeze + OVERRIDDEN = "overridden".freeze + FAILED = "failed".freeze + UNKNOWN = "unknown".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_inference_type.rb b/lib/datadog_api_client/v2/models/ownership_inference_type.rb new file mode 100644 index 000000000000..4c0067a1a2ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inference_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership inference resource. The value should always be `ownership_inference`. + class OwnershipInferenceType + include BaseEnumModel + + OWNERSHIP_INFERENCE = "ownership_inference".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_inferences_type.rb b/lib/datadog_api_client/v2/models/ownership_inferences_type.rb new file mode 100644 index 000000000000..9048ecf5e71f --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_inferences_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the ownership inferences collection resource. The value should always be `ownership_inferences`. + class OwnershipInferencesType + include BaseEnumModel + + OWNERSHIP_INFERENCES = "ownership_inferences".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ownership_owner_type.rb b/lib/datadog_api_client/v2/models/ownership_owner_type.rb new file mode 100644 index 000000000000..5dde013c0696 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ownership_owner_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 owner type for an ownership inference. + class OwnershipOwnerType + include BaseEnumModel + + USER = "user".freeze + TEAM = "team".freeze + SERVICE = "service".freeze + UNKNOWN = "unknown".freeze + end +end From 7a520a21ac6b135faac08769ee61aed519320368 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 13:50:38 +0000 Subject: [PATCH 3/3] Regenerate client from commit 41b94d9 of spec repo (#3453) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 755 ++++++++++++++++++ .../Create-a-form-returns-OK-response.frozen | 1 + .../Create-a-form-returns-OK-response.yml | 45 ++ ...-publish-a-form-returns-OK-response.frozen | 1 + ...and-publish-a-form-returns-OK-response.yml | 45 ++ .../Delete-a-form-returns-OK-response.frozen | 1 + .../Delete-a-form-returns-OK-response.yml | 62 ++ ...t-a-form-returns-Not-Found-response.frozen | 1 + .../Get-a-form-returns-Not-Found-response.yml | 21 + .../Get-a-form-returns-OK-response.frozen | 1 + .../forms/Get-a-form-returns-OK-response.yml | 63 ++ .../List-forms-returns-OK-response.frozen | 1 + .../forms/List-forms-returns-OK-response.yml | 67 ++ examples/v2/forms/CreateAndPublishForm.rb | 23 + examples/v2/forms/CreateForm.rb | 23 + examples/v2/forms/DeleteForm.rb | 11 + examples/v2/forms/GetForm.rb | 11 + examples/v2/forms/ListForms.rb | 8 + features/scenarios_model_mapping.rb | 13 + features/v2/forms.feature | 107 +++ features/v2/given.json | 24 + features/v2/undo.json | 44 + lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 20 + lib/datadog_api_client/v2/api/forms_api.rb | 382 +++++++++ .../v2/models/create_form_data.rb | 144 ++++ .../v2/models/create_form_data_attributes.rb | 205 +++++ .../v2/models/create_form_request.rb | 123 +++ .../v2/models/delete_form_data.rb | 144 ++++ .../v2/models/delete_form_response.rb | 105 +++ lib/datadog_api_client/v2/models/form_data.rb | 165 ++++ .../v2/models/form_data_attributes.rb | 424 ++++++++++ .../v2/models/form_data_definition.rb | 147 ++++ .../v2/models/form_data_definition_type.rb | 26 + .../form_datastore_config_attributes.rb | 165 ++++ .../v2/models/form_publication_attributes.rb | 280 +++++++ .../v2/models/form_response.rb | 123 +++ lib/datadog_api_client/v2/models/form_type.rb | 26 + .../v2/models/form_ui_definition.rb | 117 +++ .../v2/models/form_ui_definition_ui_theme.rb | 105 +++ ...rm_ui_definition_ui_theme_primary_color.rb | 34 + .../v2/models/form_version_attributes.rb | 319 ++++++++ .../v2/models/form_version_state.rb | 27 + .../v2/models/forms_response.rb | 125 +++ 44 files changed, 4539 insertions(+) create mode 100644 cassettes/features/v2/forms/Create-a-form-returns-OK-response.frozen create mode 100644 cassettes/features/v2/forms/Create-a-form-returns-OK-response.yml create mode 100644 cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.frozen create mode 100644 cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.yml create mode 100644 cassettes/features/v2/forms/Delete-a-form-returns-OK-response.frozen create mode 100644 cassettes/features/v2/forms/Delete-a-form-returns-OK-response.yml create mode 100644 cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/forms/Get-a-form-returns-OK-response.frozen create mode 100644 cassettes/features/v2/forms/Get-a-form-returns-OK-response.yml create mode 100644 cassettes/features/v2/forms/List-forms-returns-OK-response.frozen create mode 100644 cassettes/features/v2/forms/List-forms-returns-OK-response.yml create mode 100644 examples/v2/forms/CreateAndPublishForm.rb create mode 100644 examples/v2/forms/CreateForm.rb create mode 100644 examples/v2/forms/DeleteForm.rb create mode 100644 examples/v2/forms/GetForm.rb create mode 100644 examples/v2/forms/ListForms.rb create mode 100644 features/v2/forms.feature create mode 100644 lib/datadog_api_client/v2/api/forms_api.rb create mode 100644 lib/datadog_api_client/v2/models/create_form_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_form_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_form_request.rb create mode 100644 lib/datadog_api_client/v2/models/delete_form_data.rb create mode 100644 lib/datadog_api_client/v2/models/delete_form_response.rb create mode 100644 lib/datadog_api_client/v2/models/form_data.rb create mode 100644 lib/datadog_api_client/v2/models/form_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/form_data_definition.rb create mode 100644 lib/datadog_api_client/v2/models/form_data_definition_type.rb create mode 100644 lib/datadog_api_client/v2/models/form_datastore_config_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/form_publication_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/form_response.rb create mode 100644 lib/datadog_api_client/v2/models/form_type.rb create mode 100644 lib/datadog_api_client/v2/models/form_ui_definition.rb create mode 100644 lib/datadog_api_client/v2/models/form_ui_definition_ui_theme.rb create mode 100644 lib/datadog_api_client/v2/models/form_ui_definition_ui_theme_primary_color.rb create mode 100644 lib/datadog_api_client/v2/models/form_version_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/form_version_state.rb create mode 100644 lib/datadog_api_client/v2/models/forms_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f1a3ae34f887..e694506b53cd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23238,6 +23238,60 @@ components: required: - data type: object + CreateFormData: + description: The data for creating a form. + properties: + attributes: + $ref: "#/components/schemas/CreateFormDataAttributes" + type: + $ref: "#/components/schemas/FormType" + required: + - attributes + - type + type: object + CreateFormDataAttributes: + description: The attributes for creating a form. + properties: + anonymous: + default: false + description: Whether the form accepts anonymous submissions. + example: false + type: boolean + data_definition: + $ref: "#/components/schemas/FormDataDefinition" + description: + description: The description of the form. + example: A form to collect user feedback. + type: string + idp_survey: + default: false + description: Whether the form is an IDP survey. + example: false + type: boolean + name: + description: The name of the form. + example: User Feedback Form + type: string + single_response: + default: false + description: Whether each user can only submit one response. + example: false + type: boolean + ui_definition: + $ref: "#/components/schemas/FormUiDefinition" + required: + - data_definition + - name + - ui_definition + type: object + CreateFormRequest: + description: A request to create a form. + properties: + data: + $ref: "#/components/schemas/CreateFormData" + required: + - data + type: object CreateIncidentNotificationRuleRequest: description: Create request for a notification rule. properties: @@ -29576,6 +29630,26 @@ components: required: - data type: object + DeleteFormData: + description: The data returned when a form is deleted. + properties: + id: + description: The ID of the deleted form. + example: 844dfd88-aa84-4db4-8979-e7bdbb9c1dc3 + format: uuid + type: string + type: + $ref: "#/components/schemas/FormType" + required: + - id + - type + type: object + DeleteFormResponse: + description: A response returned after deleting a form. + properties: + data: + $ref: "#/components/schemas/DeleteFormData" + type: object DeletedSuiteResponseData: description: Data object for a deleted Synthetic test suite. properties: @@ -37046,6 +37120,233 @@ components: - type - attributes type: object + FormData: + description: A form resource object. + properties: + attributes: + $ref: "#/components/schemas/FormDataAttributes" + id: + description: The ID of the form. + example: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + format: uuid + type: string + type: + $ref: "#/components/schemas/FormType" + required: + - id + - type + - attributes + type: object + FormDataAttributes: + description: The attributes of a form. + properties: + active: + description: Whether the form is currently active. + example: true + type: boolean + anonymous: + description: Whether the form accepts anonymous submissions. + example: false + type: boolean + created_at: + description: The time at which the form was created. + example: "2026-05-29T20:06:13.677353Z" + format: date-time + type: string + datastore_config: + $ref: "#/components/schemas/FormDatastoreConfigAttributes" + description: + description: The description of the form. + example: A form to collect user feedback. + type: string + end_date: + description: The date and time at which the form stops accepting responses. + example: + format: date-time + nullable: true + type: string + has_submitted: + description: Whether the current user has already submitted this form. Only present for forms with `single_response` set to `true`. + nullable: true + type: boolean + idp_survey: + description: Whether the form is an IDP survey. + example: false + type: boolean + modified_at: + description: The time at which the form was last modified. + example: "2026-05-29T20:06:13.677353Z" + format: date-time + type: string + name: + description: The name of the form. + example: User Feedback Form + type: string + org_id: + description: The ID of the organization that owns this form. + example: 2 + format: int64 + type: integer + publication: + $ref: "#/components/schemas/FormPublicationAttributes" + self_service: + description: Whether the form is available in the self-service catalog. + example: false + type: boolean + single_response: + description: Whether each user can only submit one response. + example: false + type: boolean + user_id: + description: The ID of the user who created this form. + example: 10001 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created this form. + example: 1fc709aa-be19-4539-a47d-52a30d78a978 + format: uuid + type: string + version: + $ref: "#/components/schemas/FormVersionAttributes" + required: + - active + - anonymous + - created_at + - datastore_config + - description + - idp_survey + - modified_at + - name + - org_id + - self_service + - single_response + - user_id + - user_uuid + type: object + FormDataDefinition: + additionalProperties: {} + description: A JSON Schema definition that describes the form's data fields. + properties: + description: + description: A description shown to form respondents. + example: Welcome to the Engineering Experience Survey. + type: string + properties: + additionalProperties: {} + description: A map of field names to their JSON Schema definitions. + type: object + required: + description: List of field names that must be answered. + items: + type: string + type: array + title: + description: The title of the form schema. + example: Developer Experience Survey + type: string + type: + $ref: "#/components/schemas/FormDataDefinitionType" + type: object + FormDataDefinitionType: + default: object + description: The root schema type. + enum: + - object + type: string + x-enum-varnames: + - OBJECT + FormDataList: + description: A list of form resource objects. + items: + $ref: "#/components/schemas/FormData" + type: array + FormDatastoreConfigAttributes: + description: The datastore configuration for a form. + properties: + datastore_id: + description: The ID of the datastore. + example: 5108ea24-dd83-4696-9caa-f069f73d0fad + format: uuid + type: string + primary_column_name: + description: The name of the primary column in the datastore. + example: id + type: string + primary_key_generation_strategy: + description: The strategy used to generate primary keys in the datastore. + example: none + type: string + required: + - datastore_id + - primary_column_name + - primary_key_generation_strategy + type: object + FormPublicationAttributes: + description: The attributes of a form publication. + properties: + created_at: + description: The time at which the publication was created. + example: "2026-05-29T20:06:13.677353Z" + format: date-time + type: string + form_id: + description: The ID of the form. + example: afc67600-0511-43b1-9b18-578fb4979bd3 + format: uuid + type: string + form_version: + description: The version number that was published. + example: 1 + format: int64 + type: integer + id: + description: The ID of the form publication. + example: "42" + type: string + modified_at: + description: The time at which the publication was last modified. + example: "2026-05-29T20:06:13.677353Z" + format: date-time + type: string + org_id: + description: The ID of the organization that owns this publication. + example: 2 + format: int64 + type: integer + publish_seq: + description: The sequential publication number for this form. + example: 1 + format: int64 + type: integer + user_id: + description: The ID of the user who created this publication. + example: 10001 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created this publication. + example: 1fc709aa-be19-4539-a47d-52a30d78a978 + format: uuid + type: string + required: + - created_at + - form_id + - form_version + - modified_at + - org_id + - publish_seq + - user_id + - user_uuid + type: object + FormResponse: + description: A response containing a single form. + properties: + data: + $ref: "#/components/schemas/FormData" + required: + - data + type: object FormTrigger: description: "Trigger a workflow from a Form." properties: @@ -37064,6 +37365,133 @@ components: required: - formTrigger type: object + FormType: + default: forms + description: The resource type for a form. + enum: + - forms + example: forms + type: string + x-enum-varnames: + - FORMS + FormUiDefinition: + additionalProperties: {} + description: UI configuration for rendering form fields, including widget overrides, field ordering, and themes. + properties: + "ui:order": + description: The order in which form fields are displayed. + items: + type: string + type: array + "ui:theme": + $ref: "#/components/schemas/FormUiDefinitionUiTheme" + type: object + FormUiDefinitionUiTheme: + description: The visual theme applied to the form. + properties: + primaryColor: + $ref: "#/components/schemas/FormUiDefinitionUiThemePrimaryColor" + type: object + FormUiDefinitionUiThemePrimaryColor: + description: The primary color of the form theme. + enum: + - gray + - red + - orange + - yellow + - green + - light-blue + - dark-blue + - magenta + - indigo + type: string + x-enum-varnames: + - GRAY + - RED + - ORANGE + - YELLOW + - GREEN + - LIGHT_BLUE + - DARK_BLUE + - MAGENTA + - INDIGO + FormVersionAttributes: + description: The attributes of a form version. + properties: + created_at: + description: The time at which the version was created. + example: "2026-05-29T20:06:14.895921Z" + format: date-time + type: string + data_definition: + $ref: "#/components/schemas/FormDataDefinition" + definition_signature: + description: The signature of the version definition. + example: '{"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545","version":1}' + type: string + etag: + description: The ETag for optimistic concurrency control. + example: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d + nullable: true + type: string + id: + description: The ID of the form version. + example: "126" + type: string + modified_at: + description: The time at which the version was last modified. + example: "2026-05-29T20:06:14.949163Z" + format: date-time + type: string + state: + $ref: "#/components/schemas/FormVersionState" + ui_definition: + $ref: "#/components/schemas/FormUiDefinition" + user_id: + description: The ID of the user who created this version. + example: 10001 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created this version. + example: 1fc709aa-be19-4539-a47d-52a30d78a978 + format: uuid + type: string + version: + description: The sequential version number. + example: 1 + format: int64 + type: integer + required: + - created_at + - data_definition + - definition_signature + - etag + - modified_at + - state + - ui_definition + - user_id + - user_uuid + - version + type: object + FormVersionState: + description: The state of a form version. + enum: + - draft + - frozen + example: frozen + type: string + x-enum-varnames: + - DRAFT + - FROZEN + FormsResponse: + description: A response containing a list of forms. + properties: + data: + $ref: "#/components/schemas/FormDataList" + required: + - data + type: object FormulaLimit: description: |- Message for specifying limits to the number of values returned by a query. @@ -126806,6 +127234,330 @@ paths: permissions: - feature_flag_config_write - feature_flag_environment_config_read + /api/v2/forms: + get: + description: Get all forms for the authenticated user's organization. + operationId: ListForms + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + active: true + anonymous: false + created_at: "2026-05-29T20:06:14.895284Z" + datastore_config: + datastore_id: 00000000-0000-0000-0000-000000000000 + primary_column_name: "" + primary_key_generation_strategy: "" + description: A form to collect user feedback. + end_date: + idp_survey: false + modified_at: "2026-05-29T20:06:14.895285Z" + name: User Feedback Form + org_id: 2 + self_service: false + single_response: false + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + id: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: forms + schema: + $ref: "#/components/schemas/FormsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List forms + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form. + operationId: CreateForm + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + anonymous: false + data_definition: {} + description: A form to collect user feedback. + idp_survey: false + name: User Feedback Form + single_response: false + ui_definition: {} + type: forms + schema: + $ref: "#/components/schemas/CreateFormRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + active: true + anonymous: false + created_at: "2026-05-29T20:06:14.895284Z" + datastore_config: + datastore_id: 5108ea24-dd83-4696-9caa-f069f73d0fad + primary_column_name: id + primary_key_generation_strategy: none + description: A form to collect user feedback. + end_date: + idp_survey: false + modified_at: "2026-05-29T20:06:14.895285Z" + name: User Feedback Form + org_id: 2 + self_service: false + single_response: false + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + id: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: forms + schema: + $ref: "#/components/schemas/FormResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a form + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/forms/create_and_publish: + post: + description: Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form. + operationId: CreateAndPublishForm + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + anonymous: false + data_definition: {} + description: A form to collect user feedback. + idp_survey: false + name: User Feedback Form + single_response: false + ui_definition: {} + type: forms + schema: + $ref: "#/components/schemas/CreateFormRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + active: true + anonymous: false + created_at: "2026-05-29T20:06:14.895284Z" + datastore_config: + datastore_id: 5108ea24-dd83-4696-9caa-f069f73d0fad + primary_column_name: id + primary_key_generation_strategy: none + description: A form to collect user feedback. + end_date: + idp_survey: false + modified_at: "2026-05-29T20:06:14.895285Z" + name: User Feedback Form + org_id: 2 + self_service: false + single_response: false + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + id: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: forms + schema: + $ref: "#/components/schemas/FormResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create and publish a form + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/forms/{form_id}: + delete: + description: Delete a form by its ID. This will also try to delete the associated datastore. + operationId: DeleteForm + parameters: + - description: The ID of the form. + example: 844dfd88-aa84-4db4-8979-e7bdbb9c1dc3 + in: path + name: form_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: 844dfd88-aa84-4db4-8979-e7bdbb9c1dc3 + type: forms + schema: + $ref: "#/components/schemas/DeleteFormResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a form + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a form definition by its ID. + operationId: GetForm + parameters: + - description: The ID of the form. + example: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + in: path + name: form_id + required: true + schema: + format: uuid + type: string + - description: The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number. + in: query + name: version + required: false + schema: + default: latest + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + active: true + anonymous: false + created_at: "2026-05-29T20:06:14.895284Z" + datastore_config: + datastore_id: 5108ea24-dd83-4696-9caa-f069f73d0fad + primary_column_name: id + primary_key_generation_strategy: none + description: A form to collect user feedback. + end_date: + idp_survey: false + modified_at: "2026-05-29T20:06:14.895285Z" + name: User Feedback Form + org_id: 2 + self_service: false + single_response: false + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + id: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: forms + schema: + $ref: "#/components/schemas/FormResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a form + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/hamr: get: description: |- @@ -182866,6 +183618,9 @@ tags: Package Upgrade Deployments (`/upgrade`): - Upgrade the Datadog Agent to specific versions name: Fleet Automation + - description: |- + The Datadog Forms API lets you create and manage forms within the App Builder platform. You can configure form settings, manage versions, publish forms, and handle sharing configurations. + name: Forms - description: |- Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the [Datadog-Google Cloud Platform integration](https://docs.datadoghq.com/integrations/google_cloud_platform). diff --git a/cassettes/features/v2/forms/Create-a-form-returns-OK-response.frozen b/cassettes/features/v2/forms/Create-a-form-returns-OK-response.frozen new file mode 100644 index 000000000000..094857b451bb --- /dev/null +++ b/cassettes/features/v2/forms/Create-a-form-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:02.931Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/Create-a-form-returns-OK-response.yml b/cassettes/features/v2/forms/Create-a-form-returns-OK-response.yml new file mode 100644 index 000000000000..991b6b580f89 --- /dev/null +++ b/cassettes/features/v2/forms/Create-a-form-returns-OK-response.yml @@ -0,0 +1,45 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:02 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"anonymous":false,"data_definition":{},"description":"A + form to collect user feedback.","idp_survey":false,"name":"User Feedback Form","single_response":false,"ui_definition":{}},"type":"forms"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/forms + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"edb7d6d5-e21c-4fd0-845d-679317b5c2c9","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:04.103183Z","datastore_config":{"datastore_id":"7cc8dadd-3529-4d0f-b8cb-f8c11c165867","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + form to collect user feedback.","idp_survey":false,"modified_at":"2026-06-04T18:34:04.103183Z","name":"User + Feedback Form","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354653","state":"draft","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598044,\\\"proof\\\":\\\"MGQCMHsaS9oy6ZDzhUZuJQAYiivxgo9XKx5NjTW/0wafPecXBQ3lr27bKejXr4ihAuwxsgIwPfgedZacZ4t3Qg8p0+jrXH5MBdZx9hrat8mijVibYuLUd2n+bxaY0xcghHKwbtu4\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:04.103183Z","modified_at":"2026-06-04T18:34:04.103183Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:02 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/edb7d6d5-e21c-4fd0-845d-679317b5c2c9 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"edb7d6d5-e21c-4fd0-845d-679317b5c2c9","type":"forms"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.frozen b/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.frozen new file mode 100644 index 000000000000..0add2d175dca --- /dev/null +++ b/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:04.703Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.yml b/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.yml new file mode 100644 index 000000000000..bfe43e4d6e1b --- /dev/null +++ b/cassettes/features/v2/forms/Create-and-publish-a-form-returns-OK-response.yml @@ -0,0 +1,45 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"anonymous":false,"data_definition":{},"description":"A + form to collect user feedback.","idp_survey":false,"name":"User Feedback Form","single_response":false,"ui_definition":{}},"type":"forms"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/forms/create_and_publish + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"65318f43-ac0f-4990-add8-9847eee98fd8","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:05.178222Z","datastore_config":{"datastore_id":"c89fc16a-53fb-4439-a007-1ebec095b1b7","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + form to collect user feedback.","idp_survey":false,"modified_at":"2026-06-04T18:34:05.178222Z","name":"User + Feedback Form","org_id":321813,"publication":{"id":"357922","org_id":321813,"form_id":"65318f43-ac0f-4990-add8-9847eee98fd8","publish_seq":1,"form_version":1,"created_at":"2026-06-04T18:34:05.178222Z","modified_at":"2026-06-04T18:34:05.178222Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354654","state":"frozen","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598045,\\\"proof\\\":\\\"MGYCMQCPPczYtNvj1RLjrQkIrQNHHVgB3nxFIjn5jgwUE0tweuTV1kZnaYYUg+gl1Eh5+tMCMQCajq1cy1MaWEbzHA0EcDC6LjyQ5ajqqngb3RMQwzP8ewvsh+uzkPD2v6AHjnW115o=\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:05.178222Z","modified_at":"2026-06-04T18:34:05.178222Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:04 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/65318f43-ac0f-4990-add8-9847eee98fd8 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"65318f43-ac0f-4990-add8-9847eee98fd8","type":"forms"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.frozen b/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.frozen new file mode 100644 index 000000000000..602659c5aad7 --- /dev/null +++ b/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:05.786Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.yml b/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.yml new file mode 100644 index 000000000000..5e0fc48fccce --- /dev/null +++ b/cassettes/features/v2/forms/Delete-a-form-returns-OK-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"anonymous":false,"data_definition":{},"description":"A + simple test form.","idp_survey":false,"name":"Test-Delete_a_form_returns_OK_response-1780598045","single_response":false,"ui_definition":{}},"type":"forms"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/forms + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"257a9d32-6ed0-429b-9745-75366363caf3","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:06.128238Z","datastore_config":{"datastore_id":"1e33b83f-0733-454e-9404-c032a479548e","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + simple test form.","idp_survey":false,"modified_at":"2026-06-04T18:34:06.128238Z","name":"Test-Delete_a_form_returns_OK_response-1780598045","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354655","state":"draft","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598046,\\\"proof\\\":\\\"MGQCMDR3p4Wc6qLinT0JK9tT2I3NBvYMx43pPcUuCOyMapne99sS2RJe0woOU68I0GbQvwIwQMw7OQruNsIuTNJxK0zthVCFnXaxLASIvl2NsyomT9s/p2cgEzOY4T+XyRl6i27c\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:06.128238Z","modified_at":"2026-06-04T18:34:06.128238Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/257a9d32-6ed0-429b-9745-75366363caf3 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"257a9d32-6ed0-429b-9745-75366363caf3","type":"forms"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:05 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/257a9d32-6ed0-429b-9745-75366363caf3 + response: + body: + encoding: UTF-8 + string: '{}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.frozen b/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..9e0e0d986755 --- /dev/null +++ b/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:06.925Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.yml b/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.yml new file mode 100644 index 000000000000..4b9a314e98b6 --- /dev/null +++ b/cassettes/features/v2/forms/Get-a-form-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:06 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/forms/00000000-0000-0000-0000-000000000001 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","id":"bccf11bd-13c7-4911-9c00-58c00b6f8f52","title":"form + not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/forms/Get-a-form-returns-OK-response.frozen b/cassettes/features/v2/forms/Get-a-form-returns-OK-response.frozen new file mode 100644 index 000000000000..aea0ca127d2a --- /dev/null +++ b/cassettes/features/v2/forms/Get-a-form-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:07.294Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/Get-a-form-returns-OK-response.yml b/cassettes/features/v2/forms/Get-a-form-returns-OK-response.yml new file mode 100644 index 000000000000..ff6f7a462e66 --- /dev/null +++ b/cassettes/features/v2/forms/Get-a-form-returns-OK-response.yml @@ -0,0 +1,63 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"anonymous":false,"data_definition":{},"description":"A + simple test form.","idp_survey":false,"name":"Test-Get_a_form_returns_OK_response-1780598047","single_response":false,"ui_definition":{}},"type":"forms"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/forms + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b42493d4-fbd0-4139-b4b9-4815f414621d","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:07.632566Z","datastore_config":{"datastore_id":"9aace6ce-ee9d-4c81-b176-22bed53ff080","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + simple test form.","idp_survey":false,"modified_at":"2026-06-04T18:34:07.632566Z","name":"Test-Get_a_form_returns_OK_response-1780598047","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354656","state":"draft","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598047,\\\"proof\\\":\\\"MGUCMQCkP+Usa2zK0v4SsSDBHsE4p88u025oyaRrAnNTiTXLwGr3K0W4/MAFeeosBwZonE0CMGYsqH/GAJUKeY0ZZGl8GZp2QeY1l3byimzWXRLf36CHhuB1Pshv/7bi0WoYYCOQIg==\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:07.632566Z","modified_at":"2026-06-04T18:34:07.632566Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/forms/b42493d4-fbd0-4139-b4b9-4815f414621d + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b42493d4-fbd0-4139-b4b9-4815f414621d","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:07.632566Z","datastore_config":{"datastore_id":"9aace6ce-ee9d-4c81-b176-22bed53ff080","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + simple test form.","idp_survey":false,"modified_at":"2026-06-04T18:34:07.632566Z","name":"Test-Get_a_form_returns_OK_response-1780598047","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354656","state":"draft","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598047,\\\"proof\\\":\\\"MGUCMQCkP+Usa2zK0v4SsSDBHsE4p88u025oyaRrAnNTiTXLwGr3K0W4/MAFeeosBwZonE0CMGYsqH/GAJUKeY0ZZGl8GZp2QeY1l3byimzWXRLf36CHhuB1Pshv/7bi0WoYYCOQIg==\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:07.632566Z","modified_at":"2026-06-04T18:34:07.632566Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/b42493d4-fbd0-4139-b4b9-4815f414621d + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b42493d4-fbd0-4139-b4b9-4815f414621d","type":"forms"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/forms/List-forms-returns-OK-response.frozen b/cassettes/features/v2/forms/List-forms-returns-OK-response.frozen new file mode 100644 index 000000000000..e1050a989d02 --- /dev/null +++ b/cassettes/features/v2/forms/List-forms-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-04T18:34:08.479Z \ No newline at end of file diff --git a/cassettes/features/v2/forms/List-forms-returns-OK-response.yml b/cassettes/features/v2/forms/List-forms-returns-OK-response.yml new file mode 100644 index 000000000000..9407735cd9e8 --- /dev/null +++ b/cassettes/features/v2/forms/List-forms-returns-OK-response.yml @@ -0,0 +1,67 @@ +http_interactions: +- recorded_at: Thu, 04 Jun 2026 18:34:08 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"anonymous":false,"data_definition":{},"description":"A + simple test form.","idp_survey":false,"name":"Test-List_forms_returns_OK_response-1780598048","single_response":false,"ui_definition":{}},"type":"forms"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/forms + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d71d1aef-539d-4951-b98e-ff4c0c4f97bb","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:08.937305Z","datastore_config":{"datastore_id":"76b9f7b4-99d8-4a55-b95c-260cac22820d","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + simple test form.","idp_survey":false,"modified_at":"2026-06-04T18:34:08.937305Z","name":"Test-List_forms_returns_OK_response-1780598048","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":{"id":"354657","state":"draft","version":1,"etag":"b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d","definition_signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"XOOWpRG1rFvaLHaG9qLf+GG78llET0BKnZtokyAtLfg=\\\",\\\"timestamp\\\":1780598048,\\\"proof\\\":\\\"MGUCMBSAXvYX++PAyywDBLlJsqgHq1ug3WLtMqKQRwx50qdAdj1UP1W58NnN9/DP70HavAIxANwA4guivHrOqlL36ETzde//0mI55MJ8Yv0ynU2p+QhqCSuJEHHgUUWjk0wYKJuZog==\\\"}\",\"version\":1}","data_definition":{},"ui_definition":{},"created_at":"2026-06-04T18:34:08.937305Z","modified_at":"2026-06-04T18:34:08.937305Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/forms + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"7af864d6-8c2f-41e5-b80d-1be56ea33d23","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:05:41.512876Z","datastore_config":{"datastore_id":"543a7e0e-0f0f-4b14-8911-2f20df5f1b07","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + form to collect user feedback.","idp_survey":false,"modified_at":"2026-06-04T18:05:41.512876Z","name":"User + Feedback Form","org_id":321813,"self_service":false,"single_response":false,"user_id":1445416,"user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},{"id":"b2953c07-9385-4de2-9cd3-af3f5d6c7d09","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:15:44.116619Z","datastore_config":{"datastore_id":"77b4b384-27d6-4619-bb55-1b2158d0080b","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + form to collect user feedback.","idp_survey":false,"modified_at":"2026-06-04T18:15:44.116619Z","name":"User + Feedback Form","org_id":321813,"self_service":false,"single_response":false,"user_id":1445416,"user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},{"id":"d71d1aef-539d-4951-b98e-ff4c0c4f97bb","type":"forms","attributes":{"active":true,"anonymous":false,"created_at":"2026-06-04T18:34:08.937305Z","datastore_config":{"datastore_id":"76b9f7b4-99d8-4a55-b95c-260cac22820d","primary_column_name":"id","primary_key_generation_strategy":"none"},"description":"A + simple test form.","idp_survey":false,"modified_at":"2026-06-04T18:34:08.937305Z","name":"Test-List_forms_returns_OK_response-1780598048","org_id":321813,"self_service":false,"single_response":false,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 04 Jun 2026 18:34:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/forms/d71d1aef-539d-4951-b98e-ff4c0c4f97bb + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d71d1aef-539d-4951-b98e-ff4c0c4f97bb","type":"forms"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/forms/CreateAndPublishForm.rb b/examples/v2/forms/CreateAndPublishForm.rb new file mode 100644 index 000000000000..b8e70adcac46 --- /dev/null +++ b/examples/v2/forms/CreateAndPublishForm.rb @@ -0,0 +1,23 @@ +# Create and publish a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_and_publish_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::CreateFormRequest.new({ + data: DatadogAPIClient::V2::CreateFormData.new({ + attributes: DatadogAPIClient::V2::CreateFormDataAttributes.new({ + anonymous: false, + data_definition: DatadogAPIClient::V2::FormDataDefinition.new({}), + description: "A form to collect user feedback.", + idp_survey: false, + name: "User Feedback Form", + single_response: false, + ui_definition: DatadogAPIClient::V2::FormUiDefinition.new({}), + }), + type: DatadogAPIClient::V2::FormType::FORMS, + }), +}) +p api_instance.create_and_publish_form(body) diff --git a/examples/v2/forms/CreateForm.rb b/examples/v2/forms/CreateForm.rb new file mode 100644 index 000000000000..ddfab5c92440 --- /dev/null +++ b/examples/v2/forms/CreateForm.rb @@ -0,0 +1,23 @@ +# Create a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::CreateFormRequest.new({ + data: DatadogAPIClient::V2::CreateFormData.new({ + attributes: DatadogAPIClient::V2::CreateFormDataAttributes.new({ + anonymous: false, + data_definition: DatadogAPIClient::V2::FormDataDefinition.new({}), + description: "A form to collect user feedback.", + idp_survey: false, + name: "User Feedback Form", + single_response: false, + ui_definition: DatadogAPIClient::V2::FormUiDefinition.new({}), + }), + type: DatadogAPIClient::V2::FormType::FORMS, + }), +}) +p api_instance.create_form(body) diff --git a/examples/v2/forms/DeleteForm.rb b/examples/v2/forms/DeleteForm.rb new file mode 100644 index 000000000000..d2a05dce5c71 --- /dev/null +++ b/examples/v2/forms/DeleteForm.rb @@ -0,0 +1,11 @@ +# Delete a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +# there is a valid "form" in the system +FORM_DATA_ID = ENV["FORM_DATA_ID"] +p api_instance.delete_form(FORM_DATA_ID) diff --git a/examples/v2/forms/GetForm.rb b/examples/v2/forms/GetForm.rb new file mode 100644 index 000000000000..a675fe08c601 --- /dev/null +++ b/examples/v2/forms/GetForm.rb @@ -0,0 +1,11 @@ +# Get a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +# there is a valid "form" in the system +FORM_DATA_ID = ENV["FORM_DATA_ID"] +p api_instance.get_form(FORM_DATA_ID) diff --git a/examples/v2/forms/ListForms.rb b/examples/v2/forms/ListForms.rb new file mode 100644 index 000000000000..70ab9a7b0110 --- /dev/null +++ b/examples/v2/forms/ListForms.rb @@ -0,0 +1,8 @@ +# List forms returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_forms".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.list_forms() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index bbeab390b23f..9707cb7577db 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3170,6 +3170,19 @@ "v2.UnarchiveFeatureFlag" => { "feature_flag_id" => "UUID", }, + "v2.CreateForm" => { + "body" => "CreateFormRequest", + }, + "v2.CreateAndPublishForm" => { + "body" => "CreateFormRequest", + }, + "v2.DeleteForm" => { + "form_id" => "UUID", + }, + "v2.GetForm" => { + "form_id" => "UUID", + "version" => "String", + }, "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, diff --git a/features/v2/forms.feature b/features/v2/forms.feature new file mode 100644 index 000000000000..40823edbc0f2 --- /dev/null +++ b/features/v2/forms.feature @@ -0,0 +1,107 @@ +@endpoint(forms) @endpoint(forms-v2) +Feature: Forms + The Datadog Forms API lets you create and manage forms within the App + Builder platform. You can configure form settings, manage versions, + publish forms, and handle sharing configurations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Forms" API + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a form returns "Bad Request" response + Given operation "CreateForm" enabled + And new "CreateForm" request + And body with value {"data": {"attributes": {"anonymous": false, "data_definition": {"description": "Welcome to the Engineering Experience Survey.", "required": [], "title": "Developer Experience Survey", "type": "object"}, "description": "A form to collect user feedback.", "idp_survey": false, "name": "User Feedback Form", "single_response": false, "ui_definition": {"ui:order": [], "ui:theme": {"primaryColor": "gray"}}}, "type": "forms"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Create a form returns "OK" response + Given operation "CreateForm" enabled + And new "CreateForm" request + And body with value {"data": {"attributes": {"anonymous": false, "data_definition": {}, "description": "A form to collect user feedback.", "idp_survey": false, "name": "User Feedback Form", "single_response": false, "ui_definition": {}}, "type": "forms"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create and publish a form returns "Bad Request" response + Given operation "CreateAndPublishForm" enabled + And new "CreateAndPublishForm" request + And body with value {"data": {"attributes": {"anonymous": false, "data_definition": {"description": "Welcome to the Engineering Experience Survey.", "required": [], "title": "Developer Experience Survey", "type": "object"}, "description": "A form to collect user feedback.", "idp_survey": false, "name": "User Feedback Form", "single_response": false, "ui_definition": {"ui:order": [], "ui:theme": {"primaryColor": "gray"}}}, "type": "forms"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Create and publish a form returns "OK" response + Given operation "CreateAndPublishForm" enabled + And new "CreateAndPublishForm" request + And body with value {"data": {"attributes": {"anonymous": false, "data_definition": {}, "description": "A form to collect user feedback.", "idp_survey": false, "name": "User Feedback Form", "single_response": false, "ui_definition": {}}, "type": "forms"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Delete a form returns "Bad Request" response + Given operation "DeleteForm" enabled + And new "DeleteForm" request + And request contains "form_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Delete a form returns "OK" response + Given operation "DeleteForm" enabled + And there is a valid "form" in the system + And new "DeleteForm" request + And request contains "form_id" parameter from "form.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "form.data.id" + And the response "data.type" is equal to "forms" + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Get a form returns "Bad Request" response + Given operation "GetForm" enabled + And new "GetForm" request + And request contains "form_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Get a form returns "Not Found" response + Given operation "GetForm" enabled + And new "GetForm" request + And request contains "form_id" parameter with value "00000000-0000-0000-0000-000000000001" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/app-builder-backend + Scenario: Get a form returns "OK" response + Given operation "GetForm" enabled + And there is a valid "form" in the system + And new "GetForm" request + And request contains "form_id" parameter from "form.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "form.data.id" + And the response "data.type" is equal to "forms" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List forms returns "Bad Request" response + Given operation "ListForms" enabled + And new "ListForms" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: List forms returns "OK" response + Given operation "ListForms" enabled + And there is a valid "form" in the system + And new "ListForms" request + When the request is sent + Then the response status is 200 OK + And the response "data" has item with field "id" with value "{{ form.data.id }}" + And the response "data" has item with field "type" with value "forms" + And the response "data" has item with field "attributes.name" with value "{{ unique }}" diff --git a/features/v2/given.json b/features/v2/given.json index 0e1e956697de..0a6db71d718c 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -498,6 +498,30 @@ "tag": "Feature Flags", "operationId": "UpdateAllocationsForFeatureFlagInEnvironment" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"forms\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"description\": \"A simple test form.\",\n \"anonymous\": false,\n \"single_response\": false,\n \"idp_survey\": false,\n \"data_definition\": {},\n \"ui_definition\": {}\n }\n }\n}" + } + ], + "step": "there is a valid \"form\" in the system", + "key": "form", + "tag": "Forms", + "operationId": "CreateForm" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"forms\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"description\": \"A simple test form.\",\n \"anonymous\": false,\n \"single_response\": false,\n \"idp_survey\": false,\n \"data_definition\": {},\n \"ui_definition\": {}\n }\n }\n}" + } + ], + "step": "there is a valid \"form_published\" in the system", + "key": "form_published", + "tag": "Forms", + "operationId": "CreateAndPublishForm" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 8d4818a76334..811e650c25b9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2669,6 +2669,50 @@ "type": "unsafe" } }, + "ListForms": { + "tag": "Forms", + "undo": { + "type": "safe" + } + }, + "CreateForm": { + "tag": "Forms", + "undo": { + "operationId": "DeleteForm", + "parameters": [ + { + "name": "form_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateAndPublishForm": { + "tag": "Forms", + "undo": { + "operationId": "DeleteForm", + "parameters": [ + { + "name": "form_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteForm": { + "tag": "Forms", + "undo": { + "type": "idempotent" + } + }, + "GetForm": { + "tag": "Forms", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 641827571e54..1323e5b92ec1 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -442,6 +442,11 @@ def initialize "v2.trigger_deployment_gates_evaluation": false, "v2.update_deployment_gate": false, "v2.update_deployment_rule": false, + "v2.create_and_publish_form": false, + "v2.create_form": false, + "v2.delete_form": false, + "v2.get_form": false, + "v2.list_forms": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, "v2.delete_entity_integration_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 59d527335595..93b0106d173c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2412,6 +2412,9 @@ def overrides "v2.create_feature_flag_data" => "CreateFeatureFlagData", "v2.create_feature_flag_data_type" => "CreateFeatureFlagDataType", "v2.create_feature_flag_request" => "CreateFeatureFlagRequest", + "v2.create_form_data" => "CreateFormData", + "v2.create_form_data_attributes" => "CreateFormDataAttributes", + "v2.create_form_request" => "CreateFormRequest", "v2.create_incident_notification_rule_request" => "CreateIncidentNotificationRuleRequest", "v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest", "v2.create_jira_issue_request_array" => "CreateJiraIssueRequestArray", @@ -2772,6 +2775,8 @@ def overrides "v2.deleted_tests_request_type" => "DeletedTestsRequestType", "v2.deleted_tests_response" => "DeletedTestsResponse", "v2.deleted_tests_response_type" => "DeletedTestsResponseType", + "v2.delete_form_data" => "DeleteFormData", + "v2.delete_form_response" => "DeleteFormResponse", "v2.dependency_location" => "DependencyLocation", "v2.deployment" => "Deployment", "v2.deployment_attributes" => "DeploymentAttributes", @@ -3246,9 +3251,23 @@ def overrides "v2.fleet_tracers_response_meta" => "FleetTracersResponseMeta", "v2.flutter_sourcemap_attributes" => "FlutterSourcemapAttributes", "v2.flutter_sourcemap_data" => "FlutterSourcemapData", + "v2.form_data" => "FormData", + "v2.form_data_attributes" => "FormDataAttributes", + "v2.form_data_definition" => "FormDataDefinition", + "v2.form_data_definition_type" => "FormDataDefinitionType", + "v2.form_datastore_config_attributes" => "FormDatastoreConfigAttributes", + "v2.form_publication_attributes" => "FormPublicationAttributes", + "v2.form_response" => "FormResponse", + "v2.forms_response" => "FormsResponse", "v2.form_trigger" => "FormTrigger", "v2.form_trigger_wrapper" => "FormTriggerWrapper", + "v2.form_type" => "FormType", + "v2.form_ui_definition" => "FormUiDefinition", + "v2.form_ui_definition_ui_theme" => "FormUiDefinitionUiTheme", + "v2.form_ui_definition_ui_theme_primary_color" => "FormUiDefinitionUiThemePrimaryColor", "v2.formula_limit" => "FormulaLimit", + "v2.form_version_attributes" => "FormVersionAttributes", + "v2.form_version_state" => "FormVersionState", "v2.framework_handle_and_version_response_data" => "FrameworkHandleAndVersionResponseData", "v2.freshservice_api_key" => "FreshserviceAPIKey", "v2.freshservice_api_key_type" => "FreshserviceAPIKeyType", @@ -7552,6 +7571,7 @@ def overrides "v2.fastly_integration_api" => "FastlyIntegrationAPI", "v2.feature_flags_api" => "FeatureFlagsAPI", "v2.fleet_automation_api" => "FleetAutomationAPI", + "v2.forms_api" => "FormsAPI", "v2.gcp_integration_api" => "GCPIntegrationAPI", "v2.google_chat_integration_api" => "GoogleChatIntegrationAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", diff --git a/lib/datadog_api_client/v2/api/forms_api.rb b/lib/datadog_api_client/v2/api/forms_api.rb new file mode 100644 index 000000000000..dd0778bbefba --- /dev/null +++ b/lib/datadog_api_client/v2/api/forms_api.rb @@ -0,0 +1,382 @@ +=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 FormsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create and publish a form. + # + # @see #create_and_publish_form_with_http_info + def create_and_publish_form(body, opts = {}) + data, _status_code, _headers = create_and_publish_form_with_http_info(body, opts) + data + end + + # Create and publish a form. + # + # Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form. + # + # @param body [CreateFormRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def create_and_publish_form_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_and_publish_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_and_publish_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_and_publish_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.create_and_publish_form ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.create_and_publish_form" + end + # resource path + local_var_path = '/api/v2/forms/create_and_publish' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_and_publish_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#create_and_publish_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a form. + # + # @see #create_form_with_http_info + def create_form(body, opts = {}) + data, _status_code, _headers = create_form_with_http_info(body, opts) + data + end + + # Create a form. + # + # Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form. + # + # @param body [CreateFormRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def create_form_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.create_form ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.create_form" + end + # resource path + local_var_path = '/api/v2/forms' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#create_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a form. + # + # @see #delete_form_with_http_info + def delete_form(form_id, opts = {}) + data, _status_code, _headers = delete_form_with_http_info(form_id, opts) + data + end + + # Delete a form. + # + # Delete a form by its ID. This will also try to delete the associated datastore. + # + # @param form_id [UUID] The ID of the form. + # @param opts [Hash] the optional parameters + # @return [Array<(DeleteFormResponse, Integer, Hash)>] DeleteFormResponse data, response status code and response headers + def delete_form_with_http_info(form_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.delete_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.delete_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeleteFormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#delete_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a form. + # + # @see #get_form_with_http_info + def get_form(form_id, opts = {}) + data, _status_code, _headers = get_form_with_http_info(form_id, opts) + data + end + + # Get a form. + # + # Get a form definition by its ID. + # + # @param form_id [UUID] The ID of the form. + # @param opts [Hash] the optional parameters + # @option opts [String] :version The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number. + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def get_form_with_http_info(form_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.get_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.get_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = opts[:'version'] if !opts[:'version'].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] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_form, + :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: FormsAPI#get_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List forms. + # + # @see #list_forms_with_http_info + def list_forms(opts = {}) + data, _status_code, _headers = list_forms_with_http_info(opts) + data + end + + # List forms. + # + # Get all forms for the authenticated user's organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(FormsResponse, Integer, Hash)>] FormsResponse data, response status code and response headers + def list_forms_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_forms".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_forms") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_forms")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.list_forms ...' + end + # resource path + local_var_path = '/api/v2/forms' + + # 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] || 'FormsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_forms, + :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: FormsAPI#list_forms\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/create_form_data.rb b/lib/datadog_api_client/v2/models/create_form_data.rb new file mode 100644 index 000000000000..f1a2514c95ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_form_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data for creating a form. + class CreateFormData + include BaseGenericModel + + # The attributes for creating a form. + attr_reader :attributes + + # The resource type for a form. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateFormDataAttributes', + :'type' => :'FormType' + } + 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::CreateFormData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_form_data_attributes.rb b/lib/datadog_api_client/v2/models/create_form_data_attributes.rb new file mode 100644 index 000000000000..638170fc8618 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_form_data_attributes.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes for creating a form. + class CreateFormDataAttributes + include BaseGenericModel + + # Whether the form accepts anonymous submissions. + attr_accessor :anonymous + + # A JSON Schema definition that describes the form's data fields. + attr_reader :data_definition + + # The description of the form. + attr_accessor :description + + # Whether the form is an IDP survey. + attr_accessor :idp_survey + + # The name of the form. + attr_reader :name + + # Whether each user can only submit one response. + attr_accessor :single_response + + # UI configuration for rendering form fields, including widget overrides, field ordering, and themes. + attr_reader :ui_definition + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'anonymous' => :'anonymous', + :'data_definition' => :'data_definition', + :'description' => :'description', + :'idp_survey' => :'idp_survey', + :'name' => :'name', + :'single_response' => :'single_response', + :'ui_definition' => :'ui_definition' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'anonymous' => :'Boolean', + :'data_definition' => :'FormDataDefinition', + :'description' => :'String', + :'idp_survey' => :'Boolean', + :'name' => :'String', + :'single_response' => :'Boolean', + :'ui_definition' => :'FormUiDefinition' + } + 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::CreateFormDataAttributes` 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?(:'anonymous') + self.anonymous = attributes[:'anonymous'] + end + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'idp_survey') + self.idp_survey = attributes[:'idp_survey'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'single_response') + self.single_response = attributes[:'single_response'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + 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_definition.nil? + return false if @name.nil? + return false if @ui_definition.nil? + true + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + 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 ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + 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 && + anonymous == o.anonymous && + data_definition == o.data_definition && + description == o.description && + idp_survey == o.idp_survey && + name == o.name && + single_response == o.single_response && + ui_definition == o.ui_definition && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [anonymous, data_definition, description, idp_survey, name, single_response, ui_definition, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_form_request.rb b/lib/datadog_api_client/v2/models/create_form_request.rb new file mode 100644 index 000000000000..928db2abc4c4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_form_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to create a form. + class CreateFormRequest + include BaseGenericModel + + # The data for creating a form. + 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' => :'CreateFormData' + } + 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::CreateFormRequest` 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/delete_form_data.rb b/lib/datadog_api_client/v2/models/delete_form_data.rb new file mode 100644 index 000000000000..8dea9862b835 --- /dev/null +++ b/lib/datadog_api_client/v2/models/delete_form_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data returned when a form is deleted. + class DeleteFormData + include BaseGenericModel + + # The ID of the deleted form. + attr_reader :id + + # The resource type for a form. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'FormType' + } + 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::DeleteFormData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param 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 && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/delete_form_response.rb b/lib/datadog_api_client/v2/models/delete_form_response.rb new file mode 100644 index 000000000000..ed148fdcbba4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/delete_form_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A response returned after deleting a form. + class DeleteFormResponse + include BaseGenericModel + + # The data returned when a form is deleted. + 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' => :'DeleteFormData' + } + 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::DeleteFormResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data.rb b/lib/datadog_api_client/v2/models/form_data.rb new file mode 100644 index 000000000000..e6436cd4fbf6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_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 form resource object. + class FormData + include BaseGenericModel + + # The attributes of a form. + attr_reader :attributes + + # The ID of the form. + attr_reader :id + + # The resource type for a form. + 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' => :'FormDataAttributes', + :'id' => :'UUID', + :'type' => :'FormType' + } + 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::FormData` 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/form_data_attributes.rb b/lib/datadog_api_client/v2/models/form_data_attributes.rb new file mode 100644 index 000000000000..e0268bb42330 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_attributes.rb @@ -0,0 +1,424 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a form. + class FormDataAttributes + include BaseGenericModel + + # Whether the form is currently active. + attr_reader :active + + # Whether the form accepts anonymous submissions. + attr_reader :anonymous + + # The time at which the form was created. + attr_reader :created_at + + # The datastore configuration for a form. + attr_reader :datastore_config + + # The description of the form. + attr_reader :description + + # The date and time at which the form stops accepting responses. + attr_accessor :end_date + + # Whether the current user has already submitted this form. Only present for forms with `single_response` set to `true`. + attr_accessor :has_submitted + + # Whether the form is an IDP survey. + attr_reader :idp_survey + + # The time at which the form was last modified. + attr_reader :modified_at + + # The name of the form. + attr_reader :name + + # The ID of the organization that owns this form. + attr_reader :org_id + + # The attributes of a form publication. + attr_accessor :publication + + # Whether the form is available in the self-service catalog. + attr_reader :self_service + + # Whether each user can only submit one response. + attr_reader :single_response + + # The ID of the user who created this form. + attr_reader :user_id + + # The UUID of the user who created this form. + attr_reader :user_uuid + + # The attributes of a form version. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'active' => :'active', + :'anonymous' => :'anonymous', + :'created_at' => :'created_at', + :'datastore_config' => :'datastore_config', + :'description' => :'description', + :'end_date' => :'end_date', + :'has_submitted' => :'has_submitted', + :'idp_survey' => :'idp_survey', + :'modified_at' => :'modified_at', + :'name' => :'name', + :'org_id' => :'org_id', + :'publication' => :'publication', + :'self_service' => :'self_service', + :'single_response' => :'single_response', + :'user_id' => :'user_id', + :'user_uuid' => :'user_uuid', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'active' => :'Boolean', + :'anonymous' => :'Boolean', + :'created_at' => :'Time', + :'datastore_config' => :'FormDatastoreConfigAttributes', + :'description' => :'String', + :'end_date' => :'Time', + :'has_submitted' => :'Boolean', + :'idp_survey' => :'Boolean', + :'modified_at' => :'Time', + :'name' => :'String', + :'org_id' => :'Integer', + :'publication' => :'FormPublicationAttributes', + :'self_service' => :'Boolean', + :'single_response' => :'Boolean', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID', + :'version' => :'FormVersionAttributes' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'end_date', + :'has_submitted', + ]) + 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::FormDataAttributes` 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?(:'active') + self.active = attributes[:'active'] + end + + if attributes.key?(:'anonymous') + self.anonymous = attributes[:'anonymous'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'datastore_config') + self.datastore_config = attributes[:'datastore_config'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + + if attributes.key?(:'has_submitted') + self.has_submitted = attributes[:'has_submitted'] + end + + if attributes.key?(:'idp_survey') + self.idp_survey = attributes[:'idp_survey'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'publication') + self.publication = attributes[:'publication'] + end + + if attributes.key?(:'self_service') + self.self_service = attributes[:'self_service'] + end + + if attributes.key?(:'single_response') + self.single_response = attributes[:'single_response'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @active.nil? + return false if @anonymous.nil? + return false if @created_at.nil? + return false if @datastore_config.nil? + return false if @description.nil? + return false if @idp_survey.nil? + return false if @modified_at.nil? + return false if @name.nil? + return false if @org_id.nil? + return false if @self_service.nil? + return false if @single_response.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param active [Object] Object to be assigned + # @!visibility private + def active=(active) + if active.nil? + fail ArgumentError, 'invalid value for "active", active cannot be nil.' + end + @active = active + end + + # Custom attribute writer method with validation + # @param anonymous [Object] Object to be assigned + # @!visibility private + def anonymous=(anonymous) + if anonymous.nil? + fail ArgumentError, 'invalid value for "anonymous", anonymous cannot be nil.' + end + @anonymous = anonymous + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param datastore_config [Object] Object to be assigned + # @!visibility private + def datastore_config=(datastore_config) + if datastore_config.nil? + fail ArgumentError, 'invalid value for "datastore_config", datastore_config cannot be nil.' + end + @datastore_config = datastore_config + 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 idp_survey [Object] Object to be assigned + # @!visibility private + def idp_survey=(idp_survey) + if idp_survey.nil? + fail ArgumentError, 'invalid value for "idp_survey", idp_survey cannot be nil.' + end + @idp_survey = idp_survey + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + 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 org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param self_service [Object] Object to be assigned + # @!visibility private + def self_service=(self_service) + if self_service.nil? + fail ArgumentError, 'invalid value for "self_service", self_service cannot be nil.' + end + @self_service = self_service + end + + # Custom attribute writer method with validation + # @param single_response [Object] Object to be assigned + # @!visibility private + def single_response=(single_response) + if single_response.nil? + fail ArgumentError, 'invalid value for "single_response", single_response cannot be nil.' + end + @single_response = single_response + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + 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 && + active == o.active && + anonymous == o.anonymous && + created_at == o.created_at && + datastore_config == o.datastore_config && + description == o.description && + end_date == o.end_date && + has_submitted == o.has_submitted && + idp_survey == o.idp_survey && + modified_at == o.modified_at && + name == o.name && + org_id == o.org_id && + publication == o.publication && + self_service == o.self_service && + single_response == o.single_response && + user_id == o.user_id && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [active, anonymous, created_at, datastore_config, description, end_date, has_submitted, idp_survey, modified_at, name, org_id, publication, self_service, single_response, user_id, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_definition.rb b/lib/datadog_api_client/v2/models/form_data_definition.rb new file mode 100644 index 000000000000..657601c32056 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_definition.rb @@ -0,0 +1,147 @@ +=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 JSON Schema definition that describes the form's data fields. + class FormDataDefinition + include BaseGenericModel + + # A description shown to form respondents. + attr_accessor :description + + # A map of field names to their JSON Schema definitions. + attr_accessor :properties + + # List of field names that must be answered. + attr_accessor :required + + # The title of the form schema. + attr_accessor :title + + # The root schema type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'properties' => :'properties', + :'required' => :'required', + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'properties' => :'Hash', + :'required' => :'Array', + :'title' => :'String', + :'type' => :'FormDataDefinitionType' + } + 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::FormDataDefinition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'required') + if (value = attributes[:'required']).is_a?(Array) + self.required = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + properties == o.properties && + required == o.required && + title == o.title && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, properties, required, title, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_definition_type.rb b/lib/datadog_api_client/v2/models/form_data_definition_type.rb new file mode 100644 index 000000000000..c156933c01b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_definition_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 root schema type. + class FormDataDefinitionType + include BaseEnumModel + + OBJECT = "object".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_datastore_config_attributes.rb b/lib/datadog_api_client/v2/models/form_datastore_config_attributes.rb new file mode 100644 index 000000000000..f02da814a099 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_datastore_config_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The datastore configuration for a form. + class FormDatastoreConfigAttributes + include BaseGenericModel + + # The ID of the datastore. + attr_reader :datastore_id + + # The name of the primary column in the datastore. + attr_reader :primary_column_name + + # The strategy used to generate primary keys in the datastore. + attr_reader :primary_key_generation_strategy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'datastore_id' => :'datastore_id', + :'primary_column_name' => :'primary_column_name', + :'primary_key_generation_strategy' => :'primary_key_generation_strategy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'datastore_id' => :'UUID', + :'primary_column_name' => :'String', + :'primary_key_generation_strategy' => :'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::FormDatastoreConfigAttributes` 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?(:'datastore_id') + self.datastore_id = attributes[:'datastore_id'] + end + + if attributes.key?(:'primary_column_name') + self.primary_column_name = attributes[:'primary_column_name'] + end + + if attributes.key?(:'primary_key_generation_strategy') + self.primary_key_generation_strategy = attributes[:'primary_key_generation_strategy'] + 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 @datastore_id.nil? + return false if @primary_column_name.nil? + return false if @primary_key_generation_strategy.nil? + true + end + + # Custom attribute writer method with validation + # @param datastore_id [Object] Object to be assigned + # @!visibility private + def datastore_id=(datastore_id) + if datastore_id.nil? + fail ArgumentError, 'invalid value for "datastore_id", datastore_id cannot be nil.' + end + @datastore_id = datastore_id + end + + # Custom attribute writer method with validation + # @param primary_column_name [Object] Object to be assigned + # @!visibility private + def primary_column_name=(primary_column_name) + if primary_column_name.nil? + fail ArgumentError, 'invalid value for "primary_column_name", primary_column_name cannot be nil.' + end + @primary_column_name = primary_column_name + end + + # Custom attribute writer method with validation + # @param primary_key_generation_strategy [Object] Object to be assigned + # @!visibility private + def primary_key_generation_strategy=(primary_key_generation_strategy) + if primary_key_generation_strategy.nil? + fail ArgumentError, 'invalid value for "primary_key_generation_strategy", primary_key_generation_strategy cannot be nil.' + end + @primary_key_generation_strategy = primary_key_generation_strategy + 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 && + datastore_id == o.datastore_id && + primary_column_name == o.primary_column_name && + primary_key_generation_strategy == o.primary_key_generation_strategy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [datastore_id, primary_column_name, primary_key_generation_strategy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_attributes.rb b/lib/datadog_api_client/v2/models/form_publication_attributes.rb new file mode 100644 index 000000000000..be411c0909d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_attributes.rb @@ -0,0 +1,280 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a form publication. + class FormPublicationAttributes + include BaseGenericModel + + # The time at which the publication was created. + attr_reader :created_at + + # The ID of the form. + attr_reader :form_id + + # The version number that was published. + attr_reader :form_version + + # The ID of the form publication. + attr_accessor :id + + # The time at which the publication was last modified. + attr_reader :modified_at + + # The ID of the organization that owns this publication. + attr_reader :org_id + + # The sequential publication number for this form. + attr_reader :publish_seq + + # The ID of the user who created this publication. + attr_reader :user_id + + # The UUID of the user who created this publication. + attr_reader :user_uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'form_id' => :'form_id', + :'form_version' => :'form_version', + :'id' => :'id', + :'modified_at' => :'modified_at', + :'org_id' => :'org_id', + :'publish_seq' => :'publish_seq', + :'user_id' => :'user_id', + :'user_uuid' => :'user_uuid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'form_id' => :'UUID', + :'form_version' => :'Integer', + :'id' => :'String', + :'modified_at' => :'Time', + :'org_id' => :'Integer', + :'publish_seq' => :'Integer', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID' + } + 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::FormPublicationAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'form_id') + self.form_id = attributes[:'form_id'] + end + + if attributes.key?(:'form_version') + self.form_version = attributes[:'form_version'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'publish_seq') + self.publish_seq = attributes[:'publish_seq'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + 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 @created_at.nil? + return false if @form_id.nil? + return false if @form_version.nil? + return false if @modified_at.nil? + return false if @org_id.nil? + return false if @publish_seq.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param form_id [Object] Object to be assigned + # @!visibility private + def form_id=(form_id) + if form_id.nil? + fail ArgumentError, 'invalid value for "form_id", form_id cannot be nil.' + end + @form_id = form_id + end + + # Custom attribute writer method with validation + # @param form_version [Object] Object to be assigned + # @!visibility private + def form_version=(form_version) + if form_version.nil? + fail ArgumentError, 'invalid value for "form_version", form_version cannot be nil.' + end + @form_version = form_version + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param publish_seq [Object] Object to be assigned + # @!visibility private + def publish_seq=(publish_seq) + if publish_seq.nil? + fail ArgumentError, 'invalid value for "publish_seq", publish_seq cannot be nil.' + end + @publish_seq = publish_seq + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + form_id == o.form_id && + form_version == o.form_version && + id == o.id && + modified_at == o.modified_at && + org_id == o.org_id && + publish_seq == o.publish_seq && + user_id == o.user_id && + user_uuid == o.user_uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, form_id, form_version, id, modified_at, org_id, publish_seq, user_id, user_uuid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_response.rb b/lib/datadog_api_client/v2/models/form_response.rb new file mode 100644 index 000000000000..3d2c1d1eed25 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_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 + # A response containing a single form. + class FormResponse + include BaseGenericModel + + # A form resource object. + 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' => :'FormData' + } + 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::FormResponse` 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/form_type.rb b/lib/datadog_api_client/v2/models/form_type.rb new file mode 100644 index 000000000000..d3c58d1c9874 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for a form. + class FormType + include BaseEnumModel + + FORMS = "forms".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_ui_definition.rb b/lib/datadog_api_client/v2/models/form_ui_definition.rb new file mode 100644 index 000000000000..70d05c74c177 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_ui_definition.rb @@ -0,0 +1,117 @@ +=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 + # UI configuration for rendering form fields, including widget overrides, field ordering, and themes. + class FormUiDefinition + include BaseGenericModel + + # The order in which form fields are displayed. + attr_accessor :ui_order + + # The visual theme applied to the form. + attr_accessor :ui_theme + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ui_order' => :'ui:order', + :'ui_theme' => :'ui:theme' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ui_order' => :'Array', + :'ui_theme' => :'FormUiDefinitionUiTheme' + } + 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::FormUiDefinition` 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?(:'ui_order') + if (value = attributes[:'ui_order']).is_a?(Array) + self.ui_order = value + end + end + + if attributes.key?(:'ui_theme') + self.ui_theme = attributes[:'ui_theme'] + 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 && + ui_order == o.ui_order && + ui_theme == o.ui_theme && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ui_order, ui_theme, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme.rb b/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme.rb new file mode 100644 index 000000000000..4c036f25068e --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The visual theme applied to the form. + class FormUiDefinitionUiTheme + include BaseGenericModel + + # The primary color of the form theme. + attr_accessor :primary_color + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'primary_color' => :'primaryColor' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'primary_color' => :'FormUiDefinitionUiThemePrimaryColor' + } + 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::FormUiDefinitionUiTheme` 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?(:'primary_color') + self.primary_color = attributes[:'primary_color'] + 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 && + primary_color == o.primary_color && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [primary_color, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme_primary_color.rb b/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme_primary_color.rb new file mode 100644 index 000000000000..d8e85b9a3759 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_ui_definition_ui_theme_primary_color.rb @@ -0,0 +1,34 @@ +=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 primary color of the form theme. + class FormUiDefinitionUiThemePrimaryColor + include BaseEnumModel + + GRAY = "gray".freeze + RED = "red".freeze + ORANGE = "orange".freeze + YELLOW = "yellow".freeze + GREEN = "green".freeze + LIGHT_BLUE = "light-blue".freeze + DARK_BLUE = "dark-blue".freeze + MAGENTA = "magenta".freeze + INDIGO = "indigo".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_attributes.rb b/lib/datadog_api_client/v2/models/form_version_attributes.rb new file mode 100644 index 000000000000..da7e67b49850 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_attributes.rb @@ -0,0 +1,319 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a form version. + class FormVersionAttributes + include BaseGenericModel + + # The time at which the version was created. + attr_reader :created_at + + # A JSON Schema definition that describes the form's data fields. + attr_reader :data_definition + + # The signature of the version definition. + attr_reader :definition_signature + + # The ETag for optimistic concurrency control. + attr_accessor :etag + + # The ID of the form version. + attr_accessor :id + + # The time at which the version was last modified. + attr_reader :modified_at + + # The state of a form version. + attr_reader :state + + # UI configuration for rendering form fields, including widget overrides, field ordering, and themes. + attr_reader :ui_definition + + # The ID of the user who created this version. + attr_reader :user_id + + # The UUID of the user who created this version. + attr_reader :user_uuid + + # The sequential version number. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'data_definition' => :'data_definition', + :'definition_signature' => :'definition_signature', + :'etag' => :'etag', + :'id' => :'id', + :'modified_at' => :'modified_at', + :'state' => :'state', + :'ui_definition' => :'ui_definition', + :'user_id' => :'user_id', + :'user_uuid' => :'user_uuid', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'data_definition' => :'FormDataDefinition', + :'definition_signature' => :'String', + :'etag' => :'String', + :'id' => :'String', + :'modified_at' => :'Time', + :'state' => :'FormVersionState', + :'ui_definition' => :'FormUiDefinition', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID', + :'version' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'etag', + ]) + 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::FormVersionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'definition_signature') + self.definition_signature = attributes[:'definition_signature'] + end + + if attributes.key?(:'etag') + self.etag = attributes[:'etag'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @created_at.nil? + return false if @data_definition.nil? + return false if @definition_signature.nil? + return false if @modified_at.nil? + return false if @state.nil? + return false if @ui_definition.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + end + + # Custom attribute writer method with validation + # @param definition_signature [Object] Object to be assigned + # @!visibility private + def definition_signature=(definition_signature) + if definition_signature.nil? + fail ArgumentError, 'invalid value for "definition_signature", definition_signature cannot be nil.' + end + @definition_signature = definition_signature + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Custom attribute writer method with validation + # @param ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + data_definition == o.data_definition && + definition_signature == o.definition_signature && + etag == o.etag && + id == o.id && + modified_at == o.modified_at && + state == o.state && + ui_definition == o.ui_definition && + user_id == o.user_id && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, data_definition, definition_signature, etag, id, modified_at, state, ui_definition, user_id, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_state.rb b/lib/datadog_api_client/v2/models/form_version_state.rb new file mode 100644 index 000000000000..a9ea3cc34888 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_state.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The state of a form version. + class FormVersionState + include BaseEnumModel + + DRAFT = "draft".freeze + FROZEN = "frozen".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/forms_response.rb b/lib/datadog_api_client/v2/models/forms_response.rb new file mode 100644 index 000000000000..69c8983c39af --- /dev/null +++ b/lib/datadog_api_client/v2/models/forms_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 + # A response containing a list of forms. + class FormsResponse + include BaseGenericModel + + # A list of form resource objects. + 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::FormsResponse` 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