google_ads_datamanager_v1/client.rs
1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Data Manager API.
22///
23/// # Example
24/// ```
25/// # use google_ads_datamanager_v1::client::IngestionService;
26/// async fn sample(
27/// ) -> anyhow::Result<()> {
28/// let client = IngestionService::builder().build().await?;
29/// let response = client.ingest_audience_members()
30/// /* set fields */
31/// .send().await?;
32/// println!("response {:?}", response);
33/// Ok(())
34/// }
35/// ```
36///
37/// # Service Description
38///
39/// Service for sending audience data to supported destinations.
40///
41/// # Configuration
42///
43/// To configure `IngestionService` use the `with_*` methods in the type returned
44/// by [builder()][IngestionService::builder]. The default configuration should
45/// work for most applications. Common configuration changes include
46///
47/// * [with_endpoint()]: by default this client uses the global default endpoint
48/// (`https://datamanager.googleapis.com`). Applications using regional
49/// endpoints or running in restricted networks (e.g. a network configured
50/// with [Private Google Access with VPC Service Controls]) may want to
51/// override this default.
52/// * [with_credentials()]: by default this client uses
53/// [Application Default Credentials]. Applications using custom
54/// authentication may need to override this default.
55///
56/// [with_endpoint()]: super::builder::ingestion_service::ClientBuilder::with_endpoint
57/// [with_credentials()]: super::builder::ingestion_service::ClientBuilder::with_credentials
58/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
59/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
60///
61/// # Pooling and Cloning
62///
63/// `IngestionService` holds a connection pool internally, it is advised to
64/// create one and reuse it. You do not need to wrap `IngestionService` in
65/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
66/// already uses an `Arc` internally.
67#[derive(Clone, Debug)]
68pub struct IngestionService {
69 inner: std::sync::Arc<dyn super::stub::dynamic::IngestionService>,
70}
71
72impl IngestionService {
73 /// Returns a builder for [IngestionService].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_ads_datamanager_v1::client::IngestionService;
78 /// let client = IngestionService::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::ingestion_service::ClientBuilder {
82 crate::new_client_builder(super::builder::ingestion_service::client::Factory)
83 }
84
85 /// Creates a new client from the provided stub.
86 ///
87 /// The most common case for calling this function is in tests mocking the
88 /// client's behavior.
89 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
90 where
91 T: super::stub::IngestionService + 'static,
92 {
93 Self { inner: stub.into() }
94 }
95
96 pub(crate) async fn new(
97 config: gaxi::options::ClientConfig,
98 ) -> crate::ClientBuilderResult<Self> {
99 let inner = Self::build_inner(config).await?;
100 Ok(Self { inner })
101 }
102
103 async fn build_inner(
104 conf: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::IngestionService>>
106 {
107 if gaxi::options::tracing_enabled(&conf) {
108 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
109 }
110 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
111 }
112
113 async fn build_transport(
114 conf: gaxi::options::ClientConfig,
115 ) -> crate::ClientBuilderResult<impl super::stub::IngestionService> {
116 super::transport::IngestionService::new(conf).await
117 }
118
119 async fn build_with_tracing(
120 conf: gaxi::options::ClientConfig,
121 ) -> crate::ClientBuilderResult<impl super::stub::IngestionService> {
122 Self::build_transport(conf)
123 .await
124 .map(super::tracing::IngestionService::new)
125 }
126
127 /// Uploads a list of
128 /// [AudienceMember][google.ads.datamanager.v1.AudienceMember] resources to the
129 /// provided [Destination][google.ads.datamanager.v1.Destination].
130 ///
131 /// [google.ads.datamanager.v1.AudienceMember]: crate::model::AudienceMember
132 /// [google.ads.datamanager.v1.Destination]: crate::model::Destination
133 ///
134 /// # Example
135 /// ```
136 /// # use google_ads_datamanager_v1::client::IngestionService;
137 /// use google_ads_datamanager_v1::Result;
138 /// async fn sample(
139 /// client: &IngestionService
140 /// ) -> Result<()> {
141 /// let response = client.ingest_audience_members()
142 /// /* set fields */
143 /// .send().await?;
144 /// println!("response {:?}", response);
145 /// Ok(())
146 /// }
147 /// ```
148 pub fn ingest_audience_members(
149 &self,
150 ) -> super::builder::ingestion_service::IngestAudienceMembers {
151 super::builder::ingestion_service::IngestAudienceMembers::new(self.inner.clone())
152 }
153
154 /// Removes a list of
155 /// [AudienceMember][google.ads.datamanager.v1.AudienceMember] resources from
156 /// the provided [Destination][google.ads.datamanager.v1.Destination].
157 ///
158 /// [google.ads.datamanager.v1.AudienceMember]: crate::model::AudienceMember
159 /// [google.ads.datamanager.v1.Destination]: crate::model::Destination
160 ///
161 /// # Example
162 /// ```
163 /// # use google_ads_datamanager_v1::client::IngestionService;
164 /// use google_ads_datamanager_v1::Result;
165 /// async fn sample(
166 /// client: &IngestionService
167 /// ) -> Result<()> {
168 /// let response = client.remove_audience_members()
169 /// /* set fields */
170 /// .send().await?;
171 /// println!("response {:?}", response);
172 /// Ok(())
173 /// }
174 /// ```
175 pub fn remove_audience_members(
176 &self,
177 ) -> super::builder::ingestion_service::RemoveAudienceMembers {
178 super::builder::ingestion_service::RemoveAudienceMembers::new(self.inner.clone())
179 }
180
181 /// Removes all audience members from the provided destinations.
182 ///
183 /// # Example
184 /// ```
185 /// # use google_ads_datamanager_v1::client::IngestionService;
186 /// use google_ads_datamanager_v1::Result;
187 /// async fn sample(
188 /// client: &IngestionService
189 /// ) -> Result<()> {
190 /// let response = client.remove_all_audience_members()
191 /// /* set fields */
192 /// .send().await?;
193 /// println!("response {:?}", response);
194 /// Ok(())
195 /// }
196 /// ```
197 pub fn remove_all_audience_members(
198 &self,
199 ) -> super::builder::ingestion_service::RemoveAllAudienceMembers {
200 super::builder::ingestion_service::RemoveAllAudienceMembers::new(self.inner.clone())
201 }
202
203 /// Uploads a list of
204 /// [Event][google.ads.datamanager.v1.Event] resources from
205 /// the provided [Destination][google.ads.datamanager.v1.Destination].
206 ///
207 /// [google.ads.datamanager.v1.Destination]: crate::model::Destination
208 /// [google.ads.datamanager.v1.Event]: crate::model::Event
209 ///
210 /// # Example
211 /// ```
212 /// # use google_ads_datamanager_v1::client::IngestionService;
213 /// use google_ads_datamanager_v1::Result;
214 /// async fn sample(
215 /// client: &IngestionService
216 /// ) -> Result<()> {
217 /// let response = client.ingest_events()
218 /// /* set fields */
219 /// .send().await?;
220 /// println!("response {:?}", response);
221 /// Ok(())
222 /// }
223 /// ```
224 pub fn ingest_events(&self) -> super::builder::ingestion_service::IngestEvents {
225 super::builder::ingestion_service::IngestEvents::new(self.inner.clone())
226 }
227
228 /// Uploads a list of
229 /// [AdEvent][google.ads.datamanager.v1.AdEvent] resources to Google
230 /// Analytics.
231 ///
232 /// This feature is only available to accounts on an allowlist.
233 ///
234 /// [google.ads.datamanager.v1.AdEvent]: crate::model::AdEvent
235 ///
236 /// # Example
237 /// ```
238 /// # use google_ads_datamanager_v1::client::IngestionService;
239 /// use google_ads_datamanager_v1::Result;
240 /// async fn sample(
241 /// client: &IngestionService
242 /// ) -> Result<()> {
243 /// let response = client.ingest_ad_events()
244 /// /* set fields */
245 /// .send().await?;
246 /// println!("response {:?}", response);
247 /// Ok(())
248 /// }
249 /// ```
250 pub fn ingest_ad_events(&self) -> super::builder::ingestion_service::IngestAdEvents {
251 super::builder::ingestion_service::IngestAdEvents::new(self.inner.clone())
252 }
253
254 /// Gets the status of a request given request id.
255 ///
256 /// # Example
257 /// ```
258 /// # use google_ads_datamanager_v1::client::IngestionService;
259 /// use google_ads_datamanager_v1::Result;
260 /// async fn sample(
261 /// client: &IngestionService
262 /// ) -> Result<()> {
263 /// let response = client.retrieve_request_status()
264 /// /* set fields */
265 /// .send().await?;
266 /// println!("response {:?}", response);
267 /// Ok(())
268 /// }
269 /// ```
270 pub fn retrieve_request_status(
271 &self,
272 ) -> super::builder::ingestion_service::RetrieveRequestStatus {
273 super::builder::ingestion_service::RetrieveRequestStatus::new(self.inner.clone())
274 }
275}
276
277/// Implements a client for the Data Manager API.
278///
279/// # Example
280/// ```
281/// # use google_ads_datamanager_v1::client::MarketingDataInsightsService;
282/// async fn sample(
283/// ) -> anyhow::Result<()> {
284/// let client = MarketingDataInsightsService::builder().build().await?;
285/// let response = client.retrieve_insights()
286/// /* set fields */
287/// .send().await?;
288/// println!("response {:?}", response);
289/// Ok(())
290/// }
291/// ```
292///
293/// # Service Description
294///
295/// Service to return insights on marketing data.
296///
297/// This feature is only available to data partners.
298///
299/// # Configuration
300///
301/// To configure `MarketingDataInsightsService` use the `with_*` methods in the type returned
302/// by [builder()][MarketingDataInsightsService::builder]. The default configuration should
303/// work for most applications. Common configuration changes include
304///
305/// * [with_endpoint()]: by default this client uses the global default endpoint
306/// (`https://datamanager.googleapis.com`). Applications using regional
307/// endpoints or running in restricted networks (e.g. a network configured
308/// with [Private Google Access with VPC Service Controls]) may want to
309/// override this default.
310/// * [with_credentials()]: by default this client uses
311/// [Application Default Credentials]. Applications using custom
312/// authentication may need to override this default.
313///
314/// [with_endpoint()]: super::builder::marketing_data_insights_service::ClientBuilder::with_endpoint
315/// [with_credentials()]: super::builder::marketing_data_insights_service::ClientBuilder::with_credentials
316/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
317/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
318///
319/// # Pooling and Cloning
320///
321/// `MarketingDataInsightsService` holds a connection pool internally, it is advised to
322/// create one and reuse it. You do not need to wrap `MarketingDataInsightsService` in
323/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
324/// already uses an `Arc` internally.
325#[derive(Clone, Debug)]
326pub struct MarketingDataInsightsService {
327 inner: std::sync::Arc<dyn super::stub::dynamic::MarketingDataInsightsService>,
328}
329
330impl MarketingDataInsightsService {
331 /// Returns a builder for [MarketingDataInsightsService].
332 ///
333 /// ```
334 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
335 /// # use google_ads_datamanager_v1::client::MarketingDataInsightsService;
336 /// let client = MarketingDataInsightsService::builder().build().await?;
337 /// # Ok(()) }
338 /// ```
339 pub fn builder() -> super::builder::marketing_data_insights_service::ClientBuilder {
340 crate::new_client_builder(super::builder::marketing_data_insights_service::client::Factory)
341 }
342
343 /// Creates a new client from the provided stub.
344 ///
345 /// The most common case for calling this function is in tests mocking the
346 /// client's behavior.
347 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
348 where
349 T: super::stub::MarketingDataInsightsService + 'static,
350 {
351 Self { inner: stub.into() }
352 }
353
354 pub(crate) async fn new(
355 config: gaxi::options::ClientConfig,
356 ) -> crate::ClientBuilderResult<Self> {
357 let inner = Self::build_inner(config).await?;
358 Ok(Self { inner })
359 }
360
361 async fn build_inner(
362 conf: gaxi::options::ClientConfig,
363 ) -> crate::ClientBuilderResult<
364 std::sync::Arc<dyn super::stub::dynamic::MarketingDataInsightsService>,
365 > {
366 if gaxi::options::tracing_enabled(&conf) {
367 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
368 }
369 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
370 }
371
372 async fn build_transport(
373 conf: gaxi::options::ClientConfig,
374 ) -> crate::ClientBuilderResult<impl super::stub::MarketingDataInsightsService> {
375 super::transport::MarketingDataInsightsService::new(conf).await
376 }
377
378 async fn build_with_tracing(
379 conf: gaxi::options::ClientConfig,
380 ) -> crate::ClientBuilderResult<impl super::stub::MarketingDataInsightsService> {
381 Self::build_transport(conf)
382 .await
383 .map(super::tracing::MarketingDataInsightsService::new)
384 }
385
386 /// Retrieves marketing data insights for a given user list.
387 ///
388 /// This feature is only available to data partners.
389 ///
390 /// Authorization Headers:
391 ///
392 /// This method supports the following optional headers to define how the API
393 /// authorizes access for the request:
394 ///
395 /// * `login-account`: (Optional) The resource name of the account where the
396 /// Google Account of the credentials is a user. If not set, defaults to the
397 /// account of the request. Format:
398 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
399 /// * `linked-account`: (Optional) The resource name of the account with an
400 /// established product link to the `login-account`. Format:
401 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
402 ///
403 /// # Example
404 /// ```
405 /// # use google_ads_datamanager_v1::client::MarketingDataInsightsService;
406 /// use google_ads_datamanager_v1::Result;
407 /// async fn sample(
408 /// client: &MarketingDataInsightsService
409 /// ) -> Result<()> {
410 /// let response = client.retrieve_insights()
411 /// /* set fields */
412 /// .send().await?;
413 /// println!("response {:?}", response);
414 /// Ok(())
415 /// }
416 /// ```
417 pub fn retrieve_insights(
418 &self,
419 ) -> super::builder::marketing_data_insights_service::RetrieveInsights {
420 super::builder::marketing_data_insights_service::RetrieveInsights::new(self.inner.clone())
421 }
422}
423
424/// Implements a client for the Data Manager API.
425///
426/// # Example
427/// ```
428/// # use google_ads_datamanager_v1::client::PartnerLinkService;
429/// use google_ads_datamanager_v1::model::PartnerLink;
430/// async fn sample(
431/// account_type_id: &str,
432/// account_id: &str,
433/// ) -> anyhow::Result<()> {
434/// let client = PartnerLinkService::builder().build().await?;
435/// let response = client.create_partner_link()
436/// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
437/// .set_partner_link(
438/// PartnerLink::new()/* set fields */
439/// )
440/// .send().await?;
441/// println!("response {:?}", response);
442/// Ok(())
443/// }
444/// ```
445///
446/// # Service Description
447///
448/// Service for managing partner links.
449///
450/// # Configuration
451///
452/// To configure `PartnerLinkService` use the `with_*` methods in the type returned
453/// by [builder()][PartnerLinkService::builder]. The default configuration should
454/// work for most applications. Common configuration changes include
455///
456/// * [with_endpoint()]: by default this client uses the global default endpoint
457/// (`https://datamanager.googleapis.com`). Applications using regional
458/// endpoints or running in restricted networks (e.g. a network configured
459/// with [Private Google Access with VPC Service Controls]) may want to
460/// override this default.
461/// * [with_credentials()]: by default this client uses
462/// [Application Default Credentials]. Applications using custom
463/// authentication may need to override this default.
464///
465/// [with_endpoint()]: super::builder::partner_link_service::ClientBuilder::with_endpoint
466/// [with_credentials()]: super::builder::partner_link_service::ClientBuilder::with_credentials
467/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
468/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
469///
470/// # Pooling and Cloning
471///
472/// `PartnerLinkService` holds a connection pool internally, it is advised to
473/// create one and reuse it. You do not need to wrap `PartnerLinkService` in
474/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
475/// already uses an `Arc` internally.
476#[derive(Clone, Debug)]
477pub struct PartnerLinkService {
478 inner: std::sync::Arc<dyn super::stub::dynamic::PartnerLinkService>,
479}
480
481impl PartnerLinkService {
482 /// Returns a builder for [PartnerLinkService].
483 ///
484 /// ```
485 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
486 /// # use google_ads_datamanager_v1::client::PartnerLinkService;
487 /// let client = PartnerLinkService::builder().build().await?;
488 /// # Ok(()) }
489 /// ```
490 pub fn builder() -> super::builder::partner_link_service::ClientBuilder {
491 crate::new_client_builder(super::builder::partner_link_service::client::Factory)
492 }
493
494 /// Creates a new client from the provided stub.
495 ///
496 /// The most common case for calling this function is in tests mocking the
497 /// client's behavior.
498 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
499 where
500 T: super::stub::PartnerLinkService + 'static,
501 {
502 Self { inner: stub.into() }
503 }
504
505 pub(crate) async fn new(
506 config: gaxi::options::ClientConfig,
507 ) -> crate::ClientBuilderResult<Self> {
508 let inner = Self::build_inner(config).await?;
509 Ok(Self { inner })
510 }
511
512 async fn build_inner(
513 conf: gaxi::options::ClientConfig,
514 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PartnerLinkService>>
515 {
516 if gaxi::options::tracing_enabled(&conf) {
517 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
518 }
519 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
520 }
521
522 async fn build_transport(
523 conf: gaxi::options::ClientConfig,
524 ) -> crate::ClientBuilderResult<impl super::stub::PartnerLinkService> {
525 super::transport::PartnerLinkService::new(conf).await
526 }
527
528 async fn build_with_tracing(
529 conf: gaxi::options::ClientConfig,
530 ) -> crate::ClientBuilderResult<impl super::stub::PartnerLinkService> {
531 Self::build_transport(conf)
532 .await
533 .map(super::tracing::PartnerLinkService::new)
534 }
535
536 /// Creates a partner link for the given account.
537 ///
538 /// Authorization Headers:
539 ///
540 /// This method supports the following optional headers to define how the API
541 /// authorizes access for the request:
542 ///
543 /// * `login-account`: (Optional) The resource name of the account where the
544 /// Google Account of the credentials is a user. If not set, defaults to the
545 /// account of the request. Format:
546 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
547 ///
548 /// # Example
549 /// ```
550 /// # use google_ads_datamanager_v1::client::PartnerLinkService;
551 /// use google_ads_datamanager_v1::model::PartnerLink;
552 /// use google_ads_datamanager_v1::Result;
553 /// async fn sample(
554 /// client: &PartnerLinkService, account_type_id: &str, account_id: &str
555 /// ) -> Result<()> {
556 /// let response = client.create_partner_link()
557 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
558 /// .set_partner_link(
559 /// PartnerLink::new()/* set fields */
560 /// )
561 /// .send().await?;
562 /// println!("response {:?}", response);
563 /// Ok(())
564 /// }
565 /// ```
566 pub fn create_partner_link(&self) -> super::builder::partner_link_service::CreatePartnerLink {
567 super::builder::partner_link_service::CreatePartnerLink::new(self.inner.clone())
568 }
569
570 /// Deletes a partner link for the given account.
571 ///
572 /// Authorization Headers:
573 ///
574 /// This method supports the following optional headers to define how the API
575 /// authorizes access for the request:
576 ///
577 /// * `login-account`: (Optional) The resource name of the account where the
578 /// Google Account of the credentials is a user. If not set, defaults to the
579 /// account of the request. Format:
580 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
581 ///
582 /// # Example
583 /// ```
584 /// # use google_ads_datamanager_v1::client::PartnerLinkService;
585 /// use google_ads_datamanager_v1::Result;
586 /// async fn sample(
587 /// client: &PartnerLinkService, account_type_id: &str, account_id: &str, partner_link_id: &str
588 /// ) -> Result<()> {
589 /// client.delete_partner_link()
590 /// .set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/partnerLinks/{partner_link_id}"))
591 /// .send().await?;
592 /// Ok(())
593 /// }
594 /// ```
595 pub fn delete_partner_link(&self) -> super::builder::partner_link_service::DeletePartnerLink {
596 super::builder::partner_link_service::DeletePartnerLink::new(self.inner.clone())
597 }
598
599 /// Searches for all partner links to and from a given account.
600 ///
601 /// Authorization Headers:
602 ///
603 /// This method supports the following optional headers to define how the API
604 /// authorizes access for the request:
605 ///
606 /// * `login-account`: (Optional) The resource name of the account where the
607 /// Google Account of the credentials is a user. If not set, defaults to the
608 /// account of the request. Format:
609 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
610 ///
611 /// # Example
612 /// ```
613 /// # use google_ads_datamanager_v1::client::PartnerLinkService;
614 /// use google_cloud_gax::paginator::ItemPaginator as _;
615 /// use google_ads_datamanager_v1::Result;
616 /// async fn sample(
617 /// client: &PartnerLinkService
618 /// ) -> Result<()> {
619 /// let mut list = client.search_partner_links()
620 /// /* set fields */
621 /// .by_item();
622 /// while let Some(item) = list.next().await.transpose()? {
623 /// println!("{:?}", item);
624 /// }
625 /// Ok(())
626 /// }
627 /// ```
628 pub fn search_partner_links(&self) -> super::builder::partner_link_service::SearchPartnerLinks {
629 super::builder::partner_link_service::SearchPartnerLinks::new(self.inner.clone())
630 }
631}
632
633/// Implements a client for the Data Manager API.
634///
635/// # Example
636/// ```
637/// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
638/// use google_cloud_gax::paginator::ItemPaginator as _;
639/// async fn sample(
640/// account_type_id: &str,
641/// account_id: &str,
642/// ) -> anyhow::Result<()> {
643/// let client = UserListDirectLicenseService::builder().build().await?;
644/// let mut list = client.list_user_list_direct_licenses()
645/// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
646/// .by_item();
647/// while let Some(item) = list.next().await.transpose()? {
648/// println!("{:?}", item);
649/// }
650/// Ok(())
651/// }
652/// ```
653///
654/// # Service Description
655///
656/// Service for managing user list direct licenses. Delete is not a supported
657/// operation for UserListDirectLicenses. Callers should update the
658/// license status to DISABLED to instead to deactivate a license.
659///
660/// This feature is only available to data partners.
661///
662/// # Configuration
663///
664/// To configure `UserListDirectLicenseService` use the `with_*` methods in the type returned
665/// by [builder()][UserListDirectLicenseService::builder]. The default configuration should
666/// work for most applications. Common configuration changes include
667///
668/// * [with_endpoint()]: by default this client uses the global default endpoint
669/// (`https://datamanager.googleapis.com`). Applications using regional
670/// endpoints or running in restricted networks (e.g. a network configured
671/// with [Private Google Access with VPC Service Controls]) may want to
672/// override this default.
673/// * [with_credentials()]: by default this client uses
674/// [Application Default Credentials]. Applications using custom
675/// authentication may need to override this default.
676///
677/// [with_endpoint()]: super::builder::user_list_direct_license_service::ClientBuilder::with_endpoint
678/// [with_credentials()]: super::builder::user_list_direct_license_service::ClientBuilder::with_credentials
679/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
680/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
681///
682/// # Pooling and Cloning
683///
684/// `UserListDirectLicenseService` holds a connection pool internally, it is advised to
685/// create one and reuse it. You do not need to wrap `UserListDirectLicenseService` in
686/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
687/// already uses an `Arc` internally.
688#[derive(Clone, Debug)]
689pub struct UserListDirectLicenseService {
690 inner: std::sync::Arc<dyn super::stub::dynamic::UserListDirectLicenseService>,
691}
692
693impl UserListDirectLicenseService {
694 /// Returns a builder for [UserListDirectLicenseService].
695 ///
696 /// ```
697 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
698 /// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
699 /// let client = UserListDirectLicenseService::builder().build().await?;
700 /// # Ok(()) }
701 /// ```
702 pub fn builder() -> super::builder::user_list_direct_license_service::ClientBuilder {
703 crate::new_client_builder(super::builder::user_list_direct_license_service::client::Factory)
704 }
705
706 /// Creates a new client from the provided stub.
707 ///
708 /// The most common case for calling this function is in tests mocking the
709 /// client's behavior.
710 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
711 where
712 T: super::stub::UserListDirectLicenseService + 'static,
713 {
714 Self { inner: stub.into() }
715 }
716
717 pub(crate) async fn new(
718 config: gaxi::options::ClientConfig,
719 ) -> crate::ClientBuilderResult<Self> {
720 let inner = Self::build_inner(config).await?;
721 Ok(Self { inner })
722 }
723
724 async fn build_inner(
725 conf: gaxi::options::ClientConfig,
726 ) -> crate::ClientBuilderResult<
727 std::sync::Arc<dyn super::stub::dynamic::UserListDirectLicenseService>,
728 > {
729 if gaxi::options::tracing_enabled(&conf) {
730 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
731 }
732 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
733 }
734
735 async fn build_transport(
736 conf: gaxi::options::ClientConfig,
737 ) -> crate::ClientBuilderResult<impl super::stub::UserListDirectLicenseService> {
738 super::transport::UserListDirectLicenseService::new(conf).await
739 }
740
741 async fn build_with_tracing(
742 conf: gaxi::options::ClientConfig,
743 ) -> crate::ClientBuilderResult<impl super::stub::UserListDirectLicenseService> {
744 Self::build_transport(conf)
745 .await
746 .map(super::tracing::UserListDirectLicenseService::new)
747 }
748
749 /// Creates a user list direct license.
750 ///
751 /// This feature is only available to data partners.
752 ///
753 /// # Example
754 /// ```
755 /// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
756 /// use google_ads_datamanager_v1::model::UserListDirectLicense;
757 /// use google_ads_datamanager_v1::Result;
758 /// async fn sample(
759 /// client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str
760 /// ) -> Result<()> {
761 /// let response = client.create_user_list_direct_license()
762 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
763 /// .set_user_list_direct_license(
764 /// UserListDirectLicense::new()/* set fields */
765 /// )
766 /// .send().await?;
767 /// println!("response {:?}", response);
768 /// Ok(())
769 /// }
770 /// ```
771 pub fn create_user_list_direct_license(
772 &self,
773 ) -> super::builder::user_list_direct_license_service::CreateUserListDirectLicense {
774 super::builder::user_list_direct_license_service::CreateUserListDirectLicense::new(
775 self.inner.clone(),
776 )
777 }
778
779 /// Retrieves a user list direct license.
780 ///
781 /// This feature is only available to data partners.
782 ///
783 /// # Example
784 /// ```
785 /// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
786 /// use google_ads_datamanager_v1::Result;
787 /// async fn sample(
788 /// client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str, user_list_direct_license_id: &str
789 /// ) -> Result<()> {
790 /// let response = client.get_user_list_direct_license()
791 /// .set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListDirectLicenses/{user_list_direct_license_id}"))
792 /// .send().await?;
793 /// println!("response {:?}", response);
794 /// Ok(())
795 /// }
796 /// ```
797 pub fn get_user_list_direct_license(
798 &self,
799 ) -> super::builder::user_list_direct_license_service::GetUserListDirectLicense {
800 super::builder::user_list_direct_license_service::GetUserListDirectLicense::new(
801 self.inner.clone(),
802 )
803 }
804
805 /// Updates a user list direct license.
806 ///
807 /// This feature is only available to data partners.
808 ///
809 /// # Example
810 /// ```
811 /// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
812 /// # extern crate wkt as google_cloud_wkt;
813 /// use google_cloud_wkt::FieldMask;
814 /// use google_ads_datamanager_v1::model::UserListDirectLicense;
815 /// use google_ads_datamanager_v1::Result;
816 /// async fn sample(
817 /// client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str, user_list_direct_license_id: &str
818 /// ) -> Result<()> {
819 /// let response = client.update_user_list_direct_license()
820 /// .set_user_list_direct_license(
821 /// UserListDirectLicense::new().set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListDirectLicenses/{user_list_direct_license_id}"))/* set fields */
822 /// )
823 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
824 /// .send().await?;
825 /// println!("response {:?}", response);
826 /// Ok(())
827 /// }
828 /// ```
829 pub fn update_user_list_direct_license(
830 &self,
831 ) -> super::builder::user_list_direct_license_service::UpdateUserListDirectLicense {
832 super::builder::user_list_direct_license_service::UpdateUserListDirectLicense::new(
833 self.inner.clone(),
834 )
835 }
836
837 /// Lists all user list direct licenses owned by the parent account.
838 ///
839 /// This feature is only available to data partners.
840 ///
841 /// # Example
842 /// ```
843 /// # use google_ads_datamanager_v1::client::UserListDirectLicenseService;
844 /// use google_cloud_gax::paginator::ItemPaginator as _;
845 /// use google_ads_datamanager_v1::Result;
846 /// async fn sample(
847 /// client: &UserListDirectLicenseService, account_type_id: &str, account_id: &str
848 /// ) -> Result<()> {
849 /// let mut list = client.list_user_list_direct_licenses()
850 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
851 /// .by_item();
852 /// while let Some(item) = list.next().await.transpose()? {
853 /// println!("{:?}", item);
854 /// }
855 /// Ok(())
856 /// }
857 /// ```
858 pub fn list_user_list_direct_licenses(
859 &self,
860 ) -> super::builder::user_list_direct_license_service::ListUserListDirectLicenses {
861 super::builder::user_list_direct_license_service::ListUserListDirectLicenses::new(
862 self.inner.clone(),
863 )
864 }
865}
866
867/// Implements a client for the Data Manager API.
868///
869/// # Example
870/// ```
871/// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
872/// use google_cloud_gax::paginator::ItemPaginator as _;
873/// async fn sample(
874/// account_type_id: &str,
875/// account_id: &str,
876/// ) -> anyhow::Result<()> {
877/// let client = UserListGlobalLicenseService::builder().build().await?;
878/// let mut list = client.list_user_list_global_licenses()
879/// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
880/// .by_item();
881/// while let Some(item) = list.next().await.transpose()? {
882/// println!("{:?}", item);
883/// }
884/// Ok(())
885/// }
886/// ```
887///
888/// # Service Description
889///
890/// Service for managing user list global licenses. Delete is not a supported
891/// operation for UserListGlobalLicenses. Callers should update the
892/// license status to DISABLED to instead to deactivate a license.
893///
894/// This feature is only available to data partners.
895///
896/// # Configuration
897///
898/// To configure `UserListGlobalLicenseService` use the `with_*` methods in the type returned
899/// by [builder()][UserListGlobalLicenseService::builder]. The default configuration should
900/// work for most applications. Common configuration changes include
901///
902/// * [with_endpoint()]: by default this client uses the global default endpoint
903/// (`https://datamanager.googleapis.com`). Applications using regional
904/// endpoints or running in restricted networks (e.g. a network configured
905/// with [Private Google Access with VPC Service Controls]) may want to
906/// override this default.
907/// * [with_credentials()]: by default this client uses
908/// [Application Default Credentials]. Applications using custom
909/// authentication may need to override this default.
910///
911/// [with_endpoint()]: super::builder::user_list_global_license_service::ClientBuilder::with_endpoint
912/// [with_credentials()]: super::builder::user_list_global_license_service::ClientBuilder::with_credentials
913/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
914/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
915///
916/// # Pooling and Cloning
917///
918/// `UserListGlobalLicenseService` holds a connection pool internally, it is advised to
919/// create one and reuse it. You do not need to wrap `UserListGlobalLicenseService` in
920/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
921/// already uses an `Arc` internally.
922#[derive(Clone, Debug)]
923pub struct UserListGlobalLicenseService {
924 inner: std::sync::Arc<dyn super::stub::dynamic::UserListGlobalLicenseService>,
925}
926
927impl UserListGlobalLicenseService {
928 /// Returns a builder for [UserListGlobalLicenseService].
929 ///
930 /// ```
931 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
932 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
933 /// let client = UserListGlobalLicenseService::builder().build().await?;
934 /// # Ok(()) }
935 /// ```
936 pub fn builder() -> super::builder::user_list_global_license_service::ClientBuilder {
937 crate::new_client_builder(super::builder::user_list_global_license_service::client::Factory)
938 }
939
940 /// Creates a new client from the provided stub.
941 ///
942 /// The most common case for calling this function is in tests mocking the
943 /// client's behavior.
944 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
945 where
946 T: super::stub::UserListGlobalLicenseService + 'static,
947 {
948 Self { inner: stub.into() }
949 }
950
951 pub(crate) async fn new(
952 config: gaxi::options::ClientConfig,
953 ) -> crate::ClientBuilderResult<Self> {
954 let inner = Self::build_inner(config).await?;
955 Ok(Self { inner })
956 }
957
958 async fn build_inner(
959 conf: gaxi::options::ClientConfig,
960 ) -> crate::ClientBuilderResult<
961 std::sync::Arc<dyn super::stub::dynamic::UserListGlobalLicenseService>,
962 > {
963 if gaxi::options::tracing_enabled(&conf) {
964 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
965 }
966 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
967 }
968
969 async fn build_transport(
970 conf: gaxi::options::ClientConfig,
971 ) -> crate::ClientBuilderResult<impl super::stub::UserListGlobalLicenseService> {
972 super::transport::UserListGlobalLicenseService::new(conf).await
973 }
974
975 async fn build_with_tracing(
976 conf: gaxi::options::ClientConfig,
977 ) -> crate::ClientBuilderResult<impl super::stub::UserListGlobalLicenseService> {
978 Self::build_transport(conf)
979 .await
980 .map(super::tracing::UserListGlobalLicenseService::new)
981 }
982
983 /// Creates a user list global license.
984 ///
985 /// This feature is only available to data partners.
986 ///
987 /// # Example
988 /// ```
989 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
990 /// use google_ads_datamanager_v1::model::UserListGlobalLicense;
991 /// use google_ads_datamanager_v1::Result;
992 /// async fn sample(
993 /// client: &UserListGlobalLicenseService, account_type_id: &str, account_id: &str
994 /// ) -> Result<()> {
995 /// let response = client.create_user_list_global_license()
996 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
997 /// .set_user_list_global_license(
998 /// UserListGlobalLicense::new()/* set fields */
999 /// )
1000 /// .send().await?;
1001 /// println!("response {:?}", response);
1002 /// Ok(())
1003 /// }
1004 /// ```
1005 pub fn create_user_list_global_license(
1006 &self,
1007 ) -> super::builder::user_list_global_license_service::CreateUserListGlobalLicense {
1008 super::builder::user_list_global_license_service::CreateUserListGlobalLicense::new(
1009 self.inner.clone(),
1010 )
1011 }
1012
1013 /// Updates a user list global license.
1014 ///
1015 /// This feature is only available to data partners.
1016 ///
1017 /// # Example
1018 /// ```
1019 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
1020 /// # extern crate wkt as google_cloud_wkt;
1021 /// use google_cloud_wkt::FieldMask;
1022 /// use google_ads_datamanager_v1::model::UserListGlobalLicense;
1023 /// use google_ads_datamanager_v1::Result;
1024 /// async fn sample(
1025 /// client: &UserListGlobalLicenseService, account_type_id: &str, account_id: &str, user_list_global_license_id: &str
1026 /// ) -> Result<()> {
1027 /// let response = client.update_user_list_global_license()
1028 /// .set_user_list_global_license(
1029 /// UserListGlobalLicense::new().set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListGlobalLicenses/{user_list_global_license_id}"))/* set fields */
1030 /// )
1031 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1032 /// .send().await?;
1033 /// println!("response {:?}", response);
1034 /// Ok(())
1035 /// }
1036 /// ```
1037 pub fn update_user_list_global_license(
1038 &self,
1039 ) -> super::builder::user_list_global_license_service::UpdateUserListGlobalLicense {
1040 super::builder::user_list_global_license_service::UpdateUserListGlobalLicense::new(
1041 self.inner.clone(),
1042 )
1043 }
1044
1045 /// Retrieves a user list global license.
1046 ///
1047 /// This feature is only available to data partners.
1048 ///
1049 /// # Example
1050 /// ```
1051 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
1052 /// use google_ads_datamanager_v1::Result;
1053 /// async fn sample(
1054 /// client: &UserListGlobalLicenseService, account_type_id: &str, account_id: &str, user_list_global_license_id: &str
1055 /// ) -> Result<()> {
1056 /// let response = client.get_user_list_global_license()
1057 /// .set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListGlobalLicenses/{user_list_global_license_id}"))
1058 /// .send().await?;
1059 /// println!("response {:?}", response);
1060 /// Ok(())
1061 /// }
1062 /// ```
1063 pub fn get_user_list_global_license(
1064 &self,
1065 ) -> super::builder::user_list_global_license_service::GetUserListGlobalLicense {
1066 super::builder::user_list_global_license_service::GetUserListGlobalLicense::new(
1067 self.inner.clone(),
1068 )
1069 }
1070
1071 /// Lists all user list global licenses owned by the parent account.
1072 ///
1073 /// This feature is only available to data partners.
1074 ///
1075 /// # Example
1076 /// ```
1077 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
1078 /// use google_cloud_gax::paginator::ItemPaginator as _;
1079 /// use google_ads_datamanager_v1::Result;
1080 /// async fn sample(
1081 /// client: &UserListGlobalLicenseService, account_type_id: &str, account_id: &str
1082 /// ) -> Result<()> {
1083 /// let mut list = client.list_user_list_global_licenses()
1084 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
1085 /// .by_item();
1086 /// while let Some(item) = list.next().await.transpose()? {
1087 /// println!("{:?}", item);
1088 /// }
1089 /// Ok(())
1090 /// }
1091 /// ```
1092 pub fn list_user_list_global_licenses(
1093 &self,
1094 ) -> super::builder::user_list_global_license_service::ListUserListGlobalLicenses {
1095 super::builder::user_list_global_license_service::ListUserListGlobalLicenses::new(
1096 self.inner.clone(),
1097 )
1098 }
1099
1100 /// Lists all customer info for a user list global license.
1101 ///
1102 /// This feature is only available to data partners.
1103 ///
1104 /// # Example
1105 /// ```
1106 /// # use google_ads_datamanager_v1::client::UserListGlobalLicenseService;
1107 /// use google_cloud_gax::paginator::ItemPaginator as _;
1108 /// use google_ads_datamanager_v1::Result;
1109 /// async fn sample(
1110 /// client: &UserListGlobalLicenseService, account_type_id: &str, account_id: &str, user_list_global_license_id: &str
1111 /// ) -> Result<()> {
1112 /// let mut list = client.list_user_list_global_license_customer_infos()
1113 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}/userListGlobalLicenses/{user_list_global_license_id}"))
1114 /// .by_item();
1115 /// while let Some(item) = list.next().await.transpose()? {
1116 /// println!("{:?}", item);
1117 /// }
1118 /// Ok(())
1119 /// }
1120 /// ```
1121 pub fn list_user_list_global_license_customer_infos(
1122 &self,
1123 ) -> super::builder::user_list_global_license_service::ListUserListGlobalLicenseCustomerInfos
1124 {
1125 super::builder::user_list_global_license_service::ListUserListGlobalLicenseCustomerInfos::new(self.inner.clone())
1126 }
1127}
1128
1129/// Implements a client for the Data Manager API.
1130///
1131/// # Example
1132/// ```
1133/// # use google_ads_datamanager_v1::client::UserListService;
1134/// use google_cloud_gax::paginator::ItemPaginator as _;
1135/// async fn sample(
1136/// account_type_id: &str,
1137/// account_id: &str,
1138/// ) -> anyhow::Result<()> {
1139/// let client = UserListService::builder().build().await?;
1140/// let mut list = client.list_user_lists()
1141/// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
1142/// .by_item();
1143/// while let Some(item) = list.next().await.transpose()? {
1144/// println!("{:?}", item);
1145/// }
1146/// Ok(())
1147/// }
1148/// ```
1149///
1150/// # Service Description
1151///
1152/// Service for managing UserList resources.
1153///
1154/// # Configuration
1155///
1156/// To configure `UserListService` use the `with_*` methods in the type returned
1157/// by [builder()][UserListService::builder]. The default configuration should
1158/// work for most applications. Common configuration changes include
1159///
1160/// * [with_endpoint()]: by default this client uses the global default endpoint
1161/// (`https://datamanager.googleapis.com`). Applications using regional
1162/// endpoints or running in restricted networks (e.g. a network configured
1163/// with [Private Google Access with VPC Service Controls]) may want to
1164/// override this default.
1165/// * [with_credentials()]: by default this client uses
1166/// [Application Default Credentials]. Applications using custom
1167/// authentication may need to override this default.
1168///
1169/// [with_endpoint()]: super::builder::user_list_service::ClientBuilder::with_endpoint
1170/// [with_credentials()]: super::builder::user_list_service::ClientBuilder::with_credentials
1171/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1172/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1173///
1174/// # Pooling and Cloning
1175///
1176/// `UserListService` holds a connection pool internally, it is advised to
1177/// create one and reuse it. You do not need to wrap `UserListService` in
1178/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1179/// already uses an `Arc` internally.
1180#[derive(Clone, Debug)]
1181pub struct UserListService {
1182 inner: std::sync::Arc<dyn super::stub::dynamic::UserListService>,
1183}
1184
1185impl UserListService {
1186 /// Returns a builder for [UserListService].
1187 ///
1188 /// ```
1189 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1190 /// # use google_ads_datamanager_v1::client::UserListService;
1191 /// let client = UserListService::builder().build().await?;
1192 /// # Ok(()) }
1193 /// ```
1194 pub fn builder() -> super::builder::user_list_service::ClientBuilder {
1195 crate::new_client_builder(super::builder::user_list_service::client::Factory)
1196 }
1197
1198 /// Creates a new client from the provided stub.
1199 ///
1200 /// The most common case for calling this function is in tests mocking the
1201 /// client's behavior.
1202 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1203 where
1204 T: super::stub::UserListService + 'static,
1205 {
1206 Self { inner: stub.into() }
1207 }
1208
1209 pub(crate) async fn new(
1210 config: gaxi::options::ClientConfig,
1211 ) -> crate::ClientBuilderResult<Self> {
1212 let inner = Self::build_inner(config).await?;
1213 Ok(Self { inner })
1214 }
1215
1216 async fn build_inner(
1217 conf: gaxi::options::ClientConfig,
1218 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UserListService>> {
1219 if gaxi::options::tracing_enabled(&conf) {
1220 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1221 }
1222 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1223 }
1224
1225 async fn build_transport(
1226 conf: gaxi::options::ClientConfig,
1227 ) -> crate::ClientBuilderResult<impl super::stub::UserListService> {
1228 super::transport::UserListService::new(conf).await
1229 }
1230
1231 async fn build_with_tracing(
1232 conf: gaxi::options::ClientConfig,
1233 ) -> crate::ClientBuilderResult<impl super::stub::UserListService> {
1234 Self::build_transport(conf)
1235 .await
1236 .map(super::tracing::UserListService::new)
1237 }
1238
1239 /// Gets a UserList.
1240 ///
1241 /// Authorization Headers:
1242 ///
1243 /// This method supports the following optional headers to define how the API
1244 /// authorizes access for the request:
1245 ///
1246 /// * `login-account`: (Optional) The resource name of the account where the
1247 /// Google Account of the credentials is a user. If not set, defaults to the
1248 /// account of the request. Format:
1249 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
1250 /// * `linked-account`: (Optional) The resource name of the account with an
1251 /// established product link to the `login-account`. Format:
1252 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
1253 ///
1254 /// # Example
1255 /// ```
1256 /// # use google_ads_datamanager_v1::client::UserListService;
1257 /// use google_ads_datamanager_v1::Result;
1258 /// async fn sample(
1259 /// client: &UserListService, account_type_id: &str, account_id: &str, user_list_id: &str
1260 /// ) -> Result<()> {
1261 /// let response = client.get_user_list()
1262 /// .set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userLists/{user_list_id}"))
1263 /// .send().await?;
1264 /// println!("response {:?}", response);
1265 /// Ok(())
1266 /// }
1267 /// ```
1268 pub fn get_user_list(&self) -> super::builder::user_list_service::GetUserList {
1269 super::builder::user_list_service::GetUserList::new(self.inner.clone())
1270 }
1271
1272 /// Lists UserLists.
1273 ///
1274 /// Authorization Headers:
1275 ///
1276 /// This method supports the following optional headers to define how the API
1277 /// authorizes access for the request:
1278 ///
1279 /// * `login-account`: (Optional) The resource name of the account where the
1280 /// Google Account of the credentials is a user. If not set, defaults to the
1281 /// account of the request. Format:
1282 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
1283 /// * `linked-account`: (Optional) The resource name of the account with an
1284 /// established product link to the `login-account`. Format:
1285 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
1286 ///
1287 /// # Example
1288 /// ```
1289 /// # use google_ads_datamanager_v1::client::UserListService;
1290 /// use google_cloud_gax::paginator::ItemPaginator as _;
1291 /// use google_ads_datamanager_v1::Result;
1292 /// async fn sample(
1293 /// client: &UserListService, account_type_id: &str, account_id: &str
1294 /// ) -> Result<()> {
1295 /// let mut list = client.list_user_lists()
1296 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
1297 /// .by_item();
1298 /// while let Some(item) = list.next().await.transpose()? {
1299 /// println!("{:?}", item);
1300 /// }
1301 /// Ok(())
1302 /// }
1303 /// ```
1304 pub fn list_user_lists(&self) -> super::builder::user_list_service::ListUserLists {
1305 super::builder::user_list_service::ListUserLists::new(self.inner.clone())
1306 }
1307
1308 /// Creates a UserList.
1309 ///
1310 /// Authorization Headers:
1311 ///
1312 /// This method supports the following optional headers to define how the API
1313 /// authorizes access for the request:
1314 ///
1315 /// * `login-account`: (Optional) The resource name of the account where the
1316 /// Google Account of the credentials is a user. If not set, defaults to the
1317 /// account of the request. Format:
1318 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
1319 /// * `linked-account`: (Optional) The resource name of the account with an
1320 /// established product link to the `login-account`. Format:
1321 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
1322 ///
1323 /// # Example
1324 /// ```
1325 /// # use google_ads_datamanager_v1::client::UserListService;
1326 /// use google_ads_datamanager_v1::model::UserList;
1327 /// use google_ads_datamanager_v1::Result;
1328 /// async fn sample(
1329 /// client: &UserListService, account_type_id: &str, account_id: &str
1330 /// ) -> Result<()> {
1331 /// let response = client.create_user_list()
1332 /// .set_parent(format!("accountTypes/{account_type_id}/accounts/{account_id}"))
1333 /// .set_user_list(
1334 /// UserList::new()/* set fields */
1335 /// )
1336 /// .send().await?;
1337 /// println!("response {:?}", response);
1338 /// Ok(())
1339 /// }
1340 /// ```
1341 pub fn create_user_list(&self) -> super::builder::user_list_service::CreateUserList {
1342 super::builder::user_list_service::CreateUserList::new(self.inner.clone())
1343 }
1344
1345 /// Updates a UserList.
1346 ///
1347 /// Authorization Headers:
1348 ///
1349 /// This method supports the following optional headers to define how the API
1350 /// authorizes access for the request:
1351 ///
1352 /// * `login-account`: (Optional) The resource name of the account where the
1353 /// Google Account of the credentials is a user. If not set, defaults to the
1354 /// account of the request. Format:
1355 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
1356 /// * `linked-account`: (Optional) The resource name of the account with an
1357 /// established product link to the `login-account`. Format:
1358 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
1359 ///
1360 /// # Example
1361 /// ```
1362 /// # use google_ads_datamanager_v1::client::UserListService;
1363 /// # extern crate wkt as google_cloud_wkt;
1364 /// use google_cloud_wkt::FieldMask;
1365 /// use google_ads_datamanager_v1::model::UserList;
1366 /// use google_ads_datamanager_v1::Result;
1367 /// async fn sample(
1368 /// client: &UserListService, account_type_id: &str, account_id: &str, user_list_id: &str
1369 /// ) -> Result<()> {
1370 /// let response = client.update_user_list()
1371 /// .set_user_list(
1372 /// UserList::new().set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userLists/{user_list_id}"))/* set fields */
1373 /// )
1374 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1375 /// .send().await?;
1376 /// println!("response {:?}", response);
1377 /// Ok(())
1378 /// }
1379 /// ```
1380 pub fn update_user_list(&self) -> super::builder::user_list_service::UpdateUserList {
1381 super::builder::user_list_service::UpdateUserList::new(self.inner.clone())
1382 }
1383
1384 /// Deletes a UserList.
1385 ///
1386 /// Authorization Headers:
1387 ///
1388 /// This method supports the following optional headers to define how the API
1389 /// authorizes access for the request:
1390 ///
1391 /// * `login-account`: (Optional) The resource name of the account where the
1392 /// Google Account of the credentials is a user. If not set, defaults to the
1393 /// account of the request. Format:
1394 /// `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
1395 /// * `linked-account`: (Optional) The resource name of the account with an
1396 /// established product link to the `login-account`. Format:
1397 /// `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
1398 ///
1399 /// # Example
1400 /// ```
1401 /// # use google_ads_datamanager_v1::client::UserListService;
1402 /// use google_ads_datamanager_v1::Result;
1403 /// async fn sample(
1404 /// client: &UserListService, account_type_id: &str, account_id: &str, user_list_id: &str
1405 /// ) -> Result<()> {
1406 /// client.delete_user_list()
1407 /// .set_name(format!("accountTypes/{account_type_id}/accounts/{account_id}/userLists/{user_list_id}"))
1408 /// .send().await?;
1409 /// Ok(())
1410 /// }
1411 /// ```
1412 pub fn delete_user_list(&self) -> super::builder::user_list_service::DeleteUserList {
1413 super::builder::user_list_service::DeleteUserList::new(self.inner.clone())
1414 }
1415}