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
20 changes: 10 additions & 10 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19766,15 +19766,6 @@ components:
$ref: "#/components/schemas/DashboardListItemResponse"
type: array
type: object
DashboardListDeleteItemsRequest:
description: Request containing a list of dashboards to delete.
properties:
dashboards:
description: List of dashboards to delete from the dashboard list.
items:
$ref: "#/components/schemas/DashboardListItemRequest"
type: array
type: object
DashboardListDeleteItemsResponse:
description: Response containing a list of deleted dashboards.
properties:
Expand Down Expand Up @@ -19898,6 +19889,15 @@ components:
required:
- dashboards
type: object
DashboardListRemoveItemsRequest:
description: Request containing a list of dashboards to remove.
properties:
dashboards:
description: List of dashboards to delete from the dashboard list.
items:
$ref: "#/components/schemas/DashboardListItemRequest"
type: array
type: object
DashboardListUpdateItemsRequest:
description: Request containing the list of dashboards to update to.
properties:
Expand Down Expand Up @@ -83591,7 +83591,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/DashboardListDeleteItemsRequest"
$ref: "#/components/schemas/DashboardListRemoveItemsRequest"
description: Dashboards to delete from the dashboard list.
required: true
responses:
Expand Down
4 changes: 2 additions & 2 deletions examples/v2_dashboard-lists_DeleteDashboardListItems.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Delete items from a dashboard list returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI;
use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest;
use datadog_api_client::datadogV2::model::DashboardListItemRequest;
use datadog_api_client::datadogV2::model::DashboardListRemoveItemsRequest;
use datadog_api_client::datadogV2::model::DashboardType;

#[tokio::main]
async fn main() {
let body =
DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
DashboardListRemoveItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
"q5j-nti-fv6".to_string(),
DashboardType::HOST_TIMEBOARD,
)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI;
use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest;
use datadog_api_client::datadogV2::model::DashboardListItemRequest;
use datadog_api_client::datadogV2::model::DashboardListRemoveItemsRequest;
use datadog_api_client::datadogV2::model::DashboardType;

#[tokio::main]
Expand All @@ -14,7 +14,7 @@ async fn main() {
// there is a valid "dashboard" in the system
let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
let body =
DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
DashboardListRemoveItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
dashboard_id.clone(),
DashboardType::CUSTOM_TIMEBOARD,
)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_dashboard_lists::DashboardListsAPI;
use datadog_api_client::datadogV2::model::DashboardListDeleteItemsRequest;
use datadog_api_client::datadogV2::model::DashboardListItemRequest;
use datadog_api_client::datadogV2::model::DashboardListRemoveItemsRequest;
use datadog_api_client::datadogV2::model::DashboardType;

#[tokio::main]
Expand All @@ -14,7 +14,7 @@ async fn main() {
// there is a valid "screenboard_dashboard" in the system
let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
let body =
DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
DashboardListRemoveItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
screenboard_dashboard_id.clone(),
DashboardType::CUSTOM_SCREENBOARD,
)]);
Expand Down
4 changes: 2 additions & 2 deletions src/datadogV2/api/api_dashboard_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl DashboardListsAPI {
pub async fn delete_dashboard_list_items(
&self,
dashboard_list_id: i64,
body: crate::datadogV2::model::DashboardListDeleteItemsRequest,
body: crate::datadogV2::model::DashboardListRemoveItemsRequest,
) -> Result<
crate::datadogV2::model::DashboardListDeleteItemsResponse,
datadog::Error<DeleteDashboardListItemsError>,
Expand All @@ -309,7 +309,7 @@ impl DashboardListsAPI {
pub async fn delete_dashboard_list_items_with_http_info(
&self,
dashboard_list_id: i64,
body: crate::datadogV2::model::DashboardListDeleteItemsRequest,
body: crate::datadogV2::model::DashboardListRemoveItemsRequest,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::DashboardListDeleteItemsResponse>,
datadog::Error<DeleteDashboardListItemsError>,
Expand Down
4 changes: 2 additions & 2 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2438,8 +2438,8 @@ pub mod model_application_key_create_data;
pub use self::model_application_key_create_data::ApplicationKeyCreateData;
pub mod model_application_key_create_attributes;
pub use self::model_application_key_create_attributes::ApplicationKeyCreateAttributes;
pub mod model_dashboard_list_delete_items_request;
pub use self::model_dashboard_list_delete_items_request::DashboardListDeleteItemsRequest;
pub mod model_dashboard_list_remove_items_request;
pub use self::model_dashboard_list_remove_items_request::DashboardListRemoveItemsRequest;
pub mod model_dashboard_list_item_request;
pub use self::model_dashboard_list_item_request::DashboardListItemRequest;
pub mod model_dashboard_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Request containing a list of dashboards to delete.
/// Request containing a list of dashboards to remove.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct DashboardListDeleteItemsRequest {
pub struct DashboardListRemoveItemsRequest {
/// List of dashboards to delete from the dashboard list.
#[serde(rename = "dashboards")]
pub dashboards: Option<Vec<crate::datadogV2::model::DashboardListItemRequest>>,
Expand All @@ -21,9 +21,9 @@ pub struct DashboardListDeleteItemsRequest {
pub(crate) _unparsed: bool,
}

impl DashboardListDeleteItemsRequest {
pub fn new() -> DashboardListDeleteItemsRequest {
DashboardListDeleteItemsRequest {
impl DashboardListRemoveItemsRequest {
pub fn new() -> DashboardListRemoveItemsRequest {
DashboardListRemoveItemsRequest {
dashboards: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
Expand All @@ -47,20 +47,20 @@ impl DashboardListDeleteItemsRequest {
}
}

impl Default for DashboardListDeleteItemsRequest {
impl Default for DashboardListRemoveItemsRequest {
fn default() -> Self {
Self::new()
}
}

impl<'de> Deserialize<'de> for DashboardListDeleteItemsRequest {
impl<'de> Deserialize<'de> for DashboardListRemoveItemsRequest {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
struct DashboardListDeleteItemsRequestVisitor;
impl<'a> Visitor<'a> for DashboardListDeleteItemsRequestVisitor {
type Value = DashboardListDeleteItemsRequest;
struct DashboardListRemoveItemsRequestVisitor;
impl<'a> Visitor<'a> for DashboardListRemoveItemsRequestVisitor {
type Value = DashboardListRemoveItemsRequest;

fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str("a mapping")
Expand Down Expand Up @@ -94,7 +94,7 @@ impl<'de> Deserialize<'de> for DashboardListDeleteItemsRequest {
}
}

let content = DashboardListDeleteItemsRequest {
let content = DashboardListRemoveItemsRequest {
dashboards,
additional_properties,
_unparsed,
Expand All @@ -104,6 +104,6 @@ impl<'de> Deserialize<'de> for DashboardListDeleteItemsRequest {
}
}

deserializer.deserialize_any(DashboardListDeleteItemsRequestVisitor)
deserializer.deserialize_any(DashboardListRemoveItemsRequestVisitor)
}
}
Loading