From 6eaebeb574c95d84d6960eaecf0052279bb6ca7d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 24 Jan 2025 18:41:26 +0000 Subject: [PATCH] Regenerate client from commit 9120bb44 of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v2/openapi.yaml | 68 +++++++++++-------- ...ction-connection_CreateActionConnection.rs | 10 +-- ...ction_CreateActionConnection_2600083647.rs | 40 +++++++++++ ...2_action-connection_GetActionConnection.rs | 8 +-- ...nnection_GetActionConnection_2273648770.rs | 18 +++++ ...ction-connection_UpdateActionConnection.rs | 12 ++-- ...ction_UpdateActionConnection_2280399724.rs | 44 ++++++++++++ src/datadogV2/api/api_action_connection.rs | 21 +++--- .../model_action_connection_attributes.rs | 2 +- ...del_action_connection_attributes_update.rs | 2 +- .../model/model_action_connection_data.rs | 2 +- src/datadogV2/model/model_aws_assume_role.rs | 8 +-- .../model/model_aws_assume_role_update.rs | 2 +- .../model_create_action_connection_request.rs | 2 +- ...model_create_action_connection_response.rs | 2 +- .../model_get_action_connection_response.rs | 2 +- src/datadogV2/model/model_http_integration.rs | 2 +- .../model/model_http_integration_update.rs | 2 +- .../model_update_action_connection_request.rs | 2 +- .../features/v2/action_connection.feature | 63 +++++++++++------ 21 files changed, 231 insertions(+), 89 deletions(-) create mode 100644 examples/v2_action-connection_CreateActionConnection_2600083647.rs create mode 100644 examples/v2_action-connection_GetActionConnection_2273648770.rs create mode 100644 examples/v2_action-connection_UpdateActionConnection_2280399724.rs diff --git a/.apigentools-info b/.apigentools-info index 2be8d3bdf..116ba6710 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-23 22:24:29.403152", - "spec_repo_commit": "6a31fa8c" + "regenerated": "2025-01-24 18:35:51.026262", + "spec_repo_commit": "9120bb44" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-23 22:24:29.418552", - "spec_repo_commit": "6a31fa8c" + "regenerated": "2025-01-24 18:35:51.041263", + "spec_repo_commit": "9120bb44" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1f5214bdc..cdf67d3b2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -207,7 +207,7 @@ components: schema: type: string ConnectionId: - description: The ID of the action connection + description: The ID of the Action Connection. in: path name: connection_id required: true @@ -1221,23 +1221,23 @@ components: description: The definition of `AWSAssumeRole` object. properties: account_id: - description: AWS account the connection is created for + description: AWS account the connection is created for. example: '111222333444' pattern: ^\d{12}$ type: string external_id: description: External ID used to scope which connection can be used to assume - the role + the role. example: 33a1011635c44b38a064cf14e82e1d8f readOnly: true type: string principal_id: - description: AWS account that will assume the role + description: AWS account that will assume the role. example: '123456789012' readOnly: true type: string role: - description: Role to assume + description: Role to assume. example: my-role type: string type: @@ -1259,7 +1259,7 @@ components: description: The definition of `AWSAssumeRoleUpdate` object. properties: account_id: - description: AWS account the connection is created for + description: AWS account the connection is created for. example: '111222333444' pattern: ^\d{12}$ type: string @@ -1669,7 +1669,7 @@ components: integration: $ref: '#/components/schemas/ActionConnectionIntegration' name: - description: Name of the connection + description: Name of the connection. example: My AWS Connection type: string required: @@ -1682,7 +1682,7 @@ components: integration: $ref: '#/components/schemas/ActionConnectionIntegrationUpdate' name: - description: Name of the connection + description: Name of the connection. example: My AWS Connection type: string type: object @@ -1692,7 +1692,7 @@ components: attributes: $ref: '#/components/schemas/ActionConnectionAttributes' id: - description: The connection identifier + description: The connection identifier. readOnly: true type: string type: @@ -7193,7 +7193,7 @@ components: x-enum-varnames: - COST_BY_ORG CreateActionConnectionRequest: - description: Request used to create an action connection. + description: Request used to create an Action Connection. properties: data: $ref: '#/components/schemas/ActionConnectionData' @@ -7201,7 +7201,7 @@ components: - data type: object CreateActionConnectionResponse: - description: The response for a created connection + description: The response for a created connection. properties: data: $ref: '#/components/schemas/ActionConnectionData' @@ -12428,7 +12428,7 @@ components: x-enum-varnames: - GCP_SERVICE_ACCOUNT GetActionConnectionResponse: - description: The response for found connection + description: The response for found connection. properties: data: $ref: '#/components/schemas/ActionConnectionData' @@ -12818,7 +12818,7 @@ components: description: The definition of `HTTPIntegration` object. properties: base_url: - description: Base HTTP url for the integration + description: Base HTTP url for the integration. example: http://datadoghq.com pattern: url type: string @@ -12843,7 +12843,7 @@ components: description: The definition of `HTTPIntegrationUpdate` object. properties: base_url: - description: Base HTTP url for the integration + description: Base HTTP url for the integration. example: http://datadoghq.com pattern: url type: string @@ -29362,7 +29362,7 @@ components: type: string type: object UpdateActionConnectionRequest: - description: Request used to update an action connection. + description: Request used to update an Action Connection. properties: data: $ref: '#/components/schemas/ActionConnectionDataUpdate' @@ -30918,7 +30918,7 @@ openapi: 3.0.0 paths: /api/v2/actions/connections: post: - description: Create a new Action Connection + description: Create a new Action Connection. operationId: CreateActionConnection requestBody: content: @@ -30932,7 +30932,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateActionConnectionResponse' - description: Successfully created Action Connection + description: Successfully created an Action Connection. '400': content: application/json: @@ -30954,9 +30954,13 @@ paths: summary: Create a new Action Connection tags: - Action Connection + x-permission: + operator: OR + permissions: + - connection_read /api/v2/actions/connections/{connection_id}: delete: - description: Delete an existing Action Connection + description: Delete an existing Action Connection. operationId: DeleteActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -30989,7 +30993,7 @@ paths: permissions: - connection_write get: - description: Get an existing Action Connection + description: Get an existing Action Connection. operationId: GetActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -30999,7 +31003,7 @@ paths: application/json: schema: $ref: '#/components/schemas/GetActionConnectionResponse' - description: Successfully get Action Connection + description: Successfully got an Action Connection. '400': content: application/json: @@ -31027,6 +31031,10 @@ paths: summary: Get an existing Action Connection tags: - Action Connection + x-permission: + operator: OR + permissions: + - connection_read patch: description: Update an existing Action Connection operationId: UpdateActionConnection @@ -31037,7 +31045,7 @@ paths: application/json: schema: $ref: '#/components/schemas/UpdateActionConnectionRequest' - description: Update an existing Action Connection request body + description: Update an existing Action Connection request body. required: true responses: '200': @@ -31045,7 +31053,7 @@ paths: application/json: schema: $ref: '#/components/schemas/UpdateActionConnectionResponse' - description: Successfully updated Action Connection + description: Successfully updated an Action Connection. '400': content: application/json: @@ -31073,6 +31081,10 @@ paths: summary: Update an existing Action Connection tags: - Action Connection + x-permission: + operator: OR + permissions: + - connection_write /api/v2/agentless_scanning/accounts/aws: get: description: Fetches the scan options configured for AWS accounts. @@ -49080,13 +49092,15 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection name: AWS Logs Integration -- description: "Action connections extend your installed integrations and allow you - to take action in your third-party systems\n(e.g. AWS, GitLab, and Statuspage) - with Datadog\u2019s Workflow Automation and App Builder products.\n\nDatadog\u2019s +- description: "Action Connections extend your installed integrations and allow you + to take action in your third-party systems\n(e.g. AWS, GitLab, and OpenAI) with + Datadog\u2019s [Workflow Automation](https://docs.datadoghq.com/service_management/workflows/)\nand + [App Builder](https://docs.datadoghq.com/service_management/app_builder/) products.\n\nDatadog\u2019s Integrations automatically provide authentication for Slack, Microsoft Teams, - PagerDuty, Opsgenie,\nJIRA, GitHub, and Statuspage. You do not need additional + PagerDuty, Opsgenie,\nJira, GitHub, and Statuspage. You do not need additional connections in order to access these tools within\nWorkflow Automation and App - Builder.\n\nWe offer granular access control for editing and resolving connections." + Builder.\n\nWe offer granular access control for editing and resolving connections.\n\n**Note:** + The Action Connection API currently supports AWS and HTTP integrations." externalDocs: description: Find out more at url: https://docs.datadoghq.com/service_management/workflows/connections/ diff --git a/examples/v2_action-connection_CreateActionConnection.rs b/examples/v2_action-connection_CreateActionConnection.rs index 1376df05e..904abf43a 100644 --- a/examples/v2_action-connection_CreateActionConnection.rs +++ b/examples/v2_action-connection_CreateActionConnection.rs @@ -1,5 +1,5 @@ -// Create a new Action Connection returns "Successfully created Action Connection" -// response +// Create a new Action Connection returns "Successfully created an Action +// Connection." response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; use datadog_api_client::datadogV2::model::AWSAssumeRole; @@ -19,13 +19,13 @@ async fn main() { ActionConnectionAttributes::new( ActionConnectionIntegration::AWSIntegration(Box::new(AWSIntegration::new( AWSCredentials::AWSAssumeRole(Box::new(AWSAssumeRole::new( - "123456789123".to_string(), - "MyRoleUpdated".to_string(), + "111222333444".to_string(), + "my-role".to_string(), AWSAssumeRoleType::AWSASSUMEROLE, ))), AWSIntegrationType::AWS, ))), - "Cassette Connection DELETE_ME".to_string(), + "My AWS Connection".to_string(), ), ActionConnectionDataType::ACTION_CONNECTION, )); diff --git a/examples/v2_action-connection_CreateActionConnection_2600083647.rs b/examples/v2_action-connection_CreateActionConnection_2600083647.rs new file mode 100644 index 000000000..1376df05e --- /dev/null +++ b/examples/v2_action-connection_CreateActionConnection_2600083647.rs @@ -0,0 +1,40 @@ +// Create a new Action Connection returns "Successfully created Action Connection" +// response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; +use datadog_api_client::datadogV2::model::AWSAssumeRole; +use datadog_api_client::datadogV2::model::AWSAssumeRoleType; +use datadog_api_client::datadogV2::model::AWSCredentials; +use datadog_api_client::datadogV2::model::AWSIntegration; +use datadog_api_client::datadogV2::model::AWSIntegrationType; +use datadog_api_client::datadogV2::model::ActionConnectionAttributes; +use datadog_api_client::datadogV2::model::ActionConnectionData; +use datadog_api_client::datadogV2::model::ActionConnectionDataType; +use datadog_api_client::datadogV2::model::ActionConnectionIntegration; +use datadog_api_client::datadogV2::model::CreateActionConnectionRequest; + +#[tokio::main] +async fn main() { + let body = CreateActionConnectionRequest::new(ActionConnectionData::new( + ActionConnectionAttributes::new( + ActionConnectionIntegration::AWSIntegration(Box::new(AWSIntegration::new( + AWSCredentials::AWSAssumeRole(Box::new(AWSAssumeRole::new( + "123456789123".to_string(), + "MyRoleUpdated".to_string(), + AWSAssumeRoleType::AWSASSUMEROLE, + ))), + AWSIntegrationType::AWS, + ))), + "Cassette Connection DELETE_ME".to_string(), + ), + ActionConnectionDataType::ACTION_CONNECTION, + )); + let configuration = datadog::Configuration::new(); + let api = ActionConnectionAPI::with_config(configuration); + let resp = api.create_action_connection(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_action-connection_GetActionConnection.rs b/examples/v2_action-connection_GetActionConnection.rs index 79c046774..91904671b 100644 --- a/examples/v2_action-connection_GetActionConnection.rs +++ b/examples/v2_action-connection_GetActionConnection.rs @@ -1,5 +1,5 @@ -// Get an existing Action Connection returns "Successfully get Action Connection" -// response +// Get an existing Action Connection returns "Successfully got an Action +// Connection." response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; @@ -7,9 +7,7 @@ use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; async fn main() { let configuration = datadog::Configuration::new(); let api = ActionConnectionAPI::with_config(configuration); - let resp = api - .get_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".to_string()) - .await; + let resp = api.get_action_connection("connection_id".to_string()).await; if let Ok(value) = resp { println!("{:#?}", value); } else { diff --git a/examples/v2_action-connection_GetActionConnection_2273648770.rs b/examples/v2_action-connection_GetActionConnection_2273648770.rs new file mode 100644 index 000000000..79c046774 --- /dev/null +++ b/examples/v2_action-connection_GetActionConnection_2273648770.rs @@ -0,0 +1,18 @@ +// Get an existing Action Connection returns "Successfully get Action Connection" +// response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = ActionConnectionAPI::with_config(configuration); + let resp = api + .get_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_action-connection_UpdateActionConnection.rs b/examples/v2_action-connection_UpdateActionConnection.rs index 856a0c8e0..3e69e3c87 100644 --- a/examples/v2_action-connection_UpdateActionConnection.rs +++ b/examples/v2_action-connection_UpdateActionConnection.rs @@ -1,5 +1,5 @@ -// Update an existing Action Connection returns "Successfully updated Action -// Connection" response +// Update an existing Action Connection returns "Successfully updated an Action +// Connection." response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; use datadog_api_client::datadogV2::model::AWSAssumeRoleType; @@ -22,19 +22,19 @@ async fn main() { AWSIntegrationUpdate::new(AWSIntegrationType::AWS).credentials( AWSCredentialsUpdate::AWSAssumeRoleUpdate(Box::new( AWSAssumeRoleUpdate::new(AWSAssumeRoleType::AWSASSUMEROLE) - .account_id("123456789123".to_string()) - .role("MyRoleUpdated".to_string()), + .account_id("111222333444".to_string()) + .role("my-role".to_string()), )), ), ), )) - .name("Cassette Connection".to_string()), + .name("My AWS Connection".to_string()), ActionConnectionDataType::ACTION_CONNECTION, )); let configuration = datadog::Configuration::new(); let api = ActionConnectionAPI::with_config(configuration); let resp = api - .update_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".to_string(), body) + .update_action_connection("connection_id".to_string(), body) .await; if let Ok(value) = resp { println!("{:#?}", value); diff --git a/examples/v2_action-connection_UpdateActionConnection_2280399724.rs b/examples/v2_action-connection_UpdateActionConnection_2280399724.rs new file mode 100644 index 000000000..856a0c8e0 --- /dev/null +++ b/examples/v2_action-connection_UpdateActionConnection_2280399724.rs @@ -0,0 +1,44 @@ +// Update an existing Action Connection returns "Successfully updated Action +// Connection" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI; +use datadog_api_client::datadogV2::model::AWSAssumeRoleType; +use datadog_api_client::datadogV2::model::AWSAssumeRoleUpdate; +use datadog_api_client::datadogV2::model::AWSCredentialsUpdate; +use datadog_api_client::datadogV2::model::AWSIntegrationType; +use datadog_api_client::datadogV2::model::AWSIntegrationUpdate; +use datadog_api_client::datadogV2::model::ActionConnectionAttributesUpdate; +use datadog_api_client::datadogV2::model::ActionConnectionDataType; +use datadog_api_client::datadogV2::model::ActionConnectionDataUpdate; +use datadog_api_client::datadogV2::model::ActionConnectionIntegrationUpdate; +use datadog_api_client::datadogV2::model::UpdateActionConnectionRequest; + +#[tokio::main] +async fn main() { + let body = UpdateActionConnectionRequest::new(ActionConnectionDataUpdate::new( + ActionConnectionAttributesUpdate::new() + .integration(ActionConnectionIntegrationUpdate::AWSIntegrationUpdate( + Box::new( + AWSIntegrationUpdate::new(AWSIntegrationType::AWS).credentials( + AWSCredentialsUpdate::AWSAssumeRoleUpdate(Box::new( + AWSAssumeRoleUpdate::new(AWSAssumeRoleType::AWSASSUMEROLE) + .account_id("123456789123".to_string()) + .role("MyRoleUpdated".to_string()), + )), + ), + ), + )) + .name("Cassette Connection".to_string()), + ActionConnectionDataType::ACTION_CONNECTION, + )); + let configuration = datadog::Configuration::new(); + let api = ActionConnectionAPI::with_config(configuration); + let resp = api + .update_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".to_string(), body) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/src/datadogV2/api/api_action_connection.rs b/src/datadogV2/api/api_action_connection.rs index 27b6fb7c5..9f035a857 100644 --- a/src/datadogV2/api/api_action_connection.rs +++ b/src/datadogV2/api/api_action_connection.rs @@ -42,14 +42,17 @@ pub enum UpdateActionConnectionError { UnknownValue(serde_json::Value), } -/// Action connections extend your installed integrations and allow you to take action in your third-party systems -/// (e.g. AWS, GitLab, and Statuspage) with Datadog’s Workflow Automation and App Builder products. +/// Action Connections extend your installed integrations and allow you to take action in your third-party systems +/// (e.g. AWS, GitLab, and OpenAI) with Datadog’s [Workflow Automation]() +/// and [App Builder]() products. /// /// Datadog’s Integrations automatically provide authentication for Slack, Microsoft Teams, PagerDuty, Opsgenie, -/// JIRA, GitHub, and Statuspage. You do not need additional connections in order to access these tools within +/// Jira, GitHub, and Statuspage. You do not need additional connections in order to access these tools within /// Workflow Automation and App Builder. /// /// We offer granular access control for editing and resolving connections. +/// +/// **Note:** The Action Connection API currently supports AWS and HTTP integrations. #[derive(Debug, Clone)] pub struct ActionConnectionAPI { config: datadog::Configuration, @@ -114,7 +117,7 @@ impl ActionConnectionAPI { Self { config, client } } - /// Create a new Action Connection + /// Create a new Action Connection. pub async fn create_action_connection( &self, body: crate::datadogV2::model::CreateActionConnectionRequest, @@ -136,7 +139,7 @@ impl ActionConnectionAPI { } } - /// Create a new Action Connection + /// Create a new Action Connection. pub async fn create_action_connection_with_http_info( &self, body: crate::datadogV2::model::CreateActionConnectionRequest, @@ -268,7 +271,7 @@ impl ActionConnectionAPI { } } - /// Delete an existing Action Connection + /// Delete an existing Action Connection. pub async fn delete_action_connection( &self, connection_id: String, @@ -282,7 +285,7 @@ impl ActionConnectionAPI { } } - /// Delete an existing Action Connection + /// Delete an existing Action Connection. pub async fn delete_action_connection_with_http_info( &self, connection_id: String, @@ -359,7 +362,7 @@ impl ActionConnectionAPI { } } - /// Get an existing Action Connection + /// Get an existing Action Connection. pub async fn get_action_connection( &self, connection_id: String, @@ -384,7 +387,7 @@ impl ActionConnectionAPI { } } - /// Get an existing Action Connection + /// Get an existing Action Connection. pub async fn get_action_connection_with_http_info( &self, connection_id: String, diff --git a/src/datadogV2/model/model_action_connection_attributes.rs b/src/datadogV2/model/model_action_connection_attributes.rs index 5b136e4d9..5f6e8cd4d 100644 --- a/src/datadogV2/model/model_action_connection_attributes.rs +++ b/src/datadogV2/model/model_action_connection_attributes.rs @@ -14,7 +14,7 @@ pub struct ActionConnectionAttributes { /// The definition of `ActionConnectionIntegration` object. #[serde(rename = "integration")] pub integration: crate::datadogV2::model::ActionConnectionIntegration, - /// Name of the connection + /// Name of the connection. #[serde(rename = "name")] pub name: String, #[serde(flatten)] diff --git a/src/datadogV2/model/model_action_connection_attributes_update.rs b/src/datadogV2/model/model_action_connection_attributes_update.rs index 54b6c955c..95e0d2891 100644 --- a/src/datadogV2/model/model_action_connection_attributes_update.rs +++ b/src/datadogV2/model/model_action_connection_attributes_update.rs @@ -14,7 +14,7 @@ pub struct ActionConnectionAttributesUpdate { /// The definition of `ActionConnectionIntegrationUpdate` object. #[serde(rename = "integration")] pub integration: Option, - /// Name of the connection + /// Name of the connection. #[serde(rename = "name")] pub name: Option, #[serde(flatten)] diff --git a/src/datadogV2/model/model_action_connection_data.rs b/src/datadogV2/model/model_action_connection_data.rs index 08891cc41..051f33a0c 100644 --- a/src/datadogV2/model/model_action_connection_data.rs +++ b/src/datadogV2/model/model_action_connection_data.rs @@ -14,7 +14,7 @@ pub struct ActionConnectionData { /// The definition of `ActionConnectionAttributes` object. #[serde(rename = "attributes")] pub attributes: crate::datadogV2::model::ActionConnectionAttributes, - /// The connection identifier + /// The connection identifier. #[serde(rename = "id")] pub id: Option, /// The definition of `ActionConnectionDataType` object. diff --git a/src/datadogV2/model/model_aws_assume_role.rs b/src/datadogV2/model/model_aws_assume_role.rs index 7cb51eb90..836c15c9d 100644 --- a/src/datadogV2/model/model_aws_assume_role.rs +++ b/src/datadogV2/model/model_aws_assume_role.rs @@ -11,16 +11,16 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct AWSAssumeRole { - /// AWS account the connection is created for + /// AWS account the connection is created for. #[serde(rename = "account_id")] pub account_id: String, - /// External ID used to scope which connection can be used to assume the role + /// External ID used to scope which connection can be used to assume the role. #[serde(rename = "external_id")] pub external_id: Option, - /// AWS account that will assume the role + /// AWS account that will assume the role. #[serde(rename = "principal_id")] pub principal_id: Option, - /// Role to assume + /// Role to assume. #[serde(rename = "role")] pub role: String, /// The definition of `AWSAssumeRoleType` object. diff --git a/src/datadogV2/model/model_aws_assume_role_update.rs b/src/datadogV2/model/model_aws_assume_role_update.rs index 9ff3cd201..4b199b40f 100644 --- a/src/datadogV2/model/model_aws_assume_role_update.rs +++ b/src/datadogV2/model/model_aws_assume_role_update.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct AWSAssumeRoleUpdate { - /// AWS account the connection is created for + /// AWS account the connection is created for. #[serde(rename = "account_id")] pub account_id: Option, /// The `AWSAssumeRoleUpdate` `generate_new_external_id`. diff --git a/src/datadogV2/model/model_create_action_connection_request.rs b/src/datadogV2/model/model_create_action_connection_request.rs index 6e3faccb5..2b61b5eed 100644 --- a/src/datadogV2/model/model_create_action_connection_request.rs +++ b/src/datadogV2/model/model_create_action_connection_request.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Request used to create an action connection. +/// Request used to create an Action Connection. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_create_action_connection_response.rs b/src/datadogV2/model/model_create_action_connection_response.rs index 07250abe6..be3a19bb2 100644 --- a/src/datadogV2/model/model_create_action_connection_response.rs +++ b/src/datadogV2/model/model_create_action_connection_response.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The response for a created connection +/// The response for a created connection. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_get_action_connection_response.rs b/src/datadogV2/model/model_get_action_connection_response.rs index 4c8b63e0d..faa4e489a 100644 --- a/src/datadogV2/model/model_get_action_connection_response.rs +++ b/src/datadogV2/model/model_get_action_connection_response.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The response for found connection +/// The response for found connection. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_http_integration.rs b/src/datadogV2/model/model_http_integration.rs index b7aabd9c0..e215e2eef 100644 --- a/src/datadogV2/model/model_http_integration.rs +++ b/src/datadogV2/model/model_http_integration.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct HTTPIntegration { - /// Base HTTP url for the integration + /// Base HTTP url for the integration. #[serde(rename = "base_url")] pub base_url: String, /// The definition of `HTTPCredentials` object. diff --git a/src/datadogV2/model/model_http_integration_update.rs b/src/datadogV2/model/model_http_integration_update.rs index db2cdfc43..fc450c3f8 100644 --- a/src/datadogV2/model/model_http_integration_update.rs +++ b/src/datadogV2/model/model_http_integration_update.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct HTTPIntegrationUpdate { - /// Base HTTP url for the integration + /// Base HTTP url for the integration. #[serde(rename = "base_url")] pub base_url: Option, /// The definition of `HTTPCredentialsUpdate` object. diff --git a/src/datadogV2/model/model_update_action_connection_request.rs b/src/datadogV2/model/model_update_action_connection_request.rs index b584009b5..b4da8eb93 100644 --- a/src/datadogV2/model/model_update_action_connection_request.rs +++ b/src/datadogV2/model/model_update_action_connection_request.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Request used to update an action connection. +/// Request used to update an Action Connection. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/tests/scenarios/features/v2/action_connection.feature b/tests/scenarios/features/v2/action_connection.feature index f379fc1a0..dc8dab1fb 100644 --- a/tests/scenarios/features/v2/action_connection.feature +++ b/tests/scenarios/features/v2/action_connection.feature @@ -1,41 +1,51 @@ @endpoint(action-connection) @endpoint(action-connection-v2) Feature: Action Connection - Action connections extend your installed integrations and allow you to - take action in your third-party systems (e.g. AWS, GitLab, and Statuspage) - with Datadog’s Workflow Automation and App Builder products. Datadog’s - Integrations automatically provide authentication for Slack, Microsoft - Teams, PagerDuty, Opsgenie, JIRA, GitHub, and Statuspage. You do not need - additional connections in order to access these tools within Workflow - Automation and App Builder. We offer granular access control for editing - and resolving connections. + Action Connections extend your installed integrations and allow you to + take action in your third-party systems (e.g. AWS, GitLab, and OpenAI) + with Datadog’s [Workflow + Automation](https://docs.datadoghq.com/service_management/workflows/) and + [App Builder](https://docs.datadoghq.com/service_management/app_builder/) + products. Datadog’s Integrations automatically provide authentication for + Slack, Microsoft Teams, PagerDuty, Opsgenie, Jira, GitHub, and Statuspage. + You do not need additional connections in order to access these tools + within Workflow Automation and App Builder. We offer granular access + control for editing and resolving connections. **Note:** The Action + Connection API currently supports AWS and HTTP integrations. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system And an instance of "ActionConnection" API - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Create a new Action Connection returns "Bad Request" response Given new "CreateActionConnection" request And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"1"}}}}} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Create a new Action Connection returns "Successfully created Action Connection" response Given new "CreateActionConnection" request And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection DELETE_ME","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}} When the request is sent Then the response status is 201 Successfully created Action Connection - @team:DataDog/workflow-automation-dev + @generated @skip @team:Datadog/action-platform + Scenario: Create a new Action Connection returns "Successfully created an Action Connection." response + Given new "CreateActionConnection" request + And body with value {"data": {"attributes": {"integration": {"credentials": {"account_id": "111222333444", "role": "my-role", "type": "AWSAssumeRole"}, "type": "AWS"}, "name": "My AWS Connection"}, "type": "action_connection"}} + When the request is sent + Then the response status is 201 Successfully created an Action Connection. + + @team:Datadog/action-platform Scenario: Delete an existing Action Connection returns "Not Found" response Given new "DeleteActionConnection" request And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" When the request is sent Then the response status is 404 Not Found - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Delete an existing Action Connection returns "Successfully deleted Action Connection" response Given there is a valid "action_connection" in the system And new "DeleteActionConnection" request @@ -43,35 +53,42 @@ Feature: Action Connection When the request is sent Then the response status is 204 The resource was deleted successfully. - @generated @skip @team:DataDog/workflow-automation-dev + @generated @skip @team:Datadog/action-platform Scenario: Delete an existing Action Connection returns "The resource was deleted successfully." response Given new "DeleteActionConnection" request And request contains "connection_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 The resource was deleted successfully. - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Get an existing Action Connection returns "Bad Request" response Given new "GetActionConnection" request And request contains "connection_id" parameter with value "bad-format" When the request is sent Then the response status is 400 Bad Request - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Get an existing Action Connection returns "Not Found" response Given new "GetActionConnection" request And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" When the request is sent Then the response status is 404 Not Found - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Get an existing Action Connection returns "Successfully get Action Connection" response Given new "GetActionConnection" request And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" When the request is sent Then the response status is 200 Successfully get Action Connection - @team:DataDog/workflow-automation-dev + @generated @skip @team:Datadog/action-platform + Scenario: Get an existing Action Connection returns "Successfully got an Action Connection." response + Given new "GetActionConnection" request + And request contains "connection_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully got an Action Connection. + + @team:Datadog/action-platform Scenario: Update an existing Action Connection returns "Bad Request" response Given new "UpdateActionConnection" request And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" @@ -79,7 +96,7 @@ Feature: Action Connection When the request is sent Then the response status is 400 Bad Request - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Update an existing Action Connection returns "Not Found" response Given new "UpdateActionConnection" request And request contains "connection_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" @@ -87,10 +104,18 @@ Feature: Action Connection When the request is sent Then the response status is 404 Not Found - @team:DataDog/workflow-automation-dev + @team:Datadog/action-platform Scenario: Update an existing Action Connection returns "Successfully updated Action Connection" response Given new "UpdateActionConnection" request And request contains "connection_id" parameter with value "cb460d51-3c88-4e87-adac-d47131d0423d" And body with value {"data":{"type":"action_connection","attributes":{"name":"Cassette Connection","integration":{"type":"AWS","credentials":{"type":"AWSAssumeRole","role":"MyRoleUpdated","account_id":"123456789123"}}}}} When the request is sent Then the response status is 200 Successfully updated Action Connection + + @generated @skip @team:Datadog/action-platform + Scenario: Update an existing Action Connection returns "Successfully updated an Action Connection." response + Given new "UpdateActionConnection" request + And request contains "connection_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"integration": {"credentials": {"account_id": "111222333444", "role": "my-role", "type": "AWSAssumeRole"}, "type": "AWS"}, "name": "My AWS Connection"}, "type": "action_connection"}} + When the request is sent + Then the response status is 200 Successfully updated an Action Connection.