google-cloud-locationfinder-v1 1.10.0

Google Cloud Client Libraries for Rust - Cloud Location Finder 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
// 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::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_location;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Represents resource cloud locations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudLocation {
    /// Identifier. Name of the cloud location. Unique name of the cloud location
    /// including project and location using the form:
    /// `projects/{project_id}/locations/{location}/cloudLocations/{cloud_location}`
    pub name: std::string::String,

    /// Output only. The containing cloud location in the strict nesting hierarchy.
    /// For example, the containing cloud location of a zone is a region.
    pub containing_cloud_location: std::string::String,

    /// Optional. The human-readable name of the cloud location. Example:
    /// us-east-2, us-east1.
    pub display_name: std::string::String,

    /// Optional. The provider of the cloud location. Values can be Google Cloud or
    /// third-party providers, including AWS, Azure, or Oracle Cloud
    /// Infrastructure.
    pub cloud_provider: crate::model::cloud_location::CloudProvider,

    /// Optional. The two-letter ISO 3166-1 alpha-2 code of the cloud location.
    /// Examples: US, JP, KR.
    pub territory_code: std::string::String,

    /// Optional. The type of the cloud location.
    pub cloud_location_type: crate::model::cloud_location::CloudLocationType,

    /// Optional. The carbon free energy percentage of the cloud location. This
    /// represents the average percentage of time customers' application will be
    /// running on carbon-free energy. See
    /// <https://cloud.google.com/sustainability/region-carbon> for more details.
    /// There is a difference between default value 0 and unset value. 0 means the
    /// carbon free energy percentage is 0%, while unset value means the carbon
    /// footprint data is not available.
    pub carbon_free_energy_percentage: std::option::Option<f32>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CloudLocation {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::CloudLocation::name].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// # let cloud_location_id = "cloud_location_id";
    /// let x = CloudLocation::new().set_name(format!("projects/{project_id}/locations/{location_id}/cloudLocations/{cloud_location_id}"));
    /// ```
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [containing_cloud_location][crate::model::CloudLocation::containing_cloud_location].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// # let cloud_location_id = "cloud_location_id";
    /// let x = CloudLocation::new().set_containing_cloud_location(format!("projects/{project_id}/locations/{location_id}/cloudLocations/{cloud_location_id}"));
    /// ```
    pub fn set_containing_cloud_location<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.containing_cloud_location = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::CloudLocation::display_name].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = CloudLocation::new().set_display_name("example");
    /// ```
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [cloud_provider][crate::model::CloudLocation::cloud_provider].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// use google_cloud_locationfinder_v1::model::cloud_location::CloudProvider;
    /// let x0 = CloudLocation::new().set_cloud_provider(CloudProvider::Gcp);
    /// let x1 = CloudLocation::new().set_cloud_provider(CloudProvider::Aws);
    /// let x2 = CloudLocation::new().set_cloud_provider(CloudProvider::Azure);
    /// ```
    pub fn set_cloud_provider<
        T: std::convert::Into<crate::model::cloud_location::CloudProvider>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.cloud_provider = v.into();
        self
    }

    /// Sets the value of [territory_code][crate::model::CloudLocation::territory_code].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = CloudLocation::new().set_territory_code("example");
    /// ```
    pub fn set_territory_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.territory_code = v.into();
        self
    }

    /// Sets the value of [cloud_location_type][crate::model::CloudLocation::cloud_location_type].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// use google_cloud_locationfinder_v1::model::cloud_location::CloudLocationType;
    /// let x0 = CloudLocation::new().set_cloud_location_type(CloudLocationType::Region);
    /// let x1 = CloudLocation::new().set_cloud_location_type(CloudLocationType::Zone);
    /// let x2 = CloudLocation::new().set_cloud_location_type(CloudLocationType::RegionExtension);
    /// ```
    pub fn set_cloud_location_type<
        T: std::convert::Into<crate::model::cloud_location::CloudLocationType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.cloud_location_type = v.into();
        self
    }

    /// Sets the value of [carbon_free_energy_percentage][crate::model::CloudLocation::carbon_free_energy_percentage].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = CloudLocation::new().set_carbon_free_energy_percentage(42.0);
    /// ```
    pub fn set_carbon_free_energy_percentage<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<f32>,
    {
        self.carbon_free_energy_percentage = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [carbon_free_energy_percentage][crate::model::CloudLocation::carbon_free_energy_percentage].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = CloudLocation::new().set_or_clear_carbon_free_energy_percentage(Some(42.0));
    /// let x = CloudLocation::new().set_or_clear_carbon_free_energy_percentage(None::<f32>);
    /// ```
    pub fn set_or_clear_carbon_free_energy_percentage<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<f32>,
    {
        self.carbon_free_energy_percentage = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CloudLocation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.CloudLocation"
    }
}

/// Defines additional types related to [CloudLocation].
pub mod cloud_location {
    #[allow(unused_imports)]
    use super::*;

    /// The type of the cloud provider. This enum lists all possible providers of
    /// cloud locations.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CloudProvider {
        /// Unspecified type.
        Unspecified,
        /// Cloud provider type for Google Cloud.
        Gcp,
        /// Cloud provider type for AWS.
        Aws,
        /// Cloud provider type for Azure.
        Azure,
        /// Cloud provider type for OCI.
        Oci,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CloudProvider::value] or
        /// [CloudProvider::name].
        UnknownValue(cloud_provider::UnknownValue),
    }

    #[doc(hidden)]
    pub mod cloud_provider {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CloudProvider {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Gcp => std::option::Option::Some(1),
                Self::Aws => std::option::Option::Some(2),
                Self::Azure => std::option::Option::Some(3),
                Self::Oci => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
                Self::Gcp => std::option::Option::Some("CLOUD_PROVIDER_GCP"),
                Self::Aws => std::option::Option::Some("CLOUD_PROVIDER_AWS"),
                Self::Azure => std::option::Option::Some("CLOUD_PROVIDER_AZURE"),
                Self::Oci => std::option::Option::Some("CLOUD_PROVIDER_OCI"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CloudProvider {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CloudProvider {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CloudProvider {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Gcp,
                2 => Self::Aws,
                3 => Self::Azure,
                4 => Self::Oci,
                _ => Self::UnknownValue(cloud_provider::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CloudProvider {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
                "CLOUD_PROVIDER_GCP" => Self::Gcp,
                "CLOUD_PROVIDER_AWS" => Self::Aws,
                "CLOUD_PROVIDER_AZURE" => Self::Azure,
                "CLOUD_PROVIDER_OCI" => Self::Oci,
                _ => Self::UnknownValue(cloud_provider::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CloudProvider {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Gcp => serializer.serialize_i32(1),
                Self::Aws => serializer.serialize_i32(2),
                Self::Azure => serializer.serialize_i32(3),
                Self::Oci => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CloudProvider {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
                ".google.cloud.locationfinder.v1.CloudLocation.CloudProvider",
            ))
        }
    }

    /// The type of the cloud location. This enum lists all possible categories of
    /// cloud locations.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CloudLocationType {
        /// Unspecified type.
        Unspecified,
        /// CloudLocation type for region.
        Region,
        /// CloudLocation type for zone.
        Zone,
        /// CloudLocation type for region extension.
        RegionExtension,
        /// CloudLocation type for Google Distributed Cloud Connected Zone.
        GdccZone,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CloudLocationType::value] or
        /// [CloudLocationType::name].
        UnknownValue(cloud_location_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod cloud_location_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CloudLocationType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Region => std::option::Option::Some(1),
                Self::Zone => std::option::Option::Some(2),
                Self::RegionExtension => std::option::Option::Some(3),
                Self::GdccZone => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CLOUD_LOCATION_TYPE_UNSPECIFIED"),
                Self::Region => std::option::Option::Some("CLOUD_LOCATION_TYPE_REGION"),
                Self::Zone => std::option::Option::Some("CLOUD_LOCATION_TYPE_ZONE"),
                Self::RegionExtension => {
                    std::option::Option::Some("CLOUD_LOCATION_TYPE_REGION_EXTENSION")
                }
                Self::GdccZone => std::option::Option::Some("CLOUD_LOCATION_TYPE_GDCC_ZONE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CloudLocationType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CloudLocationType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CloudLocationType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Region,
                2 => Self::Zone,
                3 => Self::RegionExtension,
                4 => Self::GdccZone,
                _ => Self::UnknownValue(cloud_location_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CloudLocationType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CLOUD_LOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
                "CLOUD_LOCATION_TYPE_REGION" => Self::Region,
                "CLOUD_LOCATION_TYPE_ZONE" => Self::Zone,
                "CLOUD_LOCATION_TYPE_REGION_EXTENSION" => Self::RegionExtension,
                "CLOUD_LOCATION_TYPE_GDCC_ZONE" => Self::GdccZone,
                _ => Self::UnknownValue(cloud_location_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CloudLocationType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Region => serializer.serialize_i32(1),
                Self::Zone => serializer.serialize_i32(2),
                Self::RegionExtension => serializer.serialize_i32(3),
                Self::GdccZone => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CloudLocationType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudLocationType>::new(
                ".google.cloud.locationfinder.v1.CloudLocation.CloudLocationType",
            ))
        }
    }
}

/// Message for requesting list of cloud locations..
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudLocationsRequest {
    /// Required. The parent, which owns this collection of cloud locations.
    /// Format: projects/{project}/locations/{location}
    pub parent: std::string::String,

    /// Optional. The maximum number of cloud locations to return per page. The
    /// service might return fewer cloud locations than this value. If unspecified,
    /// server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    /// Provide page token returned by a previous 'ListCloudLocations' call to
    /// retrieve the next page of results. When paginating, all other parameters
    /// provided to 'ListCloudLocations' must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    /// Optional. A filter expression that filters resources listed in the
    /// response. The expression is in the form of field=value. For example,
    /// 'cloud_location_type=CLOUD_LOCATION_TYPE_REGION'. Multiple filter queries
    /// are space-separated. For example,
    /// 'cloud_location_type=CLOUD_LOCATION_TYPE_REGION territory_code="US"' By
    /// default, each expression is an AND expression. However, you can include AND
    /// and OR expressions explicitly.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCloudLocationsRequest {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListCloudLocationsRequest::parent].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsRequest;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// let x = ListCloudLocationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
    /// ```
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListCloudLocationsRequest::page_size].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsRequest;
    /// let x = ListCloudLocationsRequest::new().set_page_size(42);
    /// ```
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListCloudLocationsRequest::page_token].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsRequest;
    /// let x = ListCloudLocationsRequest::new().set_page_token("example");
    /// ```
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListCloudLocationsRequest::filter].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsRequest;
    /// let x = ListCloudLocationsRequest::new().set_filter("example");
    /// ```
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListCloudLocationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.ListCloudLocationsRequest"
    }
}

/// Message for response to listing cloud locations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudLocationsResponse {
    /// Output only. List of cloud locations.
    pub cloud_locations: std::vec::Vec<crate::model::CloudLocation>,

    /// Output only. The continuation token, used to page through large result
    /// sets. Provide this value in a subsequent request as page_token in
    /// subsequent requests to retrieve the next page. If this field is not
    /// present, there are no subsequent results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCloudLocationsResponse {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [cloud_locations][crate::model::ListCloudLocationsResponse::cloud_locations].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsResponse;
    /// use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = ListCloudLocationsResponse::new()
    ///     .set_cloud_locations([
    ///         CloudLocation::default()/* use setters */,
    ///         CloudLocation::default()/* use (different) setters */,
    ///     ]);
    /// ```
    pub fn set_cloud_locations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CloudLocation>,
    {
        use std::iter::Iterator;
        self.cloud_locations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListCloudLocationsResponse::next_page_token].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::ListCloudLocationsResponse;
    /// let x = ListCloudLocationsResponse::new().set_next_page_token("example");
    /// ```
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListCloudLocationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.ListCloudLocationsResponse"
    }
}

#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCloudLocationsResponse {
    type PageItem = crate::model::CloudLocation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.cloud_locations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a cloud location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCloudLocationRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetCloudLocationRequest {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetCloudLocationRequest::name].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::GetCloudLocationRequest;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// # let cloud_location_id = "cloud_location_id";
    /// let x = GetCloudLocationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/cloudLocations/{cloud_location_id}"));
    /// ```
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetCloudLocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.GetCloudLocationRequest"
    }
}

/// Message for searching cloud locations from a given source location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchCloudLocationsRequest {
    /// Required. The parent, which owns this collection of cloud locations.
    /// Format: projects/{project}/locations/{location}
    pub parent: std::string::String,

    /// Required. The source cloud location to search from.
    /// Example search can be searching nearby cloud locations from the source
    /// cloud location by latency.
    pub source_cloud_location: std::string::String,

    /// Optional. The maximum number of cloud locations to return. The service
    /// might return fewer cloud locations than this value. If unspecified, server
    /// will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    /// Provide Page token returned by a previous 'ListCloudLocations' call to
    /// retrieve the next page of results. When paginating, all other parameters
    /// provided to 'ListCloudLocations' must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    /// Optional. The query string in search query syntax. While filter is used to
    /// filter the search results by attributes, query is used to specify the
    /// search requirements.
    pub query: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchCloudLocationsRequest {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::SearchCloudLocationsRequest::parent].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsRequest;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// let x = SearchCloudLocationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
    /// ```
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [source_cloud_location][crate::model::SearchCloudLocationsRequest::source_cloud_location].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsRequest;
    /// # let project_id = "project_id";
    /// # let location_id = "location_id";
    /// # let cloud_location_id = "cloud_location_id";
    /// let x = SearchCloudLocationsRequest::new().set_source_cloud_location(format!("projects/{project_id}/locations/{location_id}/cloudLocations/{cloud_location_id}"));
    /// ```
    pub fn set_source_cloud_location<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_cloud_location = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::SearchCloudLocationsRequest::page_size].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsRequest;
    /// let x = SearchCloudLocationsRequest::new().set_page_size(42);
    /// ```
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::SearchCloudLocationsRequest::page_token].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsRequest;
    /// let x = SearchCloudLocationsRequest::new().set_page_token("example");
    /// ```
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [query][crate::model::SearchCloudLocationsRequest::query].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsRequest;
    /// let x = SearchCloudLocationsRequest::new().set_query("example");
    /// ```
    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.query = v.into();
        self
    }
}

impl wkt::message::Message for SearchCloudLocationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.SearchCloudLocationsRequest"
    }
}

/// Message for response to searching cloud locations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchCloudLocationsResponse {
    /// Output only. List of cloud locations.
    pub cloud_locations: std::vec::Vec<crate::model::CloudLocation>,

    /// Output only. The continuation token, used to page through large result
    /// sets. Provide this value in a subsequent request as page_token in
    /// subsequent requests to retrieve the next page. If this field is not
    /// present, there are no subsequent results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchCloudLocationsResponse {
    /// Creates a new default instance.
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [cloud_locations][crate::model::SearchCloudLocationsResponse::cloud_locations].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsResponse;
    /// use google_cloud_locationfinder_v1::model::CloudLocation;
    /// let x = SearchCloudLocationsResponse::new()
    ///     .set_cloud_locations([
    ///         CloudLocation::default()/* use setters */,
    ///         CloudLocation::default()/* use (different) setters */,
    ///     ]);
    /// ```
    pub fn set_cloud_locations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::CloudLocation>,
    {
        use std::iter::Iterator;
        self.cloud_locations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::SearchCloudLocationsResponse::next_page_token].
    ///
    /// # Example
    /// ```ignore,no_run
    /// # use google_cloud_locationfinder_v1::model::SearchCloudLocationsResponse;
    /// let x = SearchCloudLocationsResponse::new().set_next_page_token("example");
    /// ```
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for SearchCloudLocationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.locationfinder.v1.SearchCloudLocationsResponse"
    }
}

#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchCloudLocationsResponse {
    type PageItem = crate::model::CloudLocation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.cloud_locations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}