ActionsDatastoresAPI

Struct ActionsDatastoresAPI 

Source
pub struct ActionsDatastoresAPI { /* private fields */ }
Expand description

Leverage the Actions Datastore API to create, modify, and delete items in datastores owned by your organization.

Implementations§

Source§

impl ActionsDatastoresAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_actions-datastores_ListDatastores.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = ActionsDatastoresAPI::with_config(configuration);
9    let resp = api.list_datastores().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_actions-datastores_GetDatastore.rs (line 10)
6async fn main() {
7    // there is a valid "datastore" in the system
8    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = ActionsDatastoresAPI::with_config(configuration);
11    let resp = api.get_datastore(datastore_data_id.clone()).await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
examples/v2_actions-datastores_DeleteDatastore.rs (line 10)
6async fn main() {
7    // there is a valid "datastore" in the system
8    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = ActionsDatastoresAPI::with_config(configuration);
11    let resp = api.delete_datastore(datastore_data_id.clone()).await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
examples/v2_actions-datastores_ListDatastoreItems.rs (line 11)
7async fn main() {
8    // there is a valid "datastore" in the system
9    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
10    let configuration = datadog::Configuration::new();
11    let api = ActionsDatastoresAPI::with_config(configuration);
12    let resp = api
13        .list_datastore_items(
14            datastore_data_id.clone(),
15            ListDatastoreItemsOptionalParams::default(),
16        )
17        .await;
18    if let Ok(value) = resp {
19        println!("{:#?}", value);
20    } else {
21        println!("{:#?}", resp.unwrap_err());
22    }
23}
examples/v2_actions-datastores_CreateDatastore.rs (line 20)
10async fn main() {
11    let body = CreateAppsDatastoreRequest::new().data(
12        CreateAppsDatastoreRequestData::new(DatastoreDataType::DATASTORES).attributes(
13            CreateAppsDatastoreRequestDataAttributes::new(
14                "datastore-name".to_string(),
15                "primaryKey".to_string(),
16            ),
17        ),
18    );
19    let configuration = datadog::Configuration::new();
20    let api = ActionsDatastoresAPI::with_config(configuration);
21    let resp = api.create_datastore(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
examples/v2_actions-datastores_DeleteDatastoreItem.rs (line 19)
10async fn main() {
11    // there is a valid "datastore" in the system
12    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13    let body = DeleteAppsDatastoreItemRequest::new().data(
14        DeleteAppsDatastoreItemRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
15            DeleteAppsDatastoreItemRequestDataAttributes::new("test-key".to_string()),
16        ),
17    );
18    let configuration = datadog::Configuration::new();
19    let api = ActionsDatastoresAPI::with_config(configuration);
20    let resp = api
21        .delete_datastore_item(datastore_data_id.clone(), body)
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

pub async fn bulk_write_datastore_items( &self, datastore_id: String, body: BulkPutAppsDatastoreItemsRequest, ) -> Result<PutAppsDatastoreItemResponseArray, Error<BulkWriteDatastoreItemsError>>

Creates or replaces multiple items in a datastore by their keys in a single operation.

Examples found in repository?
examples/v2_actions-datastores_BulkWriteDatastoreItems.rs (line 32)
12async fn main() {
13    // there is a valid "datastore" in the system
14    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
15    let body = BulkPutAppsDatastoreItemsRequest::new().data(
16        BulkPutAppsDatastoreItemsRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
17            BulkPutAppsDatastoreItemsRequestDataAttributes::new(vec![
18                BTreeMap::from([
19                    ("id".to_string(), Value::from("cust_3141")),
20                    ("name".to_string(), Value::from("Johnathan")),
21                ]),
22                BTreeMap::from([
23                    ("id".to_string(), Value::from("cust_3142")),
24                    ("name".to_string(), Value::from("Mary")),
25                ]),
26            ]),
27        ),
28    );
29    let configuration = datadog::Configuration::new();
30    let api = ActionsDatastoresAPI::with_config(configuration);
31    let resp = api
32        .bulk_write_datastore_items(datastore_data_id.clone(), body)
33        .await;
34    if let Ok(value) = resp {
35        println!("{:#?}", value);
36    } else {
37        println!("{:#?}", resp.unwrap_err());
38    }
39}
Source

pub async fn bulk_write_datastore_items_with_http_info( &self, datastore_id: String, body: BulkPutAppsDatastoreItemsRequest, ) -> Result<ResponseContent<PutAppsDatastoreItemResponseArray>, Error<BulkWriteDatastoreItemsError>>

Creates or replaces multiple items in a datastore by their keys in a single operation.

Source

pub async fn create_datastore( &self, body: CreateAppsDatastoreRequest, ) -> Result<CreateAppsDatastoreResponse, Error<CreateDatastoreError>>

Creates a new datastore.

Examples found in repository?
examples/v2_actions-datastores_CreateDatastore.rs (line 21)
10async fn main() {
11    let body = CreateAppsDatastoreRequest::new().data(
12        CreateAppsDatastoreRequestData::new(DatastoreDataType::DATASTORES).attributes(
13            CreateAppsDatastoreRequestDataAttributes::new(
14                "datastore-name".to_string(),
15                "primaryKey".to_string(),
16            ),
17        ),
18    );
19    let configuration = datadog::Configuration::new();
20    let api = ActionsDatastoresAPI::with_config(configuration);
21    let resp = api.create_datastore(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
Source

pub async fn create_datastore_with_http_info( &self, body: CreateAppsDatastoreRequest, ) -> Result<ResponseContent<CreateAppsDatastoreResponse>, Error<CreateDatastoreError>>

Creates a new datastore.

Source

pub async fn delete_datastore( &self, datastore_id: String, ) -> Result<(), Error<DeleteDatastoreError>>

Deletes a datastore by its unique identifier.

Examples found in repository?
examples/v2_actions-datastores_DeleteDatastore.rs (line 11)
6async fn main() {
7    // there is a valid "datastore" in the system
8    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = ActionsDatastoresAPI::with_config(configuration);
11    let resp = api.delete_datastore(datastore_data_id.clone()).await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn delete_datastore_with_http_info( &self, datastore_id: String, ) -> Result<ResponseContent<()>, Error<DeleteDatastoreError>>

Deletes a datastore by its unique identifier.

Source

pub async fn delete_datastore_item( &self, datastore_id: String, body: DeleteAppsDatastoreItemRequest, ) -> Result<DeleteAppsDatastoreItemResponse, Error<DeleteDatastoreItemError>>

Deletes an item from a datastore by its key.

Examples found in repository?
examples/v2_actions-datastores_DeleteDatastoreItem.rs (line 21)
10async fn main() {
11    // there is a valid "datastore" in the system
12    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13    let body = DeleteAppsDatastoreItemRequest::new().data(
14        DeleteAppsDatastoreItemRequestData::new(DatastoreItemsDataType::ITEMS).attributes(
15            DeleteAppsDatastoreItemRequestDataAttributes::new("test-key".to_string()),
16        ),
17    );
18    let configuration = datadog::Configuration::new();
19    let api = ActionsDatastoresAPI::with_config(configuration);
20    let resp = api
21        .delete_datastore_item(datastore_data_id.clone(), body)
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn delete_datastore_item_with_http_info( &self, datastore_id: String, body: DeleteAppsDatastoreItemRequest, ) -> Result<ResponseContent<DeleteAppsDatastoreItemResponse>, Error<DeleteDatastoreItemError>>

Deletes an item from a datastore by its key.

Source

pub async fn get_datastore( &self, datastore_id: String, ) -> Result<Datastore, Error<GetDatastoreError>>

Retrieves a specific datastore by its ID.

Examples found in repository?
examples/v2_actions-datastores_GetDatastore.rs (line 11)
6async fn main() {
7    // there is a valid "datastore" in the system
8    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = ActionsDatastoresAPI::with_config(configuration);
11    let resp = api.get_datastore(datastore_data_id.clone()).await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn get_datastore_with_http_info( &self, datastore_id: String, ) -> Result<ResponseContent<Datastore>, Error<GetDatastoreError>>

Retrieves a specific datastore by its ID.

Source

pub async fn list_datastore_items( &self, datastore_id: String, params: ListDatastoreItemsOptionalParams, ) -> Result<ItemApiPayloadArray, Error<ListDatastoreItemsError>>

Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.

Examples found in repository?
examples/v2_actions-datastores_ListDatastoreItems.rs (lines 13-16)
7async fn main() {
8    // there is a valid "datastore" in the system
9    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
10    let configuration = datadog::Configuration::new();
11    let api = ActionsDatastoresAPI::with_config(configuration);
12    let resp = api
13        .list_datastore_items(
14            datastore_data_id.clone(),
15            ListDatastoreItemsOptionalParams::default(),
16        )
17        .await;
18    if let Ok(value) = resp {
19        println!("{:#?}", value);
20    } else {
21        println!("{:#?}", resp.unwrap_err());
22    }
23}
Source

pub async fn list_datastore_items_with_http_info( &self, datastore_id: String, params: ListDatastoreItemsOptionalParams, ) -> Result<ResponseContent<ItemApiPayloadArray>, Error<ListDatastoreItemsError>>

Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.

Source

pub async fn list_datastores( &self, ) -> Result<DatastoreArray, Error<ListDatastoresError>>

Lists all datastores for the organization.

Examples found in repository?
examples/v2_actions-datastores_ListDatastores.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = ActionsDatastoresAPI::with_config(configuration);
9    let resp = api.list_datastores().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_datastores_with_http_info( &self, ) -> Result<ResponseContent<DatastoreArray>, Error<ListDatastoresError>>

Lists all datastores for the organization.

Source

pub async fn update_datastore( &self, datastore_id: String, body: UpdateAppsDatastoreRequest, ) -> Result<Datastore, Error<UpdateDatastoreError>>

Updates an existing datastore’s attributes.

Examples found in repository?
examples/v2_actions-datastores_UpdateDatastore.rs (line 22)
10async fn main() {
11    // there is a valid "datastore" in the system
12    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
13    let body = UpdateAppsDatastoreRequest::new().data(
14        UpdateAppsDatastoreRequestData::new(DatastoreDataType::DATASTORES)
15            .attributes(
16                UpdateAppsDatastoreRequestDataAttributes::new().name("updated name".to_string()),
17            )
18            .id(datastore_data_id.clone()),
19    );
20    let configuration = datadog::Configuration::new();
21    let api = ActionsDatastoresAPI::with_config(configuration);
22    let resp = api.update_datastore(datastore_data_id.clone(), body).await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn update_datastore_with_http_info( &self, datastore_id: String, body: UpdateAppsDatastoreRequest, ) -> Result<ResponseContent<Datastore>, Error<UpdateDatastoreError>>

Updates an existing datastore’s attributes.

Source

pub async fn update_datastore_item( &self, datastore_id: String, body: UpdateAppsDatastoreItemRequest, ) -> Result<ItemApiPayload, Error<UpdateDatastoreItemError>>

Partially updates an item in a datastore by its key.

Examples found in repository?
examples/v2_actions-datastores_UpdateDatastoreItem.rs (line 24)
11async fn main() {
12    // there is a valid "datastore" in the system
13    let datastore_data_id = std::env::var("DATASTORE_DATA_ID").unwrap();
14    let body = UpdateAppsDatastoreItemRequest::new().data(
15        UpdateAppsDatastoreItemRequestData::new(UpdateAppsDatastoreItemRequestDataType::ITEMS)
16            .attributes(UpdateAppsDatastoreItemRequestDataAttributes::new(
17                UpdateAppsDatastoreItemRequestDataAttributesItemChanges::new(),
18                "test-key".to_string(),
19            )),
20    );
21    let configuration = datadog::Configuration::new();
22    let api = ActionsDatastoresAPI::with_config(configuration);
23    let resp = api
24        .update_datastore_item(datastore_data_id.clone(), body)
25        .await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
Source

pub async fn update_datastore_item_with_http_info( &self, datastore_id: String, body: UpdateAppsDatastoreItemRequest, ) -> Result<ResponseContent<ItemApiPayload>, Error<UpdateDatastoreItemError>>

Partially updates an item in a datastore by its key.

Trait Implementations§

Source§

impl Clone for ActionsDatastoresAPI

Source§

fn clone(&self) -> ActionsDatastoresAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionsDatastoresAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ActionsDatastoresAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,