From c487d5cf4db42eb59cf66117d3175abf54485213 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 23 Oct 2025 11:33:31 +0000 Subject: [PATCH] Regenerate client from commit e118b2e of spec repo --- .generator/schemas/v2/openapi.yaml | 422 ++++++++++++++++++ .../fleet-automation/CancelFleetDeployment.rb | 8 + .../CreateFleetDeploymentConfigure.rb | 26 ++ .../v2/fleet-automation/GetFleetDeployment.rb | 11 + .../fleet-automation/ListFleetDeployments.rb | 8 + features/scenarios_model_mapping.rb | 13 + features/v2/fleet_automation.feature | 89 ++++ features/v2/given.json | 13 + features/v2/undo.json | 31 ++ lib/datadog_api_client/configuration.rb | 4 + lib/datadog_api_client/inflector.rb | 13 + .../v2/api/fleet_automation_api.rb | 318 +++++++++++++ .../v2/models/fleet_deployment.rb | 165 +++++++ .../v2/models/fleet_deployment_attributes.rb | 147 ++++++ .../fleet_deployment_configure_attributes.rb | 135 ++++++ .../fleet_deployment_configure_create.rb | 144 ++++++ ...eet_deployment_configure_create_request.rb | 123 +++++ .../v2/models/fleet_deployment_file_op.rb | 30 ++ .../v2/models/fleet_deployment_operation.rb | 161 +++++++ .../models/fleet_deployment_resource_type.rb | 26 ++ .../v2/models/fleet_deployment_response.rb | 105 +++++ .../v2/models/fleet_deployments_page.rb | 105 +++++ .../v2/models/fleet_deployments_response.rb | 135 ++++++ .../models/fleet_deployments_response_meta.rb | 105 +++++ 24 files changed, 2337 insertions(+) create mode 100644 examples/v2/fleet-automation/CancelFleetDeployment.rb create mode 100644 examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb create mode 100644 examples/v2/fleet-automation/GetFleetDeployment.rb create mode 100644 examples/v2/fleet-automation/ListFleetDeployments.rb create mode 100644 features/v2/fleet_automation.feature create mode 100644 lib/datadog_api_client/v2/api/fleet_automation_api.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_file_op.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_operation.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployments_page.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployments_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployments_response_meta.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 364018c47d5..f35df77478f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20093,6 +20093,179 @@ components: - PIPELINES_FAILED_DESCENDING - PIPELINES_DURATION_LOST_ASCENDING - PIPELINES_DURATION_LOST_DESCENDING + FleetDeployment: + description: A deployment that defines automated configuration changes for a + fleet of hosts. + properties: + attributes: + $ref: '#/components/schemas/FleetDeploymentAttributes' + id: + description: Unique identifier for the deployment. + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/FleetDeploymentResourceType' + required: + - id + - type + - attributes + type: object + FleetDeploymentAttributes: + description: Attributes of a deployment in the response. + properties: + config_operations: + description: Ordered list of configuration file operations to perform on + the target hosts. + items: + $ref: '#/components/schemas/FleetDeploymentOperation' + type: array + estimated_end_time_unix: + description: Estimated completion time of the deployment as a Unix timestamp + (seconds since epoch). + example: 1699999999 + format: int64 + type: integer + filter_query: + description: Query used to filter and select target hosts for the deployment. + Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + high_level_status: + description: Current high-level status of the deployment (for example, "pending", + "running", "completed", "failed"). + example: pending + type: string + total_hosts: + description: Total number of hosts targeted by this deployment. + example: 42 + format: int64 + type: integer + type: object + FleetDeploymentConfigureAttributes: + description: Attributes for creating a new configuration deployment. + properties: + config_operations: + description: Ordered list of configuration file operations to perform on + the target hosts. + items: + $ref: '#/components/schemas/FleetDeploymentOperation' + type: array + filter_query: + description: Query used to filter and select target hosts for the deployment. + Uses the Datadog query syntax. + example: env:prod AND service:web + type: string + required: + - config_operations + type: object + FleetDeploymentConfigureCreate: + description: Data for creating a new deployment. + properties: + attributes: + $ref: '#/components/schemas/FleetDeploymentConfigureAttributes' + type: + $ref: '#/components/schemas/FleetDeploymentResourceType' + required: + - type + - attributes + type: object + FleetDeploymentConfigureCreateRequest: + description: Request payload for creating a new deployment. + properties: + data: + $ref: '#/components/schemas/FleetDeploymentConfigureCreate' + required: + - data + type: object + FleetDeploymentFileOp: + description: "Type of file operation to perform on the target configuration + file.\n- `merge-patch`: Merges the provided patch data with the existing configuration + file.\n Creates the file if it doesn't exist.\n- `delete`: Removes the specified + configuration file from the target hosts." + enum: + - merge-patch + - delete + example: merge-patch + type: string + x-enum-varnames: + - MERGE_PATCH + - DELETE + FleetDeploymentOperation: + description: A single configuration file operation to perform on the target + hosts. + properties: + file_op: + $ref: '#/components/schemas/FleetDeploymentFileOp' + file_path: + description: Absolute path to the target configuration file on the host. + example: /datadog.yaml + type: string + patch: + additionalProperties: {} + description: 'Patch data in JSON format to apply to the configuration file. + + When using `merge-patch`, this object is merged with the existing configuration, + + allowing you to add, update, or override specific fields without replacing + the entire file. + + The structure must match the target configuration file format (for example, + YAML structure for Datadog Agent config). + + Not applicable when using the `delete` operation.' + example: + apm_config: + enabled: true + log_level: debug + logs_enabled: true + type: object + required: + - file_op + - file_path + type: object + FleetDeploymentResourceType: + default: deployment + description: The type of deployment resource. + enum: + - deployment + example: deployment + type: string + x-enum-varnames: + - DEPLOYMENT + FleetDeploymentResponse: + description: Response containing a single deployment. + properties: + data: + $ref: '#/components/schemas/FleetDeployment' + type: object + FleetDeploymentsPage: + description: Pagination details for the list of deployments. + properties: + total_count: + description: Total number of deployments available across all pages. + example: 25 + format: int64 + type: integer + type: object + FleetDeploymentsResponse: + description: Response containing a paginated list of deployments. + properties: + data: + description: Array of deployments matching the query criteria. + items: + $ref: '#/components/schemas/FleetDeployment' + type: array + meta: + $ref: '#/components/schemas/FleetDeploymentsResponseMeta' + required: + - data + type: object + FleetDeploymentsResponseMeta: + description: Metadata for the list of deployments, including pagination information. + properties: + page: + $ref: '#/components/schemas/FleetDeploymentsPage' + type: object FormulaLimit: description: 'Message for specifying limits to the number of values returned by a query. @@ -53094,6 +53267,249 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/unstable/fleet/deployments: + get: + description: 'Retrieve a list of all deployments for fleet automation. + + Use the `page_size` and `page_offset` parameters to paginate results.' + operationId: ListFleetDeployments + parameters: + - description: Number of deployments to return per page. Maximum value is 100. + in: query + name: page_size + required: false + schema: + default: 10 + format: int64 + maximum: 100 + type: integer + - description: Index of the first deployment to return. Use this with `page_size` + to paginate through results. + in: query + name: page_offset + required: false + schema: + default: 0 + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all deployments + 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/configure: + post: + description: 'Create a new deployment to apply configuration changes + + to a fleet of hosts matching the specified filter query.' + operationId: CreateFleetDeploymentConfigure + requestBody: + content: + application/json: + examples: + add_log_integration: + summary: Add log integrations for multiple services + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /conf.d/postgres.d/logs.yaml + patch: + logs: + - path: /var/log/postgres.log + service: postgres1 + source: postgres + type: file + - file_op: merge-patch + file_path: /conf.d/kafka.d/logs.yaml + patch: + logs: + - path: /var/log/kafka.log + service: kafka1 + source: kafka + type: file + filter_query: env:prod + type: deployment + delete_config_file: + summary: Delete a configuration file + value: + data: + attributes: + config_operations: + - file_op: delete + file_path: /conf.d/old-integration.yaml + filter_query: env:dev + type: deployment + enable_apm_and_logs: + summary: Enable APM and Logs products + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + apm_config: + enabled: true + log_level: debug + logs_enabled: true + filter_query: env:prod AND service:web + type: deployment + simple_log_level: + summary: Set log level to info + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + log_level: info + filter_query: env:staging + type: deployment + schema: + $ref: '#/components/schemas/FleetDeploymentConfigureCreateRequest' + description: Request payload containing the deployment details. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a deployment + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + 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/{deployment_id}: + get: + description: Retrieve the details of a specific deployment using its unique + identifier. + operationId: GetFleetDeployment + parameters: + - description: The unique identifier of the deployment to retrieve. + example: abc-def-ghi + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetDeploymentResponse' + 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: Get a deployment by ID + 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/{deployment_id}/cancel: + post: + description: 'Cancel this deployment and stop all associated operations. + + If a workflow is currently running for this deployment, it is canceled immediately. + + Changes already applied to hosts are not rolled back.' + operationId: CancelFleetDeployment + parameters: + - description: The unique identifier of the deployment to cancel. + example: abc-def-ghi + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '204': + description: Deployment successfully canceled. + '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: Cancel a deployment + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + 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/v2/actions-datastores: get: description: Lists all datastores for the organization. @@ -79828,6 +80244,12 @@ tags: through the Datadog API. See the [Fastly integration page](https://docs.datadoghq.com/integrations/fastly/) for more information. name: Fastly Integration +- description: 'Manage automated deployments across your fleet of hosts. + + Use these endpoints to create, retrieve, and cancel deployments + + that apply configuration changes to multiple hosts at once.' + name: Fleet Automation - 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/examples/v2/fleet-automation/CancelFleetDeployment.rb b/examples/v2/fleet-automation/CancelFleetDeployment.rb new file mode 100644 index 00000000000..41f565d6a03 --- /dev/null +++ b/examples/v2/fleet-automation/CancelFleetDeployment.rb @@ -0,0 +1,8 @@ +# Cancel a deployment returns "Deployment successfully canceled." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.cancel_fleet_deployment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +api_instance.cancel_fleet_deployment("deployment_id") diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb new file mode 100644 index 00000000000..5767c0cf6c2 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb @@ -0,0 +1,26 @@ +# Create a deployment returns "CREATED" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_fleet_deployment_configure".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new + +body = DatadogAPIClient::V2::FleetDeploymentConfigureCreateRequest.new({ + data: DatadogAPIClient::V2::FleetDeploymentConfigureCreate.new({ + attributes: DatadogAPIClient::V2::FleetDeploymentConfigureAttributes.new({ + config_operations: [ + DatadogAPIClient::V2::FleetDeploymentOperation.new({ + file_op: DatadogAPIClient::V2::FleetDeploymentFileOp::MERGE_PATCH, + file_path: "/datadog.yaml", + patch: { + "apm_config": "{'enabled': True}", "log_level": "debug", "logs_enabled": "True", + }, + }), + ], + filter_query: "env:prod AND service:web", + }), + type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT, + }), +}) +p api_instance.create_fleet_deployment_configure(body) diff --git a/examples/v2/fleet-automation/GetFleetDeployment.rb b/examples/v2/fleet-automation/GetFleetDeployment.rb new file mode 100644 index 00000000000..19fa3f94565 --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetDeployment.rb @@ -0,0 +1,11 @@ +# Get a deployment by ID returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_fleet_deployment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new + +# there is a valid "deployment" in the system +DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"] +p api_instance.get_fleet_deployment(DEPLOYMENT_ID) diff --git a/examples/v2/fleet-automation/ListFleetDeployments.rb b/examples/v2/fleet-automation/ListFleetDeployments.rb new file mode 100644 index 00000000000..872e5d7440f --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetDeployments.rb @@ -0,0 +1,8 @@ +# List all deployments returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_fleet_deployments".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.list_fleet_deployments() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1b6722dd299..c3d2f43620e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -838,6 +838,19 @@ "user_handle" => "String", "body" => "User", }, + "v2.ListFleetDeployments" => { + "page_size" => "Integer", + "page_offset" => "Integer", + }, + "v2.CreateFleetDeploymentConfigure" => { + "body" => "FleetDeploymentConfigureCreateRequest", + }, + "v2.GetFleetDeployment" => { + "deployment_id" => "String", + }, + "v2.CancelFleetDeployment" => { + "deployment_id" => "String", + }, "v2.CreateDatastore" => { "body" => "CreateAppsDatastoreRequest", }, diff --git a/features/v2/fleet_automation.feature b/features/v2/fleet_automation.feature new file mode 100644 index 00000000000..2e91b6e0a85 --- /dev/null +++ b/features/v2/fleet_automation.feature @@ -0,0 +1,89 @@ +@endpoint(fleet-automation) @endpoint(fleet-automation-v2) +Feature: Fleet Automation + Manage automated deployments across your fleet of hosts. Use these + endpoints to create, retrieve, and cancel deployments that apply + configuration changes to multiple hosts at once. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "FleetAutomation" API + + @generated @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "Bad Request" response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "Deployment successfully canceled." response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 Deployment successfully canceled. + + @generated @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "Not Found" response + Given operation "CancelFleetDeployment" enabled + And new "CancelFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/fleet-automation + Scenario: Create a deployment returns "Bad Request" response + Given operation "CreateFleetDeploymentConfigure" enabled + And new "CreateFleetDeploymentConfigure" request + And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/fleet-automation + Scenario: Create a deployment returns "CREATED" response + Given operation "CreateFleetDeploymentConfigure" enabled + And new "CreateFleetDeploymentConfigure" request + And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "Bad Request" response + Given operation "GetFleetDeployment" enabled + And new "GetFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "Not Found" response + Given operation "GetFleetDeployment" enabled + And new "GetFleetDeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "OK" response + Given operation "GetFleetDeployment" enabled + And there is a valid "deployment" in the system + And new "GetFleetDeployment" request + And request contains "deployment_id" parameter from "deployment.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/fleet-automation + Scenario: List all deployments returns "Bad Request" response + Given operation "ListFleetDeployments" enabled + And new "ListFleetDeployments" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/fleet-automation + Scenario: List all deployments returns "OK" response + Given operation "ListFleetDeployments" enabled + And new "ListFleetDeployments" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/given.json b/features/v2/given.json index 23b1000e2cd..a4ab9c24bd1 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1,4 +1,17 @@ [ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/datadog.yaml\",\n \"patch\": {\n \"log_level\": \"info\"\n }\n }\n ]\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"deployment\" in the system", + "key": "deployment", + "tag": "Fleet Automation", + "operationId": "CreateFleetDeploymentConfigure" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 6c74e264b65..bb35cea36c2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1,4 +1,35 @@ { + "ListFleetDeployments": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CreateFleetDeploymentConfigure": { + "tag": "Fleet Automation", + "undo": { + "operationId": "CancelFleetDeployment", + "parameters": [ + { + "name": "deployment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetFleetDeployment": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CancelFleetDeployment": { + "tag": "Fleet Automation", + "undo": { + "type": "idempotent" + } + }, "ListDatastores": { "tag": "Actions Datastores", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index e61054d98dc..7978919a496 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -189,6 +189,10 @@ def initialize @http_proxypass = nil @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @unstable_operations = { + "v2.cancel_fleet_deployment": false, + "v2.create_fleet_deployment_configure": false, + "v2.get_fleet_deployment": false, + "v2.list_fleet_deployments": false, "v2.create_open_api": false, "v2.delete_open_api": false, "v2.get_open_api": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ae10e695b91..5436fa6f85c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2119,6 +2119,18 @@ def overrides "v2.flaky_tests_search_sort" => "FlakyTestsSearchSort", "v2.flaky_test_stats" => "FlakyTestStats", "v2.flaky_test_type" => "FlakyTestType", + "v2.fleet_deployment" => "FleetDeployment", + "v2.fleet_deployment_attributes" => "FleetDeploymentAttributes", + "v2.fleet_deployment_configure_attributes" => "FleetDeploymentConfigureAttributes", + "v2.fleet_deployment_configure_create" => "FleetDeploymentConfigureCreate", + "v2.fleet_deployment_configure_create_request" => "FleetDeploymentConfigureCreateRequest", + "v2.fleet_deployment_file_op" => "FleetDeploymentFileOp", + "v2.fleet_deployment_operation" => "FleetDeploymentOperation", + "v2.fleet_deployment_resource_type" => "FleetDeploymentResourceType", + "v2.fleet_deployment_response" => "FleetDeploymentResponse", + "v2.fleet_deployments_page" => "FleetDeploymentsPage", + "v2.fleet_deployments_response" => "FleetDeploymentsResponse", + "v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta", "v2.formula_limit" => "FormulaLimit", "v2.framework_handle_and_version_response_data" => "FrameworkHandleAndVersionResponseData", "v2.freshservice_api_key" => "FreshserviceAPIKey", @@ -4328,6 +4340,7 @@ def overrides "v2.error_tracking_api" => "ErrorTrackingAPI", "v2.events_api" => "EventsAPI", "v2.fastly_integration_api" => "FastlyIntegrationAPI", + "v2.fleet_automation_api" => "FleetAutomationAPI", "v2.gcp_integration_api" => "GCPIntegrationAPI", "v2.incident_services_api" => "IncidentServicesAPI", "v2.incident_teams_api" => "IncidentTeamsAPI", diff --git a/lib/datadog_api_client/v2/api/fleet_automation_api.rb b/lib/datadog_api_client/v2/api/fleet_automation_api.rb new file mode 100644 index 00000000000..36adfbc8e39 --- /dev/null +++ b/lib/datadog_api_client/v2/api/fleet_automation_api.rb @@ -0,0 +1,318 @@ +=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 FleetAutomationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Cancel a deployment. + # + # @see #cancel_fleet_deployment_with_http_info + def cancel_fleet_deployment(deployment_id, opts = {}) + cancel_fleet_deployment_with_http_info(deployment_id, opts) + nil + end + + # Cancel a deployment. + # + # Cancel this deployment and stop all associated operations. + # If a workflow is currently running for this deployment, it is canceled immediately. + # Changes already applied to hosts are not rolled back. + # + # @param deployment_id [String] The unique identifier of the deployment to cancel. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.cancel_fleet_deployment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_fleet_deployment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_fleet_deployment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.cancel_fleet_deployment ...' + end + # verify the required parameter 'deployment_id' is set + if @api_client.config.client_side_validation && deployment_id.nil? + fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.cancel_fleet_deployment" + end + # resource path + local_var_path = '/api/unstable/fleet/deployments/{deployment_id}/cancel'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :cancel_fleet_deployment, + :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: FleetAutomationAPI#cancel_fleet_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a deployment. + # + # @see #create_fleet_deployment_configure_with_http_info + def create_fleet_deployment_configure(body, opts = {}) + data, _status_code, _headers = create_fleet_deployment_configure_with_http_info(body, opts) + data + end + + # Create a deployment. + # + # Create a new deployment to apply configuration changes + # to a fleet of hosts matching the specified filter query. + # + # @param body [FleetDeploymentConfigureCreateRequest] Request payload containing the deployment details. + # @param opts [Hash] the optional parameters + # @return [Array<(FleetDeploymentResponse, Integer, Hash)>] FleetDeploymentResponse data, response status code and response headers + def create_fleet_deployment_configure_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_fleet_deployment_configure".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_fleet_deployment_configure") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_fleet_deployment_configure")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_configure ...' + 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 FleetAutomationAPI.create_fleet_deployment_configure" + end + # resource path + local_var_path = '/api/unstable/fleet/deployments/configure' + + # 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] || 'FleetDeploymentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_fleet_deployment_configure, + :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: FleetAutomationAPI#create_fleet_deployment_configure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a deployment by ID. + # + # @see #get_fleet_deployment_with_http_info + def get_fleet_deployment(deployment_id, opts = {}) + data, _status_code, _headers = get_fleet_deployment_with_http_info(deployment_id, opts) + data + end + + # Get a deployment by ID. + # + # Retrieve the details of a specific deployment using its unique identifier. + # + # @param deployment_id [String] The unique identifier of the deployment to retrieve. + # @param opts [Hash] the optional parameters + # @return [Array<(FleetDeploymentResponse, Integer, Hash)>] FleetDeploymentResponse data, response status code and response headers + def get_fleet_deployment_with_http_info(deployment_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_fleet_deployment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_fleet_deployment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_fleet_deployment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_deployment ...' + end + # verify the required parameter 'deployment_id' is set + if @api_client.config.client_side_validation && deployment_id.nil? + fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.get_fleet_deployment" + end + # resource path + local_var_path = '/api/unstable/fleet/deployments/{deployment_id}'.sub('{deployment_id}', CGI.escape(deployment_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] || 'FleetDeploymentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_fleet_deployment, + :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#get_fleet_deployment\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 + def list_fleet_deployments(opts = {}) + data, _status_code, _headers = list_fleet_deployments_with_http_info(opts) + data + end + + # List all deployments. + # + # Retrieve a list of all deployments for fleet automation. + # Use the `page_size` and `page_offset` parameters to paginate results. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Number of deployments to return per page. Maximum value is 100. + # @option opts [Integer] :page_offset Index of the first deployment to return. Use this with `page_size` to paginate through results. + # @return [Array<(FleetDeploymentsResponse, Integer, Hash)>] FleetDeploymentsResponse data, response status code and response headers + def list_fleet_deployments_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_deployments".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_deployments") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_deployments")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_deployments ...' + 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_deployments, must be smaller than or equal to 100.' + end + # resource path + local_var_path = '/api/unstable/fleet/deployments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page_offset'] = opts[:'page_offset'] if !opts[:'page_offset'].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] || 'FleetDeploymentsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_fleet_deployments, + :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_deployments\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/fleet_deployment.rb b/lib/datadog_api_client/v2/models/fleet_deployment.rb new file mode 100644 index 00000000000..5f3f62643f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment.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 deployment that defines automated configuration changes for a fleet of hosts. + class FleetDeployment + include BaseGenericModel + + # Attributes of a deployment in the response. + attr_reader :attributes + + # Unique identifier for the deployment. + attr_reader :id + + # The type of deployment resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FleetDeploymentAttributes', + :'id' => :'String', + :'type' => :'FleetDeploymentResourceType' + } + 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::FleetDeployment` 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_deployment_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_attributes.rb new file mode 100644 index 00000000000..205cf6fa108 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_attributes.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 + # Attributes of a deployment in the response. + class FleetDeploymentAttributes + include BaseGenericModel + + # Ordered list of configuration file operations to perform on the target hosts. + attr_accessor :config_operations + + # Estimated completion time of the deployment as a Unix timestamp (seconds since epoch). + attr_accessor :estimated_end_time_unix + + # Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + attr_accessor :filter_query + + # Current high-level status of the deployment (for example, "pending", "running", "completed", "failed"). + attr_accessor :high_level_status + + # Total number of hosts targeted by this deployment. + attr_accessor :total_hosts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config_operations' => :'config_operations', + :'estimated_end_time_unix' => :'estimated_end_time_unix', + :'filter_query' => :'filter_query', + :'high_level_status' => :'high_level_status', + :'total_hosts' => :'total_hosts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config_operations' => :'Array', + :'estimated_end_time_unix' => :'Integer', + :'filter_query' => :'String', + :'high_level_status' => :'String', + :'total_hosts' => :'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::FleetDeploymentAttributes` 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?(:'config_operations') + if (value = attributes[:'config_operations']).is_a?(Array) + self.config_operations = value + end + end + + if attributes.key?(:'estimated_end_time_unix') + self.estimated_end_time_unix = attributes[:'estimated_end_time_unix'] + end + + if attributes.key?(:'filter_query') + self.filter_query = attributes[:'filter_query'] + end + + if attributes.key?(:'high_level_status') + self.high_level_status = attributes[:'high_level_status'] + end + + if attributes.key?(:'total_hosts') + self.total_hosts = attributes[:'total_hosts'] + 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 && + config_operations == o.config_operations && + estimated_end_time_unix == o.estimated_end_time_unix && + filter_query == o.filter_query && + high_level_status == o.high_level_status && + total_hosts == o.total_hosts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config_operations, estimated_end_time_unix, filter_query, high_level_status, total_hosts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb new file mode 100644 index 00000000000..63e34bd721b --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a new configuration deployment. + class FleetDeploymentConfigureAttributes + include BaseGenericModel + + # Ordered list of configuration file operations to perform on the target hosts. + attr_reader :config_operations + + # Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. + attr_accessor :filter_query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config_operations' => :'config_operations', + :'filter_query' => :'filter_query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config_operations' => :'Array', + :'filter_query' => :'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::FleetDeploymentConfigureAttributes` 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?(:'config_operations') + if (value = attributes[:'config_operations']).is_a?(Array) + self.config_operations = value + end + end + + if attributes.key?(:'filter_query') + self.filter_query = attributes[:'filter_query'] + 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 @config_operations.nil? + true + end + + # Custom attribute writer method with validation + # @param config_operations [Object] Object to be assigned + # @!visibility private + def config_operations=(config_operations) + if config_operations.nil? + fail ArgumentError, 'invalid value for "config_operations", config_operations cannot be nil.' + end + @config_operations = config_operations + 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 && + config_operations == o.config_operations && + filter_query == o.filter_query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config_operations, filter_query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb new file mode 100644 index 00000000000..f761336321b --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating a new deployment. + class FleetDeploymentConfigureCreate + include BaseGenericModel + + # Attributes for creating a new configuration deployment. + attr_reader :attributes + + # The type of deployment resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FleetDeploymentConfigureAttributes', + :'type' => :'FleetDeploymentResourceType' + } + 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::FleetDeploymentConfigureCreate` 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/fleet_deployment_configure_create_request.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb new file mode 100644 index 00000000000..03104480079 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a new deployment. + class FleetDeploymentConfigureCreateRequest + include BaseGenericModel + + # Data for creating a new deployment. + 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' => :'FleetDeploymentConfigureCreate' + } + 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::FleetDeploymentConfigureCreateRequest` 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_deployment_file_op.rb b/lib/datadog_api_client/v2/models/fleet_deployment_file_op.rb new file mode 100644 index 00000000000..0af289f774a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_file_op.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 + # Type of file operation to perform on the target configuration file. + # - `merge-patch`: Merges the provided patch data with the existing configuration file. + # Creates the file if it doesn't exist. + # - `delete`: Removes the specified configuration file from the target hosts. + class FleetDeploymentFileOp + include BaseEnumModel + + MERGE_PATCH = "merge-patch".freeze + DELETE = "delete".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_operation.rb b/lib/datadog_api_client/v2/models/fleet_deployment_operation.rb new file mode 100644 index 00000000000..415753c1784 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_operation.rb @@ -0,0 +1,161 @@ +=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 configuration file operation to perform on the target hosts. + class FleetDeploymentOperation + include BaseGenericModel + + # Type of file operation to perform on the target configuration file. + # - `merge-patch`: Merges the provided patch data with the existing configuration file. + # Creates the file if it doesn't exist. + # - `delete`: Removes the specified configuration file from the target hosts. + attr_reader :file_op + + # Absolute path to the target configuration file on the host. + attr_reader :file_path + + # Patch data in JSON format to apply to the configuration file. + # When using `merge-patch`, this object is merged with the existing configuration, + # allowing you to add, update, or override specific fields without replacing the entire file. + # The structure must match the target configuration file format (for example, YAML structure for Datadog Agent config). + # Not applicable when using the `delete` operation. + attr_accessor :patch + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file_op' => :'file_op', + :'file_path' => :'file_path', + :'patch' => :'patch' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file_op' => :'FleetDeploymentFileOp', + :'file_path' => :'String', + :'patch' => :'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::FleetDeploymentOperation` 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?(:'file_op') + self.file_op = attributes[:'file_op'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'patch') + self.patch = attributes[:'patch'] + 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 @file_op.nil? + return false if @file_path.nil? + true + end + + # Custom attribute writer method with validation + # @param file_op [Object] Object to be assigned + # @!visibility private + def file_op=(file_op) + if file_op.nil? + fail ArgumentError, 'invalid value for "file_op", file_op cannot be nil.' + end + @file_op = file_op + end + + # Custom attribute writer method with validation + # @param file_path [Object] Object to be assigned + # @!visibility private + def file_path=(file_path) + if file_path.nil? + fail ArgumentError, 'invalid value for "file_path", file_path cannot be nil.' + end + @file_path = file_path + 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 && + file_op == o.file_op && + file_path == o.file_path && + patch == o.patch && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file_op, file_path, patch, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_resource_type.rb b/lib/datadog_api_client/v2/models/fleet_deployment_resource_type.rb new file mode 100644 index 00000000000..c4c716040d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_resource_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 deployment resource. + class FleetDeploymentResourceType + include BaseEnumModel + + DEPLOYMENT = "deployment".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_response.rb new file mode 100644 index 00000000000..b055ced273f --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_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 + # Response containing a single deployment. + class FleetDeploymentResponse + include BaseGenericModel + + # A deployment that defines automated configuration changes for a fleet of hosts. + 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' => :'FleetDeployment' + } + 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::FleetDeploymentResponse` 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/fleet_deployments_page.rb b/lib/datadog_api_client/v2/models/fleet_deployments_page.rb new file mode 100644 index 00000000000..a3609924724 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployments_page.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 + # Pagination details for the list of deployments. + class FleetDeploymentsPage + include BaseGenericModel + + # Total number of deployments available across all pages. + attr_accessor :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'total_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentsPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployments_response.rb b/lib/datadog_api_client/v2/models/fleet_deployments_response.rb new file mode 100644 index 00000000000..2cb624f6bee --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployments_response.rb @@ -0,0 +1,135 @@ +=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 deployments. + class FleetDeploymentsResponse + include BaseGenericModel + + # Array of deployments matching the query criteria. + attr_reader :data + + # Metadata for the list of deployments, including pagination information. + 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' => :'Array', + :'meta' => :'FleetDeploymentsResponseMeta' + } + 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::FleetDeploymentsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + 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_deployments_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_deployments_response_meta.rb new file mode 100644 index 00000000000..c1751676a0d --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployments_response_meta.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 + # Metadata for the list of deployments, including pagination information. + class FleetDeploymentsResponseMeta + include BaseGenericModel + + # Pagination details for the list of deployments. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'FleetDeploymentsPage' + } + 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::FleetDeploymentsResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end