From 5288bb98f1c71998f6633b64bc525e1ac35e0f53 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Feb 2026 13:44:07 +0000 Subject: [PATCH] Regenerate client from commit a48e37a of spec repo --- .generator/schemas/v2/openapi.yaml | 451 ++++++++++++++++++ ...CreateOnPremManagementServiceEnrollment.rb | 24 + .../GetOnPremManagementServiceEnrollment.rb | 8 + .../RegisterOnPremManagementServiceToken.rb | 21 + features/scenarios_model_mapping.rb | 9 + .../v2/on-prem_management_service.feature | 74 +++ .../v2/on_prem_management_service.feature | 74 +++ features/v2/undo.json | 22 + lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 23 + .../v2/api/on_prem_management_service_api.rb | 243 ++++++++++ ...ement_service_create_enrollment_request.rb | 123 +++++ ...ment_service_create_enrollment_response.rb | 123 +++++ ...e_create_enrollment_response_attributes.rb | 123 +++++ ...service_create_enrollment_response_data.rb | 165 +++++++ ...service_create_enrollment_response_type.rb | 26 + ...anagement_service_enrollment_attributes.rb | 179 +++++++ ...nrollment_attributes_runner_modes_items.rb | 27 ++ ...agement_service_enrollment_data_request.rb | 144 ++++++ ...prem_management_service_enrollment_type.rb | 26 + ...agement_service_get_enrollment_response.rb | 123 +++++ ...vice_get_enrollment_response_attributes.rb | 165 +++++++ ...t_enrollment_response_attributes_status.rb | 28 ++ ...nt_service_get_enrollment_response_data.rb | 165 +++++++ ...nt_service_get_enrollment_response_type.rb | 26 + ...ement_service_register_token_attributes.rb | 174 +++++++ ...ent_service_register_token_data_request.rb | 144 ++++++ ...nagement_service_register_token_request.rb | 123 +++++ ...agement_service_register_token_response.rb | 123 +++++ ...vice_register_token_response_attributes.rb | 123 +++++ ...nt_service_register_token_response_data.rb | 165 +++++++ ...nt_service_register_token_response_type.rb | 26 + ..._management_service_register_token_type.rb | 26 + 33 files changed, 3299 insertions(+) create mode 100644 examples/v2/on-prem-management-service/CreateOnPremManagementServiceEnrollment.rb create mode 100644 examples/v2/on-prem-management-service/GetOnPremManagementServiceEnrollment.rb create mode 100644 examples/v2/on-prem-management-service/RegisterOnPremManagementServiceToken.rb create mode 100644 features/v2/on-prem_management_service.feature create mode 100644 features/v2/on_prem_management_service.feature create mode 100644 lib/datadog_api_client/v2/api/on_prem_management_service_api.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_request.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes_runner_modes_items.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_type.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes_status.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_request.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/on_prem_management_service_register_token_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f488..c3ecc0f72ec6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1161,6 +1161,14 @@ components: example: 1706803070 format: int64 type: integer + TokenHashParam: + description: The enrollment token hash. + in: path + name: token_hash + required: true + schema: + example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + type: string UserID: description: The ID of the user. in: path @@ -43316,6 +43324,276 @@ components: type: string x-enum-varnames: - ON_DEMAND_CONCURRENCY_CAP + OnPremManagementServiceCreateEnrollmentRequest: + description: Request to create an enrollment for an on-prem runner. + properties: + data: + $ref: '#/components/schemas/OnPremManagementServiceEnrollmentDataRequest' + required: + - data + type: object + OnPremManagementServiceCreateEnrollmentResponse: + description: Response for creating an enrollment. + properties: + data: + $ref: '#/components/schemas/OnPremManagementServiceCreateEnrollmentResponseData' + required: + - data + type: object + OnPremManagementServiceCreateEnrollmentResponseAttributes: + description: Attributes for the created enrollment. + properties: + token: + description: The enrollment token. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + type: string + required: + - token + type: object + OnPremManagementServiceCreateEnrollmentResponseData: + description: Data for the created enrollment. + properties: + attributes: + $ref: '#/components/schemas/OnPremManagementServiceCreateEnrollmentResponseAttributes' + id: + description: The token hash identifier. + example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + type: string + type: + $ref: '#/components/schemas/OnPremManagementServiceCreateEnrollmentResponseType' + required: + - id + - type + - attributes + type: object + OnPremManagementServiceCreateEnrollmentResponseType: + description: The type of the resource. The value should always be createEnrollmentResponse. + enum: + - createEnrollmentResponse + example: createEnrollmentResponse + type: string + x-enum-varnames: + - CREATEENROLLMENTRESPONSE + OnPremManagementServiceEnrollmentAttributes: + description: Attributes for creating an enrollment. + properties: + actions_allowlist: + description: List of allowed actions for the runner. + example: + - com.datadoghq.jenkins.* + items: + type: string + type: array + runner_host: + description: The hostname for the runner. Required when push mode is enabled. + example: runner.example.com + type: string + runner_modes: + description: The modes the runner should operate in. + example: + - workflow_automation + items: + $ref: '#/components/schemas/OnPremManagementServiceEnrollmentAttributesRunnerModesItems' + type: array + runner_name: + description: The name of the on-prem runner. + example: my-runner + type: string + required: + - runner_name + - runner_modes + - actions_allowlist + type: object + OnPremManagementServiceEnrollmentAttributesRunnerModesItems: + enum: + - workflow_automation + - app_builder + type: string + x-enum-varnames: + - WORKFLOW_AUTOMATION + - APP_BUILDER + OnPremManagementServiceEnrollmentDataRequest: + description: Data for creating an enrollment. + properties: + attributes: + $ref: '#/components/schemas/OnPremManagementServiceEnrollmentAttributes' + type: + $ref: '#/components/schemas/OnPremManagementServiceEnrollmentType' + required: + - type + - attributes + type: object + OnPremManagementServiceEnrollmentType: + description: The type of the resource. The value should always be enrollment. + enum: + - enrollment + example: enrollment + type: string + x-enum-varnames: + - ENROLLMENT + OnPremManagementServiceGetEnrollmentResponse: + description: Response for getting an enrollment status. + properties: + data: + $ref: '#/components/schemas/OnPremManagementServiceGetEnrollmentResponseData' + required: + - data + type: object + OnPremManagementServiceGetEnrollmentResponseAttributes: + description: Attributes for the enrollment status. + properties: + failure_reason: + description: The reason for enrollment failure, if applicable. + example: '' + type: string + runner_id: + description: The runner identifier, if enrollment was successful. + example: runner-GBUyh2Tm6oKS6ap4kt8Bbx + type: string + status: + $ref: '#/components/schemas/OnPremManagementServiceGetEnrollmentResponseAttributesStatus' + required: + - status + - failure_reason + - runner_id + type: object + OnPremManagementServiceGetEnrollmentResponseAttributesStatus: + description: The status of the enrollment. + enum: + - new + - success + - failed + example: success + type: string + x-enum-varnames: + - NEW + - SUCCESS + - FAILED + OnPremManagementServiceGetEnrollmentResponseData: + description: Data for the enrollment status. + properties: + attributes: + $ref: '#/components/schemas/OnPremManagementServiceGetEnrollmentResponseAttributes' + id: + description: The token hash identifier. + example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + type: string + type: + $ref: '#/components/schemas/OnPremManagementServiceGetEnrollmentResponseType' + required: + - id + - type + - attributes + type: object + OnPremManagementServiceGetEnrollmentResponseType: + description: The type of the resource. The value should always be getEnrollmentResponse. + enum: + - getEnrollmentResponse + example: getEnrollmentResponse + type: string + x-enum-varnames: + - GETENROLLMENTRESPONSE + OnPremManagementServiceRegisterTokenAttributes: + description: Attributes for registering a token. + properties: + app_id: + description: The application identifier. + example: 9a93d314-ca37-461d-b18e-0587f03c6e2a + format: uuid + type: string + app_version: + description: The application version. + example: 5 + format: int64 + type: integer + connection_id: + description: The connection identifier. + example: 2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0 + format: uuid + type: string + query_id: + description: The query identifier. + example: 8744d459-18aa-405b-821e-df9bb101c01e + format: uuid + type: string + runner_id: + description: The on-prem runner identifier. + example: runner-GBUyh2Tm6oKS6ap4kt8Bbx + type: string + required: + - runner_id + - connection_id + type: object + OnPremManagementServiceRegisterTokenDataRequest: + description: Data for registering a token. + properties: + attributes: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenAttributes' + type: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenType' + required: + - type + - attributes + type: object + OnPremManagementServiceRegisterTokenRequest: + description: Request to register a token for query execution. + properties: + data: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenDataRequest' + required: + - data + type: object + OnPremManagementServiceRegisterTokenResponse: + description: Response for registering a token. + properties: + data: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenResponseData' + required: + - data + type: object + OnPremManagementServiceRegisterTokenResponseAttributes: + description: Attributes for the registered token. + properties: + token_string: + description: The token string. + example: token123 + type: string + required: + - token_string + type: object + OnPremManagementServiceRegisterTokenResponseData: + description: Data for the registered token. + properties: + attributes: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenResponseAttributes' + id: + description: The token identifier. + example: 88a1d16d-3ebc-4ca1-9f3e-d7ab7b34c6df + format: uuid + type: string + type: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenResponseType' + required: + - id + - type + - attributes + type: object + OnPremManagementServiceRegisterTokenResponseType: + description: The type of the resource. The value should always be tokenDefinitions. + enum: + - tokenDefinitions + example: tokenDefinitions + type: string + x-enum-varnames: + - TOKENDEFINITIONS + OnPremManagementServiceRegisterTokenType: + description: The type of the resource. The value should always be registerTokenRequest. + enum: + - registerTokenRequest + example: registerTokenRequest + type: string + x-enum-varnames: + - REGISTERTOKENREQUEST OpenAIAPIKey: description: The definition of the `OpenAIAPIKey` object. properties: @@ -86762,6 +87040,175 @@ paths: operator: OR permissions: - on_call_read + /api/v2/on-prem-management-service/enrollments: + post: + description: Create a new enrollment for an on-prem runner. This endpoint initiates + the enrollment process and returns a token that the runner will use to complete + the enrollment. + operationId: CreateOnPremManagementServiceEnrollment + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OnPremManagementServiceCreateEnrollmentRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/OnPremManagementServiceCreateEnrollmentResponse' + 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 + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an enrollment + tags: + - On Prem Management Service + 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/on-prem-management-service/enrollments/{token_hash}: + get: + description: Get the status of an enrollment for an on-prem runner using the + enrollment token hash. + operationId: GetOnPremManagementServiceEnrollment + parameters: + - $ref: '#/components/parameters/TokenHashParam' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OnPremManagementServiceGetEnrollmentResponse' + 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 + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get enrollment status + tags: + - On Prem Management Service + 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/on-prem-management-service/tokens/register: + post: + description: Register a token for query execution. This endpoint allows an on-prem + runner to register a token that will be used to execute queries on a specific + connection. + operationId: RegisterOnPremManagementServiceToken + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OnPremManagementServiceRegisterTokenResponse' + 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 + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Register a token + tags: + - On Prem Management Service + 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/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -102697,6 +103144,10 @@ tags: - description: Configure your [Datadog Okta integration](https://docs.datadoghq.com/integrations/okta/) directly through the Datadog API. name: Okta Integration +- description: Manage on-premises runners for workflow automation and app builder. + Use these endpoints to enroll runners, check enrollment status, and register tokens + for query execution. + name: On Prem Management Service - description: 'Configure your [Datadog On-Call](https://docs.datadoghq.com/service_management/on-call/) directly through the Datadog API.' diff --git a/examples/v2/on-prem-management-service/CreateOnPremManagementServiceEnrollment.rb b/examples/v2/on-prem-management-service/CreateOnPremManagementServiceEnrollment.rb new file mode 100644 index 000000000000..d18cbb206aca --- /dev/null +++ b/examples/v2/on-prem-management-service/CreateOnPremManagementServiceEnrollment.rb @@ -0,0 +1,24 @@ +# Create an enrollment returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_on_prem_management_service_enrollment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OnPremManagementServiceAPI.new + +body = DatadogAPIClient::V2::OnPremManagementServiceCreateEnrollmentRequest.new({ + data: DatadogAPIClient::V2::OnPremManagementServiceEnrollmentDataRequest.new({ + attributes: DatadogAPIClient::V2::OnPremManagementServiceEnrollmentAttributes.new({ + actions_allowlist: [ + "com.datadoghq.jenkins.*", + ], + runner_host: "runner.example.com", + runner_modes: [ + DatadogAPIClient::V2::OnPremManagementServiceEnrollmentAttributesRunnerModesItems::WORKFLOW_AUTOMATION, + ], + runner_name: "my-runner", + }), + type: DatadogAPIClient::V2::OnPremManagementServiceEnrollmentType::ENROLLMENT, + }), +}) +p api_instance.create_on_prem_management_service_enrollment(body) diff --git a/examples/v2/on-prem-management-service/GetOnPremManagementServiceEnrollment.rb b/examples/v2/on-prem-management-service/GetOnPremManagementServiceEnrollment.rb new file mode 100644 index 000000000000..b38fb3d89dfe --- /dev/null +++ b/examples/v2/on-prem-management-service/GetOnPremManagementServiceEnrollment.rb @@ -0,0 +1,8 @@ +# Get enrollment status returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_on_prem_management_service_enrollment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OnPremManagementServiceAPI.new +p api_instance.get_on_prem_management_service_enrollment("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") diff --git a/examples/v2/on-prem-management-service/RegisterOnPremManagementServiceToken.rb b/examples/v2/on-prem-management-service/RegisterOnPremManagementServiceToken.rb new file mode 100644 index 000000000000..ab965e157b57 --- /dev/null +++ b/examples/v2/on-prem-management-service/RegisterOnPremManagementServiceToken.rb @@ -0,0 +1,21 @@ +# Register a token returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.register_on_prem_management_service_token".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OnPremManagementServiceAPI.new + +body = DatadogAPIClient::V2::OnPremManagementServiceRegisterTokenRequest.new({ + data: DatadogAPIClient::V2::OnPremManagementServiceRegisterTokenDataRequest.new({ + attributes: DatadogAPIClient::V2::OnPremManagementServiceRegisterTokenAttributes.new({ + app_id: "9a93d314-ca37-461d-b18e-0587f03c6e2a", + app_version: 5, + connection_id: "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", + query_id: "8744d459-18aa-405b-821e-df9bb101c01e", + runner_id: "runner-GBUyh2Tm6oKS6ap4kt8Bbx", + }), + type: DatadogAPIClient::V2::OnPremManagementServiceRegisterTokenType::REGISTERTOKENREQUEST, + }), +}) +p api_instance.register_on_prem_management_service_token(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f9f955f31923..a1c987a34a5d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2893,6 +2893,15 @@ "v2.ResolveOnCallPage" => { "page_id" => "UUID", }, + "v2.CreateOnPremManagementServiceEnrollment" => { + "body" => "OnPremManagementServiceCreateEnrollmentRequest", + }, + "v2.GetOnPremManagementServiceEnrollment" => { + "token_hash" => "String", + }, + "v2.RegisterOnPremManagementServiceToken" => { + "body" => "OnPremManagementServiceRegisterTokenRequest", + }, "v2.GetOrgConfig" => { "org_config_name" => "String", }, diff --git a/features/v2/on-prem_management_service.feature b/features/v2/on-prem_management_service.feature new file mode 100644 index 000000000000..c6c2ef5939b7 --- /dev/null +++ b/features/v2/on-prem_management_service.feature @@ -0,0 +1,74 @@ +@endpoint(on-prem-management-service) @endpoint(on-prem-management-service-v2) +Feature: On-Prem Management Service + Manage on-premises runners for workflow automation and app builder. Use + these endpoints to enroll runners, check enrollment status, and register + tokens for query execution. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OnPremManagementService" API + + @generated @skip @team:DataDog/action-platform + Scenario: Create an enrollment returns "Bad Request" response + Given operation "CreateOnPremManagementServiceEnrollment" enabled + And new "CreateOnPremManagementServiceEnrollment" request + And body with value {"data": {"attributes": {"actions_allowlist": ["com.datadoghq.jenkins.*"], "runner_host": "runner.example.com", "runner_modes": ["workflow_automation"], "runner_name": "my-runner"}, "type": "enrollment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Create an enrollment returns "Created" response + Given operation "CreateOnPremManagementServiceEnrollment" enabled + And new "CreateOnPremManagementServiceEnrollment" request + And body with value {"data": {"attributes": {"actions_allowlist": ["com.datadoghq.jenkins.*"], "runner_host": "runner.example.com", "runner_modes": ["workflow_automation"], "runner_name": "my-runner"}, "type": "enrollment"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "Bad Request" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "Not Found" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "OK" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "Bad Request" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "Not Found" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "OK" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/on_prem_management_service.feature b/features/v2/on_prem_management_service.feature new file mode 100644 index 000000000000..db64af2a8597 --- /dev/null +++ b/features/v2/on_prem_management_service.feature @@ -0,0 +1,74 @@ +@endpoint(on-prem-management-service) @endpoint(on-prem-management-service-v2) +Feature: On Prem Management Service + Manage on-premises runners for workflow automation and app builder. Use + these endpoints to enroll runners, check enrollment status, and register + tokens for query execution. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OnPremManagementService" API + + @generated @skip @team:DataDog/action-platform + Scenario: Create an enrollment returns "Bad Request" response + Given operation "CreateOnPremManagementServiceEnrollment" enabled + And new "CreateOnPremManagementServiceEnrollment" request + And body with value {"data": {"attributes": {"actions_allowlist": ["com.datadoghq.jenkins.*"], "runner_host": "runner.example.com", "runner_modes": ["workflow_automation"], "runner_name": "my-runner"}, "type": "enrollment"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Create an enrollment returns "Created" response + Given operation "CreateOnPremManagementServiceEnrollment" enabled + And new "CreateOnPremManagementServiceEnrollment" request + And body with value {"data": {"attributes": {"actions_allowlist": ["com.datadoghq.jenkins.*"], "runner_host": "runner.example.com", "runner_modes": ["workflow_automation"], "runner_name": "my-runner"}, "type": "enrollment"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "Bad Request" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "Not Found" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/action-platform + Scenario: Get enrollment status returns "OK" response + Given operation "GetOnPremManagementServiceEnrollment" enabled + And new "GetOnPremManagementServiceEnrollment" request + And request contains "token_hash" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "Bad Request" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "Not Found" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/action-platform + Scenario: Register a token returns "OK" response + Given operation "RegisterOnPremManagementServiceToken" enabled + And new "RegisterOnPremManagementServiceToken" request + And body with value {"data": {"attributes": {"app_id": "9a93d314-ca37-461d-b18e-0587f03c6e2a", "app_version": 5, "connection_id": "2f66ec56-d1f3-4a18-908d-5e8c12dfb3b0", "query_id": "8744d459-18aa-405b-821e-df9bb101c01e", "runner_id": "runner-GBUyh2Tm6oKS6ap4kt8Bbx"}, "type": "registerTokenRequest"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 7e549784ee62..30c80633b80d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3332,6 +3332,28 @@ "type": "safe" } }, + "CreateOnPremManagementServiceEnrollment": { + "tag": "On Prem Management Service", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetOnPremManagementServiceEnrollment": { + "tag": "On Prem Management Service", + "undo": { + "type": "safe" + } + }, + "RegisterOnPremManagementServiceToken": { + "tag": "On Prem Management Service", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 1c3d360ecc93..857ddc096883 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -327,6 +327,9 @@ def initialize "v2.update_monitor_user_template": false, "v2.validate_existing_monitor_user_template": false, "v2.validate_monitor_user_template": false, + "v2.create_on_prem_management_service_enrollment": false, + "v2.get_on_prem_management_service_enrollment": false, + "v2.register_on_prem_management_service_token": false, "v2.list_role_templates": false, "v2.create_connection": false, "v2.delete_connection": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8bcf2052b621..6fb466275f2b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3634,6 +3634,28 @@ def overrides "v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes", "v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse", "v2.on_demand_concurrency_cap_type" => "OnDemandConcurrencyCapType", + "v2.on_prem_management_service_create_enrollment_request" => "OnPremManagementServiceCreateEnrollmentRequest", + "v2.on_prem_management_service_create_enrollment_response" => "OnPremManagementServiceCreateEnrollmentResponse", + "v2.on_prem_management_service_create_enrollment_response_attributes" => "OnPremManagementServiceCreateEnrollmentResponseAttributes", + "v2.on_prem_management_service_create_enrollment_response_data" => "OnPremManagementServiceCreateEnrollmentResponseData", + "v2.on_prem_management_service_create_enrollment_response_type" => "OnPremManagementServiceCreateEnrollmentResponseType", + "v2.on_prem_management_service_enrollment_attributes" => "OnPremManagementServiceEnrollmentAttributes", + "v2.on_prem_management_service_enrollment_attributes_runner_modes_items" => "OnPremManagementServiceEnrollmentAttributesRunnerModesItems", + "v2.on_prem_management_service_enrollment_data_request" => "OnPremManagementServiceEnrollmentDataRequest", + "v2.on_prem_management_service_enrollment_type" => "OnPremManagementServiceEnrollmentType", + "v2.on_prem_management_service_get_enrollment_response" => "OnPremManagementServiceGetEnrollmentResponse", + "v2.on_prem_management_service_get_enrollment_response_attributes" => "OnPremManagementServiceGetEnrollmentResponseAttributes", + "v2.on_prem_management_service_get_enrollment_response_attributes_status" => "OnPremManagementServiceGetEnrollmentResponseAttributesStatus", + "v2.on_prem_management_service_get_enrollment_response_data" => "OnPremManagementServiceGetEnrollmentResponseData", + "v2.on_prem_management_service_get_enrollment_response_type" => "OnPremManagementServiceGetEnrollmentResponseType", + "v2.on_prem_management_service_register_token_attributes" => "OnPremManagementServiceRegisterTokenAttributes", + "v2.on_prem_management_service_register_token_data_request" => "OnPremManagementServiceRegisterTokenDataRequest", + "v2.on_prem_management_service_register_token_request" => "OnPremManagementServiceRegisterTokenRequest", + "v2.on_prem_management_service_register_token_response" => "OnPremManagementServiceRegisterTokenResponse", + "v2.on_prem_management_service_register_token_response_attributes" => "OnPremManagementServiceRegisterTokenResponseAttributes", + "v2.on_prem_management_service_register_token_response_data" => "OnPremManagementServiceRegisterTokenResponseData", + "v2.on_prem_management_service_register_token_response_type" => "OnPremManagementServiceRegisterTokenResponseType", + "v2.on_prem_management_service_register_token_type" => "OnPremManagementServiceRegisterTokenType", "v2.open_aiapi_key" => "OpenAIAPIKey", "v2.open_aiapi_key_type" => "OpenAIAPIKeyType", "v2.open_aiapi_key_update" => "OpenAIAPIKeyUpdate", @@ -5283,6 +5305,7 @@ def overrides "v2.observability_pipelines_api" => "ObservabilityPipelinesAPI", "v2.oci_integration_api" => "OCIIntegrationAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", + "v2.on_prem_management_service_api" => "OnPremManagementServiceAPI", "v2.on_call_api" => "OnCallAPI", "v2.on_call_paging_api" => "OnCallPagingAPI", "v2.opsgenie_integration_api" => "OpsgenieIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/on_prem_management_service_api.rb b/lib/datadog_api_client/v2/api/on_prem_management_service_api.rb new file mode 100644 index 000000000000..c8f363e3ba63 --- /dev/null +++ b/lib/datadog_api_client/v2/api/on_prem_management_service_api.rb @@ -0,0 +1,243 @@ +=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 OnPremManagementServiceAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create an enrollment. + # + # @see #create_on_prem_management_service_enrollment_with_http_info + def create_on_prem_management_service_enrollment(body, opts = {}) + data, _status_code, _headers = create_on_prem_management_service_enrollment_with_http_info(body, opts) + data + end + + # Create an enrollment. + # + # Create a new enrollment for an on-prem runner. This endpoint initiates the enrollment process and returns a token that the runner will use to complete the enrollment. + # + # @param body [OnPremManagementServiceCreateEnrollmentRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OnPremManagementServiceCreateEnrollmentResponse, Integer, Hash)>] OnPremManagementServiceCreateEnrollmentResponse data, response status code and response headers + def create_on_prem_management_service_enrollment_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_on_prem_management_service_enrollment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_on_prem_management_service_enrollment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_on_prem_management_service_enrollment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnPremManagementServiceAPI.create_on_prem_management_service_enrollment ...' + 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 OnPremManagementServiceAPI.create_on_prem_management_service_enrollment" + end + # resource path + local_var_path = '/api/v2/on-prem-management-service/enrollments' + + # 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] || 'OnPremManagementServiceCreateEnrollmentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_on_prem_management_service_enrollment, + :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: OnPremManagementServiceAPI#create_on_prem_management_service_enrollment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get enrollment status. + # + # @see #get_on_prem_management_service_enrollment_with_http_info + def get_on_prem_management_service_enrollment(token_hash, opts = {}) + data, _status_code, _headers = get_on_prem_management_service_enrollment_with_http_info(token_hash, opts) + data + end + + # Get enrollment status. + # + # Get the status of an enrollment for an on-prem runner using the enrollment token hash. + # + # @param token_hash [String] The enrollment token hash. + # @param opts [Hash] the optional parameters + # @return [Array<(OnPremManagementServiceGetEnrollmentResponse, Integer, Hash)>] OnPremManagementServiceGetEnrollmentResponse data, response status code and response headers + def get_on_prem_management_service_enrollment_with_http_info(token_hash, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_on_prem_management_service_enrollment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_on_prem_management_service_enrollment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_on_prem_management_service_enrollment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnPremManagementServiceAPI.get_on_prem_management_service_enrollment ...' + end + # verify the required parameter 'token_hash' is set + if @api_client.config.client_side_validation && token_hash.nil? + fail ArgumentError, "Missing the required parameter 'token_hash' when calling OnPremManagementServiceAPI.get_on_prem_management_service_enrollment" + end + # resource path + local_var_path = '/api/v2/on-prem-management-service/enrollments/{token_hash}'.sub('{token_hash}', CGI.escape(token_hash.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] || 'OnPremManagementServiceGetEnrollmentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_on_prem_management_service_enrollment, + :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: OnPremManagementServiceAPI#get_on_prem_management_service_enrollment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Register a token. + # + # @see #register_on_prem_management_service_token_with_http_info + def register_on_prem_management_service_token(body, opts = {}) + data, _status_code, _headers = register_on_prem_management_service_token_with_http_info(body, opts) + data + end + + # Register a token. + # + # Register a token for query execution. This endpoint allows an on-prem runner to register a token that will be used to execute queries on a specific connection. + # + # @param body [OnPremManagementServiceRegisterTokenRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OnPremManagementServiceRegisterTokenResponse, Integer, Hash)>] OnPremManagementServiceRegisterTokenResponse data, response status code and response headers + def register_on_prem_management_service_token_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.register_on_prem_management_service_token".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.register_on_prem_management_service_token") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.register_on_prem_management_service_token")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnPremManagementServiceAPI.register_on_prem_management_service_token ...' + 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 OnPremManagementServiceAPI.register_on_prem_management_service_token" + end + # resource path + local_var_path = '/api/v2/on-prem-management-service/tokens/register' + + # 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] || 'OnPremManagementServiceRegisterTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :register_on_prem_management_service_token, + :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: OnPremManagementServiceAPI#register_on_prem_management_service_token\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/on_prem_management_service_create_enrollment_request.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_request.rb new file mode 100644 index 000000000000..094326c00f1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create an enrollment for an on-prem runner. + class OnPremManagementServiceCreateEnrollmentRequest + include BaseGenericModel + + # Data for creating an enrollment. + 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' => :'OnPremManagementServiceEnrollmentDataRequest' + } + 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::OnPremManagementServiceCreateEnrollmentRequest` 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/on_prem_management_service_create_enrollment_response.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response.rb new file mode 100644 index 000000000000..a752e0775807 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for creating an enrollment. + class OnPremManagementServiceCreateEnrollmentResponse + include BaseGenericModel + + # Data for the created enrollment. + 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' => :'OnPremManagementServiceCreateEnrollmentResponseData' + } + 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::OnPremManagementServiceCreateEnrollmentResponse` 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/on_prem_management_service_create_enrollment_response_attributes.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_attributes.rb new file mode 100644 index 000000000000..49813c0594bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for the created enrollment. + class OnPremManagementServiceCreateEnrollmentResponseAttributes + include BaseGenericModel + + # The enrollment token. + attr_reader :token + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'token' => :'token' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'token' => :'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::OnPremManagementServiceCreateEnrollmentResponseAttributes` 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?(:'token') + self.token = attributes[:'token'] + 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 @token.nil? + true + end + + # Custom attribute writer method with validation + # @param token [Object] Object to be assigned + # @!visibility private + def token=(token) + if token.nil? + fail ArgumentError, 'invalid value for "token", token cannot be nil.' + end + @token = token + 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 && + token == o.token && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [token, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_data.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_data.rb new file mode 100644 index 000000000000..94019f6ed7ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the created enrollment. + class OnPremManagementServiceCreateEnrollmentResponseData + include BaseGenericModel + + # Attributes for the created enrollment. + attr_reader :attributes + + # The token hash identifier. + attr_reader :id + + # The type of the resource. The value should always be createEnrollmentResponse. + 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' => :'OnPremManagementServiceCreateEnrollmentResponseAttributes', + :'id' => :'String', + :'type' => :'OnPremManagementServiceCreateEnrollmentResponseType' + } + 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::OnPremManagementServiceCreateEnrollmentResponseData` 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/on_prem_management_service_create_enrollment_response_type.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_type.rb new file mode 100644 index 000000000000..45840bd85dd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_create_enrollment_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be createEnrollmentResponse. + class OnPremManagementServiceCreateEnrollmentResponseType + include BaseEnumModel + + CREATEENROLLMENTRESPONSE = "createEnrollmentResponse".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes.rb new file mode 100644 index 000000000000..fd15aa06953f --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes.rb @@ -0,0 +1,179 @@ +=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 an enrollment. + class OnPremManagementServiceEnrollmentAttributes + include BaseGenericModel + + # List of allowed actions for the runner. + attr_reader :actions_allowlist + + # The hostname for the runner. Required when push mode is enabled. + attr_accessor :runner_host + + # The modes the runner should operate in. + attr_reader :runner_modes + + # The name of the on-prem runner. + attr_reader :runner_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'actions_allowlist' => :'actions_allowlist', + :'runner_host' => :'runner_host', + :'runner_modes' => :'runner_modes', + :'runner_name' => :'runner_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'actions_allowlist' => :'Array', + :'runner_host' => :'String', + :'runner_modes' => :'Array', + :'runner_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OnPremManagementServiceEnrollmentAttributes` 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?(:'actions_allowlist') + if (value = attributes[:'actions_allowlist']).is_a?(Array) + self.actions_allowlist = value + end + end + + if attributes.key?(:'runner_host') + self.runner_host = attributes[:'runner_host'] + end + + if attributes.key?(:'runner_modes') + if (value = attributes[:'runner_modes']).is_a?(Array) + self.runner_modes = value + end + end + + if attributes.key?(:'runner_name') + self.runner_name = attributes[:'runner_name'] + 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 @actions_allowlist.nil? + return false if @runner_modes.nil? + return false if @runner_name.nil? + true + end + + # Custom attribute writer method with validation + # @param actions_allowlist [Object] Object to be assigned + # @!visibility private + def actions_allowlist=(actions_allowlist) + if actions_allowlist.nil? + fail ArgumentError, 'invalid value for "actions_allowlist", actions_allowlist cannot be nil.' + end + @actions_allowlist = actions_allowlist + end + + # Custom attribute writer method with validation + # @param runner_modes [Object] Object to be assigned + # @!visibility private + def runner_modes=(runner_modes) + if runner_modes.nil? + fail ArgumentError, 'invalid value for "runner_modes", runner_modes cannot be nil.' + end + @runner_modes = runner_modes + end + + # Custom attribute writer method with validation + # @param runner_name [Object] Object to be assigned + # @!visibility private + def runner_name=(runner_name) + if runner_name.nil? + fail ArgumentError, 'invalid value for "runner_name", runner_name cannot be nil.' + end + @runner_name = runner_name + 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 && + actions_allowlist == o.actions_allowlist && + runner_host == o.runner_host && + runner_modes == o.runner_modes && + runner_name == o.runner_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [actions_allowlist, runner_host, runner_modes, runner_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes_runner_modes_items.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes_runner_modes_items.rb new file mode 100644 index 000000000000..c5d06e8dc071 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_attributes_runner_modes_items.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 + # + class OnPremManagementServiceEnrollmentAttributesRunnerModesItems + include BaseEnumModel + + WORKFLOW_AUTOMATION = "workflow_automation".freeze + APP_BUILDER = "app_builder".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_data_request.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_data_request.rb new file mode 100644 index 000000000000..842f537dff99 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_data_request.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 an enrollment. + class OnPremManagementServiceEnrollmentDataRequest + include BaseGenericModel + + # Attributes for creating an enrollment. + attr_reader :attributes + + # The type of the resource. The value should always be enrollment. + 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' => :'OnPremManagementServiceEnrollmentAttributes', + :'type' => :'OnPremManagementServiceEnrollmentType' + } + 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::OnPremManagementServiceEnrollmentDataRequest` 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/on_prem_management_service_enrollment_type.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_type.rb new file mode 100644 index 000000000000..59117ef22970 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_enrollment_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 resource. The value should always be enrollment. + class OnPremManagementServiceEnrollmentType + include BaseEnumModel + + ENROLLMENT = "enrollment".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response.rb new file mode 100644 index 000000000000..181627685802 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for getting an enrollment status. + class OnPremManagementServiceGetEnrollmentResponse + include BaseGenericModel + + # Data for the enrollment status. + 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' => :'OnPremManagementServiceGetEnrollmentResponseData' + } + 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::OnPremManagementServiceGetEnrollmentResponse` 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/on_prem_management_service_get_enrollment_response_attributes.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes.rb new file mode 100644 index 000000000000..266643a83d7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for the enrollment status. + class OnPremManagementServiceGetEnrollmentResponseAttributes + include BaseGenericModel + + # The reason for enrollment failure, if applicable. + attr_reader :failure_reason + + # The runner identifier, if enrollment was successful. + attr_reader :runner_id + + # The status of the enrollment. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'failure_reason' => :'failure_reason', + :'runner_id' => :'runner_id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'failure_reason' => :'String', + :'runner_id' => :'String', + :'status' => :'OnPremManagementServiceGetEnrollmentResponseAttributesStatus' + } + 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::OnPremManagementServiceGetEnrollmentResponseAttributes` 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?(:'failure_reason') + self.failure_reason = attributes[:'failure_reason'] + end + + if attributes.key?(:'runner_id') + self.runner_id = attributes[:'runner_id'] + 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 @failure_reason.nil? + return false if @runner_id.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param failure_reason [Object] Object to be assigned + # @!visibility private + def failure_reason=(failure_reason) + if failure_reason.nil? + fail ArgumentError, 'invalid value for "failure_reason", failure_reason cannot be nil.' + end + @failure_reason = failure_reason + end + + # Custom attribute writer method with validation + # @param runner_id [Object] Object to be assigned + # @!visibility private + def runner_id=(runner_id) + if runner_id.nil? + fail ArgumentError, 'invalid value for "runner_id", runner_id cannot be nil.' + end + @runner_id = runner_id + 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 && + failure_reason == o.failure_reason && + runner_id == o.runner_id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [failure_reason, runner_id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes_status.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes_status.rb new file mode 100644 index 000000000000..8073d4915f72 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_attributes_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of the enrollment. + class OnPremManagementServiceGetEnrollmentResponseAttributesStatus + include BaseEnumModel + + NEW = "new".freeze + SUCCESS = "success".freeze + FAILED = "failed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_data.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_data.rb new file mode 100644 index 000000000000..091b35801eae --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the enrollment status. + class OnPremManagementServiceGetEnrollmentResponseData + include BaseGenericModel + + # Attributes for the enrollment status. + attr_reader :attributes + + # The token hash identifier. + attr_reader :id + + # The type of the resource. The value should always be getEnrollmentResponse. + 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' => :'OnPremManagementServiceGetEnrollmentResponseAttributes', + :'id' => :'String', + :'type' => :'OnPremManagementServiceGetEnrollmentResponseType' + } + 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::OnPremManagementServiceGetEnrollmentResponseData` 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/on_prem_management_service_get_enrollment_response_type.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_type.rb new file mode 100644 index 000000000000..312183dccdf5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_get_enrollment_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be getEnrollmentResponse. + class OnPremManagementServiceGetEnrollmentResponseType + include BaseEnumModel + + GETENROLLMENTRESPONSE = "getEnrollmentResponse".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_attributes.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_attributes.rb new file mode 100644 index 000000000000..e96878ce7cec --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_attributes.rb @@ -0,0 +1,174 @@ +=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 registering a token. + class OnPremManagementServiceRegisterTokenAttributes + include BaseGenericModel + + # The application identifier. + attr_accessor :app_id + + # The application version. + attr_accessor :app_version + + # The connection identifier. + attr_reader :connection_id + + # The query identifier. + attr_accessor :query_id + + # The on-prem runner identifier. + attr_reader :runner_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'app_id' => :'app_id', + :'app_version' => :'app_version', + :'connection_id' => :'connection_id', + :'query_id' => :'query_id', + :'runner_id' => :'runner_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'app_id' => :'UUID', + :'app_version' => :'Integer', + :'connection_id' => :'UUID', + :'query_id' => :'UUID', + :'runner_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OnPremManagementServiceRegisterTokenAttributes` 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?(:'app_id') + self.app_id = attributes[:'app_id'] + end + + if attributes.key?(:'app_version') + self.app_version = attributes[:'app_version'] + end + + if attributes.key?(:'connection_id') + self.connection_id = attributes[:'connection_id'] + end + + if attributes.key?(:'query_id') + self.query_id = attributes[:'query_id'] + end + + if attributes.key?(:'runner_id') + self.runner_id = attributes[:'runner_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @connection_id.nil? + return false if @runner_id.nil? + true + end + + # Custom attribute writer method with validation + # @param connection_id [Object] Object to be assigned + # @!visibility private + def connection_id=(connection_id) + if connection_id.nil? + fail ArgumentError, 'invalid value for "connection_id", connection_id cannot be nil.' + end + @connection_id = connection_id + end + + # Custom attribute writer method with validation + # @param runner_id [Object] Object to be assigned + # @!visibility private + def runner_id=(runner_id) + if runner_id.nil? + fail ArgumentError, 'invalid value for "runner_id", runner_id cannot be nil.' + end + @runner_id = runner_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + app_id == o.app_id && + app_version == o.app_version && + connection_id == o.connection_id && + query_id == o.query_id && + runner_id == o.runner_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [app_id, app_version, connection_id, query_id, runner_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_data_request.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_data_request.rb new file mode 100644 index 000000000000..f5dab5ce60fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_data_request.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 registering a token. + class OnPremManagementServiceRegisterTokenDataRequest + include BaseGenericModel + + # Attributes for registering a token. + attr_reader :attributes + + # The type of the resource. The value should always be registerTokenRequest. + 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' => :'OnPremManagementServiceRegisterTokenAttributes', + :'type' => :'OnPremManagementServiceRegisterTokenType' + } + 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::OnPremManagementServiceRegisterTokenDataRequest` 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/on_prem_management_service_register_token_request.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_request.rb new file mode 100644 index 000000000000..72f134d47e70 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to register a token for query execution. + class OnPremManagementServiceRegisterTokenRequest + include BaseGenericModel + + # Data for registering a token. + 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' => :'OnPremManagementServiceRegisterTokenDataRequest' + } + 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::OnPremManagementServiceRegisterTokenRequest` 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/on_prem_management_service_register_token_response.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response.rb new file mode 100644 index 000000000000..326c3b615817 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for registering a token. + class OnPremManagementServiceRegisterTokenResponse + include BaseGenericModel + + # Data for the registered token. + 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' => :'OnPremManagementServiceRegisterTokenResponseData' + } + 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::OnPremManagementServiceRegisterTokenResponse` 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/on_prem_management_service_register_token_response_attributes.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_attributes.rb new file mode 100644 index 000000000000..0b8c959163b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for the registered token. + class OnPremManagementServiceRegisterTokenResponseAttributes + include BaseGenericModel + + # The token string. + attr_reader :token_string + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'token_string' => :'token_string' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'token_string' => :'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::OnPremManagementServiceRegisterTokenResponseAttributes` 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?(:'token_string') + self.token_string = attributes[:'token_string'] + 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 @token_string.nil? + true + end + + # Custom attribute writer method with validation + # @param token_string [Object] Object to be assigned + # @!visibility private + def token_string=(token_string) + if token_string.nil? + fail ArgumentError, 'invalid value for "token_string", token_string cannot be nil.' + end + @token_string = token_string + 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 && + token_string == o.token_string && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [token_string, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_data.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_data.rb new file mode 100644 index 000000000000..4f2275b4c3cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the registered token. + class OnPremManagementServiceRegisterTokenResponseData + include BaseGenericModel + + # Attributes for the registered token. + attr_reader :attributes + + # The token identifier. + attr_reader :id + + # The type of the resource. The value should always be tokenDefinitions. + 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' => :'OnPremManagementServiceRegisterTokenResponseAttributes', + :'id' => :'UUID', + :'type' => :'OnPremManagementServiceRegisterTokenResponseType' + } + 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::OnPremManagementServiceRegisterTokenResponseData` 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/on_prem_management_service_register_token_response_type.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_type.rb new file mode 100644 index 000000000000..c3c879f3aff3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be tokenDefinitions. + class OnPremManagementServiceRegisterTokenResponseType + include BaseEnumModel + + TOKENDEFINITIONS = "tokenDefinitions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_type.rb b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_type.rb new file mode 100644 index 000000000000..2476bca117c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/on_prem_management_service_register_token_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 resource. The value should always be registerTokenRequest. + class OnPremManagementServiceRegisterTokenType + include BaseEnumModel + + REGISTERTOKENREQUEST = "registerTokenRequest".freeze + end +end