pub struct UserListDirectLicenseService { /* private fields */ }Expand description
Implements a client for the Data Manager API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
account_type_id: &str,
account_id: &str,
) -> anyhow::Result<()> {
let client = UserListDirectLicenseService::builder().build().await?;
let mut list = client.list_user_list_direct_licenses()
.set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
Service for managing user list direct licenses. Delete is not a supported operation for UserListDirectLicenses. Callers should update the license status to DISABLED to instead to deactivate a license.
This feature is only available to data partners.
§Configuration
To configure UserListDirectLicenseService 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://datamanager.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured with Private Google Access with VPC Service Controls) may want to 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
UserListDirectLicenseService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap UserListDirectLicenseService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl UserListDirectLicenseService
impl UserListDirectLicenseService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for UserListDirectLicenseService.
let client = UserListDirectLicenseService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: UserListDirectLicenseService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: UserListDirectLicenseService + '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_user_list_direct_license(&self) -> CreateUserListDirectLicense
pub fn create_user_list_direct_license(&self) -> CreateUserListDirectLicense
Creates a user list direct license.
This feature is only available to data partners.
§Example
use google_ads_datamanager_v1::model::UserListDirectLicense;
use google_ads_datamanager_v1::Result;
async fn sample(
client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str
) -> Result<()> {
let response = client.create_user_list_direct_license()
.set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
.set_user_list_direct_license(
UserListDirectLicense::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_user_list_direct_license(&self) -> GetUserListDirectLicense
pub fn get_user_list_direct_license(&self) -> GetUserListDirectLicense
Retrieves a user list direct license.
This feature is only available to data partners.
§Example
use google_ads_datamanager_v1::Result;
async fn sample(
client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str, user_list_direct_license_id: &str
) -> Result<()> {
let response = client.get_user_list_direct_license()
.set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListDirectLicenses/{user_list_direct_license_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_user_list_direct_license(&self) -> UpdateUserListDirectLicense
pub fn update_user_list_direct_license(&self) -> UpdateUserListDirectLicense
Updates a user list direct license.
This feature is only available to data partners.
§Example
use google_cloud_wkt::FieldMask;
use google_ads_datamanager_v1::model::UserListDirectLicense;
use google_ads_datamanager_v1::Result;
async fn sample(
client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str, user_list_direct_license_id: &str
) -> Result<()> {
let response = client.update_user_list_direct_license()
.set_user_list_direct_license(
UserListDirectLicense::new().set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListDirectLicenses/{user_list_direct_license_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_user_list_direct_licenses(&self) -> ListUserListDirectLicenses
pub fn list_user_list_direct_licenses(&self) -> ListUserListDirectLicenses
Lists all user list direct licenses owned by the parent account.
This feature is only available to data partners.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_ads_datamanager_v1::Result;
async fn sample(
client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str
) -> Result<()> {
let mut list = client.list_user_list_direct_licenses()
.set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Trait Implementations§
Source§impl Clone for UserListDirectLicenseService
impl Clone for UserListDirectLicenseService
Source§fn clone(&self) -> UserListDirectLicenseService
fn clone(&self) -> UserListDirectLicenseService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more