Skip to content

Commit 6888ad4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Delete api/v2/cost/aws_related_accounts from spec (#356)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 878fc67 commit 6888ad4

14 files changed

+4
-748
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-31 16:03:52.395794",
8-
"spec_repo_commit": "a11da7b5"
7+
"regenerated": "2024-10-31 16:41:33.190685",
8+
"spec_repo_commit": "63c441b2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-31 16:03:52.415002",
13-
"spec_repo_commit": "a11da7b5"
12+
"regenerated": "2024-10-31 16:41:33.209528",
13+
"spec_repo_commit": "63c441b2"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -976,49 +976,6 @@ components:
976976
type: string
977977
x-enum-varnames:
978978
- API_KEYS
979-
AWSRelatedAccount:
980-
description: AWS related account.
981-
properties:
982-
attributes:
983-
$ref: '#/components/schemas/AWSRelatedAccountAttributes'
984-
id:
985-
description: The AWS account ID.
986-
example: '123456789123'
987-
type: string
988-
type:
989-
$ref: '#/components/schemas/AWSRelatedAccountType'
990-
required:
991-
- id
992-
- type
993-
type: object
994-
AWSRelatedAccountAttributes:
995-
description: Attributes for an AWS related account.
996-
properties:
997-
has_datadog_integration:
998-
description: Whether or not the AWS account has a Datadog integration.
999-
type: boolean
1000-
name:
1001-
description: The name of the AWS account.
1002-
type: string
1003-
type: object
1004-
AWSRelatedAccountType:
1005-
default: aws_account
1006-
description: Type of AWS related account.
1007-
enum:
1008-
- aws_account
1009-
example: aws_account
1010-
type: string
1011-
x-enum-varnames:
1012-
- AWS_ACCOUNT
1013-
AWSRelatedAccountsResponse:
1014-
description: List of AWS related accounts.
1015-
properties:
1016-
data:
1017-
description: An AWS related account.
1018-
items:
1019-
$ref: '#/components/schemas/AWSRelatedAccount'
1020-
type: array
1021-
type: object
1022979
ActiveBillingDimensionsAttributes:
1023980
description: List of active billing dimensions.
1024981
properties:
@@ -28974,53 +28931,6 @@ paths:
2897428931
operator: OR
2897528932
permissions:
2897628933
- cloud_cost_management_write
28977-
/api/v2/cost/aws_related_accounts:
28978-
get:
28979-
deprecated: true
28980-
description: List the AWS accounts in an organization by calling 'organizations:ListAccounts'
28981-
from the specified management account.
28982-
operationId: ListAWSRelatedAccounts
28983-
parameters:
28984-
- description: The ID of the management account to filter by.
28985-
example: '123456789123'
28986-
in: query
28987-
name: filter[management_account_id]
28988-
required: true
28989-
schema:
28990-
type: string
28991-
responses:
28992-
'200':
28993-
content:
28994-
application/json:
28995-
schema:
28996-
$ref: '#/components/schemas/AWSRelatedAccountsResponse'
28997-
description: OK
28998-
'400':
28999-
content:
29000-
application/json:
29001-
schema:
29002-
$ref: '#/components/schemas/APIErrorResponse'
29003-
description: Bad Request
29004-
'403':
29005-
content:
29006-
application/json:
29007-
schema:
29008-
$ref: '#/components/schemas/APIErrorResponse'
29009-
description: Forbidden
29010-
'429':
29011-
$ref: '#/components/responses/TooManyRequestsResponse'
29012-
security:
29013-
- apiKeyAuth: []
29014-
appKeyAuth: []
29015-
- AuthZ:
29016-
- cloud_cost_management_read
29017-
summary: List related AWS accounts
29018-
tags:
29019-
- Cloud Cost Management
29020-
x-permission:
29021-
operator: OR
29022-
permissions:
29023-
- cloud_cost_management_read
2902428934
/api/v2/cost/azure_uc_config:
2902528935
get:
2902628936
description: List the Azure configs.

examples/v2_cloud-cost-management_ListAWSRelatedAccounts.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/datadogV2/api/api_cloud_cost_management.rs

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ pub enum GetCustomCostsFileError {
6666
UnknownValue(serde_json::Value),
6767
}
6868

69-
/// ListAWSRelatedAccountsError is a struct for typed errors of method [`CloudCostManagementAPI::list_aws_related_accounts`]
70-
#[derive(Debug, Clone, Serialize, Deserialize)]
71-
#[serde(untagged)]
72-
pub enum ListAWSRelatedAccountsError {
73-
APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
74-
UnknownValue(serde_json::Value),
75-
}
76-
7769
/// ListCostAWSCURConfigsError is a struct for typed errors of method [`CloudCostManagementAPI::list_cost_awscur_configs`]
7870
#[derive(Debug, Clone, Serialize, Deserialize)]
7971
#[serde(untagged)]
@@ -980,122 +972,6 @@ impl CloudCostManagementAPI {
980972
}
981973
}
982974

983-
/// List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account.
984-
pub async fn list_aws_related_accounts(
985-
&self,
986-
filter_management_account_id: String,
987-
) -> Result<
988-
crate::datadogV2::model::AWSRelatedAccountsResponse,
989-
datadog::Error<ListAWSRelatedAccountsError>,
990-
> {
991-
match self
992-
.list_aws_related_accounts_with_http_info(filter_management_account_id)
993-
.await
994-
{
995-
Ok(response_content) => {
996-
if let Some(e) = response_content.entity {
997-
Ok(e)
998-
} else {
999-
Err(datadog::Error::Serde(serde::de::Error::custom(
1000-
"response content was None",
1001-
)))
1002-
}
1003-
}
1004-
Err(err) => Err(err),
1005-
}
1006-
}
1007-
1008-
/// List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account.
1009-
pub async fn list_aws_related_accounts_with_http_info(
1010-
&self,
1011-
filter_management_account_id: String,
1012-
) -> Result<
1013-
datadog::ResponseContent<crate::datadogV2::model::AWSRelatedAccountsResponse>,
1014-
datadog::Error<ListAWSRelatedAccountsError>,
1015-
> {
1016-
let local_configuration = &self.config;
1017-
let operation_id = "v2.list_aws_related_accounts";
1018-
1019-
let local_client = &self.client;
1020-
1021-
let local_uri_str = format!(
1022-
"{}/api/v2/cost/aws_related_accounts",
1023-
local_configuration.get_operation_host(operation_id)
1024-
);
1025-
let mut local_req_builder =
1026-
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
1027-
1028-
local_req_builder = local_req_builder.query(&[(
1029-
"filter[management_account_id]",
1030-
&filter_management_account_id.to_string(),
1031-
)]);
1032-
1033-
// build headers
1034-
let mut headers = HeaderMap::new();
1035-
headers.insert("Accept", HeaderValue::from_static("application/json"));
1036-
1037-
// build user agent
1038-
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
1039-
Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
1040-
Err(e) => {
1041-
log::warn!("Failed to parse user agent header: {e}, falling back to default");
1042-
headers.insert(
1043-
reqwest::header::USER_AGENT,
1044-
HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
1045-
)
1046-
}
1047-
};
1048-
1049-
// build auth
1050-
if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
1051-
headers.insert(
1052-
"DD-API-KEY",
1053-
HeaderValue::from_str(local_key.key.as_str())
1054-
.expect("failed to parse DD-API-KEY header"),
1055-
);
1056-
};
1057-
if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
1058-
headers.insert(
1059-
"DD-APPLICATION-KEY",
1060-
HeaderValue::from_str(local_key.key.as_str())
1061-
.expect("failed to parse DD-APPLICATION-KEY header"),
1062-
);
1063-
};
1064-
1065-
local_req_builder = local_req_builder.headers(headers);
1066-
let local_req = local_req_builder.build()?;
1067-
log::debug!("request content: {:?}", local_req.body());
1068-
let local_resp = local_client.execute(local_req).await?;
1069-
1070-
let local_status = local_resp.status();
1071-
let local_content = local_resp.text().await?;
1072-
log::debug!("response content: {}", local_content);
1073-
1074-
if !local_status.is_client_error() && !local_status.is_server_error() {
1075-
match serde_json::from_str::<crate::datadogV2::model::AWSRelatedAccountsResponse>(
1076-
&local_content,
1077-
) {
1078-
Ok(e) => {
1079-
return Ok(datadog::ResponseContent {
1080-
status: local_status,
1081-
content: local_content,
1082-
entity: Some(e),
1083-
})
1084-
}
1085-
Err(e) => return Err(datadog::Error::Serde(e)),
1086-
};
1087-
} else {
1088-
let local_entity: Option<ListAWSRelatedAccountsError> =
1089-
serde_json::from_str(&local_content).ok();
1090-
let local_error = datadog::ResponseContent {
1091-
status: local_status,
1092-
content: local_content,
1093-
entity: local_entity,
1094-
};
1095-
Err(datadog::Error::ResponseError(local_error))
1096-
}
1097-
}
1098-
1099975
/// List the AWS CUR configs.
1100976
pub async fn list_cost_awscur_configs(
1101977
&self,

src/datadogV2/model/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -776,14 +776,6 @@ pub mod model_aws_cur_config_patch_request_attributes;
776776
pub use self::model_aws_cur_config_patch_request_attributes::AwsCURConfigPatchRequestAttributes;
777777
pub mod model_aws_cur_config_patch_request_type;
778778
pub use self::model_aws_cur_config_patch_request_type::AwsCURConfigPatchRequestType;
779-
pub mod model_aws_related_accounts_response;
780-
pub use self::model_aws_related_accounts_response::AWSRelatedAccountsResponse;
781-
pub mod model_aws_related_account;
782-
pub use self::model_aws_related_account::AWSRelatedAccount;
783-
pub mod model_aws_related_account_attributes;
784-
pub use self::model_aws_related_account_attributes::AWSRelatedAccountAttributes;
785-
pub mod model_aws_related_account_type;
786-
pub use self::model_aws_related_account_type::AWSRelatedAccountType;
787779
pub mod model_azure_uc_configs_response;
788780
pub use self::model_azure_uc_configs_response::AzureUCConfigsResponse;
789781
pub mod model_azure_uc_config_pair;

0 commit comments

Comments
 (0)