Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1118,9 +1118,9 @@ components:
schema:
type: string
PersonalAccessTokenID:
description: The UUID of the personal access token.
description: The ID of the personal access token.
in: path
name: pat_uuid
name: pat_id
required: true
schema:
example: "00000000-0000-1234-0000-000000000000"
Expand Down Expand Up @@ -28760,11 +28760,6 @@ components:
FullPersonalAccessTokenAttributes:
description: Attributes of a full personal access token, including the token key.
properties:
alias:
description: The alias (short identifier) of the personal access token.
example: "2H9MCNMBM8FQjQ16YucXkX"
readOnly: true
type: string
created_at:
description: Creation date of the personal access token.
example: "2024-01-01T00:00:00+00:00"
Expand Down Expand Up @@ -52460,11 +52455,6 @@ components:
PersonalAccessTokenAttributes:
description: Attributes of a personal access token.
properties:
alias:
description: The alias (short identifier) of the personal access token.
example: "2H9MCNMBM8FQjQ16YucXkX"
readOnly: true
type: string
created_at:
description: Creation date of the personal access token.
example: "2024-01-01T00:00:00+00:00"
Expand Down Expand Up @@ -76731,6 +76721,10 @@ components:
description: Title of the user.
nullable: true
type: string
uuid:
description: UUID of the user.
readOnly: true
type: string
verified:
description: Whether the user is verified.
type: boolean
Expand Down Expand Up @@ -104768,7 +104762,7 @@ paths:
operator: OR
permissions:
- user_app_keys
/api/v2/personal_access_tokens/{pat_uuid}:
/api/v2/personal_access_tokens/{pat_id}:
delete:
description: Revoke a specific personal access token.
operationId: RevokePersonalAccessToken
Expand Down Expand Up @@ -114323,7 +114317,7 @@ paths:
operator: OR
permissions:
- service_account_write
/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}:
/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}:
delete:
description: Revoke a specific access token for a service account.
operationId: RevokeServiceAccountAccessToken
Expand Down
33 changes: 15 additions & 18 deletions src/datadogV2/api/api_key_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1617,15 +1617,12 @@ impl KeyManagementAPI {
/// Get a specific personal access token by its UUID.
pub async fn get_personal_access_token(
&self,
pat_uuid: String,
pat_id: String,
) -> Result<
crate::datadogV2::model::PersonalAccessTokenResponse,
datadog::Error<GetPersonalAccessTokenError>,
> {
match self
.get_personal_access_token_with_http_info(pat_uuid)
.await
{
match self.get_personal_access_token_with_http_info(pat_id).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
Expand All @@ -1642,7 +1639,7 @@ impl KeyManagementAPI {
/// Get a specific personal access token by its UUID.
pub async fn get_personal_access_token_with_http_info(
&self,
pat_uuid: String,
pat_id: String,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::PersonalAccessTokenResponse>,
datadog::Error<GetPersonalAccessTokenError>,
Expand All @@ -1653,9 +1650,9 @@ impl KeyManagementAPI {
let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/personal_access_tokens/{pat_uuid}",
"{}/api/v2/personal_access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
Expand Down Expand Up @@ -2327,10 +2324,10 @@ impl KeyManagementAPI {
/// Revoke a specific personal access token.
pub async fn revoke_personal_access_token(
&self,
pat_uuid: String,
pat_id: String,
) -> Result<(), datadog::Error<RevokePersonalAccessTokenError>> {
match self
.revoke_personal_access_token_with_http_info(pat_uuid)
.revoke_personal_access_token_with_http_info(pat_id)
.await
{
Ok(_) => Ok(()),
Expand All @@ -2341,17 +2338,17 @@ impl KeyManagementAPI {
/// Revoke a specific personal access token.
pub async fn revoke_personal_access_token_with_http_info(
&self,
pat_uuid: String,
pat_id: String,
) -> Result<datadog::ResponseContent<()>, datadog::Error<RevokePersonalAccessTokenError>> {
let local_configuration = &self.config;
let operation_id = "v2.revoke_personal_access_token";

let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/personal_access_tokens/{pat_uuid}",
"{}/api/v2/personal_access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
Expand Down Expand Up @@ -2894,14 +2891,14 @@ impl KeyManagementAPI {
/// Update a specific personal access token.
pub async fn update_personal_access_token(
&self,
pat_uuid: String,
pat_id: String,
body: crate::datadogV2::model::PersonalAccessTokenUpdateRequest,
) -> Result<
crate::datadogV2::model::PersonalAccessTokenResponse,
datadog::Error<UpdatePersonalAccessTokenError>,
> {
match self
.update_personal_access_token_with_http_info(pat_uuid, body)
.update_personal_access_token_with_http_info(pat_id, body)
.await
{
Ok(response_content) => {
Expand All @@ -2920,7 +2917,7 @@ impl KeyManagementAPI {
/// Update a specific personal access token.
pub async fn update_personal_access_token_with_http_info(
&self,
pat_uuid: String,
pat_id: String,
body: crate::datadogV2::model::PersonalAccessTokenUpdateRequest,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::PersonalAccessTokenResponse>,
Expand All @@ -2932,9 +2929,9 @@ impl KeyManagementAPI {
let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/personal_access_tokens/{pat_uuid}",
"{}/api/v2/personal_access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
Expand Down
30 changes: 15 additions & 15 deletions src/datadogV2/api/api_service_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,13 @@ impl ServiceAccountsAPI {
pub async fn get_service_account_access_token(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
) -> Result<
crate::datadogV2::model::PersonalAccessTokenResponse,
datadog::Error<GetServiceAccountAccessTokenError>,
> {
match self
.get_service_account_access_token_with_http_info(service_account_id, pat_uuid)
.get_service_account_access_token_with_http_info(service_account_id, pat_id)
.await
{
Ok(response_content) => {
Expand All @@ -866,7 +866,7 @@ impl ServiceAccountsAPI {
pub async fn get_service_account_access_token_with_http_info(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::PersonalAccessTokenResponse>,
datadog::Error<GetServiceAccountAccessTokenError>,
Expand All @@ -877,10 +877,10 @@ impl ServiceAccountsAPI {
let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}",
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
service_account_id = datadog::urlencode(service_account_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
Expand Down Expand Up @@ -1354,10 +1354,10 @@ impl ServiceAccountsAPI {
pub async fn revoke_service_account_access_token(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
) -> Result<(), datadog::Error<RevokeServiceAccountAccessTokenError>> {
match self
.revoke_service_account_access_token_with_http_info(service_account_id, pat_uuid)
.revoke_service_account_access_token_with_http_info(service_account_id, pat_id)
.await
{
Ok(_) => Ok(()),
Expand All @@ -1369,7 +1369,7 @@ impl ServiceAccountsAPI {
pub async fn revoke_service_account_access_token_with_http_info(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
) -> Result<datadog::ResponseContent<()>, datadog::Error<RevokeServiceAccountAccessTokenError>>
{
let local_configuration = &self.config;
Expand All @@ -1378,10 +1378,10 @@ impl ServiceAccountsAPI {
let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}",
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
service_account_id = datadog::urlencode(service_account_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
Expand Down Expand Up @@ -1449,14 +1449,14 @@ impl ServiceAccountsAPI {
pub async fn update_service_account_access_token(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
body: crate::datadogV2::model::PersonalAccessTokenUpdateRequest,
) -> Result<
crate::datadogV2::model::PersonalAccessTokenResponse,
datadog::Error<UpdateServiceAccountAccessTokenError>,
> {
match self
.update_service_account_access_token_with_http_info(service_account_id, pat_uuid, body)
.update_service_account_access_token_with_http_info(service_account_id, pat_id, body)
.await
{
Ok(response_content) => {
Expand All @@ -1476,7 +1476,7 @@ impl ServiceAccountsAPI {
pub async fn update_service_account_access_token_with_http_info(
&self,
service_account_id: String,
pat_uuid: String,
pat_id: String,
body: crate::datadogV2::model::PersonalAccessTokenUpdateRequest,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::PersonalAccessTokenResponse>,
Expand All @@ -1488,10 +1488,10 @@ impl ServiceAccountsAPI {
let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}",
"{}/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}",
local_configuration.get_operation_host(operation_id),
service_account_id = datadog::urlencode(service_account_id),
pat_uuid = datadog::urlencode(pat_uuid)
pat_id = datadog::urlencode(pat_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct FullPersonalAccessTokenAttributes {
/// The alias (short identifier) of the personal access token.
#[serde(rename = "alias")]
pub alias: Option<String>,
/// Creation date of the personal access token.
#[serde(rename = "created_at")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
Expand Down Expand Up @@ -46,7 +43,6 @@ pub struct FullPersonalAccessTokenAttributes {
impl FullPersonalAccessTokenAttributes {
pub fn new() -> FullPersonalAccessTokenAttributes {
FullPersonalAccessTokenAttributes {
alias: None,
created_at: None,
expires_at: None,
key: None,
Expand All @@ -58,11 +54,6 @@ impl FullPersonalAccessTokenAttributes {
}
}

pub fn alias(mut self, value: String) -> Self {
self.alias = Some(value);
self
}

pub fn created_at(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.created_at = Some(value);
self
Expand Down Expand Up @@ -125,7 +116,6 @@ impl<'de> Deserialize<'de> for FullPersonalAccessTokenAttributes {
where
M: MapAccess<'a>,
{
let mut alias: Option<String> = None;
let mut created_at: Option<chrono::DateTime<chrono::Utc>> = None;
let mut expires_at: Option<Option<chrono::DateTime<chrono::Utc>>> = None;
let mut key: Option<String> = None;
Expand All @@ -140,12 +130,6 @@ impl<'de> Deserialize<'de> for FullPersonalAccessTokenAttributes {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"alias" => {
if v.is_null() {
continue;
}
alias = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"created_at" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -189,7 +173,6 @@ impl<'de> Deserialize<'de> for FullPersonalAccessTokenAttributes {
}

let content = FullPersonalAccessTokenAttributes {
alias,
created_at,
expires_at,
key,
Expand Down
Loading
Loading