google-cloud-osconfig-v1 1.8.0

Google Cloud Client Libraries for Rust - OS Config API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::invalid_html_tags)]

/// Implements a client for the OS Config API.
///
/// # Example
/// ```
/// # use google_cloud_osconfig_v1::client::OsConfigService;
/// use google_cloud_gax::paginator::ItemPaginator as _;
/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
///     let client = OsConfigService::builder().build().await?;
///     let parent = "parent_value";
///     let mut list = client.list_patch_jobs()
///         .set_parent(parent)
///         .by_item();
///     while let Some(item) = list.next().await.transpose()? {
///         println!("{:?}", item);
///     }
/// # Ok(()) }
/// ```
///
/// # Service Description
///
/// OS Config API
///
/// The OS Config service is a server-side component that you can use to
/// manage package installations and patch jobs for virtual machine instances.
///
/// # Configuration
///
/// To configure `OsConfigService` use the `with_*` methods in the type returned
/// by [builder()][OsConfigService::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://osconfig.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.
///
/// [with_endpoint()]: super::builder::os_config_service::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::os_config_service::ClientBuilder::with_credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `OsConfigService` holds a connection pool internally, it is advised to
/// create one and reuse it. You do not need to wrap `OsConfigService` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct OsConfigService {
    inner: std::sync::Arc<dyn super::stub::dynamic::OsConfigService>,
}

impl OsConfigService {
    /// Returns a builder for [OsConfigService].
    ///
    /// ```
    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// let client = OsConfigService::builder().build().await?;
    /// # Ok(()) }
    /// ```
    pub fn builder() -> super::builder::os_config_service::ClientBuilder {
        crate::new_client_builder(super::builder::os_config_service::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::OsConfigService + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::OsConfigService>> {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::OsConfigService> {
        super::transport::OsConfigService::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::OsConfigService> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::OsConfigService::new)
    }

    /// Patch VM instances by creating and running a patch job.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let response = client.execute_patch_job()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn execute_patch_job(&self) -> super::builder::os_config_service::ExecutePatchJob {
        super::builder::os_config_service::ExecutePatchJob::new(self.inner.clone())
    }

    /// Get the patch job. This can be used to track the progress of an
    /// ongoing patch job or review the details of completed jobs.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_patch_job()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_patch_job(&self) -> super::builder::os_config_service::GetPatchJob {
        super::builder::os_config_service::GetPatchJob::new(self.inner.clone())
    }

    /// Cancel a patch job. The patch job must be active. Canceled patch jobs
    /// cannot be restarted.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let response = client.cancel_patch_job()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn cancel_patch_job(&self) -> super::builder::os_config_service::CancelPatchJob {
        super::builder::os_config_service::CancelPatchJob::new(self.inner.clone())
    }

    /// Get a list of patch jobs.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_patch_jobs()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_patch_jobs(&self) -> super::builder::os_config_service::ListPatchJobs {
        super::builder::os_config_service::ListPatchJobs::new(self.inner.clone())
    }

    /// Get a list of instance details for a given patch job.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let mut list = client.list_patch_job_instance_details()
    ///         /* set fields */
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_patch_job_instance_details(
        &self,
    ) -> super::builder::os_config_service::ListPatchJobInstanceDetails {
        super::builder::os_config_service::ListPatchJobInstanceDetails::new(self.inner.clone())
    }

    /// Create an OS Config patch deployment.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::model::PatchDeployment;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, parent: &str
    /// ) -> Result<()> {
    ///     let response = client.create_patch_deployment()
    ///         .set_parent(parent)
    ///         .set_patch_deployment(
    ///             PatchDeployment::new()/* set fields */
    ///         )
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn create_patch_deployment(
        &self,
    ) -> super::builder::os_config_service::CreatePatchDeployment {
        super::builder::os_config_service::CreatePatchDeployment::new(self.inner.clone())
    }

    /// Get an OS Config patch deployment.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_patch_deployment()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_patch_deployment(&self) -> super::builder::os_config_service::GetPatchDeployment {
        super::builder::os_config_service::GetPatchDeployment::new(self.inner.clone())
    }

    /// Get a page of OS Config patch deployments.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_patch_deployments()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_patch_deployments(
        &self,
    ) -> super::builder::os_config_service::ListPatchDeployments {
        super::builder::os_config_service::ListPatchDeployments::new(self.inner.clone())
    }

    /// Delete an OS Config patch deployment.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, name: &str
    /// ) -> Result<()> {
    ///     client.delete_patch_deployment()
    ///         .set_name(name)
    ///         .send().await?;
    ///     Ok(())
    /// }
    /// ```
    pub fn delete_patch_deployment(
        &self,
    ) -> super::builder::os_config_service::DeletePatchDeployment {
        super::builder::os_config_service::DeletePatchDeployment::new(self.inner.clone())
    }

    /// Update an OS Config patch deployment.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// # extern crate wkt as google_cloud_wkt;
    /// use google_cloud_wkt::FieldMask;
    /// use google_cloud_osconfig_v1::model::PatchDeployment;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.update_patch_deployment()
    ///         .set_patch_deployment(
    ///             PatchDeployment::new().set_name(name)/* set fields */
    ///         )
    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn update_patch_deployment(
        &self,
    ) -> super::builder::os_config_service::UpdatePatchDeployment {
        super::builder::os_config_service::UpdatePatchDeployment::new(self.inner.clone())
    }

    /// Change state of patch deployment to "PAUSED".
    /// Patch deployment in paused state doesn't generate patch jobs.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let response = client.pause_patch_deployment()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn pause_patch_deployment(
        &self,
    ) -> super::builder::os_config_service::PausePatchDeployment {
        super::builder::os_config_service::PausePatchDeployment::new(self.inner.clone())
    }

    /// Change state of patch deployment back to "ACTIVE".
    /// Patch deployment in active state continues to generate patch jobs.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let response = client.resume_patch_deployment()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn resume_patch_deployment(
        &self,
    ) -> super::builder::os_config_service::ResumePatchDeployment {
        super::builder::os_config_service::ResumePatchDeployment::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     let response = client.get_operation()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_operation(&self) -> super::builder::os_config_service::GetOperation {
        super::builder::os_config_service::GetOperation::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigService
    /// ) -> Result<()> {
    ///     client.cancel_operation()
    ///         /* set fields */
    ///         .send().await?;
    ///     Ok(())
    /// }
    /// ```
    pub fn cancel_operation(&self) -> super::builder::os_config_service::CancelOperation {
        super::builder::os_config_service::CancelOperation::new(self.inner.clone())
    }
}

/// Implements a client for the OS Config API.
///
/// # Example
/// ```
/// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
/// use google_cloud_gax::paginator::ItemPaginator as _;
/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
///     let client = OsConfigZonalService::builder().build().await?;
///     let parent = "parent_value";
///     let mut list = client.list_os_policy_assignments()
///         .set_parent(parent)
///         .by_item();
///     while let Some(item) = list.next().await.transpose()? {
///         println!("{:?}", item);
///     }
/// # Ok(()) }
/// ```
///
/// # Service Description
///
/// Zonal OS Config API
///
/// The OS Config service is the server-side component that allows users to
/// manage package installations and patch jobs for Compute Engine VM instances.
///
/// # Configuration
///
/// To configure `OsConfigZonalService` use the `with_*` methods in the type returned
/// by [builder()][OsConfigZonalService::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://osconfig.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.
///
/// [with_endpoint()]: super::builder::os_config_zonal_service::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::os_config_zonal_service::ClientBuilder::with_credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `OsConfigZonalService` holds a connection pool internally, it is advised to
/// create one and reuse it. You do not need to wrap `OsConfigZonalService` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct OsConfigZonalService {
    inner: std::sync::Arc<dyn super::stub::dynamic::OsConfigZonalService>,
}

impl OsConfigZonalService {
    /// Returns a builder for [OsConfigZonalService].
    ///
    /// ```
    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// let client = OsConfigZonalService::builder().build().await?;
    /// # Ok(()) }
    /// ```
    pub fn builder() -> super::builder::os_config_zonal_service::ClientBuilder {
        crate::new_client_builder(super::builder::os_config_zonal_service::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::OsConfigZonalService + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::OsConfigZonalService>>
    {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::OsConfigZonalService> {
        super::transport::OsConfigZonalService::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::OsConfigZonalService> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::OsConfigZonalService::new)
    }

    /// Create an OS policy assignment.
    ///
    /// This method also creates the first revision of the OS policy assignment.
    ///
    /// This method returns a long running operation (LRO) that contains the
    /// rollout details. The rollout can be cancelled by cancelling the LRO.
    ///
    /// For more information, see [Method:
    /// projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_lro::Poller;
    /// use google_cloud_osconfig_v1::model::OSPolicyAssignment;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, parent: &str
    /// ) -> Result<()> {
    ///     let response = client.create_os_policy_assignment()
    ///         .set_parent(parent)
    ///         .set_os_policy_assignment(
    ///             OSPolicyAssignment::new()/* set fields */
    ///         )
    ///         .poller().until_done().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn create_os_policy_assignment(
        &self,
    ) -> super::builder::os_config_zonal_service::CreateOSPolicyAssignment {
        super::builder::os_config_zonal_service::CreateOSPolicyAssignment::new(self.inner.clone())
    }

    /// Update an existing OS policy assignment.
    ///
    /// This method creates a new revision of the OS policy assignment.
    ///
    /// This method returns a long running operation (LRO) that contains the
    /// rollout details. The rollout can be cancelled by cancelling the LRO.
    ///
    /// For more information, see [Method:
    /// projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_lro::Poller;
    /// # extern crate wkt as google_cloud_wkt;
    /// use google_cloud_wkt::FieldMask;
    /// use google_cloud_osconfig_v1::model::OSPolicyAssignment;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.update_os_policy_assignment()
    ///         .set_os_policy_assignment(
    ///             OSPolicyAssignment::new().set_name(name)/* set fields */
    ///         )
    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
    ///         .poller().until_done().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn update_os_policy_assignment(
        &self,
    ) -> super::builder::os_config_zonal_service::UpdateOSPolicyAssignment {
        super::builder::os_config_zonal_service::UpdateOSPolicyAssignment::new(self.inner.clone())
    }

    /// Retrieve an existing OS policy assignment.
    ///
    /// This method always returns the latest revision. In order to retrieve a
    /// previous revision of the assignment, also provide the revision ID in the
    /// `name` parameter.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_os_policy_assignment()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_os_policy_assignment(
        &self,
    ) -> super::builder::os_config_zonal_service::GetOSPolicyAssignment {
        super::builder::os_config_zonal_service::GetOSPolicyAssignment::new(self.inner.clone())
    }

    /// List the OS policy assignments under the parent resource.
    ///
    /// For each OS policy assignment, the latest revision is returned.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_os_policy_assignments()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_os_policy_assignments(
        &self,
    ) -> super::builder::os_config_zonal_service::ListOSPolicyAssignments {
        super::builder::os_config_zonal_service::ListOSPolicyAssignments::new(self.inner.clone())
    }

    /// List the OS policy assignment revisions for a given OS policy assignment.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService
    /// ) -> Result<()> {
    ///     let mut list = client.list_os_policy_assignment_revisions()
    ///         /* set fields */
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_os_policy_assignment_revisions(
        &self,
    ) -> super::builder::os_config_zonal_service::ListOSPolicyAssignmentRevisions {
        super::builder::os_config_zonal_service::ListOSPolicyAssignmentRevisions::new(
            self.inner.clone(),
        )
    }

    /// Delete the OS policy assignment.
    ///
    /// This method creates a new revision of the OS policy assignment.
    ///
    /// This method returns a long running operation (LRO) that contains the
    /// rollout details. The rollout can be cancelled by cancelling the LRO.
    ///
    /// If the LRO completes and is not cancelled, all revisions associated with
    /// the OS policy assignment are deleted.
    ///
    /// For more information, see [Method:
    /// projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_lro::Poller;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     client.delete_os_policy_assignment()
    ///         .set_name(name)
    ///         .poller().until_done().await?;
    ///     Ok(())
    /// }
    /// ```
    pub fn delete_os_policy_assignment(
        &self,
    ) -> super::builder::os_config_zonal_service::DeleteOSPolicyAssignment {
        super::builder::os_config_zonal_service::DeleteOSPolicyAssignment::new(self.inner.clone())
    }

    /// Get the OS policy asssignment report for the specified Compute Engine VM
    /// instance.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_os_policy_assignment_report()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_os_policy_assignment_report(
        &self,
    ) -> super::builder::os_config_zonal_service::GetOSPolicyAssignmentReport {
        super::builder::os_config_zonal_service::GetOSPolicyAssignmentReport::new(
            self.inner.clone(),
        )
    }

    /// List OS policy asssignment reports for all Compute Engine VM instances in
    /// the specified zone.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_os_policy_assignment_reports()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_os_policy_assignment_reports(
        &self,
    ) -> super::builder::os_config_zonal_service::ListOSPolicyAssignmentReports {
        super::builder::os_config_zonal_service::ListOSPolicyAssignmentReports::new(
            self.inner.clone(),
        )
    }

    /// Get inventory data for the specified VM instance. If the VM has no
    /// associated inventory, the message `NOT_FOUND` is returned.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_inventory()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_inventory(&self) -> super::builder::os_config_zonal_service::GetInventory {
        super::builder::os_config_zonal_service::GetInventory::new(self.inner.clone())
    }

    /// List inventory data for all VM instances in the specified zone.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_inventories()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_inventories(&self) -> super::builder::os_config_zonal_service::ListInventories {
        super::builder::os_config_zonal_service::ListInventories::new(self.inner.clone())
    }

    /// Gets the vulnerability report for the specified VM instance. Only VMs with
    /// inventory data have vulnerability reports associated with them.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, name: &str
    /// ) -> Result<()> {
    ///     let response = client.get_vulnerability_report()
    ///         .set_name(name)
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_vulnerability_report(
        &self,
    ) -> super::builder::os_config_zonal_service::GetVulnerabilityReport {
        super::builder::os_config_zonal_service::GetVulnerabilityReport::new(self.inner.clone())
    }

    /// List vulnerability reports for all VM instances in the specified zone.
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_gax::paginator::ItemPaginator as _;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService, parent: &str
    /// ) -> Result<()> {
    ///     let mut list = client.list_vulnerability_reports()
    ///         .set_parent(parent)
    ///         .by_item();
    ///     while let Some(item) = list.next().await.transpose()? {
    ///         println!("{:?}", item);
    ///     }
    ///     Ok(())
    /// }
    /// ```
    pub fn list_vulnerability_reports(
        &self,
    ) -> super::builder::os_config_zonal_service::ListVulnerabilityReports {
        super::builder::os_config_zonal_service::ListVulnerabilityReports::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService
    /// ) -> Result<()> {
    ///     let response = client.get_operation()
    ///         /* set fields */
    ///         .send().await?;
    ///     println!("response {:?}", response);
    ///     Ok(())
    /// }
    /// ```
    pub fn get_operation(&self) -> super::builder::os_config_zonal_service::GetOperation {
        super::builder::os_config_zonal_service::GetOperation::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    ///
    /// # Example
    /// ```
    /// # use google_cloud_osconfig_v1::client::OsConfigZonalService;
    /// use google_cloud_osconfig_v1::Result;
    /// async fn sample(
    ///    client: &OsConfigZonalService
    /// ) -> Result<()> {
    ///     client.cancel_operation()
    ///         /* set fields */
    ///         .send().await?;
    ///     Ok(())
    /// }
    /// ```
    pub fn cancel_operation(&self) -> super::builder::os_config_zonal_service::CancelOperation {
        super::builder::os_config_zonal_service::CancelOperation::new(self.inner.clone())
    }
}