pub struct DataAccessControlService { /* private fields */ }Expand description
Implements a client for the Chronicle API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
project_id: &str,
location_id: &str,
instance_id: &str,
) -> anyhow::Result<()> {
let client = DataAccessControlService::builder().build().await?;
let mut list = client.list_data_access_labels()
.set_parent(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
DataAccessControlService exposes resources and endpoints related to data access control.
§Configuration
To configure DataAccessControlService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://chronicle.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
DataAccessControlService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap DataAccessControlService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl DataAccessControlService
impl DataAccessControlService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for DataAccessControlService.
let client = DataAccessControlService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: DataAccessControlService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: DataAccessControlService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_data_access_label(&self) -> CreateDataAccessLabel
pub fn create_data_access_label(&self) -> CreateDataAccessLabel
Creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.
§Example
use google_cloud_chronicle_v1::model::DataAccessLabel;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str
) -> Result<()> {
let response = client.create_data_access_label()
.set_parent(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
.set_data_access_label(
DataAccessLabel::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_data_access_label(&self) -> GetDataAccessLabel
pub fn get_data_access_label(&self) -> GetDataAccessLabel
Gets a data access label.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_label_id: &str
) -> Result<()> {
let response = client.get_data_access_label()
.set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessLabels/{data_access_label_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_data_access_labels(&self) -> ListDataAccessLabels
pub fn list_data_access_labels(&self) -> ListDataAccessLabels
Lists all data access labels for the customer.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str
) -> Result<()> {
let mut list = client.list_data_access_labels()
.set_parent(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn update_data_access_label(&self) -> UpdateDataAccessLabel
pub fn update_data_access_label(&self) -> UpdateDataAccessLabel
Updates a data access label.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_chronicle_v1::model::DataAccessLabel;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_label_id: &str
) -> Result<()> {
let response = client.update_data_access_label()
.set_data_access_label(
DataAccessLabel::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessLabels/{data_access_label_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_data_access_label(&self) -> DeleteDataAccessLabel
pub fn delete_data_access_label(&self) -> DeleteDataAccessLabel
Deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_label_id: &str
) -> Result<()> {
client.delete_data_access_label()
.set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessLabels/{data_access_label_id}"))
.send().await?;
Ok(())
}Sourcepub fn create_data_access_scope(&self) -> CreateDataAccessScope
pub fn create_data_access_scope(&self) -> CreateDataAccessScope
Creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.
§Example
use google_cloud_chronicle_v1::model::DataAccessScope;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str
) -> Result<()> {
let response = client.create_data_access_scope()
.set_parent(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
.set_data_access_scope(
DataAccessScope::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_data_access_scope(&self) -> GetDataAccessScope
pub fn get_data_access_scope(&self) -> GetDataAccessScope
Retrieves an existing data access scope.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_scope_id: &str
) -> Result<()> {
let response = client.get_data_access_scope()
.set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessScopes/{data_access_scope_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_data_access_scopes(&self) -> ListDataAccessScopes
pub fn list_data_access_scopes(&self) -> ListDataAccessScopes
Lists all existing data access scopes for the customer.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str
) -> Result<()> {
let mut list = client.list_data_access_scopes()
.set_parent(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn update_data_access_scope(&self) -> UpdateDataAccessScope
pub fn update_data_access_scope(&self) -> UpdateDataAccessScope
Updates a data access scope.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_chronicle_v1::model::DataAccessScope;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_scope_id: &str
) -> Result<()> {
let response = client.update_data_access_scope()
.set_data_access_scope(
DataAccessScope::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessScopes/{data_access_scope_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_data_access_scope(&self) -> DeleteDataAccessScope
pub fn delete_data_access_scope(&self) -> DeleteDataAccessScope
Deletes a data access scope.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService, project_id: &str, location_id: &str, instance_id: &str, data_access_scope_id: &str
) -> Result<()> {
client.delete_data_access_scope()
.set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}/dataAccessScopes/{data_access_scope_id}"))
.send().await?;
Ok(())
}Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService
) -> Result<()> {
let mut list = client.list_operations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService
) -> Result<()> {
let response = client.get_operation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_operation(&self) -> DeleteOperation
pub fn delete_operation(&self) -> DeleteOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService
) -> Result<()> {
client.delete_operation()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_chronicle_v1::Result;
async fn sample(
client: &DataAccessControlService
) -> Result<()> {
client.cancel_operation()
/* set fields */
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for DataAccessControlService
impl Clone for DataAccessControlService
Source§fn clone(&self) -> DataAccessControlService
fn clone(&self) -> DataAccessControlService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more