google_apps_meet_v2/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 Google Meet API.
22///
23/// # Example
24/// ```
25/// # use google_apps_meet_v2::client::SpacesService;
26/// async fn sample(
27/// space_id: &str,
28/// ) -> anyhow::Result<()> {
29/// let client = SpacesService::builder().build().await?;
30/// let response = client.get_space()
31/// .set_name(format!("spaces/{space_id}"))
32/// .send().await?;
33/// println!("response {:?}", response);
34/// Ok(())
35/// }
36/// ```
37///
38/// # Service Description
39///
40/// REST API for services dealing with spaces.
41///
42/// # Configuration
43///
44/// To configure `SpacesService` use the `with_*` methods in the type returned
45/// by [builder()][SpacesService::builder]. The default configuration should
46/// work for most applications. Common configuration changes include
47///
48/// * [with_endpoint()]: by default this client uses the global default endpoint
49/// (`https://meet.googleapis.com`). Applications using regional
50/// endpoints or running in restricted networks (e.g. a network configured
51/// with [Private Google Access with VPC Service Controls]) may want to
52/// override this default.
53/// * [with_credentials()]: by default this client uses
54/// [Application Default Credentials]. Applications using custom
55/// authentication may need to override this default.
56///
57/// [with_endpoint()]: super::builder::spaces_service::ClientBuilder::with_endpoint
58/// [with_credentials()]: super::builder::spaces_service::ClientBuilder::with_credentials
59/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
60/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
61///
62/// # Pooling and Cloning
63///
64/// `SpacesService` holds a connection pool internally, it is advised to
65/// create one and reuse it. You do not need to wrap `SpacesService` in
66/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
67/// already uses an `Arc` internally.
68#[derive(Clone, Debug)]
69pub struct SpacesService {
70 inner: std::sync::Arc<dyn super::stub::dynamic::SpacesService>,
71}
72
73impl SpacesService {
74 /// Returns a builder for [SpacesService].
75 ///
76 /// ```
77 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
78 /// # use google_apps_meet_v2::client::SpacesService;
79 /// let client = SpacesService::builder().build().await?;
80 /// # Ok(()) }
81 /// ```
82 pub fn builder() -> super::builder::spaces_service::ClientBuilder {
83 crate::new_client_builder(super::builder::spaces_service::client::Factory)
84 }
85
86 /// Creates a new client from the provided stub.
87 ///
88 /// The most common case for calling this function is in tests mocking the
89 /// client's behavior.
90 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
91 where
92 T: super::stub::SpacesService + 'static,
93 {
94 Self { inner: stub.into() }
95 }
96
97 pub(crate) async fn new(
98 config: gaxi::options::ClientConfig,
99 ) -> crate::ClientBuilderResult<Self> {
100 let inner = Self::build_inner(config).await?;
101 Ok(Self { inner })
102 }
103
104 async fn build_inner(
105 conf: gaxi::options::ClientConfig,
106 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SpacesService>> {
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::SpacesService> {
116 super::transport::SpacesService::new(conf).await
117 }
118
119 async fn build_with_tracing(
120 conf: gaxi::options::ClientConfig,
121 ) -> crate::ClientBuilderResult<impl super::stub::SpacesService> {
122 Self::build_transport(conf)
123 .await
124 .map(super::tracing::SpacesService::new)
125 }
126
127 /// Creates a space.
128 ///
129 /// # Example
130 /// ```
131 /// # use google_apps_meet_v2::client::SpacesService;
132 /// use google_apps_meet_v2::Result;
133 /// async fn sample(
134 /// client: &SpacesService
135 /// ) -> Result<()> {
136 /// let response = client.create_space()
137 /// /* set fields */
138 /// .send().await?;
139 /// println!("response {:?}", response);
140 /// Ok(())
141 /// }
142 /// ```
143 pub fn create_space(&self) -> super::builder::spaces_service::CreateSpace {
144 super::builder::spaces_service::CreateSpace::new(self.inner.clone())
145 }
146
147 /// Gets details about a meeting space.
148 ///
149 /// For an example, see [Get a meeting
150 /// space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space).
151 ///
152 /// # Example
153 /// ```
154 /// # use google_apps_meet_v2::client::SpacesService;
155 /// use google_apps_meet_v2::Result;
156 /// async fn sample(
157 /// client: &SpacesService, space_id: &str
158 /// ) -> Result<()> {
159 /// let response = client.get_space()
160 /// .set_name(format!("spaces/{space_id}"))
161 /// .send().await?;
162 /// println!("response {:?}", response);
163 /// Ok(())
164 /// }
165 /// ```
166 pub fn get_space(&self) -> super::builder::spaces_service::GetSpace {
167 super::builder::spaces_service::GetSpace::new(self.inner.clone())
168 }
169
170 /// Updates details about a meeting space.
171 ///
172 /// For an example, see [Update a meeting
173 /// space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space).
174 ///
175 /// # Example
176 /// ```
177 /// # use google_apps_meet_v2::client::SpacesService;
178 /// # extern crate wkt as google_cloud_wkt;
179 /// use google_cloud_wkt::FieldMask;
180 /// use google_apps_meet_v2::model::Space;
181 /// use google_apps_meet_v2::Result;
182 /// async fn sample(
183 /// client: &SpacesService, space_id: &str
184 /// ) -> Result<()> {
185 /// let response = client.update_space()
186 /// .set_space(
187 /// Space::new().set_name(format!("spaces/{space_id}"))/* set fields */
188 /// )
189 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
190 /// .send().await?;
191 /// println!("response {:?}", response);
192 /// Ok(())
193 /// }
194 /// ```
195 pub fn update_space(&self) -> super::builder::spaces_service::UpdateSpace {
196 super::builder::spaces_service::UpdateSpace::new(self.inner.clone())
197 }
198
199 /// Ends an active conference (if there's one).
200 ///
201 /// For an example, see [End active
202 /// conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference).
203 ///
204 /// # Example
205 /// ```
206 /// # use google_apps_meet_v2::client::SpacesService;
207 /// use google_apps_meet_v2::Result;
208 /// async fn sample(
209 /// client: &SpacesService
210 /// ) -> Result<()> {
211 /// client.end_active_conference()
212 /// /* set fields */
213 /// .send().await?;
214 /// Ok(())
215 /// }
216 /// ```
217 pub fn end_active_conference(&self) -> super::builder::spaces_service::EndActiveConference {
218 super::builder::spaces_service::EndActiveConference::new(self.inner.clone())
219 }
220}
221
222/// Implements a client for the Google Meet API.
223///
224/// # Example
225/// ```
226/// # use google_apps_meet_v2::client::ConferenceRecordsService;
227/// use google_cloud_gax::paginator::ItemPaginator as _;
228/// async fn sample(
229/// conference_record_id: &str,
230/// ) -> anyhow::Result<()> {
231/// let client = ConferenceRecordsService::builder().build().await?;
232/// let mut list = client.list_participants()
233/// .set_parent(format!("conferenceRecords/{conference_record_id}"))
234/// .by_item();
235/// while let Some(item) = list.next().await.transpose()? {
236/// println!("{:?}", item);
237/// }
238/// Ok(())
239/// }
240/// ```
241///
242/// # Service Description
243///
244/// REST API for services dealing with conference records.
245///
246/// # Configuration
247///
248/// To configure `ConferenceRecordsService` use the `with_*` methods in the type returned
249/// by [builder()][ConferenceRecordsService::builder]. The default configuration should
250/// work for most applications. Common configuration changes include
251///
252/// * [with_endpoint()]: by default this client uses the global default endpoint
253/// (`https://meet.googleapis.com`). Applications using regional
254/// endpoints or running in restricted networks (e.g. a network configured
255/// with [Private Google Access with VPC Service Controls]) may want to
256/// override this default.
257/// * [with_credentials()]: by default this client uses
258/// [Application Default Credentials]. Applications using custom
259/// authentication may need to override this default.
260///
261/// [with_endpoint()]: super::builder::conference_records_service::ClientBuilder::with_endpoint
262/// [with_credentials()]: super::builder::conference_records_service::ClientBuilder::with_credentials
263/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
264/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
265///
266/// # Pooling and Cloning
267///
268/// `ConferenceRecordsService` holds a connection pool internally, it is advised to
269/// create one and reuse it. You do not need to wrap `ConferenceRecordsService` in
270/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
271/// already uses an `Arc` internally.
272#[derive(Clone, Debug)]
273pub struct ConferenceRecordsService {
274 inner: std::sync::Arc<dyn super::stub::dynamic::ConferenceRecordsService>,
275}
276
277impl ConferenceRecordsService {
278 /// Returns a builder for [ConferenceRecordsService].
279 ///
280 /// ```
281 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
282 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
283 /// let client = ConferenceRecordsService::builder().build().await?;
284 /// # Ok(()) }
285 /// ```
286 pub fn builder() -> super::builder::conference_records_service::ClientBuilder {
287 crate::new_client_builder(super::builder::conference_records_service::client::Factory)
288 }
289
290 /// Creates a new client from the provided stub.
291 ///
292 /// The most common case for calling this function is in tests mocking the
293 /// client's behavior.
294 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
295 where
296 T: super::stub::ConferenceRecordsService + 'static,
297 {
298 Self { inner: stub.into() }
299 }
300
301 pub(crate) async fn new(
302 config: gaxi::options::ClientConfig,
303 ) -> crate::ClientBuilderResult<Self> {
304 let inner = Self::build_inner(config).await?;
305 Ok(Self { inner })
306 }
307
308 async fn build_inner(
309 conf: gaxi::options::ClientConfig,
310 ) -> crate::ClientBuilderResult<
311 std::sync::Arc<dyn super::stub::dynamic::ConferenceRecordsService>,
312 > {
313 if gaxi::options::tracing_enabled(&conf) {
314 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
315 }
316 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
317 }
318
319 async fn build_transport(
320 conf: gaxi::options::ClientConfig,
321 ) -> crate::ClientBuilderResult<impl super::stub::ConferenceRecordsService> {
322 super::transport::ConferenceRecordsService::new(conf).await
323 }
324
325 async fn build_with_tracing(
326 conf: gaxi::options::ClientConfig,
327 ) -> crate::ClientBuilderResult<impl super::stub::ConferenceRecordsService> {
328 Self::build_transport(conf)
329 .await
330 .map(super::tracing::ConferenceRecordsService::new)
331 }
332
333 /// Gets a conference record by conference ID.
334 ///
335 /// # Example
336 /// ```
337 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
338 /// use google_apps_meet_v2::Result;
339 /// async fn sample(
340 /// client: &ConferenceRecordsService, conference_record_id: &str
341 /// ) -> Result<()> {
342 /// let response = client.get_conference_record()
343 /// .set_name(format!("conferenceRecords/{conference_record_id}"))
344 /// .send().await?;
345 /// println!("response {:?}", response);
346 /// Ok(())
347 /// }
348 /// ```
349 pub fn get_conference_record(
350 &self,
351 ) -> super::builder::conference_records_service::GetConferenceRecord {
352 super::builder::conference_records_service::GetConferenceRecord::new(self.inner.clone())
353 }
354
355 /// Lists the conference records. By default, ordered by start time and in
356 /// descending order.
357 ///
358 /// # Example
359 /// ```
360 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
361 /// use google_cloud_gax::paginator::ItemPaginator as _;
362 /// use google_apps_meet_v2::Result;
363 /// async fn sample(
364 /// client: &ConferenceRecordsService
365 /// ) -> Result<()> {
366 /// let mut list = client.list_conference_records()
367 /// /* set fields */
368 /// .by_item();
369 /// while let Some(item) = list.next().await.transpose()? {
370 /// println!("{:?}", item);
371 /// }
372 /// Ok(())
373 /// }
374 /// ```
375 pub fn list_conference_records(
376 &self,
377 ) -> super::builder::conference_records_service::ListConferenceRecords {
378 super::builder::conference_records_service::ListConferenceRecords::new(self.inner.clone())
379 }
380
381 /// Gets a participant by participant ID.
382 ///
383 /// # Example
384 /// ```
385 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
386 /// use google_apps_meet_v2::Result;
387 /// async fn sample(
388 /// client: &ConferenceRecordsService, conference_record_id: &str, participant_id: &str
389 /// ) -> Result<()> {
390 /// let response = client.get_participant()
391 /// .set_name(format!("conferenceRecords/{conference_record_id}/participants/{participant_id}"))
392 /// .send().await?;
393 /// println!("response {:?}", response);
394 /// Ok(())
395 /// }
396 /// ```
397 pub fn get_participant(&self) -> super::builder::conference_records_service::GetParticipant {
398 super::builder::conference_records_service::GetParticipant::new(self.inner.clone())
399 }
400
401 /// Lists the participants in a conference record. By default, ordered by join
402 /// time and in descending order. This API supports `fields` as standard
403 /// parameters like every other API. However, when the `fields` request
404 /// parameter is omitted, this API defaults to `'participants/*,
405 /// next_page_token'`.
406 ///
407 /// # Example
408 /// ```
409 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
410 /// use google_cloud_gax::paginator::ItemPaginator as _;
411 /// use google_apps_meet_v2::Result;
412 /// async fn sample(
413 /// client: &ConferenceRecordsService, conference_record_id: &str
414 /// ) -> Result<()> {
415 /// let mut list = client.list_participants()
416 /// .set_parent(format!("conferenceRecords/{conference_record_id}"))
417 /// .by_item();
418 /// while let Some(item) = list.next().await.transpose()? {
419 /// println!("{:?}", item);
420 /// }
421 /// Ok(())
422 /// }
423 /// ```
424 pub fn list_participants(
425 &self,
426 ) -> super::builder::conference_records_service::ListParticipants {
427 super::builder::conference_records_service::ListParticipants::new(self.inner.clone())
428 }
429
430 /// Gets a participant session by participant session ID.
431 ///
432 /// # Example
433 /// ```
434 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
435 /// use google_apps_meet_v2::Result;
436 /// async fn sample(
437 /// client: &ConferenceRecordsService, conference_record_id: &str, participant_id: &str, participant_session_id: &str
438 /// ) -> Result<()> {
439 /// let response = client.get_participant_session()
440 /// .set_name(format!("conferenceRecords/{conference_record_id}/participants/{participant_id}/participantSessions/{participant_session_id}"))
441 /// .send().await?;
442 /// println!("response {:?}", response);
443 /// Ok(())
444 /// }
445 /// ```
446 pub fn get_participant_session(
447 &self,
448 ) -> super::builder::conference_records_service::GetParticipantSession {
449 super::builder::conference_records_service::GetParticipantSession::new(self.inner.clone())
450 }
451
452 /// Lists the participant sessions of a participant in a conference record. By
453 /// default, ordered by join time and in descending order. This API supports
454 /// `fields` as standard parameters like every other API. However, when the
455 /// `fields` request parameter is omitted this API defaults to
456 /// `'participantsessions/*, next_page_token'`.
457 ///
458 /// # Example
459 /// ```
460 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
461 /// use google_cloud_gax::paginator::ItemPaginator as _;
462 /// use google_apps_meet_v2::Result;
463 /// async fn sample(
464 /// client: &ConferenceRecordsService, conference_record_id: &str, participant_id: &str
465 /// ) -> Result<()> {
466 /// let mut list = client.list_participant_sessions()
467 /// .set_parent(format!("conferenceRecords/{conference_record_id}/participants/{participant_id}"))
468 /// .by_item();
469 /// while let Some(item) = list.next().await.transpose()? {
470 /// println!("{:?}", item);
471 /// }
472 /// Ok(())
473 /// }
474 /// ```
475 pub fn list_participant_sessions(
476 &self,
477 ) -> super::builder::conference_records_service::ListParticipantSessions {
478 super::builder::conference_records_service::ListParticipantSessions::new(self.inner.clone())
479 }
480
481 /// Gets a recording by recording ID.
482 ///
483 /// # Example
484 /// ```
485 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
486 /// use google_apps_meet_v2::Result;
487 /// async fn sample(
488 /// client: &ConferenceRecordsService, conference_record_id: &str, recording_id: &str
489 /// ) -> Result<()> {
490 /// let response = client.get_recording()
491 /// .set_name(format!("conferenceRecords/{conference_record_id}/recordings/{recording_id}"))
492 /// .send().await?;
493 /// println!("response {:?}", response);
494 /// Ok(())
495 /// }
496 /// ```
497 pub fn get_recording(&self) -> super::builder::conference_records_service::GetRecording {
498 super::builder::conference_records_service::GetRecording::new(self.inner.clone())
499 }
500
501 /// Lists the recording resources from the conference record. By default,
502 /// ordered by start time and in ascending order.
503 ///
504 /// # Example
505 /// ```
506 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
507 /// use google_cloud_gax::paginator::ItemPaginator as _;
508 /// use google_apps_meet_v2::Result;
509 /// async fn sample(
510 /// client: &ConferenceRecordsService, conference_record_id: &str
511 /// ) -> Result<()> {
512 /// let mut list = client.list_recordings()
513 /// .set_parent(format!("conferenceRecords/{conference_record_id}"))
514 /// .by_item();
515 /// while let Some(item) = list.next().await.transpose()? {
516 /// println!("{:?}", item);
517 /// }
518 /// Ok(())
519 /// }
520 /// ```
521 pub fn list_recordings(&self) -> super::builder::conference_records_service::ListRecordings {
522 super::builder::conference_records_service::ListRecordings::new(self.inner.clone())
523 }
524
525 /// Gets a transcript by transcript ID.
526 ///
527 /// # Example
528 /// ```
529 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
530 /// use google_apps_meet_v2::Result;
531 /// async fn sample(
532 /// client: &ConferenceRecordsService, conference_record_id: &str, transcript_id: &str
533 /// ) -> Result<()> {
534 /// let response = client.get_transcript()
535 /// .set_name(format!("conferenceRecords/{conference_record_id}/transcripts/{transcript_id}"))
536 /// .send().await?;
537 /// println!("response {:?}", response);
538 /// Ok(())
539 /// }
540 /// ```
541 pub fn get_transcript(&self) -> super::builder::conference_records_service::GetTranscript {
542 super::builder::conference_records_service::GetTranscript::new(self.inner.clone())
543 }
544
545 /// Lists the set of transcripts from the conference record. By default,
546 /// ordered by start time and in ascending order.
547 ///
548 /// # Example
549 /// ```
550 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
551 /// use google_cloud_gax::paginator::ItemPaginator as _;
552 /// use google_apps_meet_v2::Result;
553 /// async fn sample(
554 /// client: &ConferenceRecordsService, conference_record_id: &str
555 /// ) -> Result<()> {
556 /// let mut list = client.list_transcripts()
557 /// .set_parent(format!("conferenceRecords/{conference_record_id}"))
558 /// .by_item();
559 /// while let Some(item) = list.next().await.transpose()? {
560 /// println!("{:?}", item);
561 /// }
562 /// Ok(())
563 /// }
564 /// ```
565 pub fn list_transcripts(&self) -> super::builder::conference_records_service::ListTranscripts {
566 super::builder::conference_records_service::ListTranscripts::new(self.inner.clone())
567 }
568
569 /// Gets a `TranscriptEntry` resource by entry ID.
570 ///
571 /// Note: The transcript entries returned by the Google Meet API might not
572 /// match the transcription found in the Google Docs transcript file. This can
573 /// occur when the Google Docs transcript file is modified after generation.
574 ///
575 /// # Example
576 /// ```
577 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
578 /// use google_apps_meet_v2::Result;
579 /// async fn sample(
580 /// client: &ConferenceRecordsService, conference_record_id: &str, transcript_id: &str, entry_id: &str
581 /// ) -> Result<()> {
582 /// let response = client.get_transcript_entry()
583 /// .set_name(format!("conferenceRecords/{conference_record_id}/transcripts/{transcript_id}/entries/{entry_id}"))
584 /// .send().await?;
585 /// println!("response {:?}", response);
586 /// Ok(())
587 /// }
588 /// ```
589 pub fn get_transcript_entry(
590 &self,
591 ) -> super::builder::conference_records_service::GetTranscriptEntry {
592 super::builder::conference_records_service::GetTranscriptEntry::new(self.inner.clone())
593 }
594
595 /// Lists the structured transcript entries per transcript. By default, ordered
596 /// by start time and in ascending order.
597 ///
598 /// Note: The transcript entries returned by the Google Meet API might not
599 /// match the transcription found in the Google Docs transcript file. This can
600 /// occur when the Google Docs transcript file is modified after generation.
601 ///
602 /// # Example
603 /// ```
604 /// # use google_apps_meet_v2::client::ConferenceRecordsService;
605 /// use google_cloud_gax::paginator::ItemPaginator as _;
606 /// use google_apps_meet_v2::Result;
607 /// async fn sample(
608 /// client: &ConferenceRecordsService, conference_record_id: &str, transcript_id: &str
609 /// ) -> Result<()> {
610 /// let mut list = client.list_transcript_entries()
611 /// .set_parent(format!("conferenceRecords/{conference_record_id}/transcripts/{transcript_id}"))
612 /// .by_item();
613 /// while let Some(item) = list.next().await.transpose()? {
614 /// println!("{:?}", item);
615 /// }
616 /// Ok(())
617 /// }
618 /// ```
619 pub fn list_transcript_entries(
620 &self,
621 ) -> super::builder::conference_records_service::ListTranscriptEntries {
622 super::builder::conference_records_service::ListTranscriptEntries::new(self.inner.clone())
623 }
624}