pub struct VenClient { /* private fields */ }Expand description
A client for interacting with the data in a specific VEN and the resources contained in the VEN.
Implementations§
Source§impl VenClient
impl VenClient
Sourcepub fn created_date_time(&self) -> DateTime<Utc>
pub fn created_date_time(&self) -> DateTime<Utc>
Get the time the VEN was created on the VTN
Sourcepub fn modification_date_time(&self) -> DateTime<Utc>
pub fn modification_date_time(&self) -> DateTime<Utc>
Get the time the VEN was last modified on the VTN
Sourcepub fn content(&self) -> &VenContent
pub fn content(&self) -> &VenContent
Read the content of the VEN
Sourcepub fn content_mut(&mut self) -> &mut VenContent
pub fn content_mut(&mut self) -> &mut VenContent
Modify the content of the VEN.
Make sure to call update
after your modifications to store them on the VTN.
Sourcepub async fn update(&mut self) -> Result<(), Error>
pub async fn update(&mut self) -> Result<(), Error>
Stores any modifications made to the VEN content at the VTN and refreshes the data stored locally with the returned VTN data
Sourcepub async fn delete(self) -> Result<Ven, Error>
pub async fn delete(self) -> Result<Ven, Error>
Delete the VEN from the VTN.
Depending on the VTN implementation, you may need to delete all associated resources before you can delete the VEN
Sourcepub async fn create_resource(
&self,
resource: ResourceContent,
) -> Result<ResourceClient, Error>
pub async fn create_resource( &self, resource: ResourceContent, ) -> Result<ResourceClient, Error>
Create a resource as a child of this VEN
Sourcepub async fn get_all_resources(
&self,
resource_name: Option<&str>,
) -> Result<Vec<ResourceClient>, Error>
pub async fn get_all_resources( &self, resource_name: Option<&str>, ) -> Result<Vec<ResourceClient>, Error>
Get all resources stored as children of this VEN.
The client automatically tries to iterate pages where necessary.
Sourcepub async fn get_resource_by_id(
&self,
id: &ResourceId,
) -> Result<ResourceClient, Error>
pub async fn get_resource_by_id( &self, id: &ResourceId, ) -> Result<ResourceClient, Error>
Get a resource by its ID
Sourcepub async fn get_resource_by_name(
&self,
name: &str,
) -> Result<ResourceClient, Error>
pub async fn get_resource_by_name( &self, name: &str, ) -> Result<ResourceClient, Error>
Get VEN by name from VTN.
According to the spec, a resource_name must be unique per VEN.