Skip to main content

google_cloud_artifactregistry_v1/
model.rs

1// Copyright 2025 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
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate google_cloud_type;
30extern crate lazy_static;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A detailed representation of an Apt artifact. Information in the record
43/// is derived from the archive's control file.
44/// See <https://www.debian.org/doc/debian-policy/ch-controlfields.html>
45#[derive(Clone, Default, PartialEq)]
46#[non_exhaustive]
47pub struct AptArtifact {
48    /// Output only. The Artifact Registry resource name of the artifact.
49    pub name: std::string::String,
50
51    /// Output only. The Apt package name of the artifact.
52    pub package_name: std::string::String,
53
54    /// Output only. An artifact is a binary or source package.
55    pub package_type: crate::model::apt_artifact::PackageType,
56
57    /// Output only. Operating system architecture of the artifact.
58    pub architecture: std::string::String,
59
60    /// Output only. Repository component of the artifact.
61    pub component: std::string::String,
62
63    /// Output only. Contents of the artifact's control metadata file.
64    pub control_file: ::bytes::Bytes,
65
66    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
67}
68
69impl AptArtifact {
70    pub fn new() -> Self {
71        std::default::Default::default()
72    }
73
74    /// Sets the value of [name][crate::model::AptArtifact::name].
75    ///
76    /// # Example
77    /// ```ignore,no_run
78    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
79    /// let x = AptArtifact::new().set_name("example");
80    /// ```
81    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82        self.name = v.into();
83        self
84    }
85
86    /// Sets the value of [package_name][crate::model::AptArtifact::package_name].
87    ///
88    /// # Example
89    /// ```ignore,no_run
90    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
91    /// let x = AptArtifact::new().set_package_name("example");
92    /// ```
93    pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94        self.package_name = v.into();
95        self
96    }
97
98    /// Sets the value of [package_type][crate::model::AptArtifact::package_type].
99    ///
100    /// # Example
101    /// ```ignore,no_run
102    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
103    /// use google_cloud_artifactregistry_v1::model::apt_artifact::PackageType;
104    /// let x0 = AptArtifact::new().set_package_type(PackageType::Binary);
105    /// let x1 = AptArtifact::new().set_package_type(PackageType::Source);
106    /// ```
107    pub fn set_package_type<T: std::convert::Into<crate::model::apt_artifact::PackageType>>(
108        mut self,
109        v: T,
110    ) -> Self {
111        self.package_type = v.into();
112        self
113    }
114
115    /// Sets the value of [architecture][crate::model::AptArtifact::architecture].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
120    /// let x = AptArtifact::new().set_architecture("example");
121    /// ```
122    pub fn set_architecture<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123        self.architecture = v.into();
124        self
125    }
126
127    /// Sets the value of [component][crate::model::AptArtifact::component].
128    ///
129    /// # Example
130    /// ```ignore,no_run
131    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
132    /// let x = AptArtifact::new().set_component("example");
133    /// ```
134    pub fn set_component<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
135        self.component = v.into();
136        self
137    }
138
139    /// Sets the value of [control_file][crate::model::AptArtifact::control_file].
140    ///
141    /// # Example
142    /// ```ignore,no_run
143    /// # use google_cloud_artifactregistry_v1::model::AptArtifact;
144    /// let x = AptArtifact::new().set_control_file(bytes::Bytes::from_static(b"example"));
145    /// ```
146    pub fn set_control_file<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
147        self.control_file = v.into();
148        self
149    }
150}
151
152impl wkt::message::Message for AptArtifact {
153    fn typename() -> &'static str {
154        "type.googleapis.com/google.devtools.artifactregistry.v1.AptArtifact"
155    }
156}
157
158/// Defines additional types related to [AptArtifact].
159pub mod apt_artifact {
160    #[allow(unused_imports)]
161    use super::*;
162
163    /// Package type is either binary or source.
164    ///
165    /// # Working with unknown values
166    ///
167    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
168    /// additional enum variants at any time. Adding new variants is not considered
169    /// a breaking change. Applications should write their code in anticipation of:
170    ///
171    /// - New values appearing in future releases of the client library, **and**
172    /// - New values received dynamically, without application changes.
173    ///
174    /// Please consult the [Working with enums] section in the user guide for some
175    /// guidelines.
176    ///
177    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
178    #[derive(Clone, Debug, PartialEq)]
179    #[non_exhaustive]
180    pub enum PackageType {
181        /// Package type is not specified.
182        Unspecified,
183        /// Binary package.
184        Binary,
185        /// Source package.
186        Source,
187        /// If set, the enum was initialized with an unknown value.
188        ///
189        /// Applications can examine the value using [PackageType::value] or
190        /// [PackageType::name].
191        UnknownValue(package_type::UnknownValue),
192    }
193
194    #[doc(hidden)]
195    pub mod package_type {
196        #[allow(unused_imports)]
197        use super::*;
198        #[derive(Clone, Debug, PartialEq)]
199        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
200    }
201
202    impl PackageType {
203        /// Gets the enum value.
204        ///
205        /// Returns `None` if the enum contains an unknown value deserialized from
206        /// the string representation of enums.
207        pub fn value(&self) -> std::option::Option<i32> {
208            match self {
209                Self::Unspecified => std::option::Option::Some(0),
210                Self::Binary => std::option::Option::Some(1),
211                Self::Source => std::option::Option::Some(2),
212                Self::UnknownValue(u) => u.0.value(),
213            }
214        }
215
216        /// Gets the enum value as a string.
217        ///
218        /// Returns `None` if the enum contains an unknown value deserialized from
219        /// the integer representation of enums.
220        pub fn name(&self) -> std::option::Option<&str> {
221            match self {
222                Self::Unspecified => std::option::Option::Some("PACKAGE_TYPE_UNSPECIFIED"),
223                Self::Binary => std::option::Option::Some("BINARY"),
224                Self::Source => std::option::Option::Some("SOURCE"),
225                Self::UnknownValue(u) => u.0.name(),
226            }
227        }
228    }
229
230    impl std::default::Default for PackageType {
231        fn default() -> Self {
232            use std::convert::From;
233            Self::from(0)
234        }
235    }
236
237    impl std::fmt::Display for PackageType {
238        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
239            wkt::internal::display_enum(f, self.name(), self.value())
240        }
241    }
242
243    impl std::convert::From<i32> for PackageType {
244        fn from(value: i32) -> Self {
245            match value {
246                0 => Self::Unspecified,
247                1 => Self::Binary,
248                2 => Self::Source,
249                _ => Self::UnknownValue(package_type::UnknownValue(
250                    wkt::internal::UnknownEnumValue::Integer(value),
251                )),
252            }
253        }
254    }
255
256    impl std::convert::From<&str> for PackageType {
257        fn from(value: &str) -> Self {
258            use std::string::ToString;
259            match value {
260                "PACKAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
261                "BINARY" => Self::Binary,
262                "SOURCE" => Self::Source,
263                _ => Self::UnknownValue(package_type::UnknownValue(
264                    wkt::internal::UnknownEnumValue::String(value.to_string()),
265                )),
266            }
267        }
268    }
269
270    impl serde::ser::Serialize for PackageType {
271        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
272        where
273            S: serde::Serializer,
274        {
275            match self {
276                Self::Unspecified => serializer.serialize_i32(0),
277                Self::Binary => serializer.serialize_i32(1),
278                Self::Source => serializer.serialize_i32(2),
279                Self::UnknownValue(u) => u.0.serialize(serializer),
280            }
281        }
282    }
283
284    impl<'de> serde::de::Deserialize<'de> for PackageType {
285        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
286        where
287            D: serde::Deserializer<'de>,
288        {
289            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PackageType>::new(
290                ".google.devtools.artifactregistry.v1.AptArtifact.PackageType",
291            ))
292        }
293    }
294}
295
296/// Google Cloud Storage location where the artifacts currently reside.
297#[derive(Clone, Default, PartialEq)]
298#[non_exhaustive]
299pub struct ImportAptArtifactsGcsSource {
300    /// Cloud Storage paths URI (e.g., gs://my_bucket//my_object).
301    pub uris: std::vec::Vec<std::string::String>,
302
303    /// Supports URI wildcards for matching multiple objects from a single URI.
304    pub use_wildcards: bool,
305
306    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
307}
308
309impl ImportAptArtifactsGcsSource {
310    pub fn new() -> Self {
311        std::default::Default::default()
312    }
313
314    /// Sets the value of [uris][crate::model::ImportAptArtifactsGcsSource::uris].
315    ///
316    /// # Example
317    /// ```ignore,no_run
318    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
319    /// let x = ImportAptArtifactsGcsSource::new().set_uris(["a", "b", "c"]);
320    /// ```
321    pub fn set_uris<T, V>(mut self, v: T) -> Self
322    where
323        T: std::iter::IntoIterator<Item = V>,
324        V: std::convert::Into<std::string::String>,
325    {
326        use std::iter::Iterator;
327        self.uris = v.into_iter().map(|i| i.into()).collect();
328        self
329    }
330
331    /// Sets the value of [use_wildcards][crate::model::ImportAptArtifactsGcsSource::use_wildcards].
332    ///
333    /// # Example
334    /// ```ignore,no_run
335    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
336    /// let x = ImportAptArtifactsGcsSource::new().set_use_wildcards(true);
337    /// ```
338    pub fn set_use_wildcards<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
339        self.use_wildcards = v.into();
340        self
341    }
342}
343
344impl wkt::message::Message for ImportAptArtifactsGcsSource {
345    fn typename() -> &'static str {
346        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportAptArtifactsGcsSource"
347    }
348}
349
350/// The request to import new apt artifacts.
351#[derive(Clone, Default, PartialEq)]
352#[non_exhaustive]
353pub struct ImportAptArtifactsRequest {
354    /// The name of the parent resource where the artifacts will be imported.
355    pub parent: std::string::String,
356
357    /// The source location of the package binaries.
358    pub source: std::option::Option<crate::model::import_apt_artifacts_request::Source>,
359
360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
361}
362
363impl ImportAptArtifactsRequest {
364    pub fn new() -> Self {
365        std::default::Default::default()
366    }
367
368    /// Sets the value of [parent][crate::model::ImportAptArtifactsRequest::parent].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsRequest;
373    /// let x = ImportAptArtifactsRequest::new().set_parent("example");
374    /// ```
375    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
376        self.parent = v.into();
377        self
378    }
379
380    /// Sets the value of [source][crate::model::ImportAptArtifactsRequest::source].
381    ///
382    /// Note that all the setters affecting `source` are mutually
383    /// exclusive.
384    ///
385    /// # Example
386    /// ```ignore,no_run
387    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsRequest;
388    /// use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
389    /// let x = ImportAptArtifactsRequest::new().set_source(Some(
390    ///     google_cloud_artifactregistry_v1::model::import_apt_artifacts_request::Source::GcsSource(ImportAptArtifactsGcsSource::default().into())));
391    /// ```
392    pub fn set_source<
393        T: std::convert::Into<std::option::Option<crate::model::import_apt_artifacts_request::Source>>,
394    >(
395        mut self,
396        v: T,
397    ) -> Self {
398        self.source = v.into();
399        self
400    }
401
402    /// The value of [source][crate::model::ImportAptArtifactsRequest::source]
403    /// if it holds a `GcsSource`, `None` if the field is not set or
404    /// holds a different branch.
405    pub fn gcs_source(
406        &self,
407    ) -> std::option::Option<&std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>> {
408        #[allow(unreachable_patterns)]
409        self.source.as_ref().and_then(|v| match v {
410            crate::model::import_apt_artifacts_request::Source::GcsSource(v) => {
411                std::option::Option::Some(v)
412            }
413            _ => std::option::Option::None,
414        })
415    }
416
417    /// Sets the value of [source][crate::model::ImportAptArtifactsRequest::source]
418    /// to hold a `GcsSource`.
419    ///
420    /// Note that all the setters affecting `source` are
421    /// mutually exclusive.
422    ///
423    /// # Example
424    /// ```ignore,no_run
425    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsRequest;
426    /// use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
427    /// let x = ImportAptArtifactsRequest::new().set_gcs_source(ImportAptArtifactsGcsSource::default()/* use setters */);
428    /// assert!(x.gcs_source().is_some());
429    /// ```
430    pub fn set_gcs_source<
431        T: std::convert::Into<std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>>,
432    >(
433        mut self,
434        v: T,
435    ) -> Self {
436        self.source = std::option::Option::Some(
437            crate::model::import_apt_artifacts_request::Source::GcsSource(v.into()),
438        );
439        self
440    }
441}
442
443impl wkt::message::Message for ImportAptArtifactsRequest {
444    fn typename() -> &'static str {
445        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportAptArtifactsRequest"
446    }
447}
448
449/// Defines additional types related to [ImportAptArtifactsRequest].
450pub mod import_apt_artifacts_request {
451    #[allow(unused_imports)]
452    use super::*;
453
454    /// The source location of the package binaries.
455    #[derive(Clone, Debug, PartialEq)]
456    #[non_exhaustive]
457    pub enum Source {
458        /// Google Cloud Storage location where input content is located.
459        GcsSource(std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>),
460    }
461}
462
463/// Error information explaining why a package was not imported.
464#[derive(Clone, Default, PartialEq)]
465#[non_exhaustive]
466pub struct ImportAptArtifactsErrorInfo {
467    /// The detailed error status.
468    pub error: std::option::Option<google_cloud_rpc::model::Status>,
469
470    /// The source that was not imported.
471    pub source: std::option::Option<crate::model::import_apt_artifacts_error_info::Source>,
472
473    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
474}
475
476impl ImportAptArtifactsErrorInfo {
477    pub fn new() -> Self {
478        std::default::Default::default()
479    }
480
481    /// Sets the value of [error][crate::model::ImportAptArtifactsErrorInfo::error].
482    ///
483    /// # Example
484    /// ```ignore,no_run
485    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsErrorInfo;
486    /// use google_cloud_rpc::model::Status;
487    /// let x = ImportAptArtifactsErrorInfo::new().set_error(Status::default()/* use setters */);
488    /// ```
489    pub fn set_error<T>(mut self, v: T) -> Self
490    where
491        T: std::convert::Into<google_cloud_rpc::model::Status>,
492    {
493        self.error = std::option::Option::Some(v.into());
494        self
495    }
496
497    /// Sets or clears the value of [error][crate::model::ImportAptArtifactsErrorInfo::error].
498    ///
499    /// # Example
500    /// ```ignore,no_run
501    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsErrorInfo;
502    /// use google_cloud_rpc::model::Status;
503    /// let x = ImportAptArtifactsErrorInfo::new().set_or_clear_error(Some(Status::default()/* use setters */));
504    /// let x = ImportAptArtifactsErrorInfo::new().set_or_clear_error(None::<Status>);
505    /// ```
506    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
507    where
508        T: std::convert::Into<google_cloud_rpc::model::Status>,
509    {
510        self.error = v.map(|x| x.into());
511        self
512    }
513
514    /// Sets the value of [source][crate::model::ImportAptArtifactsErrorInfo::source].
515    ///
516    /// Note that all the setters affecting `source` are mutually
517    /// exclusive.
518    ///
519    /// # Example
520    /// ```ignore,no_run
521    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsErrorInfo;
522    /// use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
523    /// let x = ImportAptArtifactsErrorInfo::new().set_source(Some(
524    ///     google_cloud_artifactregistry_v1::model::import_apt_artifacts_error_info::Source::GcsSource(ImportAptArtifactsGcsSource::default().into())));
525    /// ```
526    pub fn set_source<
527        T: std::convert::Into<
528                std::option::Option<crate::model::import_apt_artifacts_error_info::Source>,
529            >,
530    >(
531        mut self,
532        v: T,
533    ) -> Self {
534        self.source = v.into();
535        self
536    }
537
538    /// The value of [source][crate::model::ImportAptArtifactsErrorInfo::source]
539    /// if it holds a `GcsSource`, `None` if the field is not set or
540    /// holds a different branch.
541    pub fn gcs_source(
542        &self,
543    ) -> std::option::Option<&std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>> {
544        #[allow(unreachable_patterns)]
545        self.source.as_ref().and_then(|v| match v {
546            crate::model::import_apt_artifacts_error_info::Source::GcsSource(v) => {
547                std::option::Option::Some(v)
548            }
549            _ => std::option::Option::None,
550        })
551    }
552
553    /// Sets the value of [source][crate::model::ImportAptArtifactsErrorInfo::source]
554    /// to hold a `GcsSource`.
555    ///
556    /// Note that all the setters affecting `source` are
557    /// mutually exclusive.
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsErrorInfo;
562    /// use google_cloud_artifactregistry_v1::model::ImportAptArtifactsGcsSource;
563    /// let x = ImportAptArtifactsErrorInfo::new().set_gcs_source(ImportAptArtifactsGcsSource::default()/* use setters */);
564    /// assert!(x.gcs_source().is_some());
565    /// ```
566    pub fn set_gcs_source<
567        T: std::convert::Into<std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>>,
568    >(
569        mut self,
570        v: T,
571    ) -> Self {
572        self.source = std::option::Option::Some(
573            crate::model::import_apt_artifacts_error_info::Source::GcsSource(v.into()),
574        );
575        self
576    }
577}
578
579impl wkt::message::Message for ImportAptArtifactsErrorInfo {
580    fn typename() -> &'static str {
581        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportAptArtifactsErrorInfo"
582    }
583}
584
585/// Defines additional types related to [ImportAptArtifactsErrorInfo].
586pub mod import_apt_artifacts_error_info {
587    #[allow(unused_imports)]
588    use super::*;
589
590    /// The source that was not imported.
591    #[derive(Clone, Debug, PartialEq)]
592    #[non_exhaustive]
593    pub enum Source {
594        /// Google Cloud Storage location requested.
595        GcsSource(std::boxed::Box<crate::model::ImportAptArtifactsGcsSource>),
596    }
597}
598
599/// The response message from importing APT artifacts.
600#[derive(Clone, Default, PartialEq)]
601#[non_exhaustive]
602pub struct ImportAptArtifactsResponse {
603    /// The Apt artifacts imported.
604    pub apt_artifacts: std::vec::Vec<crate::model::AptArtifact>,
605
606    /// Detailed error info for packages that were not imported.
607    pub errors: std::vec::Vec<crate::model::ImportAptArtifactsErrorInfo>,
608
609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
610}
611
612impl ImportAptArtifactsResponse {
613    pub fn new() -> Self {
614        std::default::Default::default()
615    }
616
617    /// Sets the value of [apt_artifacts][crate::model::ImportAptArtifactsResponse::apt_artifacts].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsResponse;
622    /// use google_cloud_artifactregistry_v1::model::AptArtifact;
623    /// let x = ImportAptArtifactsResponse::new()
624    ///     .set_apt_artifacts([
625    ///         AptArtifact::default()/* use setters */,
626    ///         AptArtifact::default()/* use (different) setters */,
627    ///     ]);
628    /// ```
629    pub fn set_apt_artifacts<T, V>(mut self, v: T) -> Self
630    where
631        T: std::iter::IntoIterator<Item = V>,
632        V: std::convert::Into<crate::model::AptArtifact>,
633    {
634        use std::iter::Iterator;
635        self.apt_artifacts = v.into_iter().map(|i| i.into()).collect();
636        self
637    }
638
639    /// Sets the value of [errors][crate::model::ImportAptArtifactsResponse::errors].
640    ///
641    /// # Example
642    /// ```ignore,no_run
643    /// # use google_cloud_artifactregistry_v1::model::ImportAptArtifactsResponse;
644    /// use google_cloud_artifactregistry_v1::model::ImportAptArtifactsErrorInfo;
645    /// let x = ImportAptArtifactsResponse::new()
646    ///     .set_errors([
647    ///         ImportAptArtifactsErrorInfo::default()/* use setters */,
648    ///         ImportAptArtifactsErrorInfo::default()/* use (different) setters */,
649    ///     ]);
650    /// ```
651    pub fn set_errors<T, V>(mut self, v: T) -> Self
652    where
653        T: std::iter::IntoIterator<Item = V>,
654        V: std::convert::Into<crate::model::ImportAptArtifactsErrorInfo>,
655    {
656        use std::iter::Iterator;
657        self.errors = v.into_iter().map(|i| i.into()).collect();
658        self
659    }
660}
661
662impl wkt::message::Message for ImportAptArtifactsResponse {
663    fn typename() -> &'static str {
664        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportAptArtifactsResponse"
665    }
666}
667
668/// The operation metadata for importing artifacts.
669#[derive(Clone, Default, PartialEq)]
670#[non_exhaustive]
671pub struct ImportAptArtifactsMetadata {
672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
673}
674
675impl ImportAptArtifactsMetadata {
676    pub fn new() -> Self {
677        std::default::Default::default()
678    }
679}
680
681impl wkt::message::Message for ImportAptArtifactsMetadata {
682    fn typename() -> &'static str {
683        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata"
684    }
685}
686
687/// DockerImage represents a docker artifact.
688/// The following fields are returned as untyped metadata in the Version
689/// resource, using camelcase keys (i.e. metadata.imageSizeBytes):
690///
691/// * imageSizeBytes
692/// * mediaType
693/// * buildTime
694#[derive(Clone, Default, PartialEq)]
695#[non_exhaustive]
696pub struct DockerImage {
697    /// Required. registry_location, project_id, repository_name and image id forms
698    /// a unique image
699    /// name:`projects/<project_id>/locations/<location>/repositories/<repository_name>/dockerImages/<docker_image>`.
700    /// For example,
701    /// "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
702    /// nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
703    /// where "us-west4" is the registry_location, "test-project" is the
704    /// project_id, "test-repo" is the repository_name and
705    /// "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
706    /// is the image's digest.
707    pub name: std::string::String,
708
709    /// Required. URL to access the image.
710    /// Example:
711    /// us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
712    pub uri: std::string::String,
713
714    /// Tags attached to this image.
715    pub tags: std::vec::Vec<std::string::String>,
716
717    /// Calculated size of the image.
718    /// This field is returned as the 'metadata.imageSizeBytes' field in the
719    /// Version resource.
720    pub image_size_bytes: i64,
721
722    /// Time the image was uploaded.
723    pub upload_time: std::option::Option<wkt::Timestamp>,
724
725    /// Media type of this image, e.g.
726    /// "application/vnd.docker.distribution.manifest.v2+json".
727    /// This field is returned as the 'metadata.mediaType' field in the
728    /// Version resource.
729    pub media_type: std::string::String,
730
731    /// The time this image was built.
732    /// This field is returned as the 'metadata.buildTime' field in the
733    /// Version resource.
734    /// The build time is returned to the client as an RFC 3339 string, which can
735    /// be easily used with the JavaScript Date constructor.
736    pub build_time: std::option::Option<wkt::Timestamp>,
737
738    /// Output only. The time when the docker image was last updated.
739    pub update_time: std::option::Option<wkt::Timestamp>,
740
741    /// ArtifactType of this image, e.g. "application/vnd.example+type".
742    /// If the `subject_digest` is set and no `artifact_type` is given, the
743    /// `media_type` will be considered as the `artifact_type`. This field is
744    /// returned as the `metadata.artifactType` field in the Version resource.
745    pub artifact_type: std::string::String,
746
747    /// Optional. For multi-arch images (manifest lists), this field contains the
748    /// list of image manifests.
749    pub image_manifests: std::vec::Vec<crate::model::ImageManifest>,
750
751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
752}
753
754impl DockerImage {
755    pub fn new() -> Self {
756        std::default::Default::default()
757    }
758
759    /// Sets the value of [name][crate::model::DockerImage::name].
760    ///
761    /// # Example
762    /// ```ignore,no_run
763    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
764    /// let x = DockerImage::new().set_name("example");
765    /// ```
766    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
767        self.name = v.into();
768        self
769    }
770
771    /// Sets the value of [uri][crate::model::DockerImage::uri].
772    ///
773    /// # Example
774    /// ```ignore,no_run
775    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
776    /// let x = DockerImage::new().set_uri("example");
777    /// ```
778    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
779        self.uri = v.into();
780        self
781    }
782
783    /// Sets the value of [tags][crate::model::DockerImage::tags].
784    ///
785    /// # Example
786    /// ```ignore,no_run
787    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
788    /// let x = DockerImage::new().set_tags(["a", "b", "c"]);
789    /// ```
790    pub fn set_tags<T, V>(mut self, v: T) -> Self
791    where
792        T: std::iter::IntoIterator<Item = V>,
793        V: std::convert::Into<std::string::String>,
794    {
795        use std::iter::Iterator;
796        self.tags = v.into_iter().map(|i| i.into()).collect();
797        self
798    }
799
800    /// Sets the value of [image_size_bytes][crate::model::DockerImage::image_size_bytes].
801    ///
802    /// # Example
803    /// ```ignore,no_run
804    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
805    /// let x = DockerImage::new().set_image_size_bytes(42);
806    /// ```
807    pub fn set_image_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
808        self.image_size_bytes = v.into();
809        self
810    }
811
812    /// Sets the value of [upload_time][crate::model::DockerImage::upload_time].
813    ///
814    /// # Example
815    /// ```ignore,no_run
816    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
817    /// use wkt::Timestamp;
818    /// let x = DockerImage::new().set_upload_time(Timestamp::default()/* use setters */);
819    /// ```
820    pub fn set_upload_time<T>(mut self, v: T) -> Self
821    where
822        T: std::convert::Into<wkt::Timestamp>,
823    {
824        self.upload_time = std::option::Option::Some(v.into());
825        self
826    }
827
828    /// Sets or clears the value of [upload_time][crate::model::DockerImage::upload_time].
829    ///
830    /// # Example
831    /// ```ignore,no_run
832    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
833    /// use wkt::Timestamp;
834    /// let x = DockerImage::new().set_or_clear_upload_time(Some(Timestamp::default()/* use setters */));
835    /// let x = DockerImage::new().set_or_clear_upload_time(None::<Timestamp>);
836    /// ```
837    pub fn set_or_clear_upload_time<T>(mut self, v: std::option::Option<T>) -> Self
838    where
839        T: std::convert::Into<wkt::Timestamp>,
840    {
841        self.upload_time = v.map(|x| x.into());
842        self
843    }
844
845    /// Sets the value of [media_type][crate::model::DockerImage::media_type].
846    ///
847    /// # Example
848    /// ```ignore,no_run
849    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
850    /// let x = DockerImage::new().set_media_type("example");
851    /// ```
852    pub fn set_media_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
853        self.media_type = v.into();
854        self
855    }
856
857    /// Sets the value of [build_time][crate::model::DockerImage::build_time].
858    ///
859    /// # Example
860    /// ```ignore,no_run
861    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
862    /// use wkt::Timestamp;
863    /// let x = DockerImage::new().set_build_time(Timestamp::default()/* use setters */);
864    /// ```
865    pub fn set_build_time<T>(mut self, v: T) -> Self
866    where
867        T: std::convert::Into<wkt::Timestamp>,
868    {
869        self.build_time = std::option::Option::Some(v.into());
870        self
871    }
872
873    /// Sets or clears the value of [build_time][crate::model::DockerImage::build_time].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
878    /// use wkt::Timestamp;
879    /// let x = DockerImage::new().set_or_clear_build_time(Some(Timestamp::default()/* use setters */));
880    /// let x = DockerImage::new().set_or_clear_build_time(None::<Timestamp>);
881    /// ```
882    pub fn set_or_clear_build_time<T>(mut self, v: std::option::Option<T>) -> Self
883    where
884        T: std::convert::Into<wkt::Timestamp>,
885    {
886        self.build_time = v.map(|x| x.into());
887        self
888    }
889
890    /// Sets the value of [update_time][crate::model::DockerImage::update_time].
891    ///
892    /// # Example
893    /// ```ignore,no_run
894    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
895    /// use wkt::Timestamp;
896    /// let x = DockerImage::new().set_update_time(Timestamp::default()/* use setters */);
897    /// ```
898    pub fn set_update_time<T>(mut self, v: T) -> Self
899    where
900        T: std::convert::Into<wkt::Timestamp>,
901    {
902        self.update_time = std::option::Option::Some(v.into());
903        self
904    }
905
906    /// Sets or clears the value of [update_time][crate::model::DockerImage::update_time].
907    ///
908    /// # Example
909    /// ```ignore,no_run
910    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
911    /// use wkt::Timestamp;
912    /// let x = DockerImage::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
913    /// let x = DockerImage::new().set_or_clear_update_time(None::<Timestamp>);
914    /// ```
915    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
916    where
917        T: std::convert::Into<wkt::Timestamp>,
918    {
919        self.update_time = v.map(|x| x.into());
920        self
921    }
922
923    /// Sets the value of [artifact_type][crate::model::DockerImage::artifact_type].
924    ///
925    /// # Example
926    /// ```ignore,no_run
927    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
928    /// let x = DockerImage::new().set_artifact_type("example");
929    /// ```
930    pub fn set_artifact_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
931        self.artifact_type = v.into();
932        self
933    }
934
935    /// Sets the value of [image_manifests][crate::model::DockerImage::image_manifests].
936    ///
937    /// # Example
938    /// ```ignore,no_run
939    /// # use google_cloud_artifactregistry_v1::model::DockerImage;
940    /// use google_cloud_artifactregistry_v1::model::ImageManifest;
941    /// let x = DockerImage::new()
942    ///     .set_image_manifests([
943    ///         ImageManifest::default()/* use setters */,
944    ///         ImageManifest::default()/* use (different) setters */,
945    ///     ]);
946    /// ```
947    pub fn set_image_manifests<T, V>(mut self, v: T) -> Self
948    where
949        T: std::iter::IntoIterator<Item = V>,
950        V: std::convert::Into<crate::model::ImageManifest>,
951    {
952        use std::iter::Iterator;
953        self.image_manifests = v.into_iter().map(|i| i.into()).collect();
954        self
955    }
956}
957
958impl wkt::message::Message for DockerImage {
959    fn typename() -> &'static str {
960        "type.googleapis.com/google.devtools.artifactregistry.v1.DockerImage"
961    }
962}
963
964/// Details of a single image manifest within a multi-arch image.
965#[derive(Clone, Default, PartialEq)]
966#[non_exhaustive]
967pub struct ImageManifest {
968    /// Optional. The CPU architecture of the image.
969    /// Values are provided by the Docker client and are not validated by Artifact
970    /// Registry. Example values include "amd64", "arm64", "ppc64le", "s390x",
971    /// "riscv64", "mips64le", etc.
972    pub architecture: std::string::String,
973
974    /// Optional. The operating system of the image.
975    /// Values are provided by the Docker client and are not validated by Artifact
976    /// Registry. Example values include "linux", "windows", "darwin", "aix", etc.
977    pub os: std::string::String,
978
979    /// Optional. The manifest digest, in the format "sha256:<sha256_hex_digest>".
980    pub digest: std::string::String,
981
982    /// Optional. The media type of the manifest, e.g.,
983    /// "application/vnd.docker.distribution.manifest.v2+json"
984    pub media_type: std::string::String,
985
986    /// Optional. The OS version of the image, for example on Windows
987    /// `10.0.14393.1066`.
988    pub os_version: std::string::String,
989
990    /// Optional. The required OS features for the image, for example on Windows
991    /// `win32k`.
992    pub os_features: std::vec::Vec<std::string::String>,
993
994    /// Optional. The variant of the CPU in the image, for example `v7` to specify
995    /// ARMv7 when architecture is `arm`.
996    pub variant: std::string::String,
997
998    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
999}
1000
1001impl ImageManifest {
1002    pub fn new() -> Self {
1003        std::default::Default::default()
1004    }
1005
1006    /// Sets the value of [architecture][crate::model::ImageManifest::architecture].
1007    ///
1008    /// # Example
1009    /// ```ignore,no_run
1010    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1011    /// let x = ImageManifest::new().set_architecture("example");
1012    /// ```
1013    pub fn set_architecture<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1014        self.architecture = v.into();
1015        self
1016    }
1017
1018    /// Sets the value of [os][crate::model::ImageManifest::os].
1019    ///
1020    /// # Example
1021    /// ```ignore,no_run
1022    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1023    /// let x = ImageManifest::new().set_os("example");
1024    /// ```
1025    pub fn set_os<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1026        self.os = v.into();
1027        self
1028    }
1029
1030    /// Sets the value of [digest][crate::model::ImageManifest::digest].
1031    ///
1032    /// # Example
1033    /// ```ignore,no_run
1034    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1035    /// let x = ImageManifest::new().set_digest("example");
1036    /// ```
1037    pub fn set_digest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1038        self.digest = v.into();
1039        self
1040    }
1041
1042    /// Sets the value of [media_type][crate::model::ImageManifest::media_type].
1043    ///
1044    /// # Example
1045    /// ```ignore,no_run
1046    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1047    /// let x = ImageManifest::new().set_media_type("example");
1048    /// ```
1049    pub fn set_media_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1050        self.media_type = v.into();
1051        self
1052    }
1053
1054    /// Sets the value of [os_version][crate::model::ImageManifest::os_version].
1055    ///
1056    /// # Example
1057    /// ```ignore,no_run
1058    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1059    /// let x = ImageManifest::new().set_os_version("example");
1060    /// ```
1061    pub fn set_os_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062        self.os_version = v.into();
1063        self
1064    }
1065
1066    /// Sets the value of [os_features][crate::model::ImageManifest::os_features].
1067    ///
1068    /// # Example
1069    /// ```ignore,no_run
1070    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1071    /// let x = ImageManifest::new().set_os_features(["a", "b", "c"]);
1072    /// ```
1073    pub fn set_os_features<T, V>(mut self, v: T) -> Self
1074    where
1075        T: std::iter::IntoIterator<Item = V>,
1076        V: std::convert::Into<std::string::String>,
1077    {
1078        use std::iter::Iterator;
1079        self.os_features = v.into_iter().map(|i| i.into()).collect();
1080        self
1081    }
1082
1083    /// Sets the value of [variant][crate::model::ImageManifest::variant].
1084    ///
1085    /// # Example
1086    /// ```ignore,no_run
1087    /// # use google_cloud_artifactregistry_v1::model::ImageManifest;
1088    /// let x = ImageManifest::new().set_variant("example");
1089    /// ```
1090    pub fn set_variant<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1091        self.variant = v.into();
1092        self
1093    }
1094}
1095
1096impl wkt::message::Message for ImageManifest {
1097    fn typename() -> &'static str {
1098        "type.googleapis.com/google.devtools.artifactregistry.v1.ImageManifest"
1099    }
1100}
1101
1102/// The request to list docker images.
1103#[derive(Clone, Default, PartialEq)]
1104#[non_exhaustive]
1105pub struct ListDockerImagesRequest {
1106    /// Required. The name of the parent resource whose docker images will be
1107    /// listed.
1108    pub parent: std::string::String,
1109
1110    /// The maximum number of artifacts to return. Maximum page size is 1,000.
1111    pub page_size: i32,
1112
1113    /// The next_page_token value returned from a previous list request, if any.
1114    pub page_token: std::string::String,
1115
1116    /// The field to order the results by.
1117    pub order_by: std::string::String,
1118
1119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1120}
1121
1122impl ListDockerImagesRequest {
1123    pub fn new() -> Self {
1124        std::default::Default::default()
1125    }
1126
1127    /// Sets the value of [parent][crate::model::ListDockerImagesRequest::parent].
1128    ///
1129    /// # Example
1130    /// ```ignore,no_run
1131    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesRequest;
1132    /// let x = ListDockerImagesRequest::new().set_parent("example");
1133    /// ```
1134    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1135        self.parent = v.into();
1136        self
1137    }
1138
1139    /// Sets the value of [page_size][crate::model::ListDockerImagesRequest::page_size].
1140    ///
1141    /// # Example
1142    /// ```ignore,no_run
1143    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesRequest;
1144    /// let x = ListDockerImagesRequest::new().set_page_size(42);
1145    /// ```
1146    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1147        self.page_size = v.into();
1148        self
1149    }
1150
1151    /// Sets the value of [page_token][crate::model::ListDockerImagesRequest::page_token].
1152    ///
1153    /// # Example
1154    /// ```ignore,no_run
1155    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesRequest;
1156    /// let x = ListDockerImagesRequest::new().set_page_token("example");
1157    /// ```
1158    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1159        self.page_token = v.into();
1160        self
1161    }
1162
1163    /// Sets the value of [order_by][crate::model::ListDockerImagesRequest::order_by].
1164    ///
1165    /// # Example
1166    /// ```ignore,no_run
1167    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesRequest;
1168    /// let x = ListDockerImagesRequest::new().set_order_by("example");
1169    /// ```
1170    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1171        self.order_by = v.into();
1172        self
1173    }
1174}
1175
1176impl wkt::message::Message for ListDockerImagesRequest {
1177    fn typename() -> &'static str {
1178        "type.googleapis.com/google.devtools.artifactregistry.v1.ListDockerImagesRequest"
1179    }
1180}
1181
1182/// The response from listing docker images.
1183#[derive(Clone, Default, PartialEq)]
1184#[non_exhaustive]
1185pub struct ListDockerImagesResponse {
1186    /// The docker images returned.
1187    pub docker_images: std::vec::Vec<crate::model::DockerImage>,
1188
1189    /// The token to retrieve the next page of artifacts, or empty if there are no
1190    /// more artifacts to return.
1191    pub next_page_token: std::string::String,
1192
1193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1194}
1195
1196impl ListDockerImagesResponse {
1197    pub fn new() -> Self {
1198        std::default::Default::default()
1199    }
1200
1201    /// Sets the value of [docker_images][crate::model::ListDockerImagesResponse::docker_images].
1202    ///
1203    /// # Example
1204    /// ```ignore,no_run
1205    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesResponse;
1206    /// use google_cloud_artifactregistry_v1::model::DockerImage;
1207    /// let x = ListDockerImagesResponse::new()
1208    ///     .set_docker_images([
1209    ///         DockerImage::default()/* use setters */,
1210    ///         DockerImage::default()/* use (different) setters */,
1211    ///     ]);
1212    /// ```
1213    pub fn set_docker_images<T, V>(mut self, v: T) -> Self
1214    where
1215        T: std::iter::IntoIterator<Item = V>,
1216        V: std::convert::Into<crate::model::DockerImage>,
1217    {
1218        use std::iter::Iterator;
1219        self.docker_images = v.into_iter().map(|i| i.into()).collect();
1220        self
1221    }
1222
1223    /// Sets the value of [next_page_token][crate::model::ListDockerImagesResponse::next_page_token].
1224    ///
1225    /// # Example
1226    /// ```ignore,no_run
1227    /// # use google_cloud_artifactregistry_v1::model::ListDockerImagesResponse;
1228    /// let x = ListDockerImagesResponse::new().set_next_page_token("example");
1229    /// ```
1230    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1231        self.next_page_token = v.into();
1232        self
1233    }
1234}
1235
1236impl wkt::message::Message for ListDockerImagesResponse {
1237    fn typename() -> &'static str {
1238        "type.googleapis.com/google.devtools.artifactregistry.v1.ListDockerImagesResponse"
1239    }
1240}
1241
1242#[doc(hidden)]
1243impl google_cloud_gax::paginator::internal::PageableResponse for ListDockerImagesResponse {
1244    type PageItem = crate::model::DockerImage;
1245
1246    fn items(self) -> std::vec::Vec<Self::PageItem> {
1247        self.docker_images
1248    }
1249
1250    fn next_page_token(&self) -> std::string::String {
1251        use std::clone::Clone;
1252        self.next_page_token.clone()
1253    }
1254}
1255
1256/// The request to get docker images.
1257#[derive(Clone, Default, PartialEq)]
1258#[non_exhaustive]
1259pub struct GetDockerImageRequest {
1260    /// Required. The name of the docker images.
1261    pub name: std::string::String,
1262
1263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1264}
1265
1266impl GetDockerImageRequest {
1267    pub fn new() -> Self {
1268        std::default::Default::default()
1269    }
1270
1271    /// Sets the value of [name][crate::model::GetDockerImageRequest::name].
1272    ///
1273    /// # Example
1274    /// ```ignore,no_run
1275    /// # use google_cloud_artifactregistry_v1::model::GetDockerImageRequest;
1276    /// let x = GetDockerImageRequest::new().set_name("example");
1277    /// ```
1278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1279        self.name = v.into();
1280        self
1281    }
1282}
1283
1284impl wkt::message::Message for GetDockerImageRequest {
1285    fn typename() -> &'static str {
1286        "type.googleapis.com/google.devtools.artifactregistry.v1.GetDockerImageRequest"
1287    }
1288}
1289
1290/// MavenArtifact represents a maven artifact.
1291#[derive(Clone, Default, PartialEq)]
1292#[non_exhaustive]
1293pub struct MavenArtifact {
1294    /// Required. registry_location, project_id, repository_name and maven_artifact
1295    /// forms a unique artifact For example,
1296    /// "projects/test-project/locations/us-west4/repositories/test-repo/mavenArtifacts/
1297    /// com.google.guava:guava:31.0-jre",
1298    /// where "us-west4" is the registry_location, "test-project" is the
1299    /// project_id, "test-repo" is the repository_name and
1300    /// "com.google.guava:guava:31.0-jre"
1301    /// is the maven artifact.
1302    pub name: std::string::String,
1303
1304    /// Required. URL to access the pom file of the artifact.
1305    /// Example:
1306    /// us-west4-maven.pkg.dev/test-project/test-repo/com/google/guava/guava/31.0/guava-31.0.pom
1307    pub pom_uri: std::string::String,
1308
1309    /// Group ID for the artifact.
1310    /// Example:
1311    /// com.google.guava
1312    pub group_id: std::string::String,
1313
1314    /// Artifact ID for the artifact.
1315    pub artifact_id: std::string::String,
1316
1317    /// Version of this artifact.
1318    pub version: std::string::String,
1319
1320    /// Output only. Time the artifact was created.
1321    pub create_time: std::option::Option<wkt::Timestamp>,
1322
1323    /// Output only. Time the artifact was updated.
1324    pub update_time: std::option::Option<wkt::Timestamp>,
1325
1326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1327}
1328
1329impl MavenArtifact {
1330    pub fn new() -> Self {
1331        std::default::Default::default()
1332    }
1333
1334    /// Sets the value of [name][crate::model::MavenArtifact::name].
1335    ///
1336    /// # Example
1337    /// ```ignore,no_run
1338    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1339    /// let x = MavenArtifact::new().set_name("example");
1340    /// ```
1341    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1342        self.name = v.into();
1343        self
1344    }
1345
1346    /// Sets the value of [pom_uri][crate::model::MavenArtifact::pom_uri].
1347    ///
1348    /// # Example
1349    /// ```ignore,no_run
1350    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1351    /// let x = MavenArtifact::new().set_pom_uri("example");
1352    /// ```
1353    pub fn set_pom_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354        self.pom_uri = v.into();
1355        self
1356    }
1357
1358    /// Sets the value of [group_id][crate::model::MavenArtifact::group_id].
1359    ///
1360    /// # Example
1361    /// ```ignore,no_run
1362    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1363    /// let x = MavenArtifact::new().set_group_id("example");
1364    /// ```
1365    pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1366        self.group_id = v.into();
1367        self
1368    }
1369
1370    /// Sets the value of [artifact_id][crate::model::MavenArtifact::artifact_id].
1371    ///
1372    /// # Example
1373    /// ```ignore,no_run
1374    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1375    /// let x = MavenArtifact::new().set_artifact_id("example");
1376    /// ```
1377    pub fn set_artifact_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1378        self.artifact_id = v.into();
1379        self
1380    }
1381
1382    /// Sets the value of [version][crate::model::MavenArtifact::version].
1383    ///
1384    /// # Example
1385    /// ```ignore,no_run
1386    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1387    /// let x = MavenArtifact::new().set_version("example");
1388    /// ```
1389    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1390        self.version = v.into();
1391        self
1392    }
1393
1394    /// Sets the value of [create_time][crate::model::MavenArtifact::create_time].
1395    ///
1396    /// # Example
1397    /// ```ignore,no_run
1398    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1399    /// use wkt::Timestamp;
1400    /// let x = MavenArtifact::new().set_create_time(Timestamp::default()/* use setters */);
1401    /// ```
1402    pub fn set_create_time<T>(mut self, v: T) -> Self
1403    where
1404        T: std::convert::Into<wkt::Timestamp>,
1405    {
1406        self.create_time = std::option::Option::Some(v.into());
1407        self
1408    }
1409
1410    /// Sets or clears the value of [create_time][crate::model::MavenArtifact::create_time].
1411    ///
1412    /// # Example
1413    /// ```ignore,no_run
1414    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1415    /// use wkt::Timestamp;
1416    /// let x = MavenArtifact::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1417    /// let x = MavenArtifact::new().set_or_clear_create_time(None::<Timestamp>);
1418    /// ```
1419    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1420    where
1421        T: std::convert::Into<wkt::Timestamp>,
1422    {
1423        self.create_time = v.map(|x| x.into());
1424        self
1425    }
1426
1427    /// Sets the value of [update_time][crate::model::MavenArtifact::update_time].
1428    ///
1429    /// # Example
1430    /// ```ignore,no_run
1431    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1432    /// use wkt::Timestamp;
1433    /// let x = MavenArtifact::new().set_update_time(Timestamp::default()/* use setters */);
1434    /// ```
1435    pub fn set_update_time<T>(mut self, v: T) -> Self
1436    where
1437        T: std::convert::Into<wkt::Timestamp>,
1438    {
1439        self.update_time = std::option::Option::Some(v.into());
1440        self
1441    }
1442
1443    /// Sets or clears the value of [update_time][crate::model::MavenArtifact::update_time].
1444    ///
1445    /// # Example
1446    /// ```ignore,no_run
1447    /// # use google_cloud_artifactregistry_v1::model::MavenArtifact;
1448    /// use wkt::Timestamp;
1449    /// let x = MavenArtifact::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1450    /// let x = MavenArtifact::new().set_or_clear_update_time(None::<Timestamp>);
1451    /// ```
1452    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1453    where
1454        T: std::convert::Into<wkt::Timestamp>,
1455    {
1456        self.update_time = v.map(|x| x.into());
1457        self
1458    }
1459}
1460
1461impl wkt::message::Message for MavenArtifact {
1462    fn typename() -> &'static str {
1463        "type.googleapis.com/google.devtools.artifactregistry.v1.MavenArtifact"
1464    }
1465}
1466
1467/// The request to list maven artifacts.
1468#[derive(Clone, Default, PartialEq)]
1469#[non_exhaustive]
1470pub struct ListMavenArtifactsRequest {
1471    /// Required. The name of the parent resource whose maven artifacts will be
1472    /// listed.
1473    pub parent: std::string::String,
1474
1475    /// The maximum number of artifacts to return. Maximum page size is 1,000.
1476    pub page_size: i32,
1477
1478    /// The next_page_token value returned from a previous list request, if any.
1479    pub page_token: std::string::String,
1480
1481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1482}
1483
1484impl ListMavenArtifactsRequest {
1485    pub fn new() -> Self {
1486        std::default::Default::default()
1487    }
1488
1489    /// Sets the value of [parent][crate::model::ListMavenArtifactsRequest::parent].
1490    ///
1491    /// # Example
1492    /// ```ignore,no_run
1493    /// # use google_cloud_artifactregistry_v1::model::ListMavenArtifactsRequest;
1494    /// let x = ListMavenArtifactsRequest::new().set_parent("example");
1495    /// ```
1496    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1497        self.parent = v.into();
1498        self
1499    }
1500
1501    /// Sets the value of [page_size][crate::model::ListMavenArtifactsRequest::page_size].
1502    ///
1503    /// # Example
1504    /// ```ignore,no_run
1505    /// # use google_cloud_artifactregistry_v1::model::ListMavenArtifactsRequest;
1506    /// let x = ListMavenArtifactsRequest::new().set_page_size(42);
1507    /// ```
1508    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1509        self.page_size = v.into();
1510        self
1511    }
1512
1513    /// Sets the value of [page_token][crate::model::ListMavenArtifactsRequest::page_token].
1514    ///
1515    /// # Example
1516    /// ```ignore,no_run
1517    /// # use google_cloud_artifactregistry_v1::model::ListMavenArtifactsRequest;
1518    /// let x = ListMavenArtifactsRequest::new().set_page_token("example");
1519    /// ```
1520    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1521        self.page_token = v.into();
1522        self
1523    }
1524}
1525
1526impl wkt::message::Message for ListMavenArtifactsRequest {
1527    fn typename() -> &'static str {
1528        "type.googleapis.com/google.devtools.artifactregistry.v1.ListMavenArtifactsRequest"
1529    }
1530}
1531
1532/// The response from listing maven artifacts.
1533#[derive(Clone, Default, PartialEq)]
1534#[non_exhaustive]
1535pub struct ListMavenArtifactsResponse {
1536    /// The maven artifacts returned.
1537    pub maven_artifacts: std::vec::Vec<crate::model::MavenArtifact>,
1538
1539    /// The token to retrieve the next page of artifacts, or empty if there are no
1540    /// more artifacts to return.
1541    pub next_page_token: std::string::String,
1542
1543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1544}
1545
1546impl ListMavenArtifactsResponse {
1547    pub fn new() -> Self {
1548        std::default::Default::default()
1549    }
1550
1551    /// Sets the value of [maven_artifacts][crate::model::ListMavenArtifactsResponse::maven_artifacts].
1552    ///
1553    /// # Example
1554    /// ```ignore,no_run
1555    /// # use google_cloud_artifactregistry_v1::model::ListMavenArtifactsResponse;
1556    /// use google_cloud_artifactregistry_v1::model::MavenArtifact;
1557    /// let x = ListMavenArtifactsResponse::new()
1558    ///     .set_maven_artifacts([
1559    ///         MavenArtifact::default()/* use setters */,
1560    ///         MavenArtifact::default()/* use (different) setters */,
1561    ///     ]);
1562    /// ```
1563    pub fn set_maven_artifacts<T, V>(mut self, v: T) -> Self
1564    where
1565        T: std::iter::IntoIterator<Item = V>,
1566        V: std::convert::Into<crate::model::MavenArtifact>,
1567    {
1568        use std::iter::Iterator;
1569        self.maven_artifacts = v.into_iter().map(|i| i.into()).collect();
1570        self
1571    }
1572
1573    /// Sets the value of [next_page_token][crate::model::ListMavenArtifactsResponse::next_page_token].
1574    ///
1575    /// # Example
1576    /// ```ignore,no_run
1577    /// # use google_cloud_artifactregistry_v1::model::ListMavenArtifactsResponse;
1578    /// let x = ListMavenArtifactsResponse::new().set_next_page_token("example");
1579    /// ```
1580    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1581        self.next_page_token = v.into();
1582        self
1583    }
1584}
1585
1586impl wkt::message::Message for ListMavenArtifactsResponse {
1587    fn typename() -> &'static str {
1588        "type.googleapis.com/google.devtools.artifactregistry.v1.ListMavenArtifactsResponse"
1589    }
1590}
1591
1592#[doc(hidden)]
1593impl google_cloud_gax::paginator::internal::PageableResponse for ListMavenArtifactsResponse {
1594    type PageItem = crate::model::MavenArtifact;
1595
1596    fn items(self) -> std::vec::Vec<Self::PageItem> {
1597        self.maven_artifacts
1598    }
1599
1600    fn next_page_token(&self) -> std::string::String {
1601        use std::clone::Clone;
1602        self.next_page_token.clone()
1603    }
1604}
1605
1606/// The request to get maven artifacts.
1607#[derive(Clone, Default, PartialEq)]
1608#[non_exhaustive]
1609pub struct GetMavenArtifactRequest {
1610    /// Required. The name of the maven artifact.
1611    pub name: std::string::String,
1612
1613    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1614}
1615
1616impl GetMavenArtifactRequest {
1617    pub fn new() -> Self {
1618        std::default::Default::default()
1619    }
1620
1621    /// Sets the value of [name][crate::model::GetMavenArtifactRequest::name].
1622    ///
1623    /// # Example
1624    /// ```ignore,no_run
1625    /// # use google_cloud_artifactregistry_v1::model::GetMavenArtifactRequest;
1626    /// let x = GetMavenArtifactRequest::new().set_name("example");
1627    /// ```
1628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1629        self.name = v.into();
1630        self
1631    }
1632}
1633
1634impl wkt::message::Message for GetMavenArtifactRequest {
1635    fn typename() -> &'static str {
1636        "type.googleapis.com/google.devtools.artifactregistry.v1.GetMavenArtifactRequest"
1637    }
1638}
1639
1640/// NpmPackage represents an npm artifact.
1641#[derive(Clone, Default, PartialEq)]
1642#[non_exhaustive]
1643pub struct NpmPackage {
1644    /// Required. registry_location, project_id, repository_name and npm_package
1645    /// forms a unique package For example,
1646    /// "projects/test-project/locations/us-west4/repositories/test-repo/npmPackages/
1647    /// npm_test:1.0.0",
1648    /// where "us-west4" is the registry_location, "test-project" is the
1649    /// project_id, "test-repo" is the repository_name and
1650    /// npm_test:1.0.0" is the npm package.
1651    pub name: std::string::String,
1652
1653    /// Package for the artifact.
1654    pub package_name: std::string::String,
1655
1656    /// Version of this package.
1657    pub version: std::string::String,
1658
1659    /// Tags attached to this package.
1660    pub tags: std::vec::Vec<std::string::String>,
1661
1662    /// Output only. Time the package was created.
1663    pub create_time: std::option::Option<wkt::Timestamp>,
1664
1665    /// Output only. Time the package was updated.
1666    pub update_time: std::option::Option<wkt::Timestamp>,
1667
1668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1669}
1670
1671impl NpmPackage {
1672    pub fn new() -> Self {
1673        std::default::Default::default()
1674    }
1675
1676    /// Sets the value of [name][crate::model::NpmPackage::name].
1677    ///
1678    /// # Example
1679    /// ```ignore,no_run
1680    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1681    /// let x = NpmPackage::new().set_name("example");
1682    /// ```
1683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684        self.name = v.into();
1685        self
1686    }
1687
1688    /// Sets the value of [package_name][crate::model::NpmPackage::package_name].
1689    ///
1690    /// # Example
1691    /// ```ignore,no_run
1692    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1693    /// let x = NpmPackage::new().set_package_name("example");
1694    /// ```
1695    pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1696        self.package_name = v.into();
1697        self
1698    }
1699
1700    /// Sets the value of [version][crate::model::NpmPackage::version].
1701    ///
1702    /// # Example
1703    /// ```ignore,no_run
1704    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1705    /// let x = NpmPackage::new().set_version("example");
1706    /// ```
1707    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1708        self.version = v.into();
1709        self
1710    }
1711
1712    /// Sets the value of [tags][crate::model::NpmPackage::tags].
1713    ///
1714    /// # Example
1715    /// ```ignore,no_run
1716    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1717    /// let x = NpmPackage::new().set_tags(["a", "b", "c"]);
1718    /// ```
1719    pub fn set_tags<T, V>(mut self, v: T) -> Self
1720    where
1721        T: std::iter::IntoIterator<Item = V>,
1722        V: std::convert::Into<std::string::String>,
1723    {
1724        use std::iter::Iterator;
1725        self.tags = v.into_iter().map(|i| i.into()).collect();
1726        self
1727    }
1728
1729    /// Sets the value of [create_time][crate::model::NpmPackage::create_time].
1730    ///
1731    /// # Example
1732    /// ```ignore,no_run
1733    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1734    /// use wkt::Timestamp;
1735    /// let x = NpmPackage::new().set_create_time(Timestamp::default()/* use setters */);
1736    /// ```
1737    pub fn set_create_time<T>(mut self, v: T) -> Self
1738    where
1739        T: std::convert::Into<wkt::Timestamp>,
1740    {
1741        self.create_time = std::option::Option::Some(v.into());
1742        self
1743    }
1744
1745    /// Sets or clears the value of [create_time][crate::model::NpmPackage::create_time].
1746    ///
1747    /// # Example
1748    /// ```ignore,no_run
1749    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1750    /// use wkt::Timestamp;
1751    /// let x = NpmPackage::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1752    /// let x = NpmPackage::new().set_or_clear_create_time(None::<Timestamp>);
1753    /// ```
1754    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1755    where
1756        T: std::convert::Into<wkt::Timestamp>,
1757    {
1758        self.create_time = v.map(|x| x.into());
1759        self
1760    }
1761
1762    /// Sets the value of [update_time][crate::model::NpmPackage::update_time].
1763    ///
1764    /// # Example
1765    /// ```ignore,no_run
1766    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1767    /// use wkt::Timestamp;
1768    /// let x = NpmPackage::new().set_update_time(Timestamp::default()/* use setters */);
1769    /// ```
1770    pub fn set_update_time<T>(mut self, v: T) -> Self
1771    where
1772        T: std::convert::Into<wkt::Timestamp>,
1773    {
1774        self.update_time = std::option::Option::Some(v.into());
1775        self
1776    }
1777
1778    /// Sets or clears the value of [update_time][crate::model::NpmPackage::update_time].
1779    ///
1780    /// # Example
1781    /// ```ignore,no_run
1782    /// # use google_cloud_artifactregistry_v1::model::NpmPackage;
1783    /// use wkt::Timestamp;
1784    /// let x = NpmPackage::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1785    /// let x = NpmPackage::new().set_or_clear_update_time(None::<Timestamp>);
1786    /// ```
1787    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1788    where
1789        T: std::convert::Into<wkt::Timestamp>,
1790    {
1791        self.update_time = v.map(|x| x.into());
1792        self
1793    }
1794}
1795
1796impl wkt::message::Message for NpmPackage {
1797    fn typename() -> &'static str {
1798        "type.googleapis.com/google.devtools.artifactregistry.v1.NpmPackage"
1799    }
1800}
1801
1802/// The request to list npm packages.
1803#[derive(Clone, Default, PartialEq)]
1804#[non_exhaustive]
1805pub struct ListNpmPackagesRequest {
1806    /// Required. The name of the parent resource whose npm packages will be
1807    /// listed.
1808    pub parent: std::string::String,
1809
1810    /// The maximum number of artifacts to return. Maximum page size is 1,000.
1811    pub page_size: i32,
1812
1813    /// The next_page_token value returned from a previous list request, if any.
1814    pub page_token: std::string::String,
1815
1816    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1817}
1818
1819impl ListNpmPackagesRequest {
1820    pub fn new() -> Self {
1821        std::default::Default::default()
1822    }
1823
1824    /// Sets the value of [parent][crate::model::ListNpmPackagesRequest::parent].
1825    ///
1826    /// # Example
1827    /// ```ignore,no_run
1828    /// # use google_cloud_artifactregistry_v1::model::ListNpmPackagesRequest;
1829    /// let x = ListNpmPackagesRequest::new().set_parent("example");
1830    /// ```
1831    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1832        self.parent = v.into();
1833        self
1834    }
1835
1836    /// Sets the value of [page_size][crate::model::ListNpmPackagesRequest::page_size].
1837    ///
1838    /// # Example
1839    /// ```ignore,no_run
1840    /// # use google_cloud_artifactregistry_v1::model::ListNpmPackagesRequest;
1841    /// let x = ListNpmPackagesRequest::new().set_page_size(42);
1842    /// ```
1843    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1844        self.page_size = v.into();
1845        self
1846    }
1847
1848    /// Sets the value of [page_token][crate::model::ListNpmPackagesRequest::page_token].
1849    ///
1850    /// # Example
1851    /// ```ignore,no_run
1852    /// # use google_cloud_artifactregistry_v1::model::ListNpmPackagesRequest;
1853    /// let x = ListNpmPackagesRequest::new().set_page_token("example");
1854    /// ```
1855    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1856        self.page_token = v.into();
1857        self
1858    }
1859}
1860
1861impl wkt::message::Message for ListNpmPackagesRequest {
1862    fn typename() -> &'static str {
1863        "type.googleapis.com/google.devtools.artifactregistry.v1.ListNpmPackagesRequest"
1864    }
1865}
1866
1867/// The response from listing npm packages.
1868#[derive(Clone, Default, PartialEq)]
1869#[non_exhaustive]
1870pub struct ListNpmPackagesResponse {
1871    /// The npm packages returned.
1872    pub npm_packages: std::vec::Vec<crate::model::NpmPackage>,
1873
1874    /// The token to retrieve the next page of artifacts, or empty if there are no
1875    /// more artifacts to return.
1876    pub next_page_token: std::string::String,
1877
1878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1879}
1880
1881impl ListNpmPackagesResponse {
1882    pub fn new() -> Self {
1883        std::default::Default::default()
1884    }
1885
1886    /// Sets the value of [npm_packages][crate::model::ListNpmPackagesResponse::npm_packages].
1887    ///
1888    /// # Example
1889    /// ```ignore,no_run
1890    /// # use google_cloud_artifactregistry_v1::model::ListNpmPackagesResponse;
1891    /// use google_cloud_artifactregistry_v1::model::NpmPackage;
1892    /// let x = ListNpmPackagesResponse::new()
1893    ///     .set_npm_packages([
1894    ///         NpmPackage::default()/* use setters */,
1895    ///         NpmPackage::default()/* use (different) setters */,
1896    ///     ]);
1897    /// ```
1898    pub fn set_npm_packages<T, V>(mut self, v: T) -> Self
1899    where
1900        T: std::iter::IntoIterator<Item = V>,
1901        V: std::convert::Into<crate::model::NpmPackage>,
1902    {
1903        use std::iter::Iterator;
1904        self.npm_packages = v.into_iter().map(|i| i.into()).collect();
1905        self
1906    }
1907
1908    /// Sets the value of [next_page_token][crate::model::ListNpmPackagesResponse::next_page_token].
1909    ///
1910    /// # Example
1911    /// ```ignore,no_run
1912    /// # use google_cloud_artifactregistry_v1::model::ListNpmPackagesResponse;
1913    /// let x = ListNpmPackagesResponse::new().set_next_page_token("example");
1914    /// ```
1915    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1916        self.next_page_token = v.into();
1917        self
1918    }
1919}
1920
1921impl wkt::message::Message for ListNpmPackagesResponse {
1922    fn typename() -> &'static str {
1923        "type.googleapis.com/google.devtools.artifactregistry.v1.ListNpmPackagesResponse"
1924    }
1925}
1926
1927#[doc(hidden)]
1928impl google_cloud_gax::paginator::internal::PageableResponse for ListNpmPackagesResponse {
1929    type PageItem = crate::model::NpmPackage;
1930
1931    fn items(self) -> std::vec::Vec<Self::PageItem> {
1932        self.npm_packages
1933    }
1934
1935    fn next_page_token(&self) -> std::string::String {
1936        use std::clone::Clone;
1937        self.next_page_token.clone()
1938    }
1939}
1940
1941/// The request to get npm packages.
1942#[derive(Clone, Default, PartialEq)]
1943#[non_exhaustive]
1944pub struct GetNpmPackageRequest {
1945    /// Required. The name of the npm package.
1946    pub name: std::string::String,
1947
1948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1949}
1950
1951impl GetNpmPackageRequest {
1952    pub fn new() -> Self {
1953        std::default::Default::default()
1954    }
1955
1956    /// Sets the value of [name][crate::model::GetNpmPackageRequest::name].
1957    ///
1958    /// # Example
1959    /// ```ignore,no_run
1960    /// # use google_cloud_artifactregistry_v1::model::GetNpmPackageRequest;
1961    /// let x = GetNpmPackageRequest::new().set_name("example");
1962    /// ```
1963    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1964        self.name = v.into();
1965        self
1966    }
1967}
1968
1969impl wkt::message::Message for GetNpmPackageRequest {
1970    fn typename() -> &'static str {
1971        "type.googleapis.com/google.devtools.artifactregistry.v1.GetNpmPackageRequest"
1972    }
1973}
1974
1975/// PythonPackage represents a python artifact.
1976#[derive(Clone, Default, PartialEq)]
1977#[non_exhaustive]
1978pub struct PythonPackage {
1979    /// Required. registry_location, project_id, repository_name and python_package
1980    /// forms a unique package
1981    /// name:`projects/<project_id>/locations/<location>/repository/<repository_name>/pythonPackages/<python_package>`.
1982    /// For example,
1983    /// "projects/test-project/locations/us-west4/repositories/test-repo/pythonPackages/
1984    /// python_package:1.0.0",
1985    /// where "us-west4" is the registry_location, "test-project" is the
1986    /// project_id, "test-repo" is the repository_name and
1987    /// python_package:1.0.0" is the python package.
1988    pub name: std::string::String,
1989
1990    /// Required. URL to access the package.
1991    /// Example:
1992    /// us-west4-python.pkg.dev/test-project/test-repo/python_package/file-name-1.0.0.tar.gz
1993    pub uri: std::string::String,
1994
1995    /// Package for the artifact.
1996    pub package_name: std::string::String,
1997
1998    /// Version of this package.
1999    pub version: std::string::String,
2000
2001    /// Output only. Time the package was created.
2002    pub create_time: std::option::Option<wkt::Timestamp>,
2003
2004    /// Output only. Time the package was updated.
2005    pub update_time: std::option::Option<wkt::Timestamp>,
2006
2007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2008}
2009
2010impl PythonPackage {
2011    pub fn new() -> Self {
2012        std::default::Default::default()
2013    }
2014
2015    /// Sets the value of [name][crate::model::PythonPackage::name].
2016    ///
2017    /// # Example
2018    /// ```ignore,no_run
2019    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2020    /// let x = PythonPackage::new().set_name("example");
2021    /// ```
2022    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2023        self.name = v.into();
2024        self
2025    }
2026
2027    /// Sets the value of [uri][crate::model::PythonPackage::uri].
2028    ///
2029    /// # Example
2030    /// ```ignore,no_run
2031    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2032    /// let x = PythonPackage::new().set_uri("example");
2033    /// ```
2034    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2035        self.uri = v.into();
2036        self
2037    }
2038
2039    /// Sets the value of [package_name][crate::model::PythonPackage::package_name].
2040    ///
2041    /// # Example
2042    /// ```ignore,no_run
2043    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2044    /// let x = PythonPackage::new().set_package_name("example");
2045    /// ```
2046    pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2047        self.package_name = v.into();
2048        self
2049    }
2050
2051    /// Sets the value of [version][crate::model::PythonPackage::version].
2052    ///
2053    /// # Example
2054    /// ```ignore,no_run
2055    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2056    /// let x = PythonPackage::new().set_version("example");
2057    /// ```
2058    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2059        self.version = v.into();
2060        self
2061    }
2062
2063    /// Sets the value of [create_time][crate::model::PythonPackage::create_time].
2064    ///
2065    /// # Example
2066    /// ```ignore,no_run
2067    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2068    /// use wkt::Timestamp;
2069    /// let x = PythonPackage::new().set_create_time(Timestamp::default()/* use setters */);
2070    /// ```
2071    pub fn set_create_time<T>(mut self, v: T) -> Self
2072    where
2073        T: std::convert::Into<wkt::Timestamp>,
2074    {
2075        self.create_time = std::option::Option::Some(v.into());
2076        self
2077    }
2078
2079    /// Sets or clears the value of [create_time][crate::model::PythonPackage::create_time].
2080    ///
2081    /// # Example
2082    /// ```ignore,no_run
2083    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2084    /// use wkt::Timestamp;
2085    /// let x = PythonPackage::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2086    /// let x = PythonPackage::new().set_or_clear_create_time(None::<Timestamp>);
2087    /// ```
2088    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2089    where
2090        T: std::convert::Into<wkt::Timestamp>,
2091    {
2092        self.create_time = v.map(|x| x.into());
2093        self
2094    }
2095
2096    /// Sets the value of [update_time][crate::model::PythonPackage::update_time].
2097    ///
2098    /// # Example
2099    /// ```ignore,no_run
2100    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2101    /// use wkt::Timestamp;
2102    /// let x = PythonPackage::new().set_update_time(Timestamp::default()/* use setters */);
2103    /// ```
2104    pub fn set_update_time<T>(mut self, v: T) -> Self
2105    where
2106        T: std::convert::Into<wkt::Timestamp>,
2107    {
2108        self.update_time = std::option::Option::Some(v.into());
2109        self
2110    }
2111
2112    /// Sets or clears the value of [update_time][crate::model::PythonPackage::update_time].
2113    ///
2114    /// # Example
2115    /// ```ignore,no_run
2116    /// # use google_cloud_artifactregistry_v1::model::PythonPackage;
2117    /// use wkt::Timestamp;
2118    /// let x = PythonPackage::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2119    /// let x = PythonPackage::new().set_or_clear_update_time(None::<Timestamp>);
2120    /// ```
2121    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2122    where
2123        T: std::convert::Into<wkt::Timestamp>,
2124    {
2125        self.update_time = v.map(|x| x.into());
2126        self
2127    }
2128}
2129
2130impl wkt::message::Message for PythonPackage {
2131    fn typename() -> &'static str {
2132        "type.googleapis.com/google.devtools.artifactregistry.v1.PythonPackage"
2133    }
2134}
2135
2136/// The request to list python packages.
2137#[derive(Clone, Default, PartialEq)]
2138#[non_exhaustive]
2139pub struct ListPythonPackagesRequest {
2140    /// Required. The name of the parent resource whose python packages will be
2141    /// listed.
2142    pub parent: std::string::String,
2143
2144    /// The maximum number of artifacts to return. Maximum page size is 1,000.
2145    pub page_size: i32,
2146
2147    /// The next_page_token value returned from a previous list request, if any.
2148    pub page_token: std::string::String,
2149
2150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2151}
2152
2153impl ListPythonPackagesRequest {
2154    pub fn new() -> Self {
2155        std::default::Default::default()
2156    }
2157
2158    /// Sets the value of [parent][crate::model::ListPythonPackagesRequest::parent].
2159    ///
2160    /// # Example
2161    /// ```ignore,no_run
2162    /// # use google_cloud_artifactregistry_v1::model::ListPythonPackagesRequest;
2163    /// let x = ListPythonPackagesRequest::new().set_parent("example");
2164    /// ```
2165    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166        self.parent = v.into();
2167        self
2168    }
2169
2170    /// Sets the value of [page_size][crate::model::ListPythonPackagesRequest::page_size].
2171    ///
2172    /// # Example
2173    /// ```ignore,no_run
2174    /// # use google_cloud_artifactregistry_v1::model::ListPythonPackagesRequest;
2175    /// let x = ListPythonPackagesRequest::new().set_page_size(42);
2176    /// ```
2177    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2178        self.page_size = v.into();
2179        self
2180    }
2181
2182    /// Sets the value of [page_token][crate::model::ListPythonPackagesRequest::page_token].
2183    ///
2184    /// # Example
2185    /// ```ignore,no_run
2186    /// # use google_cloud_artifactregistry_v1::model::ListPythonPackagesRequest;
2187    /// let x = ListPythonPackagesRequest::new().set_page_token("example");
2188    /// ```
2189    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2190        self.page_token = v.into();
2191        self
2192    }
2193}
2194
2195impl wkt::message::Message for ListPythonPackagesRequest {
2196    fn typename() -> &'static str {
2197        "type.googleapis.com/google.devtools.artifactregistry.v1.ListPythonPackagesRequest"
2198    }
2199}
2200
2201/// The response from listing python packages.
2202#[derive(Clone, Default, PartialEq)]
2203#[non_exhaustive]
2204pub struct ListPythonPackagesResponse {
2205    /// The python packages returned.
2206    pub python_packages: std::vec::Vec<crate::model::PythonPackage>,
2207
2208    /// The token to retrieve the next page of artifacts, or empty if there are no
2209    /// more artifacts to return.
2210    pub next_page_token: std::string::String,
2211
2212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2213}
2214
2215impl ListPythonPackagesResponse {
2216    pub fn new() -> Self {
2217        std::default::Default::default()
2218    }
2219
2220    /// Sets the value of [python_packages][crate::model::ListPythonPackagesResponse::python_packages].
2221    ///
2222    /// # Example
2223    /// ```ignore,no_run
2224    /// # use google_cloud_artifactregistry_v1::model::ListPythonPackagesResponse;
2225    /// use google_cloud_artifactregistry_v1::model::PythonPackage;
2226    /// let x = ListPythonPackagesResponse::new()
2227    ///     .set_python_packages([
2228    ///         PythonPackage::default()/* use setters */,
2229    ///         PythonPackage::default()/* use (different) setters */,
2230    ///     ]);
2231    /// ```
2232    pub fn set_python_packages<T, V>(mut self, v: T) -> Self
2233    where
2234        T: std::iter::IntoIterator<Item = V>,
2235        V: std::convert::Into<crate::model::PythonPackage>,
2236    {
2237        use std::iter::Iterator;
2238        self.python_packages = v.into_iter().map(|i| i.into()).collect();
2239        self
2240    }
2241
2242    /// Sets the value of [next_page_token][crate::model::ListPythonPackagesResponse::next_page_token].
2243    ///
2244    /// # Example
2245    /// ```ignore,no_run
2246    /// # use google_cloud_artifactregistry_v1::model::ListPythonPackagesResponse;
2247    /// let x = ListPythonPackagesResponse::new().set_next_page_token("example");
2248    /// ```
2249    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2250        self.next_page_token = v.into();
2251        self
2252    }
2253}
2254
2255impl wkt::message::Message for ListPythonPackagesResponse {
2256    fn typename() -> &'static str {
2257        "type.googleapis.com/google.devtools.artifactregistry.v1.ListPythonPackagesResponse"
2258    }
2259}
2260
2261#[doc(hidden)]
2262impl google_cloud_gax::paginator::internal::PageableResponse for ListPythonPackagesResponse {
2263    type PageItem = crate::model::PythonPackage;
2264
2265    fn items(self) -> std::vec::Vec<Self::PageItem> {
2266        self.python_packages
2267    }
2268
2269    fn next_page_token(&self) -> std::string::String {
2270        use std::clone::Clone;
2271        self.next_page_token.clone()
2272    }
2273}
2274
2275/// The request to get python packages.
2276#[derive(Clone, Default, PartialEq)]
2277#[non_exhaustive]
2278pub struct GetPythonPackageRequest {
2279    /// Required. The name of the python package.
2280    pub name: std::string::String,
2281
2282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2283}
2284
2285impl GetPythonPackageRequest {
2286    pub fn new() -> Self {
2287        std::default::Default::default()
2288    }
2289
2290    /// Sets the value of [name][crate::model::GetPythonPackageRequest::name].
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_artifactregistry_v1::model::GetPythonPackageRequest;
2295    /// let x = GetPythonPackageRequest::new().set_name("example");
2296    /// ```
2297    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298        self.name = v.into();
2299        self
2300    }
2301}
2302
2303impl wkt::message::Message for GetPythonPackageRequest {
2304    fn typename() -> &'static str {
2305        "type.googleapis.com/google.devtools.artifactregistry.v1.GetPythonPackageRequest"
2306    }
2307}
2308
2309/// An Attachment refers to additional metadata that can be attached to
2310/// artifacts in Artifact Registry. An attachment consists of one or more files.
2311#[derive(Clone, Default, PartialEq)]
2312#[non_exhaustive]
2313pub struct Attachment {
2314    /// The name of the attachment. E.g.
2315    /// `projects/p1/locations/us/repositories/repo/attachments/sbom`.
2316    pub name: std::string::String,
2317
2318    /// Required. The target the attachment is for, can be a Version, Package or
2319    /// Repository. E.g.
2320    /// `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
2321    pub target: std::string::String,
2322
2323    /// Type of attachment.
2324    /// E.g. `application/vnd.spdx+json`
2325    pub r#type: std::string::String,
2326
2327    /// The namespace this attachment belongs to.
2328    /// E.g. If an attachment is created by artifact analysis, namespace is set
2329    /// to `artifactanalysis.googleapis.com`.
2330    pub attachment_namespace: std::string::String,
2331
2332    /// Optional. User annotations. These attributes can only be set and used by
2333    /// the user, and not by Artifact Registry. See
2334    /// <https://google.aip.dev/128#annotations> for more details such as format and
2335    /// size limitations.
2336    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2337
2338    /// Output only. The time when the attachment was created.
2339    pub create_time: std::option::Option<wkt::Timestamp>,
2340
2341    /// Output only. The time when the attachment was last updated.
2342    pub update_time: std::option::Option<wkt::Timestamp>,
2343
2344    /// Required. The files that belong to this attachment.
2345    /// If the file ID part contains slashes, they are escaped. E.g.
2346    /// `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.
2347    pub files: std::vec::Vec<std::string::String>,
2348
2349    /// Output only. The name of the OCI version that this attachment created. Only
2350    /// populated for Docker attachments. E.g.
2351    /// `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
2352    pub oci_version_name: std::string::String,
2353
2354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2355}
2356
2357impl Attachment {
2358    pub fn new() -> Self {
2359        std::default::Default::default()
2360    }
2361
2362    /// Sets the value of [name][crate::model::Attachment::name].
2363    ///
2364    /// # Example
2365    /// ```ignore,no_run
2366    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2367    /// let x = Attachment::new().set_name("example");
2368    /// ```
2369    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2370        self.name = v.into();
2371        self
2372    }
2373
2374    /// Sets the value of [target][crate::model::Attachment::target].
2375    ///
2376    /// # Example
2377    /// ```ignore,no_run
2378    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2379    /// let x = Attachment::new().set_target("example");
2380    /// ```
2381    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2382        self.target = v.into();
2383        self
2384    }
2385
2386    /// Sets the value of [r#type][crate::model::Attachment::type].
2387    ///
2388    /// # Example
2389    /// ```ignore,no_run
2390    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2391    /// let x = Attachment::new().set_type("example");
2392    /// ```
2393    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2394        self.r#type = v.into();
2395        self
2396    }
2397
2398    /// Sets the value of [attachment_namespace][crate::model::Attachment::attachment_namespace].
2399    ///
2400    /// # Example
2401    /// ```ignore,no_run
2402    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2403    /// let x = Attachment::new().set_attachment_namespace("example");
2404    /// ```
2405    pub fn set_attachment_namespace<T: std::convert::Into<std::string::String>>(
2406        mut self,
2407        v: T,
2408    ) -> Self {
2409        self.attachment_namespace = v.into();
2410        self
2411    }
2412
2413    /// Sets the value of [annotations][crate::model::Attachment::annotations].
2414    ///
2415    /// # Example
2416    /// ```ignore,no_run
2417    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2418    /// let x = Attachment::new().set_annotations([
2419    ///     ("key0", "abc"),
2420    ///     ("key1", "xyz"),
2421    /// ]);
2422    /// ```
2423    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2424    where
2425        T: std::iter::IntoIterator<Item = (K, V)>,
2426        K: std::convert::Into<std::string::String>,
2427        V: std::convert::Into<std::string::String>,
2428    {
2429        use std::iter::Iterator;
2430        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2431        self
2432    }
2433
2434    /// Sets the value of [create_time][crate::model::Attachment::create_time].
2435    ///
2436    /// # Example
2437    /// ```ignore,no_run
2438    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2439    /// use wkt::Timestamp;
2440    /// let x = Attachment::new().set_create_time(Timestamp::default()/* use setters */);
2441    /// ```
2442    pub fn set_create_time<T>(mut self, v: T) -> Self
2443    where
2444        T: std::convert::Into<wkt::Timestamp>,
2445    {
2446        self.create_time = std::option::Option::Some(v.into());
2447        self
2448    }
2449
2450    /// Sets or clears the value of [create_time][crate::model::Attachment::create_time].
2451    ///
2452    /// # Example
2453    /// ```ignore,no_run
2454    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2455    /// use wkt::Timestamp;
2456    /// let x = Attachment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2457    /// let x = Attachment::new().set_or_clear_create_time(None::<Timestamp>);
2458    /// ```
2459    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2460    where
2461        T: std::convert::Into<wkt::Timestamp>,
2462    {
2463        self.create_time = v.map(|x| x.into());
2464        self
2465    }
2466
2467    /// Sets the value of [update_time][crate::model::Attachment::update_time].
2468    ///
2469    /// # Example
2470    /// ```ignore,no_run
2471    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2472    /// use wkt::Timestamp;
2473    /// let x = Attachment::new().set_update_time(Timestamp::default()/* use setters */);
2474    /// ```
2475    pub fn set_update_time<T>(mut self, v: T) -> Self
2476    where
2477        T: std::convert::Into<wkt::Timestamp>,
2478    {
2479        self.update_time = std::option::Option::Some(v.into());
2480        self
2481    }
2482
2483    /// Sets or clears the value of [update_time][crate::model::Attachment::update_time].
2484    ///
2485    /// # Example
2486    /// ```ignore,no_run
2487    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2488    /// use wkt::Timestamp;
2489    /// let x = Attachment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2490    /// let x = Attachment::new().set_or_clear_update_time(None::<Timestamp>);
2491    /// ```
2492    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2493    where
2494        T: std::convert::Into<wkt::Timestamp>,
2495    {
2496        self.update_time = v.map(|x| x.into());
2497        self
2498    }
2499
2500    /// Sets the value of [files][crate::model::Attachment::files].
2501    ///
2502    /// # Example
2503    /// ```ignore,no_run
2504    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2505    /// let x = Attachment::new().set_files(["a", "b", "c"]);
2506    /// ```
2507    pub fn set_files<T, V>(mut self, v: T) -> Self
2508    where
2509        T: std::iter::IntoIterator<Item = V>,
2510        V: std::convert::Into<std::string::String>,
2511    {
2512        use std::iter::Iterator;
2513        self.files = v.into_iter().map(|i| i.into()).collect();
2514        self
2515    }
2516
2517    /// Sets the value of [oci_version_name][crate::model::Attachment::oci_version_name].
2518    ///
2519    /// # Example
2520    /// ```ignore,no_run
2521    /// # use google_cloud_artifactregistry_v1::model::Attachment;
2522    /// let x = Attachment::new().set_oci_version_name("example");
2523    /// ```
2524    pub fn set_oci_version_name<T: std::convert::Into<std::string::String>>(
2525        mut self,
2526        v: T,
2527    ) -> Self {
2528        self.oci_version_name = v.into();
2529        self
2530    }
2531}
2532
2533impl wkt::message::Message for Attachment {
2534    fn typename() -> &'static str {
2535        "type.googleapis.com/google.devtools.artifactregistry.v1.Attachment"
2536    }
2537}
2538
2539/// The request to list attachments.
2540#[derive(Clone, Default, PartialEq)]
2541#[non_exhaustive]
2542pub struct ListAttachmentsRequest {
2543    /// Required. The name of the parent resource whose attachments will be listed.
2544    pub parent: std::string::String,
2545
2546    /// Optional. An expression for filtering the results of the request. Filter
2547    /// rules are case insensitive. The fields eligible for filtering are:
2548    ///
2549    /// * `target`
2550    /// * `type`
2551    /// * `attachment_namespace`
2552    pub filter: std::string::String,
2553
2554    /// The maximum number of attachments to return. Maximum page size is 1,000.
2555    pub page_size: i32,
2556
2557    /// The next_page_token value returned from a previous list request, if any.
2558    pub page_token: std::string::String,
2559
2560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2561}
2562
2563impl ListAttachmentsRequest {
2564    pub fn new() -> Self {
2565        std::default::Default::default()
2566    }
2567
2568    /// Sets the value of [parent][crate::model::ListAttachmentsRequest::parent].
2569    ///
2570    /// # Example
2571    /// ```ignore,no_run
2572    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsRequest;
2573    /// let x = ListAttachmentsRequest::new().set_parent("example");
2574    /// ```
2575    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2576        self.parent = v.into();
2577        self
2578    }
2579
2580    /// Sets the value of [filter][crate::model::ListAttachmentsRequest::filter].
2581    ///
2582    /// # Example
2583    /// ```ignore,no_run
2584    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsRequest;
2585    /// let x = ListAttachmentsRequest::new().set_filter("example");
2586    /// ```
2587    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2588        self.filter = v.into();
2589        self
2590    }
2591
2592    /// Sets the value of [page_size][crate::model::ListAttachmentsRequest::page_size].
2593    ///
2594    /// # Example
2595    /// ```ignore,no_run
2596    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsRequest;
2597    /// let x = ListAttachmentsRequest::new().set_page_size(42);
2598    /// ```
2599    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2600        self.page_size = v.into();
2601        self
2602    }
2603
2604    /// Sets the value of [page_token][crate::model::ListAttachmentsRequest::page_token].
2605    ///
2606    /// # Example
2607    /// ```ignore,no_run
2608    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsRequest;
2609    /// let x = ListAttachmentsRequest::new().set_page_token("example");
2610    /// ```
2611    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612        self.page_token = v.into();
2613        self
2614    }
2615}
2616
2617impl wkt::message::Message for ListAttachmentsRequest {
2618    fn typename() -> &'static str {
2619        "type.googleapis.com/google.devtools.artifactregistry.v1.ListAttachmentsRequest"
2620    }
2621}
2622
2623/// The response from listing attachments.
2624#[derive(Clone, Default, PartialEq)]
2625#[non_exhaustive]
2626pub struct ListAttachmentsResponse {
2627    /// The attachments returned.
2628    pub attachments: std::vec::Vec<crate::model::Attachment>,
2629
2630    /// The token to retrieve the next page of attachments, or empty if there are
2631    /// no more attachments to return.
2632    pub next_page_token: std::string::String,
2633
2634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2635}
2636
2637impl ListAttachmentsResponse {
2638    pub fn new() -> Self {
2639        std::default::Default::default()
2640    }
2641
2642    /// Sets the value of [attachments][crate::model::ListAttachmentsResponse::attachments].
2643    ///
2644    /// # Example
2645    /// ```ignore,no_run
2646    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsResponse;
2647    /// use google_cloud_artifactregistry_v1::model::Attachment;
2648    /// let x = ListAttachmentsResponse::new()
2649    ///     .set_attachments([
2650    ///         Attachment::default()/* use setters */,
2651    ///         Attachment::default()/* use (different) setters */,
2652    ///     ]);
2653    /// ```
2654    pub fn set_attachments<T, V>(mut self, v: T) -> Self
2655    where
2656        T: std::iter::IntoIterator<Item = V>,
2657        V: std::convert::Into<crate::model::Attachment>,
2658    {
2659        use std::iter::Iterator;
2660        self.attachments = v.into_iter().map(|i| i.into()).collect();
2661        self
2662    }
2663
2664    /// Sets the value of [next_page_token][crate::model::ListAttachmentsResponse::next_page_token].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_artifactregistry_v1::model::ListAttachmentsResponse;
2669    /// let x = ListAttachmentsResponse::new().set_next_page_token("example");
2670    /// ```
2671    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2672        self.next_page_token = v.into();
2673        self
2674    }
2675}
2676
2677impl wkt::message::Message for ListAttachmentsResponse {
2678    fn typename() -> &'static str {
2679        "type.googleapis.com/google.devtools.artifactregistry.v1.ListAttachmentsResponse"
2680    }
2681}
2682
2683#[doc(hidden)]
2684impl google_cloud_gax::paginator::internal::PageableResponse for ListAttachmentsResponse {
2685    type PageItem = crate::model::Attachment;
2686
2687    fn items(self) -> std::vec::Vec<Self::PageItem> {
2688        self.attachments
2689    }
2690
2691    fn next_page_token(&self) -> std::string::String {
2692        use std::clone::Clone;
2693        self.next_page_token.clone()
2694    }
2695}
2696
2697/// The request to retrieve an attachment.
2698#[derive(Clone, Default, PartialEq)]
2699#[non_exhaustive]
2700pub struct GetAttachmentRequest {
2701    /// Required. The name of the attachment to retrieve.
2702    pub name: std::string::String,
2703
2704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2705}
2706
2707impl GetAttachmentRequest {
2708    pub fn new() -> Self {
2709        std::default::Default::default()
2710    }
2711
2712    /// Sets the value of [name][crate::model::GetAttachmentRequest::name].
2713    ///
2714    /// # Example
2715    /// ```ignore,no_run
2716    /// # use google_cloud_artifactregistry_v1::model::GetAttachmentRequest;
2717    /// let x = GetAttachmentRequest::new().set_name("example");
2718    /// ```
2719    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2720        self.name = v.into();
2721        self
2722    }
2723}
2724
2725impl wkt::message::Message for GetAttachmentRequest {
2726    fn typename() -> &'static str {
2727        "type.googleapis.com/google.devtools.artifactregistry.v1.GetAttachmentRequest"
2728    }
2729}
2730
2731/// The request to create a new attachment.
2732#[derive(Clone, Default, PartialEq)]
2733#[non_exhaustive]
2734pub struct CreateAttachmentRequest {
2735    /// Required. The name of the parent resource where the attachment will be
2736    /// created.
2737    pub parent: std::string::String,
2738
2739    /// Required. The attachment id to use for this attachment.
2740    pub attachment_id: std::string::String,
2741
2742    /// Required. The attachment to be created.
2743    pub attachment: std::option::Option<crate::model::Attachment>,
2744
2745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2746}
2747
2748impl CreateAttachmentRequest {
2749    pub fn new() -> Self {
2750        std::default::Default::default()
2751    }
2752
2753    /// Sets the value of [parent][crate::model::CreateAttachmentRequest::parent].
2754    ///
2755    /// # Example
2756    /// ```ignore,no_run
2757    /// # use google_cloud_artifactregistry_v1::model::CreateAttachmentRequest;
2758    /// let x = CreateAttachmentRequest::new().set_parent("example");
2759    /// ```
2760    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2761        self.parent = v.into();
2762        self
2763    }
2764
2765    /// Sets the value of [attachment_id][crate::model::CreateAttachmentRequest::attachment_id].
2766    ///
2767    /// # Example
2768    /// ```ignore,no_run
2769    /// # use google_cloud_artifactregistry_v1::model::CreateAttachmentRequest;
2770    /// let x = CreateAttachmentRequest::new().set_attachment_id("example");
2771    /// ```
2772    pub fn set_attachment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2773        self.attachment_id = v.into();
2774        self
2775    }
2776
2777    /// Sets the value of [attachment][crate::model::CreateAttachmentRequest::attachment].
2778    ///
2779    /// # Example
2780    /// ```ignore,no_run
2781    /// # use google_cloud_artifactregistry_v1::model::CreateAttachmentRequest;
2782    /// use google_cloud_artifactregistry_v1::model::Attachment;
2783    /// let x = CreateAttachmentRequest::new().set_attachment(Attachment::default()/* use setters */);
2784    /// ```
2785    pub fn set_attachment<T>(mut self, v: T) -> Self
2786    where
2787        T: std::convert::Into<crate::model::Attachment>,
2788    {
2789        self.attachment = std::option::Option::Some(v.into());
2790        self
2791    }
2792
2793    /// Sets or clears the value of [attachment][crate::model::CreateAttachmentRequest::attachment].
2794    ///
2795    /// # Example
2796    /// ```ignore,no_run
2797    /// # use google_cloud_artifactregistry_v1::model::CreateAttachmentRequest;
2798    /// use google_cloud_artifactregistry_v1::model::Attachment;
2799    /// let x = CreateAttachmentRequest::new().set_or_clear_attachment(Some(Attachment::default()/* use setters */));
2800    /// let x = CreateAttachmentRequest::new().set_or_clear_attachment(None::<Attachment>);
2801    /// ```
2802    pub fn set_or_clear_attachment<T>(mut self, v: std::option::Option<T>) -> Self
2803    where
2804        T: std::convert::Into<crate::model::Attachment>,
2805    {
2806        self.attachment = v.map(|x| x.into());
2807        self
2808    }
2809}
2810
2811impl wkt::message::Message for CreateAttachmentRequest {
2812    fn typename() -> &'static str {
2813        "type.googleapis.com/google.devtools.artifactregistry.v1.CreateAttachmentRequest"
2814    }
2815}
2816
2817/// The request to delete an attachment.
2818#[derive(Clone, Default, PartialEq)]
2819#[non_exhaustive]
2820pub struct DeleteAttachmentRequest {
2821    /// Required. The name of the attachment to delete.
2822    pub name: std::string::String,
2823
2824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2825}
2826
2827impl DeleteAttachmentRequest {
2828    pub fn new() -> Self {
2829        std::default::Default::default()
2830    }
2831
2832    /// Sets the value of [name][crate::model::DeleteAttachmentRequest::name].
2833    ///
2834    /// # Example
2835    /// ```ignore,no_run
2836    /// # use google_cloud_artifactregistry_v1::model::DeleteAttachmentRequest;
2837    /// let x = DeleteAttachmentRequest::new().set_name("example");
2838    /// ```
2839    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2840        self.name = v.into();
2841        self
2842    }
2843}
2844
2845impl wkt::message::Message for DeleteAttachmentRequest {
2846    fn typename() -> &'static str {
2847        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteAttachmentRequest"
2848    }
2849}
2850
2851/// The request for exporting an artifact to a destination.
2852#[derive(Clone, Default, PartialEq)]
2853#[non_exhaustive]
2854pub struct ExportArtifactRequest {
2855    /// Required. The repository of the artifact to export.
2856    /// Format: projects/{project}/locations/{location}/repositories/{repository}
2857    pub repository: std::string::String,
2858
2859    /// The artifact to be exported.
2860    pub source_artifact: std::option::Option<crate::model::export_artifact_request::SourceArtifact>,
2861
2862    /// The destination to export the artifact to.
2863    pub destination: std::option::Option<crate::model::export_artifact_request::Destination>,
2864
2865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2866}
2867
2868impl ExportArtifactRequest {
2869    pub fn new() -> Self {
2870        std::default::Default::default()
2871    }
2872
2873    /// Sets the value of [repository][crate::model::ExportArtifactRequest::repository].
2874    ///
2875    /// # Example
2876    /// ```ignore,no_run
2877    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
2878    /// let x = ExportArtifactRequest::new().set_repository("example");
2879    /// ```
2880    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2881        self.repository = v.into();
2882        self
2883    }
2884
2885    /// Sets the value of [source_artifact][crate::model::ExportArtifactRequest::source_artifact].
2886    ///
2887    /// Note that all the setters affecting `source_artifact` are mutually
2888    /// exclusive.
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
2893    /// use google_cloud_artifactregistry_v1::model::export_artifact_request::SourceArtifact;
2894    /// let x = ExportArtifactRequest::new().set_source_artifact(Some(SourceArtifact::SourceVersion("example".to_string())));
2895    /// ```
2896    pub fn set_source_artifact<
2897        T: std::convert::Into<
2898                std::option::Option<crate::model::export_artifact_request::SourceArtifact>,
2899            >,
2900    >(
2901        mut self,
2902        v: T,
2903    ) -> Self {
2904        self.source_artifact = v.into();
2905        self
2906    }
2907
2908    /// The value of [source_artifact][crate::model::ExportArtifactRequest::source_artifact]
2909    /// if it holds a `SourceVersion`, `None` if the field is not set or
2910    /// holds a different branch.
2911    pub fn source_version(&self) -> std::option::Option<&std::string::String> {
2912        #[allow(unreachable_patterns)]
2913        self.source_artifact.as_ref().and_then(|v| match v {
2914            crate::model::export_artifact_request::SourceArtifact::SourceVersion(v) => {
2915                std::option::Option::Some(v)
2916            }
2917            _ => std::option::Option::None,
2918        })
2919    }
2920
2921    /// Sets the value of [source_artifact][crate::model::ExportArtifactRequest::source_artifact]
2922    /// to hold a `SourceVersion`.
2923    ///
2924    /// Note that all the setters affecting `source_artifact` are
2925    /// mutually exclusive.
2926    ///
2927    /// # Example
2928    /// ```ignore,no_run
2929    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
2930    /// let x = ExportArtifactRequest::new().set_source_version("example");
2931    /// assert!(x.source_version().is_some());
2932    /// assert!(x.source_tag().is_none());
2933    /// ```
2934    pub fn set_source_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2935        self.source_artifact = std::option::Option::Some(
2936            crate::model::export_artifact_request::SourceArtifact::SourceVersion(v.into()),
2937        );
2938        self
2939    }
2940
2941    /// The value of [source_artifact][crate::model::ExportArtifactRequest::source_artifact]
2942    /// if it holds a `SourceTag`, `None` if the field is not set or
2943    /// holds a different branch.
2944    pub fn source_tag(&self) -> std::option::Option<&std::string::String> {
2945        #[allow(unreachable_patterns)]
2946        self.source_artifact.as_ref().and_then(|v| match v {
2947            crate::model::export_artifact_request::SourceArtifact::SourceTag(v) => {
2948                std::option::Option::Some(v)
2949            }
2950            _ => std::option::Option::None,
2951        })
2952    }
2953
2954    /// Sets the value of [source_artifact][crate::model::ExportArtifactRequest::source_artifact]
2955    /// to hold a `SourceTag`.
2956    ///
2957    /// Note that all the setters affecting `source_artifact` are
2958    /// mutually exclusive.
2959    ///
2960    /// # Example
2961    /// ```ignore,no_run
2962    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
2963    /// let x = ExportArtifactRequest::new().set_source_tag("example");
2964    /// assert!(x.source_tag().is_some());
2965    /// assert!(x.source_version().is_none());
2966    /// ```
2967    pub fn set_source_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2968        self.source_artifact = std::option::Option::Some(
2969            crate::model::export_artifact_request::SourceArtifact::SourceTag(v.into()),
2970        );
2971        self
2972    }
2973
2974    /// Sets the value of [destination][crate::model::ExportArtifactRequest::destination].
2975    ///
2976    /// Note that all the setters affecting `destination` are mutually
2977    /// exclusive.
2978    ///
2979    /// # Example
2980    /// ```ignore,no_run
2981    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
2982    /// use google_cloud_artifactregistry_v1::model::export_artifact_request::Destination;
2983    /// let x = ExportArtifactRequest::new().set_destination(Some(Destination::GcsPath("example".to_string())));
2984    /// ```
2985    pub fn set_destination<
2986        T: std::convert::Into<std::option::Option<crate::model::export_artifact_request::Destination>>,
2987    >(
2988        mut self,
2989        v: T,
2990    ) -> Self {
2991        self.destination = v.into();
2992        self
2993    }
2994
2995    /// The value of [destination][crate::model::ExportArtifactRequest::destination]
2996    /// if it holds a `GcsPath`, `None` if the field is not set or
2997    /// holds a different branch.
2998    pub fn gcs_path(&self) -> std::option::Option<&std::string::String> {
2999        #[allow(unreachable_patterns)]
3000        self.destination.as_ref().and_then(|v| match v {
3001            crate::model::export_artifact_request::Destination::GcsPath(v) => {
3002                std::option::Option::Some(v)
3003            }
3004            _ => std::option::Option::None,
3005        })
3006    }
3007
3008    /// Sets the value of [destination][crate::model::ExportArtifactRequest::destination]
3009    /// to hold a `GcsPath`.
3010    ///
3011    /// Note that all the setters affecting `destination` are
3012    /// mutually exclusive.
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactRequest;
3017    /// let x = ExportArtifactRequest::new().set_gcs_path("example");
3018    /// assert!(x.gcs_path().is_some());
3019    /// ```
3020    pub fn set_gcs_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3021        self.destination = std::option::Option::Some(
3022            crate::model::export_artifact_request::Destination::GcsPath(v.into()),
3023        );
3024        self
3025    }
3026}
3027
3028impl wkt::message::Message for ExportArtifactRequest {
3029    fn typename() -> &'static str {
3030        "type.googleapis.com/google.devtools.artifactregistry.v1.ExportArtifactRequest"
3031    }
3032}
3033
3034/// Defines additional types related to [ExportArtifactRequest].
3035pub mod export_artifact_request {
3036    #[allow(unused_imports)]
3037    use super::*;
3038
3039    /// The artifact to be exported.
3040    #[derive(Clone, Debug, PartialEq)]
3041    #[non_exhaustive]
3042    pub enum SourceArtifact {
3043        /// The artifact version to export.
3044        /// Format:
3045        /// projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}
3046        SourceVersion(std::string::String),
3047        /// The artifact tag to export.
3048        /// Format:projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}
3049        SourceTag(std::string::String),
3050    }
3051
3052    /// The destination to export the artifact to.
3053    #[derive(Clone, Debug, PartialEq)]
3054    #[non_exhaustive]
3055    pub enum Destination {
3056        /// The Cloud Storage path to export the artifact to. Should start with the
3057        /// bucket name, and optionally have a directory path. Examples:
3058        /// `dst_bucket`, `dst_bucket/sub_dir`.
3059        /// Existing objects with the same path will be overwritten.
3060        GcsPath(std::string::String),
3061    }
3062}
3063
3064/// The response for exporting an artifact to a destination.
3065#[derive(Clone, Default, PartialEq)]
3066#[non_exhaustive]
3067pub struct ExportArtifactResponse {
3068    /// The exported version. Should be the same as the request version with
3069    /// fingerprint resource name.
3070    pub exported_version: std::option::Option<crate::model::Version>,
3071
3072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3073}
3074
3075impl ExportArtifactResponse {
3076    pub fn new() -> Self {
3077        std::default::Default::default()
3078    }
3079
3080    /// Sets the value of [exported_version][crate::model::ExportArtifactResponse::exported_version].
3081    ///
3082    /// # Example
3083    /// ```ignore,no_run
3084    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactResponse;
3085    /// use google_cloud_artifactregistry_v1::model::Version;
3086    /// let x = ExportArtifactResponse::new().set_exported_version(Version::default()/* use setters */);
3087    /// ```
3088    pub fn set_exported_version<T>(mut self, v: T) -> Self
3089    where
3090        T: std::convert::Into<crate::model::Version>,
3091    {
3092        self.exported_version = std::option::Option::Some(v.into());
3093        self
3094    }
3095
3096    /// Sets or clears the value of [exported_version][crate::model::ExportArtifactResponse::exported_version].
3097    ///
3098    /// # Example
3099    /// ```ignore,no_run
3100    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactResponse;
3101    /// use google_cloud_artifactregistry_v1::model::Version;
3102    /// let x = ExportArtifactResponse::new().set_or_clear_exported_version(Some(Version::default()/* use setters */));
3103    /// let x = ExportArtifactResponse::new().set_or_clear_exported_version(None::<Version>);
3104    /// ```
3105    pub fn set_or_clear_exported_version<T>(mut self, v: std::option::Option<T>) -> Self
3106    where
3107        T: std::convert::Into<crate::model::Version>,
3108    {
3109        self.exported_version = v.map(|x| x.into());
3110        self
3111    }
3112}
3113
3114impl wkt::message::Message for ExportArtifactResponse {
3115    fn typename() -> &'static str {
3116        "type.googleapis.com/google.devtools.artifactregistry.v1.ExportArtifactResponse"
3117    }
3118}
3119
3120/// The LRO metadata for exporting an artifact.
3121#[derive(Clone, Default, PartialEq)]
3122#[non_exhaustive]
3123pub struct ExportArtifactMetadata {
3124    /// The exported artifact files.
3125    pub exported_files: std::vec::Vec<crate::model::export_artifact_metadata::ExportedFile>,
3126
3127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3128}
3129
3130impl ExportArtifactMetadata {
3131    pub fn new() -> Self {
3132        std::default::Default::default()
3133    }
3134
3135    /// Sets the value of [exported_files][crate::model::ExportArtifactMetadata::exported_files].
3136    ///
3137    /// # Example
3138    /// ```ignore,no_run
3139    /// # use google_cloud_artifactregistry_v1::model::ExportArtifactMetadata;
3140    /// use google_cloud_artifactregistry_v1::model::export_artifact_metadata::ExportedFile;
3141    /// let x = ExportArtifactMetadata::new()
3142    ///     .set_exported_files([
3143    ///         ExportedFile::default()/* use setters */,
3144    ///         ExportedFile::default()/* use (different) setters */,
3145    ///     ]);
3146    /// ```
3147    pub fn set_exported_files<T, V>(mut self, v: T) -> Self
3148    where
3149        T: std::iter::IntoIterator<Item = V>,
3150        V: std::convert::Into<crate::model::export_artifact_metadata::ExportedFile>,
3151    {
3152        use std::iter::Iterator;
3153        self.exported_files = v.into_iter().map(|i| i.into()).collect();
3154        self
3155    }
3156}
3157
3158impl wkt::message::Message for ExportArtifactMetadata {
3159    fn typename() -> &'static str {
3160        "type.googleapis.com/google.devtools.artifactregistry.v1.ExportArtifactMetadata"
3161    }
3162}
3163
3164/// Defines additional types related to [ExportArtifactMetadata].
3165pub mod export_artifact_metadata {
3166    #[allow(unused_imports)]
3167    use super::*;
3168
3169    /// The exported artifact file.
3170    #[derive(Clone, Default, PartialEq)]
3171    #[non_exhaustive]
3172    pub struct ExportedFile {
3173        /// Name of the exported artifact file.
3174        /// Format: `projects/p1/locations/us/repositories/repo1/files/file1`
3175        pub name: std::string::String,
3176
3177        /// The hashes of the file content.
3178        pub hashes: std::vec::Vec<crate::model::Hash>,
3179
3180        /// The destination the file was exported to.
3181        pub destination:
3182            std::option::Option<crate::model::export_artifact_metadata::exported_file::Destination>,
3183
3184        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3185    }
3186
3187    impl ExportedFile {
3188        pub fn new() -> Self {
3189            std::default::Default::default()
3190        }
3191
3192        /// Sets the value of [name][crate::model::export_artifact_metadata::ExportedFile::name].
3193        ///
3194        /// # Example
3195        /// ```ignore,no_run
3196        /// # use google_cloud_artifactregistry_v1::model::export_artifact_metadata::ExportedFile;
3197        /// let x = ExportedFile::new().set_name("example");
3198        /// ```
3199        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3200            self.name = v.into();
3201            self
3202        }
3203
3204        /// Sets the value of [hashes][crate::model::export_artifact_metadata::ExportedFile::hashes].
3205        ///
3206        /// # Example
3207        /// ```ignore,no_run
3208        /// # use google_cloud_artifactregistry_v1::model::export_artifact_metadata::ExportedFile;
3209        /// use google_cloud_artifactregistry_v1::model::Hash;
3210        /// let x = ExportedFile::new()
3211        ///     .set_hashes([
3212        ///         Hash::default()/* use setters */,
3213        ///         Hash::default()/* use (different) setters */,
3214        ///     ]);
3215        /// ```
3216        pub fn set_hashes<T, V>(mut self, v: T) -> Self
3217        where
3218            T: std::iter::IntoIterator<Item = V>,
3219            V: std::convert::Into<crate::model::Hash>,
3220        {
3221            use std::iter::Iterator;
3222            self.hashes = v.into_iter().map(|i| i.into()).collect();
3223            self
3224        }
3225
3226        /// Sets the value of [destination][crate::model::export_artifact_metadata::ExportedFile::destination].
3227        ///
3228        /// Note that all the setters affecting `destination` are mutually
3229        /// exclusive.
3230        ///
3231        /// # Example
3232        /// ```ignore,no_run
3233        /// # use google_cloud_artifactregistry_v1::model::export_artifact_metadata::ExportedFile;
3234        /// use google_cloud_artifactregistry_v1::model::export_artifact_metadata::exported_file::Destination;
3235        /// let x = ExportedFile::new().set_destination(Some(Destination::GcsObjectPath("example".to_string())));
3236        /// ```
3237        pub fn set_destination<
3238            T: std::convert::Into<
3239                    std::option::Option<
3240                        crate::model::export_artifact_metadata::exported_file::Destination,
3241                    >,
3242                >,
3243        >(
3244            mut self,
3245            v: T,
3246        ) -> Self {
3247            self.destination = v.into();
3248            self
3249        }
3250
3251        /// The value of [destination][crate::model::export_artifact_metadata::ExportedFile::destination]
3252        /// if it holds a `GcsObjectPath`, `None` if the field is not set or
3253        /// holds a different branch.
3254        pub fn gcs_object_path(&self) -> std::option::Option<&std::string::String> {
3255            #[allow(unreachable_patterns)]
3256            self.destination.as_ref().and_then(|v| match v {
3257                crate::model::export_artifact_metadata::exported_file::Destination::GcsObjectPath(v) => std::option::Option::Some(v),
3258                _ => std::option::Option::None,
3259            })
3260        }
3261
3262        /// Sets the value of [destination][crate::model::export_artifact_metadata::ExportedFile::destination]
3263        /// to hold a `GcsObjectPath`.
3264        ///
3265        /// Note that all the setters affecting `destination` are
3266        /// mutually exclusive.
3267        ///
3268        /// # Example
3269        /// ```ignore,no_run
3270        /// # use google_cloud_artifactregistry_v1::model::export_artifact_metadata::ExportedFile;
3271        /// let x = ExportedFile::new().set_gcs_object_path("example");
3272        /// assert!(x.gcs_object_path().is_some());
3273        /// ```
3274        pub fn set_gcs_object_path<T: std::convert::Into<std::string::String>>(
3275            mut self,
3276            v: T,
3277        ) -> Self {
3278            self.destination = std::option::Option::Some(
3279                crate::model::export_artifact_metadata::exported_file::Destination::GcsObjectPath(
3280                    v.into(),
3281                ),
3282            );
3283            self
3284        }
3285    }
3286
3287    impl wkt::message::Message for ExportedFile {
3288        fn typename() -> &'static str {
3289            "type.googleapis.com/google.devtools.artifactregistry.v1.ExportArtifactMetadata.ExportedFile"
3290        }
3291    }
3292
3293    /// Defines additional types related to [ExportedFile].
3294    pub mod exported_file {
3295        #[allow(unused_imports)]
3296        use super::*;
3297
3298        /// The destination the file was exported to.
3299        #[derive(Clone, Debug, PartialEq)]
3300        #[non_exhaustive]
3301        pub enum Destination {
3302            /// Cloud Storage Object path of the exported file. Examples:
3303            /// `dst_bucket/file1`, `dst_bucket/sub_dir/file1`
3304            GcsObjectPath(std::string::String),
3305        }
3306    }
3307}
3308
3309/// A hash of file content.
3310#[derive(Clone, Default, PartialEq)]
3311#[non_exhaustive]
3312pub struct Hash {
3313    /// The algorithm used to compute the hash value.
3314    pub r#type: crate::model::hash::HashType,
3315
3316    /// The hash value.
3317    pub value: ::bytes::Bytes,
3318
3319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3320}
3321
3322impl Hash {
3323    pub fn new() -> Self {
3324        std::default::Default::default()
3325    }
3326
3327    /// Sets the value of [r#type][crate::model::Hash::type].
3328    ///
3329    /// # Example
3330    /// ```ignore,no_run
3331    /// # use google_cloud_artifactregistry_v1::model::Hash;
3332    /// use google_cloud_artifactregistry_v1::model::hash::HashType;
3333    /// let x0 = Hash::new().set_type(HashType::Sha256);
3334    /// let x1 = Hash::new().set_type(HashType::Md5);
3335    /// let x2 = Hash::new().set_type(HashType::DirsumSha256);
3336    /// ```
3337    pub fn set_type<T: std::convert::Into<crate::model::hash::HashType>>(mut self, v: T) -> Self {
3338        self.r#type = v.into();
3339        self
3340    }
3341
3342    /// Sets the value of [value][crate::model::Hash::value].
3343    ///
3344    /// # Example
3345    /// ```ignore,no_run
3346    /// # use google_cloud_artifactregistry_v1::model::Hash;
3347    /// let x = Hash::new().set_value(bytes::Bytes::from_static(b"example"));
3348    /// ```
3349    pub fn set_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
3350        self.value = v.into();
3351        self
3352    }
3353}
3354
3355impl wkt::message::Message for Hash {
3356    fn typename() -> &'static str {
3357        "type.googleapis.com/google.devtools.artifactregistry.v1.Hash"
3358    }
3359}
3360
3361/// Defines additional types related to [Hash].
3362pub mod hash {
3363    #[allow(unused_imports)]
3364    use super::*;
3365
3366    /// The algorithm used to compute the hash.
3367    ///
3368    /// # Working with unknown values
3369    ///
3370    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3371    /// additional enum variants at any time. Adding new variants is not considered
3372    /// a breaking change. Applications should write their code in anticipation of:
3373    ///
3374    /// - New values appearing in future releases of the client library, **and**
3375    /// - New values received dynamically, without application changes.
3376    ///
3377    /// Please consult the [Working with enums] section in the user guide for some
3378    /// guidelines.
3379    ///
3380    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3381    #[derive(Clone, Debug, PartialEq)]
3382    #[non_exhaustive]
3383    pub enum HashType {
3384        /// Unspecified.
3385        Unspecified,
3386        /// SHA256 hash.
3387        Sha256,
3388        /// MD5 hash.
3389        Md5,
3390        /// Dirsum SHA256 hash.
3391        DirsumSha256,
3392        /// If set, the enum was initialized with an unknown value.
3393        ///
3394        /// Applications can examine the value using [HashType::value] or
3395        /// [HashType::name].
3396        UnknownValue(hash_type::UnknownValue),
3397    }
3398
3399    #[doc(hidden)]
3400    pub mod hash_type {
3401        #[allow(unused_imports)]
3402        use super::*;
3403        #[derive(Clone, Debug, PartialEq)]
3404        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3405    }
3406
3407    impl HashType {
3408        /// Gets the enum value.
3409        ///
3410        /// Returns `None` if the enum contains an unknown value deserialized from
3411        /// the string representation of enums.
3412        pub fn value(&self) -> std::option::Option<i32> {
3413            match self {
3414                Self::Unspecified => std::option::Option::Some(0),
3415                Self::Sha256 => std::option::Option::Some(1),
3416                Self::Md5 => std::option::Option::Some(2),
3417                Self::DirsumSha256 => std::option::Option::Some(3),
3418                Self::UnknownValue(u) => u.0.value(),
3419            }
3420        }
3421
3422        /// Gets the enum value as a string.
3423        ///
3424        /// Returns `None` if the enum contains an unknown value deserialized from
3425        /// the integer representation of enums.
3426        pub fn name(&self) -> std::option::Option<&str> {
3427            match self {
3428                Self::Unspecified => std::option::Option::Some("HASH_TYPE_UNSPECIFIED"),
3429                Self::Sha256 => std::option::Option::Some("SHA256"),
3430                Self::Md5 => std::option::Option::Some("MD5"),
3431                Self::DirsumSha256 => std::option::Option::Some("DIRSUM_SHA256"),
3432                Self::UnknownValue(u) => u.0.name(),
3433            }
3434        }
3435    }
3436
3437    impl std::default::Default for HashType {
3438        fn default() -> Self {
3439            use std::convert::From;
3440            Self::from(0)
3441        }
3442    }
3443
3444    impl std::fmt::Display for HashType {
3445        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3446            wkt::internal::display_enum(f, self.name(), self.value())
3447        }
3448    }
3449
3450    impl std::convert::From<i32> for HashType {
3451        fn from(value: i32) -> Self {
3452            match value {
3453                0 => Self::Unspecified,
3454                1 => Self::Sha256,
3455                2 => Self::Md5,
3456                3 => Self::DirsumSha256,
3457                _ => Self::UnknownValue(hash_type::UnknownValue(
3458                    wkt::internal::UnknownEnumValue::Integer(value),
3459                )),
3460            }
3461        }
3462    }
3463
3464    impl std::convert::From<&str> for HashType {
3465        fn from(value: &str) -> Self {
3466            use std::string::ToString;
3467            match value {
3468                "HASH_TYPE_UNSPECIFIED" => Self::Unspecified,
3469                "SHA256" => Self::Sha256,
3470                "MD5" => Self::Md5,
3471                "DIRSUM_SHA256" => Self::DirsumSha256,
3472                _ => Self::UnknownValue(hash_type::UnknownValue(
3473                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3474                )),
3475            }
3476        }
3477    }
3478
3479    impl serde::ser::Serialize for HashType {
3480        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3481        where
3482            S: serde::Serializer,
3483        {
3484            match self {
3485                Self::Unspecified => serializer.serialize_i32(0),
3486                Self::Sha256 => serializer.serialize_i32(1),
3487                Self::Md5 => serializer.serialize_i32(2),
3488                Self::DirsumSha256 => serializer.serialize_i32(3),
3489                Self::UnknownValue(u) => u.0.serialize(serializer),
3490            }
3491        }
3492    }
3493
3494    impl<'de> serde::de::Deserialize<'de> for HashType {
3495        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3496        where
3497            D: serde::Deserializer<'de>,
3498        {
3499            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HashType>::new(
3500                ".google.devtools.artifactregistry.v1.Hash.HashType",
3501            ))
3502        }
3503    }
3504}
3505
3506/// Files store content that is potentially associated with Packages or Versions.
3507#[derive(Clone, Default, PartialEq)]
3508#[non_exhaustive]
3509pub struct File {
3510    /// The name of the file, for example:
3511    /// `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`.
3512    /// If the file ID part contains slashes, they are escaped.
3513    pub name: std::string::String,
3514
3515    /// The size of the File in bytes.
3516    pub size_bytes: i64,
3517
3518    /// The hashes of the file content.
3519    pub hashes: std::vec::Vec<crate::model::Hash>,
3520
3521    /// Output only. The time when the File was created.
3522    pub create_time: std::option::Option<wkt::Timestamp>,
3523
3524    /// Output only. The time when the File was last updated.
3525    pub update_time: std::option::Option<wkt::Timestamp>,
3526
3527    /// The name of the Package or Version that owns this file, if any.
3528    pub owner: std::string::String,
3529
3530    /// Output only. The time when the last attempt to refresh the file's data was
3531    /// made. Only set when the repository is remote.
3532    pub fetch_time: std::option::Option<wkt::Timestamp>,
3533
3534    /// Optional. Client specified annotations.
3535    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3536
3537    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3538}
3539
3540impl File {
3541    pub fn new() -> Self {
3542        std::default::Default::default()
3543    }
3544
3545    /// Sets the value of [name][crate::model::File::name].
3546    ///
3547    /// # Example
3548    /// ```ignore,no_run
3549    /// # use google_cloud_artifactregistry_v1::model::File;
3550    /// let x = File::new().set_name("example");
3551    /// ```
3552    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3553        self.name = v.into();
3554        self
3555    }
3556
3557    /// Sets the value of [size_bytes][crate::model::File::size_bytes].
3558    ///
3559    /// # Example
3560    /// ```ignore,no_run
3561    /// # use google_cloud_artifactregistry_v1::model::File;
3562    /// let x = File::new().set_size_bytes(42);
3563    /// ```
3564    pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3565        self.size_bytes = v.into();
3566        self
3567    }
3568
3569    /// Sets the value of [hashes][crate::model::File::hashes].
3570    ///
3571    /// # Example
3572    /// ```ignore,no_run
3573    /// # use google_cloud_artifactregistry_v1::model::File;
3574    /// use google_cloud_artifactregistry_v1::model::Hash;
3575    /// let x = File::new()
3576    ///     .set_hashes([
3577    ///         Hash::default()/* use setters */,
3578    ///         Hash::default()/* use (different) setters */,
3579    ///     ]);
3580    /// ```
3581    pub fn set_hashes<T, V>(mut self, v: T) -> Self
3582    where
3583        T: std::iter::IntoIterator<Item = V>,
3584        V: std::convert::Into<crate::model::Hash>,
3585    {
3586        use std::iter::Iterator;
3587        self.hashes = v.into_iter().map(|i| i.into()).collect();
3588        self
3589    }
3590
3591    /// Sets the value of [create_time][crate::model::File::create_time].
3592    ///
3593    /// # Example
3594    /// ```ignore,no_run
3595    /// # use google_cloud_artifactregistry_v1::model::File;
3596    /// use wkt::Timestamp;
3597    /// let x = File::new().set_create_time(Timestamp::default()/* use setters */);
3598    /// ```
3599    pub fn set_create_time<T>(mut self, v: T) -> Self
3600    where
3601        T: std::convert::Into<wkt::Timestamp>,
3602    {
3603        self.create_time = std::option::Option::Some(v.into());
3604        self
3605    }
3606
3607    /// Sets or clears the value of [create_time][crate::model::File::create_time].
3608    ///
3609    /// # Example
3610    /// ```ignore,no_run
3611    /// # use google_cloud_artifactregistry_v1::model::File;
3612    /// use wkt::Timestamp;
3613    /// let x = File::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3614    /// let x = File::new().set_or_clear_create_time(None::<Timestamp>);
3615    /// ```
3616    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3617    where
3618        T: std::convert::Into<wkt::Timestamp>,
3619    {
3620        self.create_time = v.map(|x| x.into());
3621        self
3622    }
3623
3624    /// Sets the value of [update_time][crate::model::File::update_time].
3625    ///
3626    /// # Example
3627    /// ```ignore,no_run
3628    /// # use google_cloud_artifactregistry_v1::model::File;
3629    /// use wkt::Timestamp;
3630    /// let x = File::new().set_update_time(Timestamp::default()/* use setters */);
3631    /// ```
3632    pub fn set_update_time<T>(mut self, v: T) -> Self
3633    where
3634        T: std::convert::Into<wkt::Timestamp>,
3635    {
3636        self.update_time = std::option::Option::Some(v.into());
3637        self
3638    }
3639
3640    /// Sets or clears the value of [update_time][crate::model::File::update_time].
3641    ///
3642    /// # Example
3643    /// ```ignore,no_run
3644    /// # use google_cloud_artifactregistry_v1::model::File;
3645    /// use wkt::Timestamp;
3646    /// let x = File::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3647    /// let x = File::new().set_or_clear_update_time(None::<Timestamp>);
3648    /// ```
3649    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3650    where
3651        T: std::convert::Into<wkt::Timestamp>,
3652    {
3653        self.update_time = v.map(|x| x.into());
3654        self
3655    }
3656
3657    /// Sets the value of [owner][crate::model::File::owner].
3658    ///
3659    /// # Example
3660    /// ```ignore,no_run
3661    /// # use google_cloud_artifactregistry_v1::model::File;
3662    /// let x = File::new().set_owner("example");
3663    /// ```
3664    pub fn set_owner<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3665        self.owner = v.into();
3666        self
3667    }
3668
3669    /// Sets the value of [fetch_time][crate::model::File::fetch_time].
3670    ///
3671    /// # Example
3672    /// ```ignore,no_run
3673    /// # use google_cloud_artifactregistry_v1::model::File;
3674    /// use wkt::Timestamp;
3675    /// let x = File::new().set_fetch_time(Timestamp::default()/* use setters */);
3676    /// ```
3677    pub fn set_fetch_time<T>(mut self, v: T) -> Self
3678    where
3679        T: std::convert::Into<wkt::Timestamp>,
3680    {
3681        self.fetch_time = std::option::Option::Some(v.into());
3682        self
3683    }
3684
3685    /// Sets or clears the value of [fetch_time][crate::model::File::fetch_time].
3686    ///
3687    /// # Example
3688    /// ```ignore,no_run
3689    /// # use google_cloud_artifactregistry_v1::model::File;
3690    /// use wkt::Timestamp;
3691    /// let x = File::new().set_or_clear_fetch_time(Some(Timestamp::default()/* use setters */));
3692    /// let x = File::new().set_or_clear_fetch_time(None::<Timestamp>);
3693    /// ```
3694    pub fn set_or_clear_fetch_time<T>(mut self, v: std::option::Option<T>) -> Self
3695    where
3696        T: std::convert::Into<wkt::Timestamp>,
3697    {
3698        self.fetch_time = v.map(|x| x.into());
3699        self
3700    }
3701
3702    /// Sets the value of [annotations][crate::model::File::annotations].
3703    ///
3704    /// # Example
3705    /// ```ignore,no_run
3706    /// # use google_cloud_artifactregistry_v1::model::File;
3707    /// let x = File::new().set_annotations([
3708    ///     ("key0", "abc"),
3709    ///     ("key1", "xyz"),
3710    /// ]);
3711    /// ```
3712    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3713    where
3714        T: std::iter::IntoIterator<Item = (K, V)>,
3715        K: std::convert::Into<std::string::String>,
3716        V: std::convert::Into<std::string::String>,
3717    {
3718        use std::iter::Iterator;
3719        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3720        self
3721    }
3722}
3723
3724impl wkt::message::Message for File {
3725    fn typename() -> &'static str {
3726        "type.googleapis.com/google.devtools.artifactregistry.v1.File"
3727    }
3728}
3729
3730/// The request to list files.
3731#[derive(Clone, Default, PartialEq)]
3732#[non_exhaustive]
3733pub struct ListFilesRequest {
3734    /// Required. The name of the repository whose files will be listed. For
3735    /// example: "projects/p1/locations/us-central1/repositories/repo1
3736    pub parent: std::string::String,
3737
3738    /// An expression for filtering the results of the request. Filter rules are
3739    /// case insensitive. The fields eligible for filtering are:
3740    ///
3741    /// * `name`
3742    /// * `owner`
3743    /// * `annotations`
3744    ///
3745    /// Examples of using a filter:
3746    ///
3747    /// To filter the results of your request to files with the name `my_file.txt`
3748    /// in project `my-project` in the `us-central` region, in repository
3749    /// `my-repo`, append the following filter expression to your request:
3750    ///
3751    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"`
3752    ///
3753    /// You can also use wildcards to match any number of characters before or
3754    /// after the value:
3755    ///
3756    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"`
3757    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"`
3758    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"`
3759    ///
3760    /// To filter the results of your request to files owned by the version `1.0`
3761    /// in package `pkg1`, append the following filter expression to your request:
3762    ///
3763    /// * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"`
3764    ///
3765    /// To filter the results of your request to files with the annotation
3766    /// key-value pair [`external_link`: `external_link_value`], append the
3767    /// following filter expression to your request:
3768    ///
3769    /// * `"annotations.external_link:external_link_value"`
3770    ///
3771    /// To filter just for a specific annotation key `external_link`, append the
3772    /// following filter expression to your request:
3773    ///
3774    /// * `"annotations.external_link"`
3775    ///
3776    /// If the annotation key or value contains special characters, you can escape
3777    /// them by surrounding the value with backticks. For example, to filter the
3778    /// results of your request to files with the annotation key-value pair
3779    /// [`external.link`:`<https://example.com/my-file>`], append the following
3780    /// filter expression to your request:
3781    ///
3782    /// * `` "annotations.`external.link`:`<https://example.com/my-file>`" ``
3783    ///
3784    /// You can also filter with annotations with a wildcard to
3785    /// match any number of characters before or after the value:
3786    ///
3787    /// * `` "annotations.*_link:`*example.com*`" ``
3788    pub filter: std::string::String,
3789
3790    /// The maximum number of files to return. Maximum page size is 1,000.
3791    pub page_size: i32,
3792
3793    /// The next_page_token value returned from a previous list request, if any.
3794    pub page_token: std::string::String,
3795
3796    /// The field to order the results by.
3797    pub order_by: std::string::String,
3798
3799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3800}
3801
3802impl ListFilesRequest {
3803    pub fn new() -> Self {
3804        std::default::Default::default()
3805    }
3806
3807    /// Sets the value of [parent][crate::model::ListFilesRequest::parent].
3808    ///
3809    /// # Example
3810    /// ```ignore,no_run
3811    /// # use google_cloud_artifactregistry_v1::model::ListFilesRequest;
3812    /// let x = ListFilesRequest::new().set_parent("example");
3813    /// ```
3814    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815        self.parent = v.into();
3816        self
3817    }
3818
3819    /// Sets the value of [filter][crate::model::ListFilesRequest::filter].
3820    ///
3821    /// # Example
3822    /// ```ignore,no_run
3823    /// # use google_cloud_artifactregistry_v1::model::ListFilesRequest;
3824    /// let x = ListFilesRequest::new().set_filter("example");
3825    /// ```
3826    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3827        self.filter = v.into();
3828        self
3829    }
3830
3831    /// Sets the value of [page_size][crate::model::ListFilesRequest::page_size].
3832    ///
3833    /// # Example
3834    /// ```ignore,no_run
3835    /// # use google_cloud_artifactregistry_v1::model::ListFilesRequest;
3836    /// let x = ListFilesRequest::new().set_page_size(42);
3837    /// ```
3838    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3839        self.page_size = v.into();
3840        self
3841    }
3842
3843    /// Sets the value of [page_token][crate::model::ListFilesRequest::page_token].
3844    ///
3845    /// # Example
3846    /// ```ignore,no_run
3847    /// # use google_cloud_artifactregistry_v1::model::ListFilesRequest;
3848    /// let x = ListFilesRequest::new().set_page_token("example");
3849    /// ```
3850    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3851        self.page_token = v.into();
3852        self
3853    }
3854
3855    /// Sets the value of [order_by][crate::model::ListFilesRequest::order_by].
3856    ///
3857    /// # Example
3858    /// ```ignore,no_run
3859    /// # use google_cloud_artifactregistry_v1::model::ListFilesRequest;
3860    /// let x = ListFilesRequest::new().set_order_by("example");
3861    /// ```
3862    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3863        self.order_by = v.into();
3864        self
3865    }
3866}
3867
3868impl wkt::message::Message for ListFilesRequest {
3869    fn typename() -> &'static str {
3870        "type.googleapis.com/google.devtools.artifactregistry.v1.ListFilesRequest"
3871    }
3872}
3873
3874/// The response from listing files.
3875#[derive(Clone, Default, PartialEq)]
3876#[non_exhaustive]
3877pub struct ListFilesResponse {
3878    /// The files returned.
3879    pub files: std::vec::Vec<crate::model::File>,
3880
3881    /// The token to retrieve the next page of files, or empty if there are no
3882    /// more files to return.
3883    pub next_page_token: std::string::String,
3884
3885    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3886}
3887
3888impl ListFilesResponse {
3889    pub fn new() -> Self {
3890        std::default::Default::default()
3891    }
3892
3893    /// Sets the value of [files][crate::model::ListFilesResponse::files].
3894    ///
3895    /// # Example
3896    /// ```ignore,no_run
3897    /// # use google_cloud_artifactregistry_v1::model::ListFilesResponse;
3898    /// use google_cloud_artifactregistry_v1::model::File;
3899    /// let x = ListFilesResponse::new()
3900    ///     .set_files([
3901    ///         File::default()/* use setters */,
3902    ///         File::default()/* use (different) setters */,
3903    ///     ]);
3904    /// ```
3905    pub fn set_files<T, V>(mut self, v: T) -> Self
3906    where
3907        T: std::iter::IntoIterator<Item = V>,
3908        V: std::convert::Into<crate::model::File>,
3909    {
3910        use std::iter::Iterator;
3911        self.files = v.into_iter().map(|i| i.into()).collect();
3912        self
3913    }
3914
3915    /// Sets the value of [next_page_token][crate::model::ListFilesResponse::next_page_token].
3916    ///
3917    /// # Example
3918    /// ```ignore,no_run
3919    /// # use google_cloud_artifactregistry_v1::model::ListFilesResponse;
3920    /// let x = ListFilesResponse::new().set_next_page_token("example");
3921    /// ```
3922    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3923        self.next_page_token = v.into();
3924        self
3925    }
3926}
3927
3928impl wkt::message::Message for ListFilesResponse {
3929    fn typename() -> &'static str {
3930        "type.googleapis.com/google.devtools.artifactregistry.v1.ListFilesResponse"
3931    }
3932}
3933
3934#[doc(hidden)]
3935impl google_cloud_gax::paginator::internal::PageableResponse for ListFilesResponse {
3936    type PageItem = crate::model::File;
3937
3938    fn items(self) -> std::vec::Vec<Self::PageItem> {
3939        self.files
3940    }
3941
3942    fn next_page_token(&self) -> std::string::String {
3943        use std::clone::Clone;
3944        self.next_page_token.clone()
3945    }
3946}
3947
3948/// The request to retrieve a file.
3949#[derive(Clone, Default, PartialEq)]
3950#[non_exhaustive]
3951pub struct GetFileRequest {
3952    /// Required. The name of the file to retrieve.
3953    pub name: std::string::String,
3954
3955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3956}
3957
3958impl GetFileRequest {
3959    pub fn new() -> Self {
3960        std::default::Default::default()
3961    }
3962
3963    /// Sets the value of [name][crate::model::GetFileRequest::name].
3964    ///
3965    /// # Example
3966    /// ```ignore,no_run
3967    /// # use google_cloud_artifactregistry_v1::model::GetFileRequest;
3968    /// let x = GetFileRequest::new().set_name("example");
3969    /// ```
3970    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3971        self.name = v.into();
3972        self
3973    }
3974}
3975
3976impl wkt::message::Message for GetFileRequest {
3977    fn typename() -> &'static str {
3978        "type.googleapis.com/google.devtools.artifactregistry.v1.GetFileRequest"
3979    }
3980}
3981
3982/// The request to delete a file.
3983#[derive(Clone, Default, PartialEq)]
3984#[non_exhaustive]
3985pub struct DeleteFileRequest {
3986    /// Required. The name of the file to delete.
3987    pub name: std::string::String,
3988
3989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3990}
3991
3992impl DeleteFileRequest {
3993    pub fn new() -> Self {
3994        std::default::Default::default()
3995    }
3996
3997    /// Sets the value of [name][crate::model::DeleteFileRequest::name].
3998    ///
3999    /// # Example
4000    /// ```ignore,no_run
4001    /// # use google_cloud_artifactregistry_v1::model::DeleteFileRequest;
4002    /// let x = DeleteFileRequest::new().set_name("example");
4003    /// ```
4004    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4005        self.name = v.into();
4006        self
4007    }
4008}
4009
4010impl wkt::message::Message for DeleteFileRequest {
4011    fn typename() -> &'static str {
4012        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteFileRequest"
4013    }
4014}
4015
4016/// The request to update a file.
4017#[derive(Clone, Default, PartialEq)]
4018#[non_exhaustive]
4019pub struct UpdateFileRequest {
4020    /// Required. The File that replaces the resource on the server.
4021    pub file: std::option::Option<crate::model::File>,
4022
4023    /// Required. The update mask applies to the resource. For the `FieldMask`
4024    /// definition, see
4025    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
4026    pub update_mask: std::option::Option<wkt::FieldMask>,
4027
4028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029}
4030
4031impl UpdateFileRequest {
4032    pub fn new() -> Self {
4033        std::default::Default::default()
4034    }
4035
4036    /// Sets the value of [file][crate::model::UpdateFileRequest::file].
4037    ///
4038    /// # Example
4039    /// ```ignore,no_run
4040    /// # use google_cloud_artifactregistry_v1::model::UpdateFileRequest;
4041    /// use google_cloud_artifactregistry_v1::model::File;
4042    /// let x = UpdateFileRequest::new().set_file(File::default()/* use setters */);
4043    /// ```
4044    pub fn set_file<T>(mut self, v: T) -> Self
4045    where
4046        T: std::convert::Into<crate::model::File>,
4047    {
4048        self.file = std::option::Option::Some(v.into());
4049        self
4050    }
4051
4052    /// Sets or clears the value of [file][crate::model::UpdateFileRequest::file].
4053    ///
4054    /// # Example
4055    /// ```ignore,no_run
4056    /// # use google_cloud_artifactregistry_v1::model::UpdateFileRequest;
4057    /// use google_cloud_artifactregistry_v1::model::File;
4058    /// let x = UpdateFileRequest::new().set_or_clear_file(Some(File::default()/* use setters */));
4059    /// let x = UpdateFileRequest::new().set_or_clear_file(None::<File>);
4060    /// ```
4061    pub fn set_or_clear_file<T>(mut self, v: std::option::Option<T>) -> Self
4062    where
4063        T: std::convert::Into<crate::model::File>,
4064    {
4065        self.file = v.map(|x| x.into());
4066        self
4067    }
4068
4069    /// Sets the value of [update_mask][crate::model::UpdateFileRequest::update_mask].
4070    ///
4071    /// # Example
4072    /// ```ignore,no_run
4073    /// # use google_cloud_artifactregistry_v1::model::UpdateFileRequest;
4074    /// use wkt::FieldMask;
4075    /// let x = UpdateFileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4076    /// ```
4077    pub fn set_update_mask<T>(mut self, v: T) -> Self
4078    where
4079        T: std::convert::Into<wkt::FieldMask>,
4080    {
4081        self.update_mask = std::option::Option::Some(v.into());
4082        self
4083    }
4084
4085    /// Sets or clears the value of [update_mask][crate::model::UpdateFileRequest::update_mask].
4086    ///
4087    /// # Example
4088    /// ```ignore,no_run
4089    /// # use google_cloud_artifactregistry_v1::model::UpdateFileRequest;
4090    /// use wkt::FieldMask;
4091    /// let x = UpdateFileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4092    /// let x = UpdateFileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4093    /// ```
4094    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4095    where
4096        T: std::convert::Into<wkt::FieldMask>,
4097    {
4098        self.update_mask = v.map(|x| x.into());
4099        self
4100    }
4101}
4102
4103impl wkt::message::Message for UpdateFileRequest {
4104    fn typename() -> &'static str {
4105        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateFileRequest"
4106    }
4107}
4108
4109/// GenericArtifact represents a generic artifact
4110#[derive(Clone, Default, PartialEq)]
4111#[non_exhaustive]
4112pub struct GenericArtifact {
4113    /// Resource name of the generic artifact.
4114    /// project, location, repository, package_id and version_id
4115    /// create a unique generic artifact.
4116    /// i.e. "projects/test-project/locations/us-west4/repositories/test-repo/
4117    /// genericArtifacts/package_id:version_id"
4118    pub name: std::string::String,
4119
4120    /// The version of the generic artifact.
4121    pub version: std::string::String,
4122
4123    /// Output only. The time when the Generic module is created.
4124    pub create_time: std::option::Option<wkt::Timestamp>,
4125
4126    /// Output only. The time when the Generic module is updated.
4127    pub update_time: std::option::Option<wkt::Timestamp>,
4128
4129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4130}
4131
4132impl GenericArtifact {
4133    pub fn new() -> Self {
4134        std::default::Default::default()
4135    }
4136
4137    /// Sets the value of [name][crate::model::GenericArtifact::name].
4138    ///
4139    /// # Example
4140    /// ```ignore,no_run
4141    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4142    /// let x = GenericArtifact::new().set_name("example");
4143    /// ```
4144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4145        self.name = v.into();
4146        self
4147    }
4148
4149    /// Sets the value of [version][crate::model::GenericArtifact::version].
4150    ///
4151    /// # Example
4152    /// ```ignore,no_run
4153    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4154    /// let x = GenericArtifact::new().set_version("example");
4155    /// ```
4156    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157        self.version = v.into();
4158        self
4159    }
4160
4161    /// Sets the value of [create_time][crate::model::GenericArtifact::create_time].
4162    ///
4163    /// # Example
4164    /// ```ignore,no_run
4165    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4166    /// use wkt::Timestamp;
4167    /// let x = GenericArtifact::new().set_create_time(Timestamp::default()/* use setters */);
4168    /// ```
4169    pub fn set_create_time<T>(mut self, v: T) -> Self
4170    where
4171        T: std::convert::Into<wkt::Timestamp>,
4172    {
4173        self.create_time = std::option::Option::Some(v.into());
4174        self
4175    }
4176
4177    /// Sets or clears the value of [create_time][crate::model::GenericArtifact::create_time].
4178    ///
4179    /// # Example
4180    /// ```ignore,no_run
4181    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4182    /// use wkt::Timestamp;
4183    /// let x = GenericArtifact::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4184    /// let x = GenericArtifact::new().set_or_clear_create_time(None::<Timestamp>);
4185    /// ```
4186    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4187    where
4188        T: std::convert::Into<wkt::Timestamp>,
4189    {
4190        self.create_time = v.map(|x| x.into());
4191        self
4192    }
4193
4194    /// Sets the value of [update_time][crate::model::GenericArtifact::update_time].
4195    ///
4196    /// # Example
4197    /// ```ignore,no_run
4198    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4199    /// use wkt::Timestamp;
4200    /// let x = GenericArtifact::new().set_update_time(Timestamp::default()/* use setters */);
4201    /// ```
4202    pub fn set_update_time<T>(mut self, v: T) -> Self
4203    where
4204        T: std::convert::Into<wkt::Timestamp>,
4205    {
4206        self.update_time = std::option::Option::Some(v.into());
4207        self
4208    }
4209
4210    /// Sets or clears the value of [update_time][crate::model::GenericArtifact::update_time].
4211    ///
4212    /// # Example
4213    /// ```ignore,no_run
4214    /// # use google_cloud_artifactregistry_v1::model::GenericArtifact;
4215    /// use wkt::Timestamp;
4216    /// let x = GenericArtifact::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4217    /// let x = GenericArtifact::new().set_or_clear_update_time(None::<Timestamp>);
4218    /// ```
4219    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4220    where
4221        T: std::convert::Into<wkt::Timestamp>,
4222    {
4223        self.update_time = v.map(|x| x.into());
4224        self
4225    }
4226}
4227
4228impl wkt::message::Message for GenericArtifact {
4229    fn typename() -> &'static str {
4230        "type.googleapis.com/google.devtools.artifactregistry.v1.GenericArtifact"
4231    }
4232}
4233
4234/// GoModule represents a Go module.
4235#[derive(Clone, Default, PartialEq)]
4236#[non_exhaustive]
4237pub struct GoModule {
4238    /// The resource name of a Go module.
4239    pub name: std::string::String,
4240
4241    /// The version of the Go module. Must be a valid canonical version as defined
4242    /// in <https://go.dev/ref/mod#glos-canonical-version>.
4243    pub version: std::string::String,
4244
4245    /// Output only. The time when the Go module is created.
4246    pub create_time: std::option::Option<wkt::Timestamp>,
4247
4248    /// Output only. The time when the Go module is updated.
4249    pub update_time: std::option::Option<wkt::Timestamp>,
4250
4251    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4252}
4253
4254impl GoModule {
4255    pub fn new() -> Self {
4256        std::default::Default::default()
4257    }
4258
4259    /// Sets the value of [name][crate::model::GoModule::name].
4260    ///
4261    /// # Example
4262    /// ```ignore,no_run
4263    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4264    /// let x = GoModule::new().set_name("example");
4265    /// ```
4266    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4267        self.name = v.into();
4268        self
4269    }
4270
4271    /// Sets the value of [version][crate::model::GoModule::version].
4272    ///
4273    /// # Example
4274    /// ```ignore,no_run
4275    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4276    /// let x = GoModule::new().set_version("example");
4277    /// ```
4278    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4279        self.version = v.into();
4280        self
4281    }
4282
4283    /// Sets the value of [create_time][crate::model::GoModule::create_time].
4284    ///
4285    /// # Example
4286    /// ```ignore,no_run
4287    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4288    /// use wkt::Timestamp;
4289    /// let x = GoModule::new().set_create_time(Timestamp::default()/* use setters */);
4290    /// ```
4291    pub fn set_create_time<T>(mut self, v: T) -> Self
4292    where
4293        T: std::convert::Into<wkt::Timestamp>,
4294    {
4295        self.create_time = std::option::Option::Some(v.into());
4296        self
4297    }
4298
4299    /// Sets or clears the value of [create_time][crate::model::GoModule::create_time].
4300    ///
4301    /// # Example
4302    /// ```ignore,no_run
4303    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4304    /// use wkt::Timestamp;
4305    /// let x = GoModule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4306    /// let x = GoModule::new().set_or_clear_create_time(None::<Timestamp>);
4307    /// ```
4308    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4309    where
4310        T: std::convert::Into<wkt::Timestamp>,
4311    {
4312        self.create_time = v.map(|x| x.into());
4313        self
4314    }
4315
4316    /// Sets the value of [update_time][crate::model::GoModule::update_time].
4317    ///
4318    /// # Example
4319    /// ```ignore,no_run
4320    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4321    /// use wkt::Timestamp;
4322    /// let x = GoModule::new().set_update_time(Timestamp::default()/* use setters */);
4323    /// ```
4324    pub fn set_update_time<T>(mut self, v: T) -> Self
4325    where
4326        T: std::convert::Into<wkt::Timestamp>,
4327    {
4328        self.update_time = std::option::Option::Some(v.into());
4329        self
4330    }
4331
4332    /// Sets or clears the value of [update_time][crate::model::GoModule::update_time].
4333    ///
4334    /// # Example
4335    /// ```ignore,no_run
4336    /// # use google_cloud_artifactregistry_v1::model::GoModule;
4337    /// use wkt::Timestamp;
4338    /// let x = GoModule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4339    /// let x = GoModule::new().set_or_clear_update_time(None::<Timestamp>);
4340    /// ```
4341    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4342    where
4343        T: std::convert::Into<wkt::Timestamp>,
4344    {
4345        self.update_time = v.map(|x| x.into());
4346        self
4347    }
4348}
4349
4350impl wkt::message::Message for GoModule {
4351    fn typename() -> &'static str {
4352        "type.googleapis.com/google.devtools.artifactregistry.v1.GoModule"
4353    }
4354}
4355
4356/// A detailed representation of a KFP artifact.
4357#[derive(Clone, Default, PartialEq)]
4358#[non_exhaustive]
4359pub struct KfpArtifact {
4360    /// Output only. Resource name of the KFP artifact. Since users don't directly
4361    /// interact with this resource, the name will be derived from the associated
4362    /// version. For example, when version = ".../versions/sha256:abcdef...", the
4363    /// name will be ".../kfpArtifacts/sha256:abcdef...".
4364    pub name: std::string::String,
4365
4366    /// The version associated with the KFP artifact. Must follow the Semantic
4367    /// Versioning standard.
4368    pub version: std::string::String,
4369
4370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4371}
4372
4373impl KfpArtifact {
4374    pub fn new() -> Self {
4375        std::default::Default::default()
4376    }
4377
4378    /// Sets the value of [name][crate::model::KfpArtifact::name].
4379    ///
4380    /// # Example
4381    /// ```ignore,no_run
4382    /// # use google_cloud_artifactregistry_v1::model::KfpArtifact;
4383    /// let x = KfpArtifact::new().set_name("example");
4384    /// ```
4385    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4386        self.name = v.into();
4387        self
4388    }
4389
4390    /// Sets the value of [version][crate::model::KfpArtifact::version].
4391    ///
4392    /// # Example
4393    /// ```ignore,no_run
4394    /// # use google_cloud_artifactregistry_v1::model::KfpArtifact;
4395    /// let x = KfpArtifact::new().set_version("example");
4396    /// ```
4397    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398        self.version = v.into();
4399        self
4400    }
4401}
4402
4403impl wkt::message::Message for KfpArtifact {
4404    fn typename() -> &'static str {
4405        "type.googleapis.com/google.devtools.artifactregistry.v1.KfpArtifact"
4406    }
4407}
4408
4409/// Packages are named collections of versions.
4410#[derive(Clone, Default, PartialEq)]
4411#[non_exhaustive]
4412pub struct Package {
4413    /// The name of the package, for example:
4414    /// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.
4415    /// If the package ID part contains slashes, the slashes are escaped.
4416    pub name: std::string::String,
4417
4418    /// The display name of the package.
4419    pub display_name: std::string::String,
4420
4421    /// The time when the package was created.
4422    pub create_time: std::option::Option<wkt::Timestamp>,
4423
4424    /// The time when the package was last updated. This includes publishing a new
4425    /// version of the package.
4426    pub update_time: std::option::Option<wkt::Timestamp>,
4427
4428    /// Optional. Client specified annotations.
4429    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4430
4431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4432}
4433
4434impl Package {
4435    pub fn new() -> Self {
4436        std::default::Default::default()
4437    }
4438
4439    /// Sets the value of [name][crate::model::Package::name].
4440    ///
4441    /// # Example
4442    /// ```ignore,no_run
4443    /// # use google_cloud_artifactregistry_v1::model::Package;
4444    /// let x = Package::new().set_name("example");
4445    /// ```
4446    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4447        self.name = v.into();
4448        self
4449    }
4450
4451    /// Sets the value of [display_name][crate::model::Package::display_name].
4452    ///
4453    /// # Example
4454    /// ```ignore,no_run
4455    /// # use google_cloud_artifactregistry_v1::model::Package;
4456    /// let x = Package::new().set_display_name("example");
4457    /// ```
4458    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4459        self.display_name = v.into();
4460        self
4461    }
4462
4463    /// Sets the value of [create_time][crate::model::Package::create_time].
4464    ///
4465    /// # Example
4466    /// ```ignore,no_run
4467    /// # use google_cloud_artifactregistry_v1::model::Package;
4468    /// use wkt::Timestamp;
4469    /// let x = Package::new().set_create_time(Timestamp::default()/* use setters */);
4470    /// ```
4471    pub fn set_create_time<T>(mut self, v: T) -> Self
4472    where
4473        T: std::convert::Into<wkt::Timestamp>,
4474    {
4475        self.create_time = std::option::Option::Some(v.into());
4476        self
4477    }
4478
4479    /// Sets or clears the value of [create_time][crate::model::Package::create_time].
4480    ///
4481    /// # Example
4482    /// ```ignore,no_run
4483    /// # use google_cloud_artifactregistry_v1::model::Package;
4484    /// use wkt::Timestamp;
4485    /// let x = Package::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4486    /// let x = Package::new().set_or_clear_create_time(None::<Timestamp>);
4487    /// ```
4488    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4489    where
4490        T: std::convert::Into<wkt::Timestamp>,
4491    {
4492        self.create_time = v.map(|x| x.into());
4493        self
4494    }
4495
4496    /// Sets the value of [update_time][crate::model::Package::update_time].
4497    ///
4498    /// # Example
4499    /// ```ignore,no_run
4500    /// # use google_cloud_artifactregistry_v1::model::Package;
4501    /// use wkt::Timestamp;
4502    /// let x = Package::new().set_update_time(Timestamp::default()/* use setters */);
4503    /// ```
4504    pub fn set_update_time<T>(mut self, v: T) -> Self
4505    where
4506        T: std::convert::Into<wkt::Timestamp>,
4507    {
4508        self.update_time = std::option::Option::Some(v.into());
4509        self
4510    }
4511
4512    /// Sets or clears the value of [update_time][crate::model::Package::update_time].
4513    ///
4514    /// # Example
4515    /// ```ignore,no_run
4516    /// # use google_cloud_artifactregistry_v1::model::Package;
4517    /// use wkt::Timestamp;
4518    /// let x = Package::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4519    /// let x = Package::new().set_or_clear_update_time(None::<Timestamp>);
4520    /// ```
4521    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4522    where
4523        T: std::convert::Into<wkt::Timestamp>,
4524    {
4525        self.update_time = v.map(|x| x.into());
4526        self
4527    }
4528
4529    /// Sets the value of [annotations][crate::model::Package::annotations].
4530    ///
4531    /// # Example
4532    /// ```ignore,no_run
4533    /// # use google_cloud_artifactregistry_v1::model::Package;
4534    /// let x = Package::new().set_annotations([
4535    ///     ("key0", "abc"),
4536    ///     ("key1", "xyz"),
4537    /// ]);
4538    /// ```
4539    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4540    where
4541        T: std::iter::IntoIterator<Item = (K, V)>,
4542        K: std::convert::Into<std::string::String>,
4543        V: std::convert::Into<std::string::String>,
4544    {
4545        use std::iter::Iterator;
4546        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4547        self
4548    }
4549}
4550
4551impl wkt::message::Message for Package {
4552    fn typename() -> &'static str {
4553        "type.googleapis.com/google.devtools.artifactregistry.v1.Package"
4554    }
4555}
4556
4557/// The request to list packages.
4558#[derive(Clone, Default, PartialEq)]
4559#[non_exhaustive]
4560pub struct ListPackagesRequest {
4561    /// Required. The name of the parent resource whose packages will be listed.
4562    pub parent: std::string::String,
4563
4564    /// The maximum number of packages to return. Maximum page size is 1,000.
4565    pub page_size: i32,
4566
4567    /// The next_page_token value returned from a previous list request, if any.
4568    pub page_token: std::string::String,
4569
4570    /// Optional. An expression for filtering the results of the request. Filter
4571    /// rules are case insensitive. The fields eligible for filtering are:
4572    ///
4573    /// * `name`
4574    /// * `annotations`
4575    ///
4576    /// Examples of using a filter:
4577    ///
4578    /// To filter the results of your request to packages with the name
4579    /// `my-package` in project `my-project` in the `us-central` region, in
4580    /// repository `my-repo`, append the following filter expression to your
4581    /// request:
4582    ///
4583    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"`
4584    ///
4585    /// You can also use wildcards to match any number of characters before or
4586    /// after the value:
4587    ///
4588    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"`
4589    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"`
4590    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"`
4591    ///
4592    /// To filter the results of your request to packages with the annotation
4593    /// key-value pair [`external_link`: `external_link_value`], append the
4594    /// following filter expression to your request":
4595    ///
4596    /// * `"annotations.external_link:external_link_value"`
4597    ///
4598    /// To filter the results just for a specific annotation key `external_link`,
4599    /// append the following filter expression to your request:
4600    ///
4601    /// * `"annotations.external_link"`
4602    ///
4603    /// If the annotation key or value contains special characters, you can escape
4604    /// them by surrounding the value with backticks. For example, to filter the
4605    /// results of your request to packages with the annotation key-value pair
4606    /// [`external.link`:`<https://example.com/my-package>`], append the following
4607    /// filter expression to your request:
4608    ///
4609    /// * `` "annotations.`external.link`:`<https://example.com/my-package>`" ``
4610    ///
4611    /// You can also filter with annotations with a wildcard to
4612    /// match any number of characters before or after the value:
4613    ///
4614    /// * `` "annotations.*_link:`*example.com*`" ``
4615    pub filter: std::string::String,
4616
4617    /// Optional. The field to order the results by.
4618    pub order_by: std::string::String,
4619
4620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4621}
4622
4623impl ListPackagesRequest {
4624    pub fn new() -> Self {
4625        std::default::Default::default()
4626    }
4627
4628    /// Sets the value of [parent][crate::model::ListPackagesRequest::parent].
4629    ///
4630    /// # Example
4631    /// ```ignore,no_run
4632    /// # use google_cloud_artifactregistry_v1::model::ListPackagesRequest;
4633    /// let x = ListPackagesRequest::new().set_parent("example");
4634    /// ```
4635    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4636        self.parent = v.into();
4637        self
4638    }
4639
4640    /// Sets the value of [page_size][crate::model::ListPackagesRequest::page_size].
4641    ///
4642    /// # Example
4643    /// ```ignore,no_run
4644    /// # use google_cloud_artifactregistry_v1::model::ListPackagesRequest;
4645    /// let x = ListPackagesRequest::new().set_page_size(42);
4646    /// ```
4647    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4648        self.page_size = v.into();
4649        self
4650    }
4651
4652    /// Sets the value of [page_token][crate::model::ListPackagesRequest::page_token].
4653    ///
4654    /// # Example
4655    /// ```ignore,no_run
4656    /// # use google_cloud_artifactregistry_v1::model::ListPackagesRequest;
4657    /// let x = ListPackagesRequest::new().set_page_token("example");
4658    /// ```
4659    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4660        self.page_token = v.into();
4661        self
4662    }
4663
4664    /// Sets the value of [filter][crate::model::ListPackagesRequest::filter].
4665    ///
4666    /// # Example
4667    /// ```ignore,no_run
4668    /// # use google_cloud_artifactregistry_v1::model::ListPackagesRequest;
4669    /// let x = ListPackagesRequest::new().set_filter("example");
4670    /// ```
4671    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4672        self.filter = v.into();
4673        self
4674    }
4675
4676    /// Sets the value of [order_by][crate::model::ListPackagesRequest::order_by].
4677    ///
4678    /// # Example
4679    /// ```ignore,no_run
4680    /// # use google_cloud_artifactregistry_v1::model::ListPackagesRequest;
4681    /// let x = ListPackagesRequest::new().set_order_by("example");
4682    /// ```
4683    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4684        self.order_by = v.into();
4685        self
4686    }
4687}
4688
4689impl wkt::message::Message for ListPackagesRequest {
4690    fn typename() -> &'static str {
4691        "type.googleapis.com/google.devtools.artifactregistry.v1.ListPackagesRequest"
4692    }
4693}
4694
4695/// The response from listing packages.
4696#[derive(Clone, Default, PartialEq)]
4697#[non_exhaustive]
4698pub struct ListPackagesResponse {
4699    /// The packages returned.
4700    pub packages: std::vec::Vec<crate::model::Package>,
4701
4702    /// The token to retrieve the next page of packages, or empty if there are no
4703    /// more packages to return.
4704    pub next_page_token: std::string::String,
4705
4706    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4707}
4708
4709impl ListPackagesResponse {
4710    pub fn new() -> Self {
4711        std::default::Default::default()
4712    }
4713
4714    /// Sets the value of [packages][crate::model::ListPackagesResponse::packages].
4715    ///
4716    /// # Example
4717    /// ```ignore,no_run
4718    /// # use google_cloud_artifactregistry_v1::model::ListPackagesResponse;
4719    /// use google_cloud_artifactregistry_v1::model::Package;
4720    /// let x = ListPackagesResponse::new()
4721    ///     .set_packages([
4722    ///         Package::default()/* use setters */,
4723    ///         Package::default()/* use (different) setters */,
4724    ///     ]);
4725    /// ```
4726    pub fn set_packages<T, V>(mut self, v: T) -> Self
4727    where
4728        T: std::iter::IntoIterator<Item = V>,
4729        V: std::convert::Into<crate::model::Package>,
4730    {
4731        use std::iter::Iterator;
4732        self.packages = v.into_iter().map(|i| i.into()).collect();
4733        self
4734    }
4735
4736    /// Sets the value of [next_page_token][crate::model::ListPackagesResponse::next_page_token].
4737    ///
4738    /// # Example
4739    /// ```ignore,no_run
4740    /// # use google_cloud_artifactregistry_v1::model::ListPackagesResponse;
4741    /// let x = ListPackagesResponse::new().set_next_page_token("example");
4742    /// ```
4743    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4744        self.next_page_token = v.into();
4745        self
4746    }
4747}
4748
4749impl wkt::message::Message for ListPackagesResponse {
4750    fn typename() -> &'static str {
4751        "type.googleapis.com/google.devtools.artifactregistry.v1.ListPackagesResponse"
4752    }
4753}
4754
4755#[doc(hidden)]
4756impl google_cloud_gax::paginator::internal::PageableResponse for ListPackagesResponse {
4757    type PageItem = crate::model::Package;
4758
4759    fn items(self) -> std::vec::Vec<Self::PageItem> {
4760        self.packages
4761    }
4762
4763    fn next_page_token(&self) -> std::string::String {
4764        use std::clone::Clone;
4765        self.next_page_token.clone()
4766    }
4767}
4768
4769/// The request to retrieve a package.
4770#[derive(Clone, Default, PartialEq)]
4771#[non_exhaustive]
4772pub struct GetPackageRequest {
4773    /// Required. The name of the package to retrieve.
4774    pub name: std::string::String,
4775
4776    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4777}
4778
4779impl GetPackageRequest {
4780    pub fn new() -> Self {
4781        std::default::Default::default()
4782    }
4783
4784    /// Sets the value of [name][crate::model::GetPackageRequest::name].
4785    ///
4786    /// # Example
4787    /// ```ignore,no_run
4788    /// # use google_cloud_artifactregistry_v1::model::GetPackageRequest;
4789    /// let x = GetPackageRequest::new().set_name("example");
4790    /// ```
4791    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4792        self.name = v.into();
4793        self
4794    }
4795}
4796
4797impl wkt::message::Message for GetPackageRequest {
4798    fn typename() -> &'static str {
4799        "type.googleapis.com/google.devtools.artifactregistry.v1.GetPackageRequest"
4800    }
4801}
4802
4803/// The request to delete a package.
4804#[derive(Clone, Default, PartialEq)]
4805#[non_exhaustive]
4806pub struct DeletePackageRequest {
4807    /// Required. The name of the package to delete.
4808    pub name: std::string::String,
4809
4810    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4811}
4812
4813impl DeletePackageRequest {
4814    pub fn new() -> Self {
4815        std::default::Default::default()
4816    }
4817
4818    /// Sets the value of [name][crate::model::DeletePackageRequest::name].
4819    ///
4820    /// # Example
4821    /// ```ignore,no_run
4822    /// # use google_cloud_artifactregistry_v1::model::DeletePackageRequest;
4823    /// let x = DeletePackageRequest::new().set_name("example");
4824    /// ```
4825    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4826        self.name = v.into();
4827        self
4828    }
4829}
4830
4831impl wkt::message::Message for DeletePackageRequest {
4832    fn typename() -> &'static str {
4833        "type.googleapis.com/google.devtools.artifactregistry.v1.DeletePackageRequest"
4834    }
4835}
4836
4837/// The request to update a package.
4838#[derive(Clone, Default, PartialEq)]
4839#[non_exhaustive]
4840pub struct UpdatePackageRequest {
4841    /// The package that replaces the resource on the server.
4842    pub package: std::option::Option<crate::model::Package>,
4843
4844    /// The update mask applies to the resource. For the `FieldMask` definition,
4845    /// see
4846    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
4847    pub update_mask: std::option::Option<wkt::FieldMask>,
4848
4849    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4850}
4851
4852impl UpdatePackageRequest {
4853    pub fn new() -> Self {
4854        std::default::Default::default()
4855    }
4856
4857    /// Sets the value of [package][crate::model::UpdatePackageRequest::package].
4858    ///
4859    /// # Example
4860    /// ```ignore,no_run
4861    /// # use google_cloud_artifactregistry_v1::model::UpdatePackageRequest;
4862    /// use google_cloud_artifactregistry_v1::model::Package;
4863    /// let x = UpdatePackageRequest::new().set_package(Package::default()/* use setters */);
4864    /// ```
4865    pub fn set_package<T>(mut self, v: T) -> Self
4866    where
4867        T: std::convert::Into<crate::model::Package>,
4868    {
4869        self.package = std::option::Option::Some(v.into());
4870        self
4871    }
4872
4873    /// Sets or clears the value of [package][crate::model::UpdatePackageRequest::package].
4874    ///
4875    /// # Example
4876    /// ```ignore,no_run
4877    /// # use google_cloud_artifactregistry_v1::model::UpdatePackageRequest;
4878    /// use google_cloud_artifactregistry_v1::model::Package;
4879    /// let x = UpdatePackageRequest::new().set_or_clear_package(Some(Package::default()/* use setters */));
4880    /// let x = UpdatePackageRequest::new().set_or_clear_package(None::<Package>);
4881    /// ```
4882    pub fn set_or_clear_package<T>(mut self, v: std::option::Option<T>) -> Self
4883    where
4884        T: std::convert::Into<crate::model::Package>,
4885    {
4886        self.package = v.map(|x| x.into());
4887        self
4888    }
4889
4890    /// Sets the value of [update_mask][crate::model::UpdatePackageRequest::update_mask].
4891    ///
4892    /// # Example
4893    /// ```ignore,no_run
4894    /// # use google_cloud_artifactregistry_v1::model::UpdatePackageRequest;
4895    /// use wkt::FieldMask;
4896    /// let x = UpdatePackageRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4897    /// ```
4898    pub fn set_update_mask<T>(mut self, v: T) -> Self
4899    where
4900        T: std::convert::Into<wkt::FieldMask>,
4901    {
4902        self.update_mask = std::option::Option::Some(v.into());
4903        self
4904    }
4905
4906    /// Sets or clears the value of [update_mask][crate::model::UpdatePackageRequest::update_mask].
4907    ///
4908    /// # Example
4909    /// ```ignore,no_run
4910    /// # use google_cloud_artifactregistry_v1::model::UpdatePackageRequest;
4911    /// use wkt::FieldMask;
4912    /// let x = UpdatePackageRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4913    /// let x = UpdatePackageRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4914    /// ```
4915    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4916    where
4917        T: std::convert::Into<wkt::FieldMask>,
4918    {
4919        self.update_mask = v.map(|x| x.into());
4920        self
4921    }
4922}
4923
4924impl wkt::message::Message for UpdatePackageRequest {
4925    fn typename() -> &'static str {
4926        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdatePackageRequest"
4927    }
4928}
4929
4930/// Artifact policy configuration for the repository contents.
4931#[derive(Clone, Default, PartialEq)]
4932#[non_exhaustive]
4933pub struct UpstreamPolicy {
4934    /// The user-provided ID of the upstream policy.
4935    pub id: std::string::String,
4936
4937    /// A reference to the repository resource, for example:
4938    /// `projects/p1/locations/us-central1/repositories/repo1`.
4939    pub repository: std::string::String,
4940
4941    /// Entries with a greater priority value take precedence in the pull order.
4942    pub priority: i32,
4943
4944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4945}
4946
4947impl UpstreamPolicy {
4948    pub fn new() -> Self {
4949        std::default::Default::default()
4950    }
4951
4952    /// Sets the value of [id][crate::model::UpstreamPolicy::id].
4953    ///
4954    /// # Example
4955    /// ```ignore,no_run
4956    /// # use google_cloud_artifactregistry_v1::model::UpstreamPolicy;
4957    /// let x = UpstreamPolicy::new().set_id("example");
4958    /// ```
4959    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4960        self.id = v.into();
4961        self
4962    }
4963
4964    /// Sets the value of [repository][crate::model::UpstreamPolicy::repository].
4965    ///
4966    /// # Example
4967    /// ```ignore,no_run
4968    /// # use google_cloud_artifactregistry_v1::model::UpstreamPolicy;
4969    /// let x = UpstreamPolicy::new().set_repository("example");
4970    /// ```
4971    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4972        self.repository = v.into();
4973        self
4974    }
4975
4976    /// Sets the value of [priority][crate::model::UpstreamPolicy::priority].
4977    ///
4978    /// # Example
4979    /// ```ignore,no_run
4980    /// # use google_cloud_artifactregistry_v1::model::UpstreamPolicy;
4981    /// let x = UpstreamPolicy::new().set_priority(42);
4982    /// ```
4983    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4984        self.priority = v.into();
4985        self
4986    }
4987}
4988
4989impl wkt::message::Message for UpstreamPolicy {
4990    fn typename() -> &'static str {
4991        "type.googleapis.com/google.devtools.artifactregistry.v1.UpstreamPolicy"
4992    }
4993}
4994
4995/// CleanupPolicyCondition is a set of conditions attached to a CleanupPolicy.
4996/// If multiple entries are set, all must be satisfied for the condition to be
4997/// satisfied.
4998#[derive(Clone, Default, PartialEq)]
4999#[non_exhaustive]
5000pub struct CleanupPolicyCondition {
5001    /// Match versions by tag status.
5002    pub tag_state: std::option::Option<crate::model::cleanup_policy_condition::TagState>,
5003
5004    /// Match versions by tag prefix. Applied on any prefix match.
5005    pub tag_prefixes: std::vec::Vec<std::string::String>,
5006
5007    /// Match versions by version name prefix. Applied on any prefix match.
5008    pub version_name_prefixes: std::vec::Vec<std::string::String>,
5009
5010    /// Match versions by package prefix. Applied on any prefix match.
5011    pub package_name_prefixes: std::vec::Vec<std::string::String>,
5012
5013    /// Match versions older than a duration.
5014    pub older_than: std::option::Option<wkt::Duration>,
5015
5016    /// Match versions newer than a duration.
5017    pub newer_than: std::option::Option<wkt::Duration>,
5018
5019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5020}
5021
5022impl CleanupPolicyCondition {
5023    pub fn new() -> Self {
5024        std::default::Default::default()
5025    }
5026
5027    /// Sets the value of [tag_state][crate::model::CleanupPolicyCondition::tag_state].
5028    ///
5029    /// # Example
5030    /// ```ignore,no_run
5031    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5032    /// use google_cloud_artifactregistry_v1::model::cleanup_policy_condition::TagState;
5033    /// let x0 = CleanupPolicyCondition::new().set_tag_state(TagState::Tagged);
5034    /// let x1 = CleanupPolicyCondition::new().set_tag_state(TagState::Untagged);
5035    /// let x2 = CleanupPolicyCondition::new().set_tag_state(TagState::Any);
5036    /// ```
5037    pub fn set_tag_state<T>(mut self, v: T) -> Self
5038    where
5039        T: std::convert::Into<crate::model::cleanup_policy_condition::TagState>,
5040    {
5041        self.tag_state = std::option::Option::Some(v.into());
5042        self
5043    }
5044
5045    /// Sets or clears the value of [tag_state][crate::model::CleanupPolicyCondition::tag_state].
5046    ///
5047    /// # Example
5048    /// ```ignore,no_run
5049    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5050    /// use google_cloud_artifactregistry_v1::model::cleanup_policy_condition::TagState;
5051    /// let x0 = CleanupPolicyCondition::new().set_or_clear_tag_state(Some(TagState::Tagged));
5052    /// let x1 = CleanupPolicyCondition::new().set_or_clear_tag_state(Some(TagState::Untagged));
5053    /// let x2 = CleanupPolicyCondition::new().set_or_clear_tag_state(Some(TagState::Any));
5054    /// let x_none = CleanupPolicyCondition::new().set_or_clear_tag_state(None::<TagState>);
5055    /// ```
5056    pub fn set_or_clear_tag_state<T>(mut self, v: std::option::Option<T>) -> Self
5057    where
5058        T: std::convert::Into<crate::model::cleanup_policy_condition::TagState>,
5059    {
5060        self.tag_state = v.map(|x| x.into());
5061        self
5062    }
5063
5064    /// Sets the value of [tag_prefixes][crate::model::CleanupPolicyCondition::tag_prefixes].
5065    ///
5066    /// # Example
5067    /// ```ignore,no_run
5068    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5069    /// let x = CleanupPolicyCondition::new().set_tag_prefixes(["a", "b", "c"]);
5070    /// ```
5071    pub fn set_tag_prefixes<T, V>(mut self, v: T) -> Self
5072    where
5073        T: std::iter::IntoIterator<Item = V>,
5074        V: std::convert::Into<std::string::String>,
5075    {
5076        use std::iter::Iterator;
5077        self.tag_prefixes = v.into_iter().map(|i| i.into()).collect();
5078        self
5079    }
5080
5081    /// Sets the value of [version_name_prefixes][crate::model::CleanupPolicyCondition::version_name_prefixes].
5082    ///
5083    /// # Example
5084    /// ```ignore,no_run
5085    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5086    /// let x = CleanupPolicyCondition::new().set_version_name_prefixes(["a", "b", "c"]);
5087    /// ```
5088    pub fn set_version_name_prefixes<T, V>(mut self, v: T) -> Self
5089    where
5090        T: std::iter::IntoIterator<Item = V>,
5091        V: std::convert::Into<std::string::String>,
5092    {
5093        use std::iter::Iterator;
5094        self.version_name_prefixes = v.into_iter().map(|i| i.into()).collect();
5095        self
5096    }
5097
5098    /// Sets the value of [package_name_prefixes][crate::model::CleanupPolicyCondition::package_name_prefixes].
5099    ///
5100    /// # Example
5101    /// ```ignore,no_run
5102    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5103    /// let x = CleanupPolicyCondition::new().set_package_name_prefixes(["a", "b", "c"]);
5104    /// ```
5105    pub fn set_package_name_prefixes<T, V>(mut self, v: T) -> Self
5106    where
5107        T: std::iter::IntoIterator<Item = V>,
5108        V: std::convert::Into<std::string::String>,
5109    {
5110        use std::iter::Iterator;
5111        self.package_name_prefixes = v.into_iter().map(|i| i.into()).collect();
5112        self
5113    }
5114
5115    /// Sets the value of [older_than][crate::model::CleanupPolicyCondition::older_than].
5116    ///
5117    /// # Example
5118    /// ```ignore,no_run
5119    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5120    /// use wkt::Duration;
5121    /// let x = CleanupPolicyCondition::new().set_older_than(Duration::default()/* use setters */);
5122    /// ```
5123    pub fn set_older_than<T>(mut self, v: T) -> Self
5124    where
5125        T: std::convert::Into<wkt::Duration>,
5126    {
5127        self.older_than = std::option::Option::Some(v.into());
5128        self
5129    }
5130
5131    /// Sets or clears the value of [older_than][crate::model::CleanupPolicyCondition::older_than].
5132    ///
5133    /// # Example
5134    /// ```ignore,no_run
5135    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5136    /// use wkt::Duration;
5137    /// let x = CleanupPolicyCondition::new().set_or_clear_older_than(Some(Duration::default()/* use setters */));
5138    /// let x = CleanupPolicyCondition::new().set_or_clear_older_than(None::<Duration>);
5139    /// ```
5140    pub fn set_or_clear_older_than<T>(mut self, v: std::option::Option<T>) -> Self
5141    where
5142        T: std::convert::Into<wkt::Duration>,
5143    {
5144        self.older_than = v.map(|x| x.into());
5145        self
5146    }
5147
5148    /// Sets the value of [newer_than][crate::model::CleanupPolicyCondition::newer_than].
5149    ///
5150    /// # Example
5151    /// ```ignore,no_run
5152    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5153    /// use wkt::Duration;
5154    /// let x = CleanupPolicyCondition::new().set_newer_than(Duration::default()/* use setters */);
5155    /// ```
5156    pub fn set_newer_than<T>(mut self, v: T) -> Self
5157    where
5158        T: std::convert::Into<wkt::Duration>,
5159    {
5160        self.newer_than = std::option::Option::Some(v.into());
5161        self
5162    }
5163
5164    /// Sets or clears the value of [newer_than][crate::model::CleanupPolicyCondition::newer_than].
5165    ///
5166    /// # Example
5167    /// ```ignore,no_run
5168    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5169    /// use wkt::Duration;
5170    /// let x = CleanupPolicyCondition::new().set_or_clear_newer_than(Some(Duration::default()/* use setters */));
5171    /// let x = CleanupPolicyCondition::new().set_or_clear_newer_than(None::<Duration>);
5172    /// ```
5173    pub fn set_or_clear_newer_than<T>(mut self, v: std::option::Option<T>) -> Self
5174    where
5175        T: std::convert::Into<wkt::Duration>,
5176    {
5177        self.newer_than = v.map(|x| x.into());
5178        self
5179    }
5180}
5181
5182impl wkt::message::Message for CleanupPolicyCondition {
5183    fn typename() -> &'static str {
5184        "type.googleapis.com/google.devtools.artifactregistry.v1.CleanupPolicyCondition"
5185    }
5186}
5187
5188/// Defines additional types related to [CleanupPolicyCondition].
5189pub mod cleanup_policy_condition {
5190    #[allow(unused_imports)]
5191    use super::*;
5192
5193    /// Statuses applying to versions.
5194    ///
5195    /// # Working with unknown values
5196    ///
5197    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5198    /// additional enum variants at any time. Adding new variants is not considered
5199    /// a breaking change. Applications should write their code in anticipation of:
5200    ///
5201    /// - New values appearing in future releases of the client library, **and**
5202    /// - New values received dynamically, without application changes.
5203    ///
5204    /// Please consult the [Working with enums] section in the user guide for some
5205    /// guidelines.
5206    ///
5207    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5208    #[derive(Clone, Debug, PartialEq)]
5209    #[non_exhaustive]
5210    pub enum TagState {
5211        /// Tag status not specified.
5212        Unspecified,
5213        /// Applies to tagged versions only.
5214        Tagged,
5215        /// Applies to untagged versions only.
5216        Untagged,
5217        /// Applies to all versions.
5218        Any,
5219        /// If set, the enum was initialized with an unknown value.
5220        ///
5221        /// Applications can examine the value using [TagState::value] or
5222        /// [TagState::name].
5223        UnknownValue(tag_state::UnknownValue),
5224    }
5225
5226    #[doc(hidden)]
5227    pub mod tag_state {
5228        #[allow(unused_imports)]
5229        use super::*;
5230        #[derive(Clone, Debug, PartialEq)]
5231        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5232    }
5233
5234    impl TagState {
5235        /// Gets the enum value.
5236        ///
5237        /// Returns `None` if the enum contains an unknown value deserialized from
5238        /// the string representation of enums.
5239        pub fn value(&self) -> std::option::Option<i32> {
5240            match self {
5241                Self::Unspecified => std::option::Option::Some(0),
5242                Self::Tagged => std::option::Option::Some(1),
5243                Self::Untagged => std::option::Option::Some(2),
5244                Self::Any => std::option::Option::Some(3),
5245                Self::UnknownValue(u) => u.0.value(),
5246            }
5247        }
5248
5249        /// Gets the enum value as a string.
5250        ///
5251        /// Returns `None` if the enum contains an unknown value deserialized from
5252        /// the integer representation of enums.
5253        pub fn name(&self) -> std::option::Option<&str> {
5254            match self {
5255                Self::Unspecified => std::option::Option::Some("TAG_STATE_UNSPECIFIED"),
5256                Self::Tagged => std::option::Option::Some("TAGGED"),
5257                Self::Untagged => std::option::Option::Some("UNTAGGED"),
5258                Self::Any => std::option::Option::Some("ANY"),
5259                Self::UnknownValue(u) => u.0.name(),
5260            }
5261        }
5262    }
5263
5264    impl std::default::Default for TagState {
5265        fn default() -> Self {
5266            use std::convert::From;
5267            Self::from(0)
5268        }
5269    }
5270
5271    impl std::fmt::Display for TagState {
5272        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5273            wkt::internal::display_enum(f, self.name(), self.value())
5274        }
5275    }
5276
5277    impl std::convert::From<i32> for TagState {
5278        fn from(value: i32) -> Self {
5279            match value {
5280                0 => Self::Unspecified,
5281                1 => Self::Tagged,
5282                2 => Self::Untagged,
5283                3 => Self::Any,
5284                _ => Self::UnknownValue(tag_state::UnknownValue(
5285                    wkt::internal::UnknownEnumValue::Integer(value),
5286                )),
5287            }
5288        }
5289    }
5290
5291    impl std::convert::From<&str> for TagState {
5292        fn from(value: &str) -> Self {
5293            use std::string::ToString;
5294            match value {
5295                "TAG_STATE_UNSPECIFIED" => Self::Unspecified,
5296                "TAGGED" => Self::Tagged,
5297                "UNTAGGED" => Self::Untagged,
5298                "ANY" => Self::Any,
5299                _ => Self::UnknownValue(tag_state::UnknownValue(
5300                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5301                )),
5302            }
5303        }
5304    }
5305
5306    impl serde::ser::Serialize for TagState {
5307        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5308        where
5309            S: serde::Serializer,
5310        {
5311            match self {
5312                Self::Unspecified => serializer.serialize_i32(0),
5313                Self::Tagged => serializer.serialize_i32(1),
5314                Self::Untagged => serializer.serialize_i32(2),
5315                Self::Any => serializer.serialize_i32(3),
5316                Self::UnknownValue(u) => u.0.serialize(serializer),
5317            }
5318        }
5319    }
5320
5321    impl<'de> serde::de::Deserialize<'de> for TagState {
5322        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5323        where
5324            D: serde::Deserializer<'de>,
5325        {
5326            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TagState>::new(
5327                ".google.devtools.artifactregistry.v1.CleanupPolicyCondition.TagState",
5328            ))
5329        }
5330    }
5331}
5332
5333/// CleanupPolicyMostRecentVersions is an alternate condition of a CleanupPolicy
5334/// for retaining a minimum number of versions.
5335#[derive(Clone, Default, PartialEq)]
5336#[non_exhaustive]
5337pub struct CleanupPolicyMostRecentVersions {
5338    /// List of package name prefixes that will apply this rule.
5339    pub package_name_prefixes: std::vec::Vec<std::string::String>,
5340
5341    /// Minimum number of versions to keep.
5342    pub keep_count: std::option::Option<i32>,
5343
5344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5345}
5346
5347impl CleanupPolicyMostRecentVersions {
5348    pub fn new() -> Self {
5349        std::default::Default::default()
5350    }
5351
5352    /// Sets the value of [package_name_prefixes][crate::model::CleanupPolicyMostRecentVersions::package_name_prefixes].
5353    ///
5354    /// # Example
5355    /// ```ignore,no_run
5356    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyMostRecentVersions;
5357    /// let x = CleanupPolicyMostRecentVersions::new().set_package_name_prefixes(["a", "b", "c"]);
5358    /// ```
5359    pub fn set_package_name_prefixes<T, V>(mut self, v: T) -> Self
5360    where
5361        T: std::iter::IntoIterator<Item = V>,
5362        V: std::convert::Into<std::string::String>,
5363    {
5364        use std::iter::Iterator;
5365        self.package_name_prefixes = v.into_iter().map(|i| i.into()).collect();
5366        self
5367    }
5368
5369    /// Sets the value of [keep_count][crate::model::CleanupPolicyMostRecentVersions::keep_count].
5370    ///
5371    /// # Example
5372    /// ```ignore,no_run
5373    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyMostRecentVersions;
5374    /// let x = CleanupPolicyMostRecentVersions::new().set_keep_count(42);
5375    /// ```
5376    pub fn set_keep_count<T>(mut self, v: T) -> Self
5377    where
5378        T: std::convert::Into<i32>,
5379    {
5380        self.keep_count = std::option::Option::Some(v.into());
5381        self
5382    }
5383
5384    /// Sets or clears the value of [keep_count][crate::model::CleanupPolicyMostRecentVersions::keep_count].
5385    ///
5386    /// # Example
5387    /// ```ignore,no_run
5388    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicyMostRecentVersions;
5389    /// let x = CleanupPolicyMostRecentVersions::new().set_or_clear_keep_count(Some(42));
5390    /// let x = CleanupPolicyMostRecentVersions::new().set_or_clear_keep_count(None::<i32>);
5391    /// ```
5392    pub fn set_or_clear_keep_count<T>(mut self, v: std::option::Option<T>) -> Self
5393    where
5394        T: std::convert::Into<i32>,
5395    {
5396        self.keep_count = v.map(|x| x.into());
5397        self
5398    }
5399}
5400
5401impl wkt::message::Message for CleanupPolicyMostRecentVersions {
5402    fn typename() -> &'static str {
5403        "type.googleapis.com/google.devtools.artifactregistry.v1.CleanupPolicyMostRecentVersions"
5404    }
5405}
5406
5407/// Artifact policy configuration for repository cleanup policies.
5408#[derive(Clone, Default, PartialEq)]
5409#[non_exhaustive]
5410pub struct CleanupPolicy {
5411    /// The user-provided ID of the cleanup policy.
5412    pub id: std::string::String,
5413
5414    /// Policy action.
5415    pub action: crate::model::cleanup_policy::Action,
5416
5417    pub condition_type: std::option::Option<crate::model::cleanup_policy::ConditionType>,
5418
5419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5420}
5421
5422impl CleanupPolicy {
5423    pub fn new() -> Self {
5424        std::default::Default::default()
5425    }
5426
5427    /// Sets the value of [id][crate::model::CleanupPolicy::id].
5428    ///
5429    /// # Example
5430    /// ```ignore,no_run
5431    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicy;
5432    /// let x = CleanupPolicy::new().set_id("example");
5433    /// ```
5434    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5435        self.id = v.into();
5436        self
5437    }
5438
5439    /// Sets the value of [action][crate::model::CleanupPolicy::action].
5440    ///
5441    /// # Example
5442    /// ```ignore,no_run
5443    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicy;
5444    /// use google_cloud_artifactregistry_v1::model::cleanup_policy::Action;
5445    /// let x0 = CleanupPolicy::new().set_action(Action::Delete);
5446    /// let x1 = CleanupPolicy::new().set_action(Action::Keep);
5447    /// ```
5448    pub fn set_action<T: std::convert::Into<crate::model::cleanup_policy::Action>>(
5449        mut self,
5450        v: T,
5451    ) -> Self {
5452        self.action = v.into();
5453        self
5454    }
5455
5456    /// Sets the value of [condition_type][crate::model::CleanupPolicy::condition_type].
5457    ///
5458    /// Note that all the setters affecting `condition_type` are mutually
5459    /// exclusive.
5460    ///
5461    /// # Example
5462    /// ```ignore,no_run
5463    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicy;
5464    /// use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5465    /// let x = CleanupPolicy::new().set_condition_type(Some(
5466    ///     google_cloud_artifactregistry_v1::model::cleanup_policy::ConditionType::Condition(CleanupPolicyCondition::default().into())));
5467    /// ```
5468    pub fn set_condition_type<
5469        T: std::convert::Into<std::option::Option<crate::model::cleanup_policy::ConditionType>>,
5470    >(
5471        mut self,
5472        v: T,
5473    ) -> Self {
5474        self.condition_type = v.into();
5475        self
5476    }
5477
5478    /// The value of [condition_type][crate::model::CleanupPolicy::condition_type]
5479    /// if it holds a `Condition`, `None` if the field is not set or
5480    /// holds a different branch.
5481    pub fn condition(
5482        &self,
5483    ) -> std::option::Option<&std::boxed::Box<crate::model::CleanupPolicyCondition>> {
5484        #[allow(unreachable_patterns)]
5485        self.condition_type.as_ref().and_then(|v| match v {
5486            crate::model::cleanup_policy::ConditionType::Condition(v) => {
5487                std::option::Option::Some(v)
5488            }
5489            _ => std::option::Option::None,
5490        })
5491    }
5492
5493    /// Sets the value of [condition_type][crate::model::CleanupPolicy::condition_type]
5494    /// to hold a `Condition`.
5495    ///
5496    /// Note that all the setters affecting `condition_type` are
5497    /// mutually exclusive.
5498    ///
5499    /// # Example
5500    /// ```ignore,no_run
5501    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicy;
5502    /// use google_cloud_artifactregistry_v1::model::CleanupPolicyCondition;
5503    /// let x = CleanupPolicy::new().set_condition(CleanupPolicyCondition::default()/* use setters */);
5504    /// assert!(x.condition().is_some());
5505    /// assert!(x.most_recent_versions().is_none());
5506    /// ```
5507    pub fn set_condition<
5508        T: std::convert::Into<std::boxed::Box<crate::model::CleanupPolicyCondition>>,
5509    >(
5510        mut self,
5511        v: T,
5512    ) -> Self {
5513        self.condition_type = std::option::Option::Some(
5514            crate::model::cleanup_policy::ConditionType::Condition(v.into()),
5515        );
5516        self
5517    }
5518
5519    /// The value of [condition_type][crate::model::CleanupPolicy::condition_type]
5520    /// if it holds a `MostRecentVersions`, `None` if the field is not set or
5521    /// holds a different branch.
5522    pub fn most_recent_versions(
5523        &self,
5524    ) -> std::option::Option<&std::boxed::Box<crate::model::CleanupPolicyMostRecentVersions>> {
5525        #[allow(unreachable_patterns)]
5526        self.condition_type.as_ref().and_then(|v| match v {
5527            crate::model::cleanup_policy::ConditionType::MostRecentVersions(v) => {
5528                std::option::Option::Some(v)
5529            }
5530            _ => std::option::Option::None,
5531        })
5532    }
5533
5534    /// Sets the value of [condition_type][crate::model::CleanupPolicy::condition_type]
5535    /// to hold a `MostRecentVersions`.
5536    ///
5537    /// Note that all the setters affecting `condition_type` are
5538    /// mutually exclusive.
5539    ///
5540    /// # Example
5541    /// ```ignore,no_run
5542    /// # use google_cloud_artifactregistry_v1::model::CleanupPolicy;
5543    /// use google_cloud_artifactregistry_v1::model::CleanupPolicyMostRecentVersions;
5544    /// let x = CleanupPolicy::new().set_most_recent_versions(CleanupPolicyMostRecentVersions::default()/* use setters */);
5545    /// assert!(x.most_recent_versions().is_some());
5546    /// assert!(x.condition().is_none());
5547    /// ```
5548    pub fn set_most_recent_versions<
5549        T: std::convert::Into<std::boxed::Box<crate::model::CleanupPolicyMostRecentVersions>>,
5550    >(
5551        mut self,
5552        v: T,
5553    ) -> Self {
5554        self.condition_type = std::option::Option::Some(
5555            crate::model::cleanup_policy::ConditionType::MostRecentVersions(v.into()),
5556        );
5557        self
5558    }
5559}
5560
5561impl wkt::message::Message for CleanupPolicy {
5562    fn typename() -> &'static str {
5563        "type.googleapis.com/google.devtools.artifactregistry.v1.CleanupPolicy"
5564    }
5565}
5566
5567/// Defines additional types related to [CleanupPolicy].
5568pub mod cleanup_policy {
5569    #[allow(unused_imports)]
5570    use super::*;
5571
5572    /// Action type for a cleanup policy.
5573    ///
5574    /// # Working with unknown values
5575    ///
5576    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5577    /// additional enum variants at any time. Adding new variants is not considered
5578    /// a breaking change. Applications should write their code in anticipation of:
5579    ///
5580    /// - New values appearing in future releases of the client library, **and**
5581    /// - New values received dynamically, without application changes.
5582    ///
5583    /// Please consult the [Working with enums] section in the user guide for some
5584    /// guidelines.
5585    ///
5586    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5587    #[derive(Clone, Debug, PartialEq)]
5588    #[non_exhaustive]
5589    pub enum Action {
5590        /// Action not specified.
5591        Unspecified,
5592        /// Delete action.
5593        Delete,
5594        /// Keep action.
5595        Keep,
5596        /// If set, the enum was initialized with an unknown value.
5597        ///
5598        /// Applications can examine the value using [Action::value] or
5599        /// [Action::name].
5600        UnknownValue(action::UnknownValue),
5601    }
5602
5603    #[doc(hidden)]
5604    pub mod action {
5605        #[allow(unused_imports)]
5606        use super::*;
5607        #[derive(Clone, Debug, PartialEq)]
5608        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5609    }
5610
5611    impl Action {
5612        /// Gets the enum value.
5613        ///
5614        /// Returns `None` if the enum contains an unknown value deserialized from
5615        /// the string representation of enums.
5616        pub fn value(&self) -> std::option::Option<i32> {
5617            match self {
5618                Self::Unspecified => std::option::Option::Some(0),
5619                Self::Delete => std::option::Option::Some(1),
5620                Self::Keep => std::option::Option::Some(2),
5621                Self::UnknownValue(u) => u.0.value(),
5622            }
5623        }
5624
5625        /// Gets the enum value as a string.
5626        ///
5627        /// Returns `None` if the enum contains an unknown value deserialized from
5628        /// the integer representation of enums.
5629        pub fn name(&self) -> std::option::Option<&str> {
5630            match self {
5631                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
5632                Self::Delete => std::option::Option::Some("DELETE"),
5633                Self::Keep => std::option::Option::Some("KEEP"),
5634                Self::UnknownValue(u) => u.0.name(),
5635            }
5636        }
5637    }
5638
5639    impl std::default::Default for Action {
5640        fn default() -> Self {
5641            use std::convert::From;
5642            Self::from(0)
5643        }
5644    }
5645
5646    impl std::fmt::Display for Action {
5647        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5648            wkt::internal::display_enum(f, self.name(), self.value())
5649        }
5650    }
5651
5652    impl std::convert::From<i32> for Action {
5653        fn from(value: i32) -> Self {
5654            match value {
5655                0 => Self::Unspecified,
5656                1 => Self::Delete,
5657                2 => Self::Keep,
5658                _ => Self::UnknownValue(action::UnknownValue(
5659                    wkt::internal::UnknownEnumValue::Integer(value),
5660                )),
5661            }
5662        }
5663    }
5664
5665    impl std::convert::From<&str> for Action {
5666        fn from(value: &str) -> Self {
5667            use std::string::ToString;
5668            match value {
5669                "ACTION_UNSPECIFIED" => Self::Unspecified,
5670                "DELETE" => Self::Delete,
5671                "KEEP" => Self::Keep,
5672                _ => Self::UnknownValue(action::UnknownValue(
5673                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5674                )),
5675            }
5676        }
5677    }
5678
5679    impl serde::ser::Serialize for Action {
5680        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5681        where
5682            S: serde::Serializer,
5683        {
5684            match self {
5685                Self::Unspecified => serializer.serialize_i32(0),
5686                Self::Delete => serializer.serialize_i32(1),
5687                Self::Keep => serializer.serialize_i32(2),
5688                Self::UnknownValue(u) => u.0.serialize(serializer),
5689            }
5690        }
5691    }
5692
5693    impl<'de> serde::de::Deserialize<'de> for Action {
5694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5695        where
5696            D: serde::Deserializer<'de>,
5697        {
5698            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
5699                ".google.devtools.artifactregistry.v1.CleanupPolicy.Action",
5700            ))
5701        }
5702    }
5703
5704    #[derive(Clone, Debug, PartialEq)]
5705    #[non_exhaustive]
5706    pub enum ConditionType {
5707        /// Policy condition for matching versions.
5708        Condition(std::boxed::Box<crate::model::CleanupPolicyCondition>),
5709        /// Policy condition for retaining a minimum number of versions. May only be
5710        /// specified with a Keep action.
5711        MostRecentVersions(std::boxed::Box<crate::model::CleanupPolicyMostRecentVersions>),
5712    }
5713}
5714
5715/// Virtual repository configuration.
5716#[derive(Clone, Default, PartialEq)]
5717#[non_exhaustive]
5718pub struct VirtualRepositoryConfig {
5719    /// Policies that configure the upstream artifacts distributed by the Virtual
5720    /// Repository. Upstream policies cannot be set on a standard repository.
5721    pub upstream_policies: std::vec::Vec<crate::model::UpstreamPolicy>,
5722
5723    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5724}
5725
5726impl VirtualRepositoryConfig {
5727    pub fn new() -> Self {
5728        std::default::Default::default()
5729    }
5730
5731    /// Sets the value of [upstream_policies][crate::model::VirtualRepositoryConfig::upstream_policies].
5732    ///
5733    /// # Example
5734    /// ```ignore,no_run
5735    /// # use google_cloud_artifactregistry_v1::model::VirtualRepositoryConfig;
5736    /// use google_cloud_artifactregistry_v1::model::UpstreamPolicy;
5737    /// let x = VirtualRepositoryConfig::new()
5738    ///     .set_upstream_policies([
5739    ///         UpstreamPolicy::default()/* use setters */,
5740    ///         UpstreamPolicy::default()/* use (different) setters */,
5741    ///     ]);
5742    /// ```
5743    pub fn set_upstream_policies<T, V>(mut self, v: T) -> Self
5744    where
5745        T: std::iter::IntoIterator<Item = V>,
5746        V: std::convert::Into<crate::model::UpstreamPolicy>,
5747    {
5748        use std::iter::Iterator;
5749        self.upstream_policies = v.into_iter().map(|i| i.into()).collect();
5750        self
5751    }
5752}
5753
5754impl wkt::message::Message for VirtualRepositoryConfig {
5755    fn typename() -> &'static str {
5756        "type.googleapis.com/google.devtools.artifactregistry.v1.VirtualRepositoryConfig"
5757    }
5758}
5759
5760/// Remote repository configuration.
5761#[derive(Clone, Default, PartialEq)]
5762#[non_exhaustive]
5763pub struct RemoteRepositoryConfig {
5764    /// The description of the remote source.
5765    pub description: std::string::String,
5766
5767    /// Optional. The credentials used to access the remote repository.
5768    pub upstream_credentials:
5769        std::option::Option<crate::model::remote_repository_config::UpstreamCredentials>,
5770
5771    /// Input only. A create/update remote repo option to avoid making a HEAD/GET
5772    /// request to validate a remote repo and any supplied upstream credentials.
5773    pub disable_upstream_validation: bool,
5774
5775    /// Settings specific to the remote repository.
5776    pub remote_source: std::option::Option<crate::model::remote_repository_config::RemoteSource>,
5777
5778    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5779}
5780
5781impl RemoteRepositoryConfig {
5782    pub fn new() -> Self {
5783        std::default::Default::default()
5784    }
5785
5786    /// Sets the value of [description][crate::model::RemoteRepositoryConfig::description].
5787    ///
5788    /// # Example
5789    /// ```ignore,no_run
5790    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5791    /// let x = RemoteRepositoryConfig::new().set_description("example");
5792    /// ```
5793    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5794        self.description = v.into();
5795        self
5796    }
5797
5798    /// Sets the value of [upstream_credentials][crate::model::RemoteRepositoryConfig::upstream_credentials].
5799    ///
5800    /// # Example
5801    /// ```ignore,no_run
5802    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5803    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::UpstreamCredentials;
5804    /// let x = RemoteRepositoryConfig::new().set_upstream_credentials(UpstreamCredentials::default()/* use setters */);
5805    /// ```
5806    pub fn set_upstream_credentials<T>(mut self, v: T) -> Self
5807    where
5808        T: std::convert::Into<crate::model::remote_repository_config::UpstreamCredentials>,
5809    {
5810        self.upstream_credentials = std::option::Option::Some(v.into());
5811        self
5812    }
5813
5814    /// Sets or clears the value of [upstream_credentials][crate::model::RemoteRepositoryConfig::upstream_credentials].
5815    ///
5816    /// # Example
5817    /// ```ignore,no_run
5818    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5819    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::UpstreamCredentials;
5820    /// let x = RemoteRepositoryConfig::new().set_or_clear_upstream_credentials(Some(UpstreamCredentials::default()/* use setters */));
5821    /// let x = RemoteRepositoryConfig::new().set_or_clear_upstream_credentials(None::<UpstreamCredentials>);
5822    /// ```
5823    pub fn set_or_clear_upstream_credentials<T>(mut self, v: std::option::Option<T>) -> Self
5824    where
5825        T: std::convert::Into<crate::model::remote_repository_config::UpstreamCredentials>,
5826    {
5827        self.upstream_credentials = v.map(|x| x.into());
5828        self
5829    }
5830
5831    /// Sets the value of [disable_upstream_validation][crate::model::RemoteRepositoryConfig::disable_upstream_validation].
5832    ///
5833    /// # Example
5834    /// ```ignore,no_run
5835    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5836    /// let x = RemoteRepositoryConfig::new().set_disable_upstream_validation(true);
5837    /// ```
5838    pub fn set_disable_upstream_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5839        self.disable_upstream_validation = v.into();
5840        self
5841    }
5842
5843    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source].
5844    ///
5845    /// Note that all the setters affecting `remote_source` are mutually
5846    /// exclusive.
5847    ///
5848    /// # Example
5849    /// ```ignore,no_run
5850    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5851    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::DockerRepository;
5852    /// let x = RemoteRepositoryConfig::new().set_remote_source(Some(
5853    ///     google_cloud_artifactregistry_v1::model::remote_repository_config::RemoteSource::DockerRepository(DockerRepository::default().into())));
5854    /// ```
5855    pub fn set_remote_source<
5856        T: std::convert::Into<
5857                std::option::Option<crate::model::remote_repository_config::RemoteSource>,
5858            >,
5859    >(
5860        mut self,
5861        v: T,
5862    ) -> Self {
5863        self.remote_source = v.into();
5864        self
5865    }
5866
5867    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5868    /// if it holds a `DockerRepository`, `None` if the field is not set or
5869    /// holds a different branch.
5870    pub fn docker_repository(
5871        &self,
5872    ) -> std::option::Option<
5873        &std::boxed::Box<crate::model::remote_repository_config::DockerRepository>,
5874    > {
5875        #[allow(unreachable_patterns)]
5876        self.remote_source.as_ref().and_then(|v| match v {
5877            crate::model::remote_repository_config::RemoteSource::DockerRepository(v) => {
5878                std::option::Option::Some(v)
5879            }
5880            _ => std::option::Option::None,
5881        })
5882    }
5883
5884    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5885    /// to hold a `DockerRepository`.
5886    ///
5887    /// Note that all the setters affecting `remote_source` are
5888    /// mutually exclusive.
5889    ///
5890    /// # Example
5891    /// ```ignore,no_run
5892    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5893    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::DockerRepository;
5894    /// let x = RemoteRepositoryConfig::new().set_docker_repository(DockerRepository::default()/* use setters */);
5895    /// assert!(x.docker_repository().is_some());
5896    /// assert!(x.maven_repository().is_none());
5897    /// assert!(x.npm_repository().is_none());
5898    /// assert!(x.python_repository().is_none());
5899    /// assert!(x.apt_repository().is_none());
5900    /// assert!(x.yum_repository().is_none());
5901    /// assert!(x.common_repository().is_none());
5902    /// ```
5903    pub fn set_docker_repository<
5904        T: std::convert::Into<
5905                std::boxed::Box<crate::model::remote_repository_config::DockerRepository>,
5906            >,
5907    >(
5908        mut self,
5909        v: T,
5910    ) -> Self {
5911        self.remote_source = std::option::Option::Some(
5912            crate::model::remote_repository_config::RemoteSource::DockerRepository(v.into()),
5913        );
5914        self
5915    }
5916
5917    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5918    /// if it holds a `MavenRepository`, `None` if the field is not set or
5919    /// holds a different branch.
5920    pub fn maven_repository(
5921        &self,
5922    ) -> std::option::Option<
5923        &std::boxed::Box<crate::model::remote_repository_config::MavenRepository>,
5924    > {
5925        #[allow(unreachable_patterns)]
5926        self.remote_source.as_ref().and_then(|v| match v {
5927            crate::model::remote_repository_config::RemoteSource::MavenRepository(v) => {
5928                std::option::Option::Some(v)
5929            }
5930            _ => std::option::Option::None,
5931        })
5932    }
5933
5934    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5935    /// to hold a `MavenRepository`.
5936    ///
5937    /// Note that all the setters affecting `remote_source` are
5938    /// mutually exclusive.
5939    ///
5940    /// # Example
5941    /// ```ignore,no_run
5942    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5943    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::MavenRepository;
5944    /// let x = RemoteRepositoryConfig::new().set_maven_repository(MavenRepository::default()/* use setters */);
5945    /// assert!(x.maven_repository().is_some());
5946    /// assert!(x.docker_repository().is_none());
5947    /// assert!(x.npm_repository().is_none());
5948    /// assert!(x.python_repository().is_none());
5949    /// assert!(x.apt_repository().is_none());
5950    /// assert!(x.yum_repository().is_none());
5951    /// assert!(x.common_repository().is_none());
5952    /// ```
5953    pub fn set_maven_repository<
5954        T: std::convert::Into<
5955                std::boxed::Box<crate::model::remote_repository_config::MavenRepository>,
5956            >,
5957    >(
5958        mut self,
5959        v: T,
5960    ) -> Self {
5961        self.remote_source = std::option::Option::Some(
5962            crate::model::remote_repository_config::RemoteSource::MavenRepository(v.into()),
5963        );
5964        self
5965    }
5966
5967    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5968    /// if it holds a `NpmRepository`, `None` if the field is not set or
5969    /// holds a different branch.
5970    pub fn npm_repository(
5971        &self,
5972    ) -> std::option::Option<&std::boxed::Box<crate::model::remote_repository_config::NpmRepository>>
5973    {
5974        #[allow(unreachable_patterns)]
5975        self.remote_source.as_ref().and_then(|v| match v {
5976            crate::model::remote_repository_config::RemoteSource::NpmRepository(v) => {
5977                std::option::Option::Some(v)
5978            }
5979            _ => std::option::Option::None,
5980        })
5981    }
5982
5983    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
5984    /// to hold a `NpmRepository`.
5985    ///
5986    /// Note that all the setters affecting `remote_source` are
5987    /// mutually exclusive.
5988    ///
5989    /// # Example
5990    /// ```ignore,no_run
5991    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
5992    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::NpmRepository;
5993    /// let x = RemoteRepositoryConfig::new().set_npm_repository(NpmRepository::default()/* use setters */);
5994    /// assert!(x.npm_repository().is_some());
5995    /// assert!(x.docker_repository().is_none());
5996    /// assert!(x.maven_repository().is_none());
5997    /// assert!(x.python_repository().is_none());
5998    /// assert!(x.apt_repository().is_none());
5999    /// assert!(x.yum_repository().is_none());
6000    /// assert!(x.common_repository().is_none());
6001    /// ```
6002    pub fn set_npm_repository<
6003        T: std::convert::Into<std::boxed::Box<crate::model::remote_repository_config::NpmRepository>>,
6004    >(
6005        mut self,
6006        v: T,
6007    ) -> Self {
6008        self.remote_source = std::option::Option::Some(
6009            crate::model::remote_repository_config::RemoteSource::NpmRepository(v.into()),
6010        );
6011        self
6012    }
6013
6014    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6015    /// if it holds a `PythonRepository`, `None` if the field is not set or
6016    /// holds a different branch.
6017    pub fn python_repository(
6018        &self,
6019    ) -> std::option::Option<
6020        &std::boxed::Box<crate::model::remote_repository_config::PythonRepository>,
6021    > {
6022        #[allow(unreachable_patterns)]
6023        self.remote_source.as_ref().and_then(|v| match v {
6024            crate::model::remote_repository_config::RemoteSource::PythonRepository(v) => {
6025                std::option::Option::Some(v)
6026            }
6027            _ => std::option::Option::None,
6028        })
6029    }
6030
6031    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6032    /// to hold a `PythonRepository`.
6033    ///
6034    /// Note that all the setters affecting `remote_source` are
6035    /// mutually exclusive.
6036    ///
6037    /// # Example
6038    /// ```ignore,no_run
6039    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
6040    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::PythonRepository;
6041    /// let x = RemoteRepositoryConfig::new().set_python_repository(PythonRepository::default()/* use setters */);
6042    /// assert!(x.python_repository().is_some());
6043    /// assert!(x.docker_repository().is_none());
6044    /// assert!(x.maven_repository().is_none());
6045    /// assert!(x.npm_repository().is_none());
6046    /// assert!(x.apt_repository().is_none());
6047    /// assert!(x.yum_repository().is_none());
6048    /// assert!(x.common_repository().is_none());
6049    /// ```
6050    pub fn set_python_repository<
6051        T: std::convert::Into<
6052                std::boxed::Box<crate::model::remote_repository_config::PythonRepository>,
6053            >,
6054    >(
6055        mut self,
6056        v: T,
6057    ) -> Self {
6058        self.remote_source = std::option::Option::Some(
6059            crate::model::remote_repository_config::RemoteSource::PythonRepository(v.into()),
6060        );
6061        self
6062    }
6063
6064    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6065    /// if it holds a `AptRepository`, `None` if the field is not set or
6066    /// holds a different branch.
6067    pub fn apt_repository(
6068        &self,
6069    ) -> std::option::Option<&std::boxed::Box<crate::model::remote_repository_config::AptRepository>>
6070    {
6071        #[allow(unreachable_patterns)]
6072        self.remote_source.as_ref().and_then(|v| match v {
6073            crate::model::remote_repository_config::RemoteSource::AptRepository(v) => {
6074                std::option::Option::Some(v)
6075            }
6076            _ => std::option::Option::None,
6077        })
6078    }
6079
6080    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6081    /// to hold a `AptRepository`.
6082    ///
6083    /// Note that all the setters affecting `remote_source` are
6084    /// mutually exclusive.
6085    ///
6086    /// # Example
6087    /// ```ignore,no_run
6088    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
6089    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::AptRepository;
6090    /// let x = RemoteRepositoryConfig::new().set_apt_repository(AptRepository::default()/* use setters */);
6091    /// assert!(x.apt_repository().is_some());
6092    /// assert!(x.docker_repository().is_none());
6093    /// assert!(x.maven_repository().is_none());
6094    /// assert!(x.npm_repository().is_none());
6095    /// assert!(x.python_repository().is_none());
6096    /// assert!(x.yum_repository().is_none());
6097    /// assert!(x.common_repository().is_none());
6098    /// ```
6099    pub fn set_apt_repository<
6100        T: std::convert::Into<std::boxed::Box<crate::model::remote_repository_config::AptRepository>>,
6101    >(
6102        mut self,
6103        v: T,
6104    ) -> Self {
6105        self.remote_source = std::option::Option::Some(
6106            crate::model::remote_repository_config::RemoteSource::AptRepository(v.into()),
6107        );
6108        self
6109    }
6110
6111    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6112    /// if it holds a `YumRepository`, `None` if the field is not set or
6113    /// holds a different branch.
6114    pub fn yum_repository(
6115        &self,
6116    ) -> std::option::Option<&std::boxed::Box<crate::model::remote_repository_config::YumRepository>>
6117    {
6118        #[allow(unreachable_patterns)]
6119        self.remote_source.as_ref().and_then(|v| match v {
6120            crate::model::remote_repository_config::RemoteSource::YumRepository(v) => {
6121                std::option::Option::Some(v)
6122            }
6123            _ => std::option::Option::None,
6124        })
6125    }
6126
6127    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6128    /// to hold a `YumRepository`.
6129    ///
6130    /// Note that all the setters affecting `remote_source` are
6131    /// mutually exclusive.
6132    ///
6133    /// # Example
6134    /// ```ignore,no_run
6135    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
6136    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::YumRepository;
6137    /// let x = RemoteRepositoryConfig::new().set_yum_repository(YumRepository::default()/* use setters */);
6138    /// assert!(x.yum_repository().is_some());
6139    /// assert!(x.docker_repository().is_none());
6140    /// assert!(x.maven_repository().is_none());
6141    /// assert!(x.npm_repository().is_none());
6142    /// assert!(x.python_repository().is_none());
6143    /// assert!(x.apt_repository().is_none());
6144    /// assert!(x.common_repository().is_none());
6145    /// ```
6146    pub fn set_yum_repository<
6147        T: std::convert::Into<std::boxed::Box<crate::model::remote_repository_config::YumRepository>>,
6148    >(
6149        mut self,
6150        v: T,
6151    ) -> Self {
6152        self.remote_source = std::option::Option::Some(
6153            crate::model::remote_repository_config::RemoteSource::YumRepository(v.into()),
6154        );
6155        self
6156    }
6157
6158    /// The value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6159    /// if it holds a `CommonRepository`, `None` if the field is not set or
6160    /// holds a different branch.
6161    pub fn common_repository(
6162        &self,
6163    ) -> std::option::Option<
6164        &std::boxed::Box<crate::model::remote_repository_config::CommonRemoteRepository>,
6165    > {
6166        #[allow(unreachable_patterns)]
6167        self.remote_source.as_ref().and_then(|v| match v {
6168            crate::model::remote_repository_config::RemoteSource::CommonRepository(v) => {
6169                std::option::Option::Some(v)
6170            }
6171            _ => std::option::Option::None,
6172        })
6173    }
6174
6175    /// Sets the value of [remote_source][crate::model::RemoteRepositoryConfig::remote_source]
6176    /// to hold a `CommonRepository`.
6177    ///
6178    /// Note that all the setters affecting `remote_source` are
6179    /// mutually exclusive.
6180    ///
6181    /// # Example
6182    /// ```ignore,no_run
6183    /// # use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
6184    /// use google_cloud_artifactregistry_v1::model::remote_repository_config::CommonRemoteRepository;
6185    /// let x = RemoteRepositoryConfig::new().set_common_repository(CommonRemoteRepository::default()/* use setters */);
6186    /// assert!(x.common_repository().is_some());
6187    /// assert!(x.docker_repository().is_none());
6188    /// assert!(x.maven_repository().is_none());
6189    /// assert!(x.npm_repository().is_none());
6190    /// assert!(x.python_repository().is_none());
6191    /// assert!(x.apt_repository().is_none());
6192    /// assert!(x.yum_repository().is_none());
6193    /// ```
6194    pub fn set_common_repository<
6195        T: std::convert::Into<
6196                std::boxed::Box<crate::model::remote_repository_config::CommonRemoteRepository>,
6197            >,
6198    >(
6199        mut self,
6200        v: T,
6201    ) -> Self {
6202        self.remote_source = std::option::Option::Some(
6203            crate::model::remote_repository_config::RemoteSource::CommonRepository(v.into()),
6204        );
6205        self
6206    }
6207}
6208
6209impl wkt::message::Message for RemoteRepositoryConfig {
6210    fn typename() -> &'static str {
6211        "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig"
6212    }
6213}
6214
6215/// Defines additional types related to [RemoteRepositoryConfig].
6216pub mod remote_repository_config {
6217    #[allow(unused_imports)]
6218    use super::*;
6219
6220    /// The credentials to access the remote repository.
6221    #[derive(Clone, Default, PartialEq)]
6222    #[non_exhaustive]
6223    pub struct UpstreamCredentials {
6224        pub credentials: std::option::Option<
6225            crate::model::remote_repository_config::upstream_credentials::Credentials,
6226        >,
6227
6228        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6229    }
6230
6231    impl UpstreamCredentials {
6232        pub fn new() -> Self {
6233            std::default::Default::default()
6234        }
6235
6236        /// Sets the value of [credentials][crate::model::remote_repository_config::UpstreamCredentials::credentials].
6237        ///
6238        /// Note that all the setters affecting `credentials` are mutually
6239        /// exclusive.
6240        ///
6241        /// # Example
6242        /// ```ignore,no_run
6243        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::UpstreamCredentials;
6244        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials;
6245        /// let x = UpstreamCredentials::new().set_credentials(Some(
6246        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::upstream_credentials::Credentials::UsernamePasswordCredentials(UsernamePasswordCredentials::default().into())));
6247        /// ```
6248        pub fn set_credentials<
6249            T: std::convert::Into<
6250                    std::option::Option<
6251                        crate::model::remote_repository_config::upstream_credentials::Credentials,
6252                    >,
6253                >,
6254        >(
6255            mut self,
6256            v: T,
6257        ) -> Self {
6258            self.credentials = v.into();
6259            self
6260        }
6261
6262        /// The value of [credentials][crate::model::remote_repository_config::UpstreamCredentials::credentials]
6263        /// if it holds a `UsernamePasswordCredentials`, `None` if the field is not set or
6264        /// holds a different branch.
6265        pub fn username_password_credentials(&self) -> std::option::Option<&std::boxed::Box<crate::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials>>{
6266            #[allow(unreachable_patterns)]
6267            self.credentials.as_ref().and_then(|v| match v {
6268                crate::model::remote_repository_config::upstream_credentials::Credentials::UsernamePasswordCredentials(v) => std::option::Option::Some(v),
6269                _ => std::option::Option::None,
6270            })
6271        }
6272
6273        /// Sets the value of [credentials][crate::model::remote_repository_config::UpstreamCredentials::credentials]
6274        /// to hold a `UsernamePasswordCredentials`.
6275        ///
6276        /// Note that all the setters affecting `credentials` are
6277        /// mutually exclusive.
6278        ///
6279        /// # Example
6280        /// ```ignore,no_run
6281        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::UpstreamCredentials;
6282        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials;
6283        /// let x = UpstreamCredentials::new().set_username_password_credentials(UsernamePasswordCredentials::default()/* use setters */);
6284        /// assert!(x.username_password_credentials().is_some());
6285        /// ```
6286        pub fn set_username_password_credentials<T: std::convert::Into<std::boxed::Box<crate::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials>>>(mut self, v: T) -> Self{
6287            self.credentials = std::option::Option::Some(
6288                crate::model::remote_repository_config::upstream_credentials::Credentials::UsernamePasswordCredentials(
6289                    v.into()
6290                )
6291            );
6292            self
6293        }
6294    }
6295
6296    impl wkt::message::Message for UpstreamCredentials {
6297        fn typename() -> &'static str {
6298            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials"
6299        }
6300    }
6301
6302    /// Defines additional types related to [UpstreamCredentials].
6303    pub mod upstream_credentials {
6304        #[allow(unused_imports)]
6305        use super::*;
6306
6307        /// Username and password credentials.
6308        #[derive(Clone, Default, PartialEq)]
6309        #[non_exhaustive]
6310        pub struct UsernamePasswordCredentials {
6311            /// The username to access the remote repository.
6312            pub username: std::string::String,
6313
6314            /// The Secret Manager key version that holds the password to access the
6315            /// remote repository. Must be in the format of
6316            /// `projects/{project}/secrets/{secret}/versions/{version}`.
6317            pub password_secret_version: std::string::String,
6318
6319            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6320        }
6321
6322        impl UsernamePasswordCredentials {
6323            pub fn new() -> Self {
6324                std::default::Default::default()
6325            }
6326
6327            /// Sets the value of [username][crate::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials::username].
6328            ///
6329            /// # Example
6330            /// ```ignore,no_run
6331            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials;
6332            /// let x = UsernamePasswordCredentials::new().set_username("example");
6333            /// ```
6334            pub fn set_username<T: std::convert::Into<std::string::String>>(
6335                mut self,
6336                v: T,
6337            ) -> Self {
6338                self.username = v.into();
6339                self
6340            }
6341
6342            /// Sets the value of [password_secret_version][crate::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials::password_secret_version].
6343            ///
6344            /// # Example
6345            /// ```ignore,no_run
6346            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials;
6347            /// let x = UsernamePasswordCredentials::new().set_password_secret_version("example");
6348            /// ```
6349            pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
6350                mut self,
6351                v: T,
6352            ) -> Self {
6353                self.password_secret_version = v.into();
6354                self
6355            }
6356        }
6357
6358        impl wkt::message::Message for UsernamePasswordCredentials {
6359            fn typename() -> &'static str {
6360                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials.UsernamePasswordCredentials"
6361            }
6362        }
6363
6364        #[derive(Clone, Debug, PartialEq)]
6365        #[non_exhaustive]
6366        pub enum Credentials {
6367            /// Use username and password to access the remote repository.
6368            UsernamePasswordCredentials(std::boxed::Box<crate::model::remote_repository_config::upstream_credentials::UsernamePasswordCredentials>),
6369        }
6370    }
6371
6372    /// Configuration for a Docker remote repository.
6373    #[derive(Clone, Default, PartialEq)]
6374    #[non_exhaustive]
6375    pub struct DockerRepository {
6376        /// Address of the remote repository.
6377        pub upstream: std::option::Option<
6378            crate::model::remote_repository_config::docker_repository::Upstream,
6379        >,
6380
6381        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6382    }
6383
6384    impl DockerRepository {
6385        pub fn new() -> Self {
6386            std::default::Default::default()
6387        }
6388
6389        /// Sets the value of [upstream][crate::model::remote_repository_config::DockerRepository::upstream].
6390        ///
6391        /// Note that all the setters affecting `upstream` are mutually
6392        /// exclusive.
6393        ///
6394        /// # Example
6395        /// ```ignore,no_run
6396        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::DockerRepository;
6397        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::docker_repository::PublicRepository;
6398        /// let x0 = DockerRepository::new().set_upstream(Some(
6399        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::docker_repository::Upstream::PublicRepository(PublicRepository::DockerHub)));
6400        /// ```
6401        pub fn set_upstream<
6402            T: std::convert::Into<
6403                    std::option::Option<
6404                        crate::model::remote_repository_config::docker_repository::Upstream,
6405                    >,
6406                >,
6407        >(
6408            mut self,
6409            v: T,
6410        ) -> Self {
6411            self.upstream = v.into();
6412            self
6413        }
6414
6415        /// The value of [upstream][crate::model::remote_repository_config::DockerRepository::upstream]
6416        /// if it holds a `PublicRepository`, `None` if the field is not set or
6417        /// holds a different branch.
6418        pub fn public_repository(
6419            &self,
6420        ) -> std::option::Option<
6421            &crate::model::remote_repository_config::docker_repository::PublicRepository,
6422        > {
6423            #[allow(unreachable_patterns)]
6424            self.upstream.as_ref().and_then(|v| match v {
6425                crate::model::remote_repository_config::docker_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
6426                _ => std::option::Option::None,
6427            })
6428        }
6429
6430        /// Sets the value of [upstream][crate::model::remote_repository_config::DockerRepository::upstream]
6431        /// to hold a `PublicRepository`.
6432        ///
6433        /// Note that all the setters affecting `upstream` are
6434        /// mutually exclusive.
6435        ///
6436        /// # Example
6437        /// ```ignore,no_run
6438        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::DockerRepository;
6439        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::docker_repository::PublicRepository;
6440        /// let x0 = DockerRepository::new().set_public_repository(PublicRepository::DockerHub);
6441        /// assert!(x0.public_repository().is_some());
6442        /// assert!(x0.custom_repository().is_none());
6443        /// ```
6444        pub fn set_public_repository<
6445            T: std::convert::Into<
6446                    crate::model::remote_repository_config::docker_repository::PublicRepository,
6447                >,
6448        >(
6449            mut self,
6450            v: T,
6451        ) -> Self {
6452            self.upstream = std::option::Option::Some(
6453                crate::model::remote_repository_config::docker_repository::Upstream::PublicRepository(
6454                    v.into()
6455                )
6456            );
6457            self
6458        }
6459
6460        /// The value of [upstream][crate::model::remote_repository_config::DockerRepository::upstream]
6461        /// if it holds a `CustomRepository`, `None` if the field is not set or
6462        /// holds a different branch.
6463        pub fn custom_repository(
6464            &self,
6465        ) -> std::option::Option<
6466            &std::boxed::Box<
6467                crate::model::remote_repository_config::docker_repository::CustomRepository,
6468            >,
6469        > {
6470            #[allow(unreachable_patterns)]
6471            self.upstream.as_ref().and_then(|v| match v {
6472                crate::model::remote_repository_config::docker_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
6473                _ => std::option::Option::None,
6474            })
6475        }
6476
6477        /// Sets the value of [upstream][crate::model::remote_repository_config::DockerRepository::upstream]
6478        /// to hold a `CustomRepository`.
6479        ///
6480        /// Note that all the setters affecting `upstream` are
6481        /// mutually exclusive.
6482        ///
6483        /// # Example
6484        /// ```ignore,no_run
6485        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::DockerRepository;
6486        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::docker_repository::CustomRepository;
6487        /// let x = DockerRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
6488        /// assert!(x.custom_repository().is_some());
6489        /// assert!(x.public_repository().is_none());
6490        /// ```
6491        pub fn set_custom_repository<
6492            T: std::convert::Into<
6493                    std::boxed::Box<
6494                        crate::model::remote_repository_config::docker_repository::CustomRepository,
6495                    >,
6496                >,
6497        >(
6498            mut self,
6499            v: T,
6500        ) -> Self {
6501            self.upstream = std::option::Option::Some(
6502                crate::model::remote_repository_config::docker_repository::Upstream::CustomRepository(
6503                    v.into()
6504                )
6505            );
6506            self
6507        }
6508    }
6509
6510    impl wkt::message::Message for DockerRepository {
6511        fn typename() -> &'static str {
6512            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository"
6513        }
6514    }
6515
6516    /// Defines additional types related to [DockerRepository].
6517    pub mod docker_repository {
6518        #[allow(unused_imports)]
6519        use super::*;
6520
6521        /// Customer-specified publicly available remote repository.
6522        #[derive(Clone, Default, PartialEq)]
6523        #[non_exhaustive]
6524        pub struct CustomRepository {
6525            /// An http/https uri reference to the custom remote repository, for ex:
6526            /// `https://registry-1.docker.io`.
6527            pub uri: std::string::String,
6528
6529            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6530        }
6531
6532        impl CustomRepository {
6533            pub fn new() -> Self {
6534                std::default::Default::default()
6535            }
6536
6537            /// Sets the value of [uri][crate::model::remote_repository_config::docker_repository::CustomRepository::uri].
6538            ///
6539            /// # Example
6540            /// ```ignore,no_run
6541            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::docker_repository::CustomRepository;
6542            /// let x = CustomRepository::new().set_uri("example");
6543            /// ```
6544            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545                self.uri = v.into();
6546                self
6547            }
6548        }
6549
6550        impl wkt::message::Message for CustomRepository {
6551            fn typename() -> &'static str {
6552                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository"
6553            }
6554        }
6555
6556        /// Predefined list of publicly available Docker repositories like Docker
6557        /// Hub.
6558        ///
6559        /// # Working with unknown values
6560        ///
6561        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6562        /// additional enum variants at any time. Adding new variants is not considered
6563        /// a breaking change. Applications should write their code in anticipation of:
6564        ///
6565        /// - New values appearing in future releases of the client library, **and**
6566        /// - New values received dynamically, without application changes.
6567        ///
6568        /// Please consult the [Working with enums] section in the user guide for some
6569        /// guidelines.
6570        ///
6571        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6572        #[derive(Clone, Debug, PartialEq)]
6573        #[non_exhaustive]
6574        pub enum PublicRepository {
6575            /// Unspecified repository.
6576            Unspecified,
6577            /// Docker Hub.
6578            DockerHub,
6579            /// If set, the enum was initialized with an unknown value.
6580            ///
6581            /// Applications can examine the value using [PublicRepository::value] or
6582            /// [PublicRepository::name].
6583            UnknownValue(public_repository::UnknownValue),
6584        }
6585
6586        #[doc(hidden)]
6587        pub mod public_repository {
6588            #[allow(unused_imports)]
6589            use super::*;
6590            #[derive(Clone, Debug, PartialEq)]
6591            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6592        }
6593
6594        impl PublicRepository {
6595            /// Gets the enum value.
6596            ///
6597            /// Returns `None` if the enum contains an unknown value deserialized from
6598            /// the string representation of enums.
6599            pub fn value(&self) -> std::option::Option<i32> {
6600                match self {
6601                    Self::Unspecified => std::option::Option::Some(0),
6602                    Self::DockerHub => std::option::Option::Some(1),
6603                    Self::UnknownValue(u) => u.0.value(),
6604                }
6605            }
6606
6607            /// Gets the enum value as a string.
6608            ///
6609            /// Returns `None` if the enum contains an unknown value deserialized from
6610            /// the integer representation of enums.
6611            pub fn name(&self) -> std::option::Option<&str> {
6612                match self {
6613                    Self::Unspecified => std::option::Option::Some("PUBLIC_REPOSITORY_UNSPECIFIED"),
6614                    Self::DockerHub => std::option::Option::Some("DOCKER_HUB"),
6615                    Self::UnknownValue(u) => u.0.name(),
6616                }
6617            }
6618        }
6619
6620        impl std::default::Default for PublicRepository {
6621            fn default() -> Self {
6622                use std::convert::From;
6623                Self::from(0)
6624            }
6625        }
6626
6627        impl std::fmt::Display for PublicRepository {
6628            fn fmt(
6629                &self,
6630                f: &mut std::fmt::Formatter<'_>,
6631            ) -> std::result::Result<(), std::fmt::Error> {
6632                wkt::internal::display_enum(f, self.name(), self.value())
6633            }
6634        }
6635
6636        impl std::convert::From<i32> for PublicRepository {
6637            fn from(value: i32) -> Self {
6638                match value {
6639                    0 => Self::Unspecified,
6640                    1 => Self::DockerHub,
6641                    _ => Self::UnknownValue(public_repository::UnknownValue(
6642                        wkt::internal::UnknownEnumValue::Integer(value),
6643                    )),
6644                }
6645            }
6646        }
6647
6648        impl std::convert::From<&str> for PublicRepository {
6649            fn from(value: &str) -> Self {
6650                use std::string::ToString;
6651                match value {
6652                    "PUBLIC_REPOSITORY_UNSPECIFIED" => Self::Unspecified,
6653                    "DOCKER_HUB" => Self::DockerHub,
6654                    _ => Self::UnknownValue(public_repository::UnknownValue(
6655                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6656                    )),
6657                }
6658            }
6659        }
6660
6661        impl serde::ser::Serialize for PublicRepository {
6662            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6663            where
6664                S: serde::Serializer,
6665            {
6666                match self {
6667                    Self::Unspecified => serializer.serialize_i32(0),
6668                    Self::DockerHub => serializer.serialize_i32(1),
6669                    Self::UnknownValue(u) => u.0.serialize(serializer),
6670                }
6671            }
6672        }
6673
6674        impl<'de> serde::de::Deserialize<'de> for PublicRepository {
6675            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6676            where
6677                D: serde::Deserializer<'de>,
6678            {
6679                deserializer.deserialize_any(wkt::internal::EnumVisitor::<PublicRepository>::new(
6680                    ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.PublicRepository"))
6681            }
6682        }
6683
6684        /// Address of the remote repository.
6685        #[derive(Clone, Debug, PartialEq)]
6686        #[non_exhaustive]
6687        pub enum Upstream {
6688            /// One of the publicly available Docker repositories supported by Artifact
6689            /// Registry.
6690            PublicRepository(
6691                crate::model::remote_repository_config::docker_repository::PublicRepository,
6692            ),
6693            /// Customer-specified remote repository.
6694            CustomRepository(
6695                std::boxed::Box<
6696                    crate::model::remote_repository_config::docker_repository::CustomRepository,
6697                >,
6698            ),
6699        }
6700    }
6701
6702    /// Configuration for a Maven remote repository.
6703    #[derive(Clone, Default, PartialEq)]
6704    #[non_exhaustive]
6705    pub struct MavenRepository {
6706        /// Address of the remote repository.
6707        pub upstream:
6708            std::option::Option<crate::model::remote_repository_config::maven_repository::Upstream>,
6709
6710        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6711    }
6712
6713    impl MavenRepository {
6714        pub fn new() -> Self {
6715            std::default::Default::default()
6716        }
6717
6718        /// Sets the value of [upstream][crate::model::remote_repository_config::MavenRepository::upstream].
6719        ///
6720        /// Note that all the setters affecting `upstream` are mutually
6721        /// exclusive.
6722        ///
6723        /// # Example
6724        /// ```ignore,no_run
6725        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::MavenRepository;
6726        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::maven_repository::PublicRepository;
6727        /// let x0 = MavenRepository::new().set_upstream(Some(
6728        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::maven_repository::Upstream::PublicRepository(PublicRepository::MavenCentral)));
6729        /// ```
6730        pub fn set_upstream<
6731            T: std::convert::Into<
6732                    std::option::Option<
6733                        crate::model::remote_repository_config::maven_repository::Upstream,
6734                    >,
6735                >,
6736        >(
6737            mut self,
6738            v: T,
6739        ) -> Self {
6740            self.upstream = v.into();
6741            self
6742        }
6743
6744        /// The value of [upstream][crate::model::remote_repository_config::MavenRepository::upstream]
6745        /// if it holds a `PublicRepository`, `None` if the field is not set or
6746        /// holds a different branch.
6747        pub fn public_repository(
6748            &self,
6749        ) -> std::option::Option<
6750            &crate::model::remote_repository_config::maven_repository::PublicRepository,
6751        > {
6752            #[allow(unreachable_patterns)]
6753            self.upstream.as_ref().and_then(|v| match v {
6754                crate::model::remote_repository_config::maven_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
6755                _ => std::option::Option::None,
6756            })
6757        }
6758
6759        /// Sets the value of [upstream][crate::model::remote_repository_config::MavenRepository::upstream]
6760        /// to hold a `PublicRepository`.
6761        ///
6762        /// Note that all the setters affecting `upstream` are
6763        /// mutually exclusive.
6764        ///
6765        /// # Example
6766        /// ```ignore,no_run
6767        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::MavenRepository;
6768        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::maven_repository::PublicRepository;
6769        /// let x0 = MavenRepository::new().set_public_repository(PublicRepository::MavenCentral);
6770        /// assert!(x0.public_repository().is_some());
6771        /// assert!(x0.custom_repository().is_none());
6772        /// ```
6773        pub fn set_public_repository<
6774            T: std::convert::Into<
6775                    crate::model::remote_repository_config::maven_repository::PublicRepository,
6776                >,
6777        >(
6778            mut self,
6779            v: T,
6780        ) -> Self {
6781            self.upstream = std::option::Option::Some(
6782                crate::model::remote_repository_config::maven_repository::Upstream::PublicRepository(
6783                    v.into()
6784                )
6785            );
6786            self
6787        }
6788
6789        /// The value of [upstream][crate::model::remote_repository_config::MavenRepository::upstream]
6790        /// if it holds a `CustomRepository`, `None` if the field is not set or
6791        /// holds a different branch.
6792        pub fn custom_repository(
6793            &self,
6794        ) -> std::option::Option<
6795            &std::boxed::Box<
6796                crate::model::remote_repository_config::maven_repository::CustomRepository,
6797            >,
6798        > {
6799            #[allow(unreachable_patterns)]
6800            self.upstream.as_ref().and_then(|v| match v {
6801                crate::model::remote_repository_config::maven_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
6802                _ => std::option::Option::None,
6803            })
6804        }
6805
6806        /// Sets the value of [upstream][crate::model::remote_repository_config::MavenRepository::upstream]
6807        /// to hold a `CustomRepository`.
6808        ///
6809        /// Note that all the setters affecting `upstream` are
6810        /// mutually exclusive.
6811        ///
6812        /// # Example
6813        /// ```ignore,no_run
6814        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::MavenRepository;
6815        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::maven_repository::CustomRepository;
6816        /// let x = MavenRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
6817        /// assert!(x.custom_repository().is_some());
6818        /// assert!(x.public_repository().is_none());
6819        /// ```
6820        pub fn set_custom_repository<
6821            T: std::convert::Into<
6822                    std::boxed::Box<
6823                        crate::model::remote_repository_config::maven_repository::CustomRepository,
6824                    >,
6825                >,
6826        >(
6827            mut self,
6828            v: T,
6829        ) -> Self {
6830            self.upstream = std::option::Option::Some(
6831                crate::model::remote_repository_config::maven_repository::Upstream::CustomRepository(
6832                    v.into()
6833                )
6834            );
6835            self
6836        }
6837    }
6838
6839    impl wkt::message::Message for MavenRepository {
6840        fn typename() -> &'static str {
6841            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository"
6842        }
6843    }
6844
6845    /// Defines additional types related to [MavenRepository].
6846    pub mod maven_repository {
6847        #[allow(unused_imports)]
6848        use super::*;
6849
6850        /// Customer-specified publicly available remote repository.
6851        #[derive(Clone, Default, PartialEq)]
6852        #[non_exhaustive]
6853        pub struct CustomRepository {
6854            /// An http/https uri reference to the upstream remote repository, for ex:
6855            /// `https://my.maven.registry/`.
6856            pub uri: std::string::String,
6857
6858            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6859        }
6860
6861        impl CustomRepository {
6862            pub fn new() -> Self {
6863                std::default::Default::default()
6864            }
6865
6866            /// Sets the value of [uri][crate::model::remote_repository_config::maven_repository::CustomRepository::uri].
6867            ///
6868            /// # Example
6869            /// ```ignore,no_run
6870            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::maven_repository::CustomRepository;
6871            /// let x = CustomRepository::new().set_uri("example");
6872            /// ```
6873            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6874                self.uri = v.into();
6875                self
6876            }
6877        }
6878
6879        impl wkt::message::Message for CustomRepository {
6880            fn typename() -> &'static str {
6881                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository"
6882            }
6883        }
6884
6885        /// Predefined list of publicly available Maven repositories like Maven
6886        /// Central.
6887        ///
6888        /// # Working with unknown values
6889        ///
6890        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6891        /// additional enum variants at any time. Adding new variants is not considered
6892        /// a breaking change. Applications should write their code in anticipation of:
6893        ///
6894        /// - New values appearing in future releases of the client library, **and**
6895        /// - New values received dynamically, without application changes.
6896        ///
6897        /// Please consult the [Working with enums] section in the user guide for some
6898        /// guidelines.
6899        ///
6900        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6901        #[derive(Clone, Debug, PartialEq)]
6902        #[non_exhaustive]
6903        pub enum PublicRepository {
6904            /// Unspecified repository.
6905            Unspecified,
6906            /// Maven Central.
6907            MavenCentral,
6908            /// If set, the enum was initialized with an unknown value.
6909            ///
6910            /// Applications can examine the value using [PublicRepository::value] or
6911            /// [PublicRepository::name].
6912            UnknownValue(public_repository::UnknownValue),
6913        }
6914
6915        #[doc(hidden)]
6916        pub mod public_repository {
6917            #[allow(unused_imports)]
6918            use super::*;
6919            #[derive(Clone, Debug, PartialEq)]
6920            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6921        }
6922
6923        impl PublicRepository {
6924            /// Gets the enum value.
6925            ///
6926            /// Returns `None` if the enum contains an unknown value deserialized from
6927            /// the string representation of enums.
6928            pub fn value(&self) -> std::option::Option<i32> {
6929                match self {
6930                    Self::Unspecified => std::option::Option::Some(0),
6931                    Self::MavenCentral => std::option::Option::Some(1),
6932                    Self::UnknownValue(u) => u.0.value(),
6933                }
6934            }
6935
6936            /// Gets the enum value as a string.
6937            ///
6938            /// Returns `None` if the enum contains an unknown value deserialized from
6939            /// the integer representation of enums.
6940            pub fn name(&self) -> std::option::Option<&str> {
6941                match self {
6942                    Self::Unspecified => std::option::Option::Some("PUBLIC_REPOSITORY_UNSPECIFIED"),
6943                    Self::MavenCentral => std::option::Option::Some("MAVEN_CENTRAL"),
6944                    Self::UnknownValue(u) => u.0.name(),
6945                }
6946            }
6947        }
6948
6949        impl std::default::Default for PublicRepository {
6950            fn default() -> Self {
6951                use std::convert::From;
6952                Self::from(0)
6953            }
6954        }
6955
6956        impl std::fmt::Display for PublicRepository {
6957            fn fmt(
6958                &self,
6959                f: &mut std::fmt::Formatter<'_>,
6960            ) -> std::result::Result<(), std::fmt::Error> {
6961                wkt::internal::display_enum(f, self.name(), self.value())
6962            }
6963        }
6964
6965        impl std::convert::From<i32> for PublicRepository {
6966            fn from(value: i32) -> Self {
6967                match value {
6968                    0 => Self::Unspecified,
6969                    1 => Self::MavenCentral,
6970                    _ => Self::UnknownValue(public_repository::UnknownValue(
6971                        wkt::internal::UnknownEnumValue::Integer(value),
6972                    )),
6973                }
6974            }
6975        }
6976
6977        impl std::convert::From<&str> for PublicRepository {
6978            fn from(value: &str) -> Self {
6979                use std::string::ToString;
6980                match value {
6981                    "PUBLIC_REPOSITORY_UNSPECIFIED" => Self::Unspecified,
6982                    "MAVEN_CENTRAL" => Self::MavenCentral,
6983                    _ => Self::UnknownValue(public_repository::UnknownValue(
6984                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6985                    )),
6986                }
6987            }
6988        }
6989
6990        impl serde::ser::Serialize for PublicRepository {
6991            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6992            where
6993                S: serde::Serializer,
6994            {
6995                match self {
6996                    Self::Unspecified => serializer.serialize_i32(0),
6997                    Self::MavenCentral => serializer.serialize_i32(1),
6998                    Self::UnknownValue(u) => u.0.serialize(serializer),
6999                }
7000            }
7001        }
7002
7003        impl<'de> serde::de::Deserialize<'de> for PublicRepository {
7004            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7005            where
7006                D: serde::Deserializer<'de>,
7007            {
7008                deserializer.deserialize_any(wkt::internal::EnumVisitor::<PublicRepository>::new(
7009                    ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.PublicRepository"))
7010            }
7011        }
7012
7013        /// Address of the remote repository.
7014        #[derive(Clone, Debug, PartialEq)]
7015        #[non_exhaustive]
7016        pub enum Upstream {
7017            /// One of the publicly available Maven repositories supported by Artifact
7018            /// Registry.
7019            PublicRepository(
7020                crate::model::remote_repository_config::maven_repository::PublicRepository,
7021            ),
7022            /// Customer-specified remote repository.
7023            CustomRepository(
7024                std::boxed::Box<
7025                    crate::model::remote_repository_config::maven_repository::CustomRepository,
7026                >,
7027            ),
7028        }
7029    }
7030
7031    /// Configuration for a Npm remote repository.
7032    #[derive(Clone, Default, PartialEq)]
7033    #[non_exhaustive]
7034    pub struct NpmRepository {
7035        /// Address of the remote repository
7036        pub upstream:
7037            std::option::Option<crate::model::remote_repository_config::npm_repository::Upstream>,
7038
7039        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7040    }
7041
7042    impl NpmRepository {
7043        pub fn new() -> Self {
7044            std::default::Default::default()
7045        }
7046
7047        /// Sets the value of [upstream][crate::model::remote_repository_config::NpmRepository::upstream].
7048        ///
7049        /// Note that all the setters affecting `upstream` are mutually
7050        /// exclusive.
7051        ///
7052        /// # Example
7053        /// ```ignore,no_run
7054        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::NpmRepository;
7055        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::npm_repository::PublicRepository;
7056        /// let x0 = NpmRepository::new().set_upstream(Some(
7057        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::npm_repository::Upstream::PublicRepository(PublicRepository::Npmjs)));
7058        /// ```
7059        pub fn set_upstream<
7060            T: std::convert::Into<
7061                    std::option::Option<
7062                        crate::model::remote_repository_config::npm_repository::Upstream,
7063                    >,
7064                >,
7065        >(
7066            mut self,
7067            v: T,
7068        ) -> Self {
7069            self.upstream = v.into();
7070            self
7071        }
7072
7073        /// The value of [upstream][crate::model::remote_repository_config::NpmRepository::upstream]
7074        /// if it holds a `PublicRepository`, `None` if the field is not set or
7075        /// holds a different branch.
7076        pub fn public_repository(
7077            &self,
7078        ) -> std::option::Option<
7079            &crate::model::remote_repository_config::npm_repository::PublicRepository,
7080        > {
7081            #[allow(unreachable_patterns)]
7082            self.upstream.as_ref().and_then(|v| match v {
7083                crate::model::remote_repository_config::npm_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
7084                _ => std::option::Option::None,
7085            })
7086        }
7087
7088        /// Sets the value of [upstream][crate::model::remote_repository_config::NpmRepository::upstream]
7089        /// to hold a `PublicRepository`.
7090        ///
7091        /// Note that all the setters affecting `upstream` are
7092        /// mutually exclusive.
7093        ///
7094        /// # Example
7095        /// ```ignore,no_run
7096        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::NpmRepository;
7097        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::npm_repository::PublicRepository;
7098        /// let x0 = NpmRepository::new().set_public_repository(PublicRepository::Npmjs);
7099        /// assert!(x0.public_repository().is_some());
7100        /// assert!(x0.custom_repository().is_none());
7101        /// ```
7102        pub fn set_public_repository<
7103            T: std::convert::Into<
7104                    crate::model::remote_repository_config::npm_repository::PublicRepository,
7105                >,
7106        >(
7107            mut self,
7108            v: T,
7109        ) -> Self {
7110            self.upstream = std::option::Option::Some(
7111                crate::model::remote_repository_config::npm_repository::Upstream::PublicRepository(
7112                    v.into(),
7113                ),
7114            );
7115            self
7116        }
7117
7118        /// The value of [upstream][crate::model::remote_repository_config::NpmRepository::upstream]
7119        /// if it holds a `CustomRepository`, `None` if the field is not set or
7120        /// holds a different branch.
7121        pub fn custom_repository(
7122            &self,
7123        ) -> std::option::Option<
7124            &std::boxed::Box<
7125                crate::model::remote_repository_config::npm_repository::CustomRepository,
7126            >,
7127        > {
7128            #[allow(unreachable_patterns)]
7129            self.upstream.as_ref().and_then(|v| match v {
7130                crate::model::remote_repository_config::npm_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
7131                _ => std::option::Option::None,
7132            })
7133        }
7134
7135        /// Sets the value of [upstream][crate::model::remote_repository_config::NpmRepository::upstream]
7136        /// to hold a `CustomRepository`.
7137        ///
7138        /// Note that all the setters affecting `upstream` are
7139        /// mutually exclusive.
7140        ///
7141        /// # Example
7142        /// ```ignore,no_run
7143        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::NpmRepository;
7144        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::npm_repository::CustomRepository;
7145        /// let x = NpmRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
7146        /// assert!(x.custom_repository().is_some());
7147        /// assert!(x.public_repository().is_none());
7148        /// ```
7149        pub fn set_custom_repository<
7150            T: std::convert::Into<
7151                    std::boxed::Box<
7152                        crate::model::remote_repository_config::npm_repository::CustomRepository,
7153                    >,
7154                >,
7155        >(
7156            mut self,
7157            v: T,
7158        ) -> Self {
7159            self.upstream = std::option::Option::Some(
7160                crate::model::remote_repository_config::npm_repository::Upstream::CustomRepository(
7161                    v.into(),
7162                ),
7163            );
7164            self
7165        }
7166    }
7167
7168    impl wkt::message::Message for NpmRepository {
7169        fn typename() -> &'static str {
7170            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository"
7171        }
7172    }
7173
7174    /// Defines additional types related to [NpmRepository].
7175    pub mod npm_repository {
7176        #[allow(unused_imports)]
7177        use super::*;
7178
7179        /// Customer-specified publicly available remote repository.
7180        #[derive(Clone, Default, PartialEq)]
7181        #[non_exhaustive]
7182        pub struct CustomRepository {
7183            /// An http/https uri reference to the upstream remote repository, for ex:
7184            /// `https://my.npm.registry/`.
7185            pub uri: std::string::String,
7186
7187            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7188        }
7189
7190        impl CustomRepository {
7191            pub fn new() -> Self {
7192                std::default::Default::default()
7193            }
7194
7195            /// Sets the value of [uri][crate::model::remote_repository_config::npm_repository::CustomRepository::uri].
7196            ///
7197            /// # Example
7198            /// ```ignore,no_run
7199            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::npm_repository::CustomRepository;
7200            /// let x = CustomRepository::new().set_uri("example");
7201            /// ```
7202            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7203                self.uri = v.into();
7204                self
7205            }
7206        }
7207
7208        impl wkt::message::Message for CustomRepository {
7209            fn typename() -> &'static str {
7210                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository"
7211            }
7212        }
7213
7214        /// Predefined list of publicly available NPM repositories like npmjs.
7215        ///
7216        /// # Working with unknown values
7217        ///
7218        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7219        /// additional enum variants at any time. Adding new variants is not considered
7220        /// a breaking change. Applications should write their code in anticipation of:
7221        ///
7222        /// - New values appearing in future releases of the client library, **and**
7223        /// - New values received dynamically, without application changes.
7224        ///
7225        /// Please consult the [Working with enums] section in the user guide for some
7226        /// guidelines.
7227        ///
7228        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7229        #[derive(Clone, Debug, PartialEq)]
7230        #[non_exhaustive]
7231        pub enum PublicRepository {
7232            /// Unspecified repository.
7233            Unspecified,
7234            /// npmjs.
7235            Npmjs,
7236            /// If set, the enum was initialized with an unknown value.
7237            ///
7238            /// Applications can examine the value using [PublicRepository::value] or
7239            /// [PublicRepository::name].
7240            UnknownValue(public_repository::UnknownValue),
7241        }
7242
7243        #[doc(hidden)]
7244        pub mod public_repository {
7245            #[allow(unused_imports)]
7246            use super::*;
7247            #[derive(Clone, Debug, PartialEq)]
7248            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7249        }
7250
7251        impl PublicRepository {
7252            /// Gets the enum value.
7253            ///
7254            /// Returns `None` if the enum contains an unknown value deserialized from
7255            /// the string representation of enums.
7256            pub fn value(&self) -> std::option::Option<i32> {
7257                match self {
7258                    Self::Unspecified => std::option::Option::Some(0),
7259                    Self::Npmjs => std::option::Option::Some(1),
7260                    Self::UnknownValue(u) => u.0.value(),
7261                }
7262            }
7263
7264            /// Gets the enum value as a string.
7265            ///
7266            /// Returns `None` if the enum contains an unknown value deserialized from
7267            /// the integer representation of enums.
7268            pub fn name(&self) -> std::option::Option<&str> {
7269                match self {
7270                    Self::Unspecified => std::option::Option::Some("PUBLIC_REPOSITORY_UNSPECIFIED"),
7271                    Self::Npmjs => std::option::Option::Some("NPMJS"),
7272                    Self::UnknownValue(u) => u.0.name(),
7273                }
7274            }
7275        }
7276
7277        impl std::default::Default for PublicRepository {
7278            fn default() -> Self {
7279                use std::convert::From;
7280                Self::from(0)
7281            }
7282        }
7283
7284        impl std::fmt::Display for PublicRepository {
7285            fn fmt(
7286                &self,
7287                f: &mut std::fmt::Formatter<'_>,
7288            ) -> std::result::Result<(), std::fmt::Error> {
7289                wkt::internal::display_enum(f, self.name(), self.value())
7290            }
7291        }
7292
7293        impl std::convert::From<i32> for PublicRepository {
7294            fn from(value: i32) -> Self {
7295                match value {
7296                    0 => Self::Unspecified,
7297                    1 => Self::Npmjs,
7298                    _ => Self::UnknownValue(public_repository::UnknownValue(
7299                        wkt::internal::UnknownEnumValue::Integer(value),
7300                    )),
7301                }
7302            }
7303        }
7304
7305        impl std::convert::From<&str> for PublicRepository {
7306            fn from(value: &str) -> Self {
7307                use std::string::ToString;
7308                match value {
7309                    "PUBLIC_REPOSITORY_UNSPECIFIED" => Self::Unspecified,
7310                    "NPMJS" => Self::Npmjs,
7311                    _ => Self::UnknownValue(public_repository::UnknownValue(
7312                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7313                    )),
7314                }
7315            }
7316        }
7317
7318        impl serde::ser::Serialize for PublicRepository {
7319            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7320            where
7321                S: serde::Serializer,
7322            {
7323                match self {
7324                    Self::Unspecified => serializer.serialize_i32(0),
7325                    Self::Npmjs => serializer.serialize_i32(1),
7326                    Self::UnknownValue(u) => u.0.serialize(serializer),
7327                }
7328            }
7329        }
7330
7331        impl<'de> serde::de::Deserialize<'de> for PublicRepository {
7332            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7333            where
7334                D: serde::Deserializer<'de>,
7335            {
7336                deserializer.deserialize_any(wkt::internal::EnumVisitor::<PublicRepository>::new(
7337                    ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.PublicRepository"))
7338            }
7339        }
7340
7341        /// Address of the remote repository
7342        #[derive(Clone, Debug, PartialEq)]
7343        #[non_exhaustive]
7344        pub enum Upstream {
7345            /// One of the publicly available Npm repositories supported by Artifact
7346            /// Registry.
7347            PublicRepository(
7348                crate::model::remote_repository_config::npm_repository::PublicRepository,
7349            ),
7350            /// Customer-specified remote repository.
7351            CustomRepository(
7352                std::boxed::Box<
7353                    crate::model::remote_repository_config::npm_repository::CustomRepository,
7354                >,
7355            ),
7356        }
7357    }
7358
7359    /// Configuration for a Python remote repository.
7360    #[derive(Clone, Default, PartialEq)]
7361    #[non_exhaustive]
7362    pub struct PythonRepository {
7363        /// Address of the remote repository.
7364        pub upstream: std::option::Option<
7365            crate::model::remote_repository_config::python_repository::Upstream,
7366        >,
7367
7368        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7369    }
7370
7371    impl PythonRepository {
7372        pub fn new() -> Self {
7373            std::default::Default::default()
7374        }
7375
7376        /// Sets the value of [upstream][crate::model::remote_repository_config::PythonRepository::upstream].
7377        ///
7378        /// Note that all the setters affecting `upstream` are mutually
7379        /// exclusive.
7380        ///
7381        /// # Example
7382        /// ```ignore,no_run
7383        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::PythonRepository;
7384        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::python_repository::PublicRepository;
7385        /// let x0 = PythonRepository::new().set_upstream(Some(
7386        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::python_repository::Upstream::PublicRepository(PublicRepository::Pypi)));
7387        /// ```
7388        pub fn set_upstream<
7389            T: std::convert::Into<
7390                    std::option::Option<
7391                        crate::model::remote_repository_config::python_repository::Upstream,
7392                    >,
7393                >,
7394        >(
7395            mut self,
7396            v: T,
7397        ) -> Self {
7398            self.upstream = v.into();
7399            self
7400        }
7401
7402        /// The value of [upstream][crate::model::remote_repository_config::PythonRepository::upstream]
7403        /// if it holds a `PublicRepository`, `None` if the field is not set or
7404        /// holds a different branch.
7405        pub fn public_repository(
7406            &self,
7407        ) -> std::option::Option<
7408            &crate::model::remote_repository_config::python_repository::PublicRepository,
7409        > {
7410            #[allow(unreachable_patterns)]
7411            self.upstream.as_ref().and_then(|v| match v {
7412                crate::model::remote_repository_config::python_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
7413                _ => std::option::Option::None,
7414            })
7415        }
7416
7417        /// Sets the value of [upstream][crate::model::remote_repository_config::PythonRepository::upstream]
7418        /// to hold a `PublicRepository`.
7419        ///
7420        /// Note that all the setters affecting `upstream` are
7421        /// mutually exclusive.
7422        ///
7423        /// # Example
7424        /// ```ignore,no_run
7425        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::PythonRepository;
7426        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::python_repository::PublicRepository;
7427        /// let x0 = PythonRepository::new().set_public_repository(PublicRepository::Pypi);
7428        /// assert!(x0.public_repository().is_some());
7429        /// assert!(x0.custom_repository().is_none());
7430        /// ```
7431        pub fn set_public_repository<
7432            T: std::convert::Into<
7433                    crate::model::remote_repository_config::python_repository::PublicRepository,
7434                >,
7435        >(
7436            mut self,
7437            v: T,
7438        ) -> Self {
7439            self.upstream = std::option::Option::Some(
7440                crate::model::remote_repository_config::python_repository::Upstream::PublicRepository(
7441                    v.into()
7442                )
7443            );
7444            self
7445        }
7446
7447        /// The value of [upstream][crate::model::remote_repository_config::PythonRepository::upstream]
7448        /// if it holds a `CustomRepository`, `None` if the field is not set or
7449        /// holds a different branch.
7450        pub fn custom_repository(
7451            &self,
7452        ) -> std::option::Option<
7453            &std::boxed::Box<
7454                crate::model::remote_repository_config::python_repository::CustomRepository,
7455            >,
7456        > {
7457            #[allow(unreachable_patterns)]
7458            self.upstream.as_ref().and_then(|v| match v {
7459                crate::model::remote_repository_config::python_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
7460                _ => std::option::Option::None,
7461            })
7462        }
7463
7464        /// Sets the value of [upstream][crate::model::remote_repository_config::PythonRepository::upstream]
7465        /// to hold a `CustomRepository`.
7466        ///
7467        /// Note that all the setters affecting `upstream` are
7468        /// mutually exclusive.
7469        ///
7470        /// # Example
7471        /// ```ignore,no_run
7472        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::PythonRepository;
7473        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::python_repository::CustomRepository;
7474        /// let x = PythonRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
7475        /// assert!(x.custom_repository().is_some());
7476        /// assert!(x.public_repository().is_none());
7477        /// ```
7478        pub fn set_custom_repository<
7479            T: std::convert::Into<
7480                    std::boxed::Box<
7481                        crate::model::remote_repository_config::python_repository::CustomRepository,
7482                    >,
7483                >,
7484        >(
7485            mut self,
7486            v: T,
7487        ) -> Self {
7488            self.upstream = std::option::Option::Some(
7489                crate::model::remote_repository_config::python_repository::Upstream::CustomRepository(
7490                    v.into()
7491                )
7492            );
7493            self
7494        }
7495    }
7496
7497    impl wkt::message::Message for PythonRepository {
7498        fn typename() -> &'static str {
7499            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository"
7500        }
7501    }
7502
7503    /// Defines additional types related to [PythonRepository].
7504    pub mod python_repository {
7505        #[allow(unused_imports)]
7506        use super::*;
7507
7508        /// Customer-specified publicly available remote repository.
7509        #[derive(Clone, Default, PartialEq)]
7510        #[non_exhaustive]
7511        pub struct CustomRepository {
7512            /// An http/https uri reference to the upstream remote repository, for ex:
7513            /// `https://my.python.registry/`.
7514            pub uri: std::string::String,
7515
7516            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7517        }
7518
7519        impl CustomRepository {
7520            pub fn new() -> Self {
7521                std::default::Default::default()
7522            }
7523
7524            /// Sets the value of [uri][crate::model::remote_repository_config::python_repository::CustomRepository::uri].
7525            ///
7526            /// # Example
7527            /// ```ignore,no_run
7528            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::python_repository::CustomRepository;
7529            /// let x = CustomRepository::new().set_uri("example");
7530            /// ```
7531            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7532                self.uri = v.into();
7533                self
7534            }
7535        }
7536
7537        impl wkt::message::Message for CustomRepository {
7538            fn typename() -> &'static str {
7539                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository"
7540            }
7541        }
7542
7543        /// Predefined list of publicly available Python repositories like PyPI.org.
7544        ///
7545        /// # Working with unknown values
7546        ///
7547        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7548        /// additional enum variants at any time. Adding new variants is not considered
7549        /// a breaking change. Applications should write their code in anticipation of:
7550        ///
7551        /// - New values appearing in future releases of the client library, **and**
7552        /// - New values received dynamically, without application changes.
7553        ///
7554        /// Please consult the [Working with enums] section in the user guide for some
7555        /// guidelines.
7556        ///
7557        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7558        #[derive(Clone, Debug, PartialEq)]
7559        #[non_exhaustive]
7560        pub enum PublicRepository {
7561            /// Unspecified repository.
7562            Unspecified,
7563            /// PyPI.
7564            Pypi,
7565            /// If set, the enum was initialized with an unknown value.
7566            ///
7567            /// Applications can examine the value using [PublicRepository::value] or
7568            /// [PublicRepository::name].
7569            UnknownValue(public_repository::UnknownValue),
7570        }
7571
7572        #[doc(hidden)]
7573        pub mod public_repository {
7574            #[allow(unused_imports)]
7575            use super::*;
7576            #[derive(Clone, Debug, PartialEq)]
7577            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7578        }
7579
7580        impl PublicRepository {
7581            /// Gets the enum value.
7582            ///
7583            /// Returns `None` if the enum contains an unknown value deserialized from
7584            /// the string representation of enums.
7585            pub fn value(&self) -> std::option::Option<i32> {
7586                match self {
7587                    Self::Unspecified => std::option::Option::Some(0),
7588                    Self::Pypi => std::option::Option::Some(1),
7589                    Self::UnknownValue(u) => u.0.value(),
7590                }
7591            }
7592
7593            /// Gets the enum value as a string.
7594            ///
7595            /// Returns `None` if the enum contains an unknown value deserialized from
7596            /// the integer representation of enums.
7597            pub fn name(&self) -> std::option::Option<&str> {
7598                match self {
7599                    Self::Unspecified => std::option::Option::Some("PUBLIC_REPOSITORY_UNSPECIFIED"),
7600                    Self::Pypi => std::option::Option::Some("PYPI"),
7601                    Self::UnknownValue(u) => u.0.name(),
7602                }
7603            }
7604        }
7605
7606        impl std::default::Default for PublicRepository {
7607            fn default() -> Self {
7608                use std::convert::From;
7609                Self::from(0)
7610            }
7611        }
7612
7613        impl std::fmt::Display for PublicRepository {
7614            fn fmt(
7615                &self,
7616                f: &mut std::fmt::Formatter<'_>,
7617            ) -> std::result::Result<(), std::fmt::Error> {
7618                wkt::internal::display_enum(f, self.name(), self.value())
7619            }
7620        }
7621
7622        impl std::convert::From<i32> for PublicRepository {
7623            fn from(value: i32) -> Self {
7624                match value {
7625                    0 => Self::Unspecified,
7626                    1 => Self::Pypi,
7627                    _ => Self::UnknownValue(public_repository::UnknownValue(
7628                        wkt::internal::UnknownEnumValue::Integer(value),
7629                    )),
7630                }
7631            }
7632        }
7633
7634        impl std::convert::From<&str> for PublicRepository {
7635            fn from(value: &str) -> Self {
7636                use std::string::ToString;
7637                match value {
7638                    "PUBLIC_REPOSITORY_UNSPECIFIED" => Self::Unspecified,
7639                    "PYPI" => Self::Pypi,
7640                    _ => Self::UnknownValue(public_repository::UnknownValue(
7641                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7642                    )),
7643                }
7644            }
7645        }
7646
7647        impl serde::ser::Serialize for PublicRepository {
7648            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7649            where
7650                S: serde::Serializer,
7651            {
7652                match self {
7653                    Self::Unspecified => serializer.serialize_i32(0),
7654                    Self::Pypi => serializer.serialize_i32(1),
7655                    Self::UnknownValue(u) => u.0.serialize(serializer),
7656                }
7657            }
7658        }
7659
7660        impl<'de> serde::de::Deserialize<'de> for PublicRepository {
7661            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7662            where
7663                D: serde::Deserializer<'de>,
7664            {
7665                deserializer.deserialize_any(wkt::internal::EnumVisitor::<PublicRepository>::new(
7666                    ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.PublicRepository"))
7667            }
7668        }
7669
7670        /// Address of the remote repository.
7671        #[derive(Clone, Debug, PartialEq)]
7672        #[non_exhaustive]
7673        pub enum Upstream {
7674            /// One of the publicly available Python repositories supported by Artifact
7675            /// Registry.
7676            PublicRepository(
7677                crate::model::remote_repository_config::python_repository::PublicRepository,
7678            ),
7679            /// Customer-specified remote repository.
7680            CustomRepository(
7681                std::boxed::Box<
7682                    crate::model::remote_repository_config::python_repository::CustomRepository,
7683                >,
7684            ),
7685        }
7686    }
7687
7688    /// Configuration for an Apt remote repository.
7689    #[derive(Clone, Default, PartialEq)]
7690    #[non_exhaustive]
7691    pub struct AptRepository {
7692        /// Address of the remote repository.
7693        pub upstream:
7694            std::option::Option<crate::model::remote_repository_config::apt_repository::Upstream>,
7695
7696        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7697    }
7698
7699    impl AptRepository {
7700        pub fn new() -> Self {
7701            std::default::Default::default()
7702        }
7703
7704        /// Sets the value of [upstream][crate::model::remote_repository_config::AptRepository::upstream].
7705        ///
7706        /// Note that all the setters affecting `upstream` are mutually
7707        /// exclusive.
7708        ///
7709        /// # Example
7710        /// ```ignore,no_run
7711        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::AptRepository;
7712        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::PublicRepository;
7713        /// let x = AptRepository::new().set_upstream(Some(
7714        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::Upstream::PublicRepository(PublicRepository::default().into())));
7715        /// ```
7716        pub fn set_upstream<
7717            T: std::convert::Into<
7718                    std::option::Option<
7719                        crate::model::remote_repository_config::apt_repository::Upstream,
7720                    >,
7721                >,
7722        >(
7723            mut self,
7724            v: T,
7725        ) -> Self {
7726            self.upstream = v.into();
7727            self
7728        }
7729
7730        /// The value of [upstream][crate::model::remote_repository_config::AptRepository::upstream]
7731        /// if it holds a `PublicRepository`, `None` if the field is not set or
7732        /// holds a different branch.
7733        pub fn public_repository(
7734            &self,
7735        ) -> std::option::Option<
7736            &std::boxed::Box<
7737                crate::model::remote_repository_config::apt_repository::PublicRepository,
7738            >,
7739        > {
7740            #[allow(unreachable_patterns)]
7741            self.upstream.as_ref().and_then(|v| match v {
7742                crate::model::remote_repository_config::apt_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
7743                _ => std::option::Option::None,
7744            })
7745        }
7746
7747        /// Sets the value of [upstream][crate::model::remote_repository_config::AptRepository::upstream]
7748        /// to hold a `PublicRepository`.
7749        ///
7750        /// Note that all the setters affecting `upstream` are
7751        /// mutually exclusive.
7752        ///
7753        /// # Example
7754        /// ```ignore,no_run
7755        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::AptRepository;
7756        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::PublicRepository;
7757        /// let x = AptRepository::new().set_public_repository(PublicRepository::default()/* use setters */);
7758        /// assert!(x.public_repository().is_some());
7759        /// assert!(x.custom_repository().is_none());
7760        /// ```
7761        pub fn set_public_repository<
7762            T: std::convert::Into<
7763                    std::boxed::Box<
7764                        crate::model::remote_repository_config::apt_repository::PublicRepository,
7765                    >,
7766                >,
7767        >(
7768            mut self,
7769            v: T,
7770        ) -> Self {
7771            self.upstream = std::option::Option::Some(
7772                crate::model::remote_repository_config::apt_repository::Upstream::PublicRepository(
7773                    v.into(),
7774                ),
7775            );
7776            self
7777        }
7778
7779        /// The value of [upstream][crate::model::remote_repository_config::AptRepository::upstream]
7780        /// if it holds a `CustomRepository`, `None` if the field is not set or
7781        /// holds a different branch.
7782        pub fn custom_repository(
7783            &self,
7784        ) -> std::option::Option<
7785            &std::boxed::Box<
7786                crate::model::remote_repository_config::apt_repository::CustomRepository,
7787            >,
7788        > {
7789            #[allow(unreachable_patterns)]
7790            self.upstream.as_ref().and_then(|v| match v {
7791                crate::model::remote_repository_config::apt_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
7792                _ => std::option::Option::None,
7793            })
7794        }
7795
7796        /// Sets the value of [upstream][crate::model::remote_repository_config::AptRepository::upstream]
7797        /// to hold a `CustomRepository`.
7798        ///
7799        /// Note that all the setters affecting `upstream` are
7800        /// mutually exclusive.
7801        ///
7802        /// # Example
7803        /// ```ignore,no_run
7804        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::AptRepository;
7805        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::CustomRepository;
7806        /// let x = AptRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
7807        /// assert!(x.custom_repository().is_some());
7808        /// assert!(x.public_repository().is_none());
7809        /// ```
7810        pub fn set_custom_repository<
7811            T: std::convert::Into<
7812                    std::boxed::Box<
7813                        crate::model::remote_repository_config::apt_repository::CustomRepository,
7814                    >,
7815                >,
7816        >(
7817            mut self,
7818            v: T,
7819        ) -> Self {
7820            self.upstream = std::option::Option::Some(
7821                crate::model::remote_repository_config::apt_repository::Upstream::CustomRepository(
7822                    v.into(),
7823                ),
7824            );
7825            self
7826        }
7827    }
7828
7829    impl wkt::message::Message for AptRepository {
7830        fn typename() -> &'static str {
7831            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository"
7832        }
7833    }
7834
7835    /// Defines additional types related to [AptRepository].
7836    pub mod apt_repository {
7837        #[allow(unused_imports)]
7838        use super::*;
7839
7840        /// Publicly available Apt repositories constructed from a common repository
7841        /// base and a custom repository path.
7842        #[derive(Clone, Default, PartialEq)]
7843        #[non_exhaustive]
7844        pub struct PublicRepository {
7845
7846            /// A common public repository base for Apt.
7847            pub repository_base: crate::model::remote_repository_config::apt_repository::public_repository::RepositoryBase,
7848
7849            /// A custom field to define a path to a specific repository from the base.
7850            pub repository_path: std::string::String,
7851
7852            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7853        }
7854
7855        impl PublicRepository {
7856            pub fn new() -> Self {
7857                std::default::Default::default()
7858            }
7859
7860            /// Sets the value of [repository_base][crate::model::remote_repository_config::apt_repository::PublicRepository::repository_base].
7861            ///
7862            /// # Example
7863            /// ```ignore,no_run
7864            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::PublicRepository;
7865            /// use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::public_repository::RepositoryBase;
7866            /// let x0 = PublicRepository::new().set_repository_base(RepositoryBase::Debian);
7867            /// let x1 = PublicRepository::new().set_repository_base(RepositoryBase::Ubuntu);
7868            /// let x2 = PublicRepository::new().set_repository_base(RepositoryBase::DebianSnapshot);
7869            /// ```
7870            pub fn set_repository_base<T: std::convert::Into<crate::model::remote_repository_config::apt_repository::public_repository::RepositoryBase>>(mut self, v: T) -> Self{
7871                self.repository_base = v.into();
7872                self
7873            }
7874
7875            /// Sets the value of [repository_path][crate::model::remote_repository_config::apt_repository::PublicRepository::repository_path].
7876            ///
7877            /// # Example
7878            /// ```ignore,no_run
7879            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::PublicRepository;
7880            /// let x = PublicRepository::new().set_repository_path("example");
7881            /// ```
7882            pub fn set_repository_path<T: std::convert::Into<std::string::String>>(
7883                mut self,
7884                v: T,
7885            ) -> Self {
7886                self.repository_path = v.into();
7887                self
7888            }
7889        }
7890
7891        impl wkt::message::Message for PublicRepository {
7892            fn typename() -> &'static str {
7893                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository"
7894            }
7895        }
7896
7897        /// Defines additional types related to [PublicRepository].
7898        pub mod public_repository {
7899            #[allow(unused_imports)]
7900            use super::*;
7901
7902            /// Predefined list of publicly available repository bases for Apt.
7903            ///
7904            /// # Working with unknown values
7905            ///
7906            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7907            /// additional enum variants at any time. Adding new variants is not considered
7908            /// a breaking change. Applications should write their code in anticipation of:
7909            ///
7910            /// - New values appearing in future releases of the client library, **and**
7911            /// - New values received dynamically, without application changes.
7912            ///
7913            /// Please consult the [Working with enums] section in the user guide for some
7914            /// guidelines.
7915            ///
7916            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7917            #[derive(Clone, Debug, PartialEq)]
7918            #[non_exhaustive]
7919            pub enum RepositoryBase {
7920                /// Unspecified repository base.
7921                Unspecified,
7922                /// Debian.
7923                Debian,
7924                /// Ubuntu LTS/Pro.
7925                Ubuntu,
7926                /// Archived Debian.
7927                DebianSnapshot,
7928                /// If set, the enum was initialized with an unknown value.
7929                ///
7930                /// Applications can examine the value using [RepositoryBase::value] or
7931                /// [RepositoryBase::name].
7932                UnknownValue(repository_base::UnknownValue),
7933            }
7934
7935            #[doc(hidden)]
7936            pub mod repository_base {
7937                #[allow(unused_imports)]
7938                use super::*;
7939                #[derive(Clone, Debug, PartialEq)]
7940                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7941            }
7942
7943            impl RepositoryBase {
7944                /// Gets the enum value.
7945                ///
7946                /// Returns `None` if the enum contains an unknown value deserialized from
7947                /// the string representation of enums.
7948                pub fn value(&self) -> std::option::Option<i32> {
7949                    match self {
7950                        Self::Unspecified => std::option::Option::Some(0),
7951                        Self::Debian => std::option::Option::Some(1),
7952                        Self::Ubuntu => std::option::Option::Some(2),
7953                        Self::DebianSnapshot => std::option::Option::Some(3),
7954                        Self::UnknownValue(u) => u.0.value(),
7955                    }
7956                }
7957
7958                /// Gets the enum value as a string.
7959                ///
7960                /// Returns `None` if the enum contains an unknown value deserialized from
7961                /// the integer representation of enums.
7962                pub fn name(&self) -> std::option::Option<&str> {
7963                    match self {
7964                        Self::Unspecified => {
7965                            std::option::Option::Some("REPOSITORY_BASE_UNSPECIFIED")
7966                        }
7967                        Self::Debian => std::option::Option::Some("DEBIAN"),
7968                        Self::Ubuntu => std::option::Option::Some("UBUNTU"),
7969                        Self::DebianSnapshot => std::option::Option::Some("DEBIAN_SNAPSHOT"),
7970                        Self::UnknownValue(u) => u.0.name(),
7971                    }
7972                }
7973            }
7974
7975            impl std::default::Default for RepositoryBase {
7976                fn default() -> Self {
7977                    use std::convert::From;
7978                    Self::from(0)
7979                }
7980            }
7981
7982            impl std::fmt::Display for RepositoryBase {
7983                fn fmt(
7984                    &self,
7985                    f: &mut std::fmt::Formatter<'_>,
7986                ) -> std::result::Result<(), std::fmt::Error> {
7987                    wkt::internal::display_enum(f, self.name(), self.value())
7988                }
7989            }
7990
7991            impl std::convert::From<i32> for RepositoryBase {
7992                fn from(value: i32) -> Self {
7993                    match value {
7994                        0 => Self::Unspecified,
7995                        1 => Self::Debian,
7996                        2 => Self::Ubuntu,
7997                        3 => Self::DebianSnapshot,
7998                        _ => Self::UnknownValue(repository_base::UnknownValue(
7999                            wkt::internal::UnknownEnumValue::Integer(value),
8000                        )),
8001                    }
8002                }
8003            }
8004
8005            impl std::convert::From<&str> for RepositoryBase {
8006                fn from(value: &str) -> Self {
8007                    use std::string::ToString;
8008                    match value {
8009                        "REPOSITORY_BASE_UNSPECIFIED" => Self::Unspecified,
8010                        "DEBIAN" => Self::Debian,
8011                        "UBUNTU" => Self::Ubuntu,
8012                        "DEBIAN_SNAPSHOT" => Self::DebianSnapshot,
8013                        _ => Self::UnknownValue(repository_base::UnknownValue(
8014                            wkt::internal::UnknownEnumValue::String(value.to_string()),
8015                        )),
8016                    }
8017                }
8018            }
8019
8020            impl serde::ser::Serialize for RepositoryBase {
8021                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8022                where
8023                    S: serde::Serializer,
8024                {
8025                    match self {
8026                        Self::Unspecified => serializer.serialize_i32(0),
8027                        Self::Debian => serializer.serialize_i32(1),
8028                        Self::Ubuntu => serializer.serialize_i32(2),
8029                        Self::DebianSnapshot => serializer.serialize_i32(3),
8030                        Self::UnknownValue(u) => u.0.serialize(serializer),
8031                    }
8032                }
8033            }
8034
8035            impl<'de> serde::de::Deserialize<'de> for RepositoryBase {
8036                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8037                where
8038                    D: serde::Deserializer<'de>,
8039                {
8040                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepositoryBase>::new(
8041                        ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.PublicRepository.RepositoryBase"))
8042                }
8043            }
8044        }
8045
8046        /// Customer-specified publicly available remote repository.
8047        #[derive(Clone, Default, PartialEq)]
8048        #[non_exhaustive]
8049        pub struct CustomRepository {
8050            /// An http/https uri reference to the upstream remote repository, for ex:
8051            /// `https://my.apt.registry/`.
8052            pub uri: std::string::String,
8053
8054            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8055        }
8056
8057        impl CustomRepository {
8058            pub fn new() -> Self {
8059                std::default::Default::default()
8060            }
8061
8062            /// Sets the value of [uri][crate::model::remote_repository_config::apt_repository::CustomRepository::uri].
8063            ///
8064            /// # Example
8065            /// ```ignore,no_run
8066            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::apt_repository::CustomRepository;
8067            /// let x = CustomRepository::new().set_uri("example");
8068            /// ```
8069            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8070                self.uri = v.into();
8071                self
8072            }
8073        }
8074
8075        impl wkt::message::Message for CustomRepository {
8076            fn typename() -> &'static str {
8077                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository"
8078            }
8079        }
8080
8081        /// Address of the remote repository.
8082        #[derive(Clone, Debug, PartialEq)]
8083        #[non_exhaustive]
8084        pub enum Upstream {
8085            /// One of the publicly available Apt repositories supported by Artifact
8086            /// Registry.
8087            PublicRepository(
8088                std::boxed::Box<
8089                    crate::model::remote_repository_config::apt_repository::PublicRepository,
8090                >,
8091            ),
8092            /// Customer-specified remote repository.
8093            CustomRepository(
8094                std::boxed::Box<
8095                    crate::model::remote_repository_config::apt_repository::CustomRepository,
8096                >,
8097            ),
8098        }
8099    }
8100
8101    /// Configuration for a Yum remote repository.
8102    #[derive(Clone, Default, PartialEq)]
8103    #[non_exhaustive]
8104    pub struct YumRepository {
8105        /// Address of the remote repository.
8106        pub upstream:
8107            std::option::Option<crate::model::remote_repository_config::yum_repository::Upstream>,
8108
8109        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8110    }
8111
8112    impl YumRepository {
8113        pub fn new() -> Self {
8114            std::default::Default::default()
8115        }
8116
8117        /// Sets the value of [upstream][crate::model::remote_repository_config::YumRepository::upstream].
8118        ///
8119        /// Note that all the setters affecting `upstream` are mutually
8120        /// exclusive.
8121        ///
8122        /// # Example
8123        /// ```ignore,no_run
8124        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::YumRepository;
8125        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::PublicRepository;
8126        /// let x = YumRepository::new().set_upstream(Some(
8127        ///     google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::Upstream::PublicRepository(PublicRepository::default().into())));
8128        /// ```
8129        pub fn set_upstream<
8130            T: std::convert::Into<
8131                    std::option::Option<
8132                        crate::model::remote_repository_config::yum_repository::Upstream,
8133                    >,
8134                >,
8135        >(
8136            mut self,
8137            v: T,
8138        ) -> Self {
8139            self.upstream = v.into();
8140            self
8141        }
8142
8143        /// The value of [upstream][crate::model::remote_repository_config::YumRepository::upstream]
8144        /// if it holds a `PublicRepository`, `None` if the field is not set or
8145        /// holds a different branch.
8146        pub fn public_repository(
8147            &self,
8148        ) -> std::option::Option<
8149            &std::boxed::Box<
8150                crate::model::remote_repository_config::yum_repository::PublicRepository,
8151            >,
8152        > {
8153            #[allow(unreachable_patterns)]
8154            self.upstream.as_ref().and_then(|v| match v {
8155                crate::model::remote_repository_config::yum_repository::Upstream::PublicRepository(v) => std::option::Option::Some(v),
8156                _ => std::option::Option::None,
8157            })
8158        }
8159
8160        /// Sets the value of [upstream][crate::model::remote_repository_config::YumRepository::upstream]
8161        /// to hold a `PublicRepository`.
8162        ///
8163        /// Note that all the setters affecting `upstream` are
8164        /// mutually exclusive.
8165        ///
8166        /// # Example
8167        /// ```ignore,no_run
8168        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::YumRepository;
8169        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::PublicRepository;
8170        /// let x = YumRepository::new().set_public_repository(PublicRepository::default()/* use setters */);
8171        /// assert!(x.public_repository().is_some());
8172        /// assert!(x.custom_repository().is_none());
8173        /// ```
8174        pub fn set_public_repository<
8175            T: std::convert::Into<
8176                    std::boxed::Box<
8177                        crate::model::remote_repository_config::yum_repository::PublicRepository,
8178                    >,
8179                >,
8180        >(
8181            mut self,
8182            v: T,
8183        ) -> Self {
8184            self.upstream = std::option::Option::Some(
8185                crate::model::remote_repository_config::yum_repository::Upstream::PublicRepository(
8186                    v.into(),
8187                ),
8188            );
8189            self
8190        }
8191
8192        /// The value of [upstream][crate::model::remote_repository_config::YumRepository::upstream]
8193        /// if it holds a `CustomRepository`, `None` if the field is not set or
8194        /// holds a different branch.
8195        pub fn custom_repository(
8196            &self,
8197        ) -> std::option::Option<
8198            &std::boxed::Box<
8199                crate::model::remote_repository_config::yum_repository::CustomRepository,
8200            >,
8201        > {
8202            #[allow(unreachable_patterns)]
8203            self.upstream.as_ref().and_then(|v| match v {
8204                crate::model::remote_repository_config::yum_repository::Upstream::CustomRepository(v) => std::option::Option::Some(v),
8205                _ => std::option::Option::None,
8206            })
8207        }
8208
8209        /// Sets the value of [upstream][crate::model::remote_repository_config::YumRepository::upstream]
8210        /// to hold a `CustomRepository`.
8211        ///
8212        /// Note that all the setters affecting `upstream` are
8213        /// mutually exclusive.
8214        ///
8215        /// # Example
8216        /// ```ignore,no_run
8217        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::YumRepository;
8218        /// use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::CustomRepository;
8219        /// let x = YumRepository::new().set_custom_repository(CustomRepository::default()/* use setters */);
8220        /// assert!(x.custom_repository().is_some());
8221        /// assert!(x.public_repository().is_none());
8222        /// ```
8223        pub fn set_custom_repository<
8224            T: std::convert::Into<
8225                    std::boxed::Box<
8226                        crate::model::remote_repository_config::yum_repository::CustomRepository,
8227                    >,
8228                >,
8229        >(
8230            mut self,
8231            v: T,
8232        ) -> Self {
8233            self.upstream = std::option::Option::Some(
8234                crate::model::remote_repository_config::yum_repository::Upstream::CustomRepository(
8235                    v.into(),
8236                ),
8237            );
8238            self
8239        }
8240    }
8241
8242    impl wkt::message::Message for YumRepository {
8243        fn typename() -> &'static str {
8244            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository"
8245        }
8246    }
8247
8248    /// Defines additional types related to [YumRepository].
8249    pub mod yum_repository {
8250        #[allow(unused_imports)]
8251        use super::*;
8252
8253        /// Publicly available Yum repositories constructed from a common repository
8254        /// base and a custom repository path.
8255        #[derive(Clone, Default, PartialEq)]
8256        #[non_exhaustive]
8257        pub struct PublicRepository {
8258
8259            /// A common public repository base for Yum.
8260            pub repository_base: crate::model::remote_repository_config::yum_repository::public_repository::RepositoryBase,
8261
8262            /// A custom field to define a path to a specific repository from the base.
8263            pub repository_path: std::string::String,
8264
8265            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8266        }
8267
8268        impl PublicRepository {
8269            pub fn new() -> Self {
8270                std::default::Default::default()
8271            }
8272
8273            /// Sets the value of [repository_base][crate::model::remote_repository_config::yum_repository::PublicRepository::repository_base].
8274            ///
8275            /// # Example
8276            /// ```ignore,no_run
8277            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::PublicRepository;
8278            /// use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::public_repository::RepositoryBase;
8279            /// let x0 = PublicRepository::new().set_repository_base(RepositoryBase::Centos);
8280            /// let x1 = PublicRepository::new().set_repository_base(RepositoryBase::CentosDebug);
8281            /// let x2 = PublicRepository::new().set_repository_base(RepositoryBase::CentosVault);
8282            /// ```
8283            pub fn set_repository_base<T: std::convert::Into<crate::model::remote_repository_config::yum_repository::public_repository::RepositoryBase>>(mut self, v: T) -> Self{
8284                self.repository_base = v.into();
8285                self
8286            }
8287
8288            /// Sets the value of [repository_path][crate::model::remote_repository_config::yum_repository::PublicRepository::repository_path].
8289            ///
8290            /// # Example
8291            /// ```ignore,no_run
8292            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::PublicRepository;
8293            /// let x = PublicRepository::new().set_repository_path("example");
8294            /// ```
8295            pub fn set_repository_path<T: std::convert::Into<std::string::String>>(
8296                mut self,
8297                v: T,
8298            ) -> Self {
8299                self.repository_path = v.into();
8300                self
8301            }
8302        }
8303
8304        impl wkt::message::Message for PublicRepository {
8305            fn typename() -> &'static str {
8306                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository"
8307            }
8308        }
8309
8310        /// Defines additional types related to [PublicRepository].
8311        pub mod public_repository {
8312            #[allow(unused_imports)]
8313            use super::*;
8314
8315            /// Predefined list of publicly available repository bases for Yum.
8316            ///
8317            /// # Working with unknown values
8318            ///
8319            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8320            /// additional enum variants at any time. Adding new variants is not considered
8321            /// a breaking change. Applications should write their code in anticipation of:
8322            ///
8323            /// - New values appearing in future releases of the client library, **and**
8324            /// - New values received dynamically, without application changes.
8325            ///
8326            /// Please consult the [Working with enums] section in the user guide for some
8327            /// guidelines.
8328            ///
8329            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8330            #[derive(Clone, Debug, PartialEq)]
8331            #[non_exhaustive]
8332            pub enum RepositoryBase {
8333                /// Unspecified repository base.
8334                Unspecified,
8335                /// CentOS.
8336                Centos,
8337                /// CentOS Debug.
8338                CentosDebug,
8339                /// CentOS Vault.
8340                CentosVault,
8341                /// CentOS Stream.
8342                CentosStream,
8343                /// Rocky.
8344                Rocky,
8345                /// Fedora Extra Packages for Enterprise Linux (EPEL).
8346                Epel,
8347                /// If set, the enum was initialized with an unknown value.
8348                ///
8349                /// Applications can examine the value using [RepositoryBase::value] or
8350                /// [RepositoryBase::name].
8351                UnknownValue(repository_base::UnknownValue),
8352            }
8353
8354            #[doc(hidden)]
8355            pub mod repository_base {
8356                #[allow(unused_imports)]
8357                use super::*;
8358                #[derive(Clone, Debug, PartialEq)]
8359                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8360            }
8361
8362            impl RepositoryBase {
8363                /// Gets the enum value.
8364                ///
8365                /// Returns `None` if the enum contains an unknown value deserialized from
8366                /// the string representation of enums.
8367                pub fn value(&self) -> std::option::Option<i32> {
8368                    match self {
8369                        Self::Unspecified => std::option::Option::Some(0),
8370                        Self::Centos => std::option::Option::Some(1),
8371                        Self::CentosDebug => std::option::Option::Some(2),
8372                        Self::CentosVault => std::option::Option::Some(3),
8373                        Self::CentosStream => std::option::Option::Some(4),
8374                        Self::Rocky => std::option::Option::Some(5),
8375                        Self::Epel => std::option::Option::Some(6),
8376                        Self::UnknownValue(u) => u.0.value(),
8377                    }
8378                }
8379
8380                /// Gets the enum value as a string.
8381                ///
8382                /// Returns `None` if the enum contains an unknown value deserialized from
8383                /// the integer representation of enums.
8384                pub fn name(&self) -> std::option::Option<&str> {
8385                    match self {
8386                        Self::Unspecified => {
8387                            std::option::Option::Some("REPOSITORY_BASE_UNSPECIFIED")
8388                        }
8389                        Self::Centos => std::option::Option::Some("CENTOS"),
8390                        Self::CentosDebug => std::option::Option::Some("CENTOS_DEBUG"),
8391                        Self::CentosVault => std::option::Option::Some("CENTOS_VAULT"),
8392                        Self::CentosStream => std::option::Option::Some("CENTOS_STREAM"),
8393                        Self::Rocky => std::option::Option::Some("ROCKY"),
8394                        Self::Epel => std::option::Option::Some("EPEL"),
8395                        Self::UnknownValue(u) => u.0.name(),
8396                    }
8397                }
8398            }
8399
8400            impl std::default::Default for RepositoryBase {
8401                fn default() -> Self {
8402                    use std::convert::From;
8403                    Self::from(0)
8404                }
8405            }
8406
8407            impl std::fmt::Display for RepositoryBase {
8408                fn fmt(
8409                    &self,
8410                    f: &mut std::fmt::Formatter<'_>,
8411                ) -> std::result::Result<(), std::fmt::Error> {
8412                    wkt::internal::display_enum(f, self.name(), self.value())
8413                }
8414            }
8415
8416            impl std::convert::From<i32> for RepositoryBase {
8417                fn from(value: i32) -> Self {
8418                    match value {
8419                        0 => Self::Unspecified,
8420                        1 => Self::Centos,
8421                        2 => Self::CentosDebug,
8422                        3 => Self::CentosVault,
8423                        4 => Self::CentosStream,
8424                        5 => Self::Rocky,
8425                        6 => Self::Epel,
8426                        _ => Self::UnknownValue(repository_base::UnknownValue(
8427                            wkt::internal::UnknownEnumValue::Integer(value),
8428                        )),
8429                    }
8430                }
8431            }
8432
8433            impl std::convert::From<&str> for RepositoryBase {
8434                fn from(value: &str) -> Self {
8435                    use std::string::ToString;
8436                    match value {
8437                        "REPOSITORY_BASE_UNSPECIFIED" => Self::Unspecified,
8438                        "CENTOS" => Self::Centos,
8439                        "CENTOS_DEBUG" => Self::CentosDebug,
8440                        "CENTOS_VAULT" => Self::CentosVault,
8441                        "CENTOS_STREAM" => Self::CentosStream,
8442                        "ROCKY" => Self::Rocky,
8443                        "EPEL" => Self::Epel,
8444                        _ => Self::UnknownValue(repository_base::UnknownValue(
8445                            wkt::internal::UnknownEnumValue::String(value.to_string()),
8446                        )),
8447                    }
8448                }
8449            }
8450
8451            impl serde::ser::Serialize for RepositoryBase {
8452                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8453                where
8454                    S: serde::Serializer,
8455                {
8456                    match self {
8457                        Self::Unspecified => serializer.serialize_i32(0),
8458                        Self::Centos => serializer.serialize_i32(1),
8459                        Self::CentosDebug => serializer.serialize_i32(2),
8460                        Self::CentosVault => serializer.serialize_i32(3),
8461                        Self::CentosStream => serializer.serialize_i32(4),
8462                        Self::Rocky => serializer.serialize_i32(5),
8463                        Self::Epel => serializer.serialize_i32(6),
8464                        Self::UnknownValue(u) => u.0.serialize(serializer),
8465                    }
8466                }
8467            }
8468
8469            impl<'de> serde::de::Deserialize<'de> for RepositoryBase {
8470                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8471                where
8472                    D: serde::Deserializer<'de>,
8473                {
8474                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepositoryBase>::new(
8475                        ".google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.PublicRepository.RepositoryBase"))
8476                }
8477            }
8478        }
8479
8480        /// Customer-specified publicly available remote repository.
8481        #[derive(Clone, Default, PartialEq)]
8482        #[non_exhaustive]
8483        pub struct CustomRepository {
8484            /// An http/https uri reference to the upstream remote repository, for ex:
8485            /// `https://my.yum.registry/`.
8486            pub uri: std::string::String,
8487
8488            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8489        }
8490
8491        impl CustomRepository {
8492            pub fn new() -> Self {
8493                std::default::Default::default()
8494            }
8495
8496            /// Sets the value of [uri][crate::model::remote_repository_config::yum_repository::CustomRepository::uri].
8497            ///
8498            /// # Example
8499            /// ```ignore,no_run
8500            /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::yum_repository::CustomRepository;
8501            /// let x = CustomRepository::new().set_uri("example");
8502            /// ```
8503            pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8504                self.uri = v.into();
8505                self
8506            }
8507        }
8508
8509        impl wkt::message::Message for CustomRepository {
8510            fn typename() -> &'static str {
8511                "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository"
8512            }
8513        }
8514
8515        /// Address of the remote repository.
8516        #[derive(Clone, Debug, PartialEq)]
8517        #[non_exhaustive]
8518        pub enum Upstream {
8519            /// One of the publicly available Yum repositories supported by Artifact
8520            /// Registry.
8521            PublicRepository(
8522                std::boxed::Box<
8523                    crate::model::remote_repository_config::yum_repository::PublicRepository,
8524                >,
8525            ),
8526            /// Customer-specified remote repository.
8527            CustomRepository(
8528                std::boxed::Box<
8529                    crate::model::remote_repository_config::yum_repository::CustomRepository,
8530                >,
8531            ),
8532        }
8533    }
8534
8535    /// Common remote repository settings type.
8536    #[derive(Clone, Default, PartialEq)]
8537    #[non_exhaustive]
8538    pub struct CommonRemoteRepository {
8539        /// Required. A common public repository base for remote repository.
8540        pub uri: std::string::String,
8541
8542        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8543    }
8544
8545    impl CommonRemoteRepository {
8546        pub fn new() -> Self {
8547            std::default::Default::default()
8548        }
8549
8550        /// Sets the value of [uri][crate::model::remote_repository_config::CommonRemoteRepository::uri].
8551        ///
8552        /// # Example
8553        /// ```ignore,no_run
8554        /// # use google_cloud_artifactregistry_v1::model::remote_repository_config::CommonRemoteRepository;
8555        /// let x = CommonRemoteRepository::new().set_uri("example");
8556        /// ```
8557        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8558            self.uri = v.into();
8559            self
8560        }
8561    }
8562
8563    impl wkt::message::Message for CommonRemoteRepository {
8564        fn typename() -> &'static str {
8565            "type.googleapis.com/google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository"
8566        }
8567    }
8568
8569    /// Settings specific to the remote repository.
8570    #[derive(Clone, Debug, PartialEq)]
8571    #[non_exhaustive]
8572    pub enum RemoteSource {
8573        /// Specific settings for a Docker remote repository.
8574        DockerRepository(std::boxed::Box<crate::model::remote_repository_config::DockerRepository>),
8575        /// Specific settings for a Maven remote repository.
8576        MavenRepository(std::boxed::Box<crate::model::remote_repository_config::MavenRepository>),
8577        /// Specific settings for an Npm remote repository.
8578        NpmRepository(std::boxed::Box<crate::model::remote_repository_config::NpmRepository>),
8579        /// Specific settings for a Python remote repository.
8580        PythonRepository(std::boxed::Box<crate::model::remote_repository_config::PythonRepository>),
8581        /// Specific settings for an Apt remote repository.
8582        AptRepository(std::boxed::Box<crate::model::remote_repository_config::AptRepository>),
8583        /// Specific settings for a Yum remote repository.
8584        YumRepository(std::boxed::Box<crate::model::remote_repository_config::YumRepository>),
8585        /// Common remote repository settings.
8586        /// Used as the remote repository upstream URL.
8587        CommonRepository(
8588            std::boxed::Box<crate::model::remote_repository_config::CommonRemoteRepository>,
8589        ),
8590    }
8591}
8592
8593/// A Repository for storing artifacts with a specific format.
8594#[derive(Clone, Default, PartialEq)]
8595#[non_exhaustive]
8596pub struct Repository {
8597    /// The name of the repository, for example:
8598    /// `projects/p1/locations/us-central1/repositories/repo1`. For each location
8599    /// in a project, repository names must be unique.
8600    pub name: std::string::String,
8601
8602    /// Optional. The format of packages that are stored in the repository.
8603    pub format: crate::model::repository::Format,
8604
8605    /// The user-provided description of the repository.
8606    pub description: std::string::String,
8607
8608    /// Labels with user-defined metadata.
8609    /// This field may contain up to 64 entries. Label keys and values may be no
8610    /// longer than 63 characters. Label keys must begin with a lowercase letter
8611    /// and may only contain lowercase letters, numeric characters, underscores,
8612    /// and dashes.
8613    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8614
8615    /// Output only. The time when the repository was created.
8616    pub create_time: std::option::Option<wkt::Timestamp>,
8617
8618    /// Output only. The time when the repository was last updated.
8619    pub update_time: std::option::Option<wkt::Timestamp>,
8620
8621    /// The Cloud KMS resource name of the customer managed encryption key that's
8622    /// used to encrypt the contents of the Repository. Has the form:
8623    /// `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
8624    /// This value may not be changed after the Repository has been created.
8625    pub kms_key_name: std::string::String,
8626
8627    /// Optional. The mode of the repository.
8628    pub mode: crate::model::repository::Mode,
8629
8630    /// Optional. Cleanup policies for this repository. Cleanup policies indicate
8631    /// when certain package versions can be automatically deleted. Map keys are
8632    /// policy IDs supplied by users during policy creation. They must unique
8633    /// within a repository and be under 128 characters in length.
8634    pub cleanup_policies:
8635        std::collections::HashMap<std::string::String, crate::model::CleanupPolicy>,
8636
8637    /// Output only. The size, in bytes, of all artifact storage in this
8638    /// repository. Repositories that are generally available or in public preview
8639    /// use this to calculate storage costs.
8640    pub size_bytes: i64,
8641
8642    /// Output only. Whether or not this repository satisfies PZS.
8643    pub satisfies_pzs: bool,
8644
8645    /// Optional. If true, the cleanup pipeline is prevented from deleting versions
8646    /// in this repository.
8647    pub cleanup_policy_dry_run: bool,
8648
8649    /// Optional. Config and state for vulnerability scanning of resources within
8650    /// this Repository.
8651    pub vulnerability_scanning_config:
8652        std::option::Option<crate::model::repository::VulnerabilityScanningConfig>,
8653
8654    /// Optional. If this is true, an unspecified repo type will be treated as
8655    /// error rather than defaulting to standard.
8656    pub disallow_unspecified_mode: bool,
8657
8658    /// Output only. Whether or not this repository satisfies PZI.
8659    pub satisfies_pzi: bool,
8660
8661    /// Output only. The repository endpoint, for example:
8662    /// `us-docker.pkg.dev/my-proj/my-repo`.
8663    pub registry_uri: std::string::String,
8664
8665    /// Repository-specific configurations.
8666    pub format_config: std::option::Option<crate::model::repository::FormatConfig>,
8667
8668    /// Repository configuration specific to the Mode value being selected (Remote
8669    /// or Virtual)
8670    pub mode_config: std::option::Option<crate::model::repository::ModeConfig>,
8671
8672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8673}
8674
8675impl Repository {
8676    pub fn new() -> Self {
8677        std::default::Default::default()
8678    }
8679
8680    /// Sets the value of [name][crate::model::Repository::name].
8681    ///
8682    /// # Example
8683    /// ```ignore,no_run
8684    /// # use google_cloud_artifactregistry_v1::model::Repository;
8685    /// let x = Repository::new().set_name("example");
8686    /// ```
8687    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8688        self.name = v.into();
8689        self
8690    }
8691
8692    /// Sets the value of [format][crate::model::Repository::format].
8693    ///
8694    /// # Example
8695    /// ```ignore,no_run
8696    /// # use google_cloud_artifactregistry_v1::model::Repository;
8697    /// use google_cloud_artifactregistry_v1::model::repository::Format;
8698    /// let x0 = Repository::new().set_format(Format::Docker);
8699    /// let x1 = Repository::new().set_format(Format::Maven);
8700    /// let x2 = Repository::new().set_format(Format::Npm);
8701    /// ```
8702    pub fn set_format<T: std::convert::Into<crate::model::repository::Format>>(
8703        mut self,
8704        v: T,
8705    ) -> Self {
8706        self.format = v.into();
8707        self
8708    }
8709
8710    /// Sets the value of [description][crate::model::Repository::description].
8711    ///
8712    /// # Example
8713    /// ```ignore,no_run
8714    /// # use google_cloud_artifactregistry_v1::model::Repository;
8715    /// let x = Repository::new().set_description("example");
8716    /// ```
8717    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8718        self.description = v.into();
8719        self
8720    }
8721
8722    /// Sets the value of [labels][crate::model::Repository::labels].
8723    ///
8724    /// # Example
8725    /// ```ignore,no_run
8726    /// # use google_cloud_artifactregistry_v1::model::Repository;
8727    /// let x = Repository::new().set_labels([
8728    ///     ("key0", "abc"),
8729    ///     ("key1", "xyz"),
8730    /// ]);
8731    /// ```
8732    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8733    where
8734        T: std::iter::IntoIterator<Item = (K, V)>,
8735        K: std::convert::Into<std::string::String>,
8736        V: std::convert::Into<std::string::String>,
8737    {
8738        use std::iter::Iterator;
8739        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8740        self
8741    }
8742
8743    /// Sets the value of [create_time][crate::model::Repository::create_time].
8744    ///
8745    /// # Example
8746    /// ```ignore,no_run
8747    /// # use google_cloud_artifactregistry_v1::model::Repository;
8748    /// use wkt::Timestamp;
8749    /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
8750    /// ```
8751    pub fn set_create_time<T>(mut self, v: T) -> Self
8752    where
8753        T: std::convert::Into<wkt::Timestamp>,
8754    {
8755        self.create_time = std::option::Option::Some(v.into());
8756        self
8757    }
8758
8759    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
8760    ///
8761    /// # Example
8762    /// ```ignore,no_run
8763    /// # use google_cloud_artifactregistry_v1::model::Repository;
8764    /// use wkt::Timestamp;
8765    /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8766    /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
8767    /// ```
8768    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8769    where
8770        T: std::convert::Into<wkt::Timestamp>,
8771    {
8772        self.create_time = v.map(|x| x.into());
8773        self
8774    }
8775
8776    /// Sets the value of [update_time][crate::model::Repository::update_time].
8777    ///
8778    /// # Example
8779    /// ```ignore,no_run
8780    /// # use google_cloud_artifactregistry_v1::model::Repository;
8781    /// use wkt::Timestamp;
8782    /// let x = Repository::new().set_update_time(Timestamp::default()/* use setters */);
8783    /// ```
8784    pub fn set_update_time<T>(mut self, v: T) -> Self
8785    where
8786        T: std::convert::Into<wkt::Timestamp>,
8787    {
8788        self.update_time = std::option::Option::Some(v.into());
8789        self
8790    }
8791
8792    /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
8793    ///
8794    /// # Example
8795    /// ```ignore,no_run
8796    /// # use google_cloud_artifactregistry_v1::model::Repository;
8797    /// use wkt::Timestamp;
8798    /// let x = Repository::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8799    /// let x = Repository::new().set_or_clear_update_time(None::<Timestamp>);
8800    /// ```
8801    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8802    where
8803        T: std::convert::Into<wkt::Timestamp>,
8804    {
8805        self.update_time = v.map(|x| x.into());
8806        self
8807    }
8808
8809    /// Sets the value of [kms_key_name][crate::model::Repository::kms_key_name].
8810    ///
8811    /// # Example
8812    /// ```ignore,no_run
8813    /// # use google_cloud_artifactregistry_v1::model::Repository;
8814    /// let x = Repository::new().set_kms_key_name("example");
8815    /// ```
8816    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8817        self.kms_key_name = v.into();
8818        self
8819    }
8820
8821    /// Sets the value of [mode][crate::model::Repository::mode].
8822    ///
8823    /// # Example
8824    /// ```ignore,no_run
8825    /// # use google_cloud_artifactregistry_v1::model::Repository;
8826    /// use google_cloud_artifactregistry_v1::model::repository::Mode;
8827    /// let x0 = Repository::new().set_mode(Mode::StandardRepository);
8828    /// let x1 = Repository::new().set_mode(Mode::VirtualRepository);
8829    /// let x2 = Repository::new().set_mode(Mode::RemoteRepository);
8830    /// ```
8831    pub fn set_mode<T: std::convert::Into<crate::model::repository::Mode>>(mut self, v: T) -> Self {
8832        self.mode = v.into();
8833        self
8834    }
8835
8836    /// Sets the value of [cleanup_policies][crate::model::Repository::cleanup_policies].
8837    ///
8838    /// # Example
8839    /// ```ignore,no_run
8840    /// # use google_cloud_artifactregistry_v1::model::Repository;
8841    /// use google_cloud_artifactregistry_v1::model::CleanupPolicy;
8842    /// let x = Repository::new().set_cleanup_policies([
8843    ///     ("key0", CleanupPolicy::default()/* use setters */),
8844    ///     ("key1", CleanupPolicy::default()/* use (different) setters */),
8845    /// ]);
8846    /// ```
8847    pub fn set_cleanup_policies<T, K, V>(mut self, v: T) -> Self
8848    where
8849        T: std::iter::IntoIterator<Item = (K, V)>,
8850        K: std::convert::Into<std::string::String>,
8851        V: std::convert::Into<crate::model::CleanupPolicy>,
8852    {
8853        use std::iter::Iterator;
8854        self.cleanup_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8855        self
8856    }
8857
8858    /// Sets the value of [size_bytes][crate::model::Repository::size_bytes].
8859    ///
8860    /// # Example
8861    /// ```ignore,no_run
8862    /// # use google_cloud_artifactregistry_v1::model::Repository;
8863    /// let x = Repository::new().set_size_bytes(42);
8864    /// ```
8865    pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8866        self.size_bytes = v.into();
8867        self
8868    }
8869
8870    /// Sets the value of [satisfies_pzs][crate::model::Repository::satisfies_pzs].
8871    ///
8872    /// # Example
8873    /// ```ignore,no_run
8874    /// # use google_cloud_artifactregistry_v1::model::Repository;
8875    /// let x = Repository::new().set_satisfies_pzs(true);
8876    /// ```
8877    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8878        self.satisfies_pzs = v.into();
8879        self
8880    }
8881
8882    /// Sets the value of [cleanup_policy_dry_run][crate::model::Repository::cleanup_policy_dry_run].
8883    ///
8884    /// # Example
8885    /// ```ignore,no_run
8886    /// # use google_cloud_artifactregistry_v1::model::Repository;
8887    /// let x = Repository::new().set_cleanup_policy_dry_run(true);
8888    /// ```
8889    pub fn set_cleanup_policy_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8890        self.cleanup_policy_dry_run = v.into();
8891        self
8892    }
8893
8894    /// Sets the value of [vulnerability_scanning_config][crate::model::Repository::vulnerability_scanning_config].
8895    ///
8896    /// # Example
8897    /// ```ignore,no_run
8898    /// # use google_cloud_artifactregistry_v1::model::Repository;
8899    /// use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
8900    /// let x = Repository::new().set_vulnerability_scanning_config(VulnerabilityScanningConfig::default()/* use setters */);
8901    /// ```
8902    pub fn set_vulnerability_scanning_config<T>(mut self, v: T) -> Self
8903    where
8904        T: std::convert::Into<crate::model::repository::VulnerabilityScanningConfig>,
8905    {
8906        self.vulnerability_scanning_config = std::option::Option::Some(v.into());
8907        self
8908    }
8909
8910    /// Sets or clears the value of [vulnerability_scanning_config][crate::model::Repository::vulnerability_scanning_config].
8911    ///
8912    /// # Example
8913    /// ```ignore,no_run
8914    /// # use google_cloud_artifactregistry_v1::model::Repository;
8915    /// use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
8916    /// let x = Repository::new().set_or_clear_vulnerability_scanning_config(Some(VulnerabilityScanningConfig::default()/* use setters */));
8917    /// let x = Repository::new().set_or_clear_vulnerability_scanning_config(None::<VulnerabilityScanningConfig>);
8918    /// ```
8919    pub fn set_or_clear_vulnerability_scanning_config<T>(
8920        mut self,
8921        v: std::option::Option<T>,
8922    ) -> Self
8923    where
8924        T: std::convert::Into<crate::model::repository::VulnerabilityScanningConfig>,
8925    {
8926        self.vulnerability_scanning_config = v.map(|x| x.into());
8927        self
8928    }
8929
8930    /// Sets the value of [disallow_unspecified_mode][crate::model::Repository::disallow_unspecified_mode].
8931    ///
8932    /// # Example
8933    /// ```ignore,no_run
8934    /// # use google_cloud_artifactregistry_v1::model::Repository;
8935    /// let x = Repository::new().set_disallow_unspecified_mode(true);
8936    /// ```
8937    pub fn set_disallow_unspecified_mode<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8938        self.disallow_unspecified_mode = v.into();
8939        self
8940    }
8941
8942    /// Sets the value of [satisfies_pzi][crate::model::Repository::satisfies_pzi].
8943    ///
8944    /// # Example
8945    /// ```ignore,no_run
8946    /// # use google_cloud_artifactregistry_v1::model::Repository;
8947    /// let x = Repository::new().set_satisfies_pzi(true);
8948    /// ```
8949    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8950        self.satisfies_pzi = v.into();
8951        self
8952    }
8953
8954    /// Sets the value of [registry_uri][crate::model::Repository::registry_uri].
8955    ///
8956    /// # Example
8957    /// ```ignore,no_run
8958    /// # use google_cloud_artifactregistry_v1::model::Repository;
8959    /// let x = Repository::new().set_registry_uri("example");
8960    /// ```
8961    pub fn set_registry_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8962        self.registry_uri = v.into();
8963        self
8964    }
8965
8966    /// Sets the value of [format_config][crate::model::Repository::format_config].
8967    ///
8968    /// Note that all the setters affecting `format_config` are mutually
8969    /// exclusive.
8970    ///
8971    /// # Example
8972    /// ```ignore,no_run
8973    /// # use google_cloud_artifactregistry_v1::model::Repository;
8974    /// use google_cloud_artifactregistry_v1::model::repository::MavenRepositoryConfig;
8975    /// let x = Repository::new().set_format_config(Some(
8976    ///     google_cloud_artifactregistry_v1::model::repository::FormatConfig::MavenConfig(MavenRepositoryConfig::default().into())));
8977    /// ```
8978    pub fn set_format_config<
8979        T: std::convert::Into<std::option::Option<crate::model::repository::FormatConfig>>,
8980    >(
8981        mut self,
8982        v: T,
8983    ) -> Self {
8984        self.format_config = v.into();
8985        self
8986    }
8987
8988    /// The value of [format_config][crate::model::Repository::format_config]
8989    /// if it holds a `MavenConfig`, `None` if the field is not set or
8990    /// holds a different branch.
8991    pub fn maven_config(
8992        &self,
8993    ) -> std::option::Option<&std::boxed::Box<crate::model::repository::MavenRepositoryConfig>>
8994    {
8995        #[allow(unreachable_patterns)]
8996        self.format_config.as_ref().and_then(|v| match v {
8997            crate::model::repository::FormatConfig::MavenConfig(v) => std::option::Option::Some(v),
8998            _ => std::option::Option::None,
8999        })
9000    }
9001
9002    /// Sets the value of [format_config][crate::model::Repository::format_config]
9003    /// to hold a `MavenConfig`.
9004    ///
9005    /// Note that all the setters affecting `format_config` are
9006    /// mutually exclusive.
9007    ///
9008    /// # Example
9009    /// ```ignore,no_run
9010    /// # use google_cloud_artifactregistry_v1::model::Repository;
9011    /// use google_cloud_artifactregistry_v1::model::repository::MavenRepositoryConfig;
9012    /// let x = Repository::new().set_maven_config(MavenRepositoryConfig::default()/* use setters */);
9013    /// assert!(x.maven_config().is_some());
9014    /// assert!(x.docker_config().is_none());
9015    /// ```
9016    pub fn set_maven_config<
9017        T: std::convert::Into<std::boxed::Box<crate::model::repository::MavenRepositoryConfig>>,
9018    >(
9019        mut self,
9020        v: T,
9021    ) -> Self {
9022        self.format_config = std::option::Option::Some(
9023            crate::model::repository::FormatConfig::MavenConfig(v.into()),
9024        );
9025        self
9026    }
9027
9028    /// The value of [format_config][crate::model::Repository::format_config]
9029    /// if it holds a `DockerConfig`, `None` if the field is not set or
9030    /// holds a different branch.
9031    pub fn docker_config(
9032        &self,
9033    ) -> std::option::Option<&std::boxed::Box<crate::model::repository::DockerRepositoryConfig>>
9034    {
9035        #[allow(unreachable_patterns)]
9036        self.format_config.as_ref().and_then(|v| match v {
9037            crate::model::repository::FormatConfig::DockerConfig(v) => std::option::Option::Some(v),
9038            _ => std::option::Option::None,
9039        })
9040    }
9041
9042    /// Sets the value of [format_config][crate::model::Repository::format_config]
9043    /// to hold a `DockerConfig`.
9044    ///
9045    /// Note that all the setters affecting `format_config` are
9046    /// mutually exclusive.
9047    ///
9048    /// # Example
9049    /// ```ignore,no_run
9050    /// # use google_cloud_artifactregistry_v1::model::Repository;
9051    /// use google_cloud_artifactregistry_v1::model::repository::DockerRepositoryConfig;
9052    /// let x = Repository::new().set_docker_config(DockerRepositoryConfig::default()/* use setters */);
9053    /// assert!(x.docker_config().is_some());
9054    /// assert!(x.maven_config().is_none());
9055    /// ```
9056    pub fn set_docker_config<
9057        T: std::convert::Into<std::boxed::Box<crate::model::repository::DockerRepositoryConfig>>,
9058    >(
9059        mut self,
9060        v: T,
9061    ) -> Self {
9062        self.format_config = std::option::Option::Some(
9063            crate::model::repository::FormatConfig::DockerConfig(v.into()),
9064        );
9065        self
9066    }
9067
9068    /// Sets the value of [mode_config][crate::model::Repository::mode_config].
9069    ///
9070    /// Note that all the setters affecting `mode_config` are mutually
9071    /// exclusive.
9072    ///
9073    /// # Example
9074    /// ```ignore,no_run
9075    /// # use google_cloud_artifactregistry_v1::model::Repository;
9076    /// use google_cloud_artifactregistry_v1::model::VirtualRepositoryConfig;
9077    /// let x = Repository::new().set_mode_config(Some(
9078    ///     google_cloud_artifactregistry_v1::model::repository::ModeConfig::VirtualRepositoryConfig(VirtualRepositoryConfig::default().into())));
9079    /// ```
9080    pub fn set_mode_config<
9081        T: std::convert::Into<std::option::Option<crate::model::repository::ModeConfig>>,
9082    >(
9083        mut self,
9084        v: T,
9085    ) -> Self {
9086        self.mode_config = v.into();
9087        self
9088    }
9089
9090    /// The value of [mode_config][crate::model::Repository::mode_config]
9091    /// if it holds a `VirtualRepositoryConfig`, `None` if the field is not set or
9092    /// holds a different branch.
9093    pub fn virtual_repository_config(
9094        &self,
9095    ) -> std::option::Option<&std::boxed::Box<crate::model::VirtualRepositoryConfig>> {
9096        #[allow(unreachable_patterns)]
9097        self.mode_config.as_ref().and_then(|v| match v {
9098            crate::model::repository::ModeConfig::VirtualRepositoryConfig(v) => {
9099                std::option::Option::Some(v)
9100            }
9101            _ => std::option::Option::None,
9102        })
9103    }
9104
9105    /// Sets the value of [mode_config][crate::model::Repository::mode_config]
9106    /// to hold a `VirtualRepositoryConfig`.
9107    ///
9108    /// Note that all the setters affecting `mode_config` are
9109    /// mutually exclusive.
9110    ///
9111    /// # Example
9112    /// ```ignore,no_run
9113    /// # use google_cloud_artifactregistry_v1::model::Repository;
9114    /// use google_cloud_artifactregistry_v1::model::VirtualRepositoryConfig;
9115    /// let x = Repository::new().set_virtual_repository_config(VirtualRepositoryConfig::default()/* use setters */);
9116    /// assert!(x.virtual_repository_config().is_some());
9117    /// assert!(x.remote_repository_config().is_none());
9118    /// ```
9119    pub fn set_virtual_repository_config<
9120        T: std::convert::Into<std::boxed::Box<crate::model::VirtualRepositoryConfig>>,
9121    >(
9122        mut self,
9123        v: T,
9124    ) -> Self {
9125        self.mode_config = std::option::Option::Some(
9126            crate::model::repository::ModeConfig::VirtualRepositoryConfig(v.into()),
9127        );
9128        self
9129    }
9130
9131    /// The value of [mode_config][crate::model::Repository::mode_config]
9132    /// if it holds a `RemoteRepositoryConfig`, `None` if the field is not set or
9133    /// holds a different branch.
9134    pub fn remote_repository_config(
9135        &self,
9136    ) -> std::option::Option<&std::boxed::Box<crate::model::RemoteRepositoryConfig>> {
9137        #[allow(unreachable_patterns)]
9138        self.mode_config.as_ref().and_then(|v| match v {
9139            crate::model::repository::ModeConfig::RemoteRepositoryConfig(v) => {
9140                std::option::Option::Some(v)
9141            }
9142            _ => std::option::Option::None,
9143        })
9144    }
9145
9146    /// Sets the value of [mode_config][crate::model::Repository::mode_config]
9147    /// to hold a `RemoteRepositoryConfig`.
9148    ///
9149    /// Note that all the setters affecting `mode_config` are
9150    /// mutually exclusive.
9151    ///
9152    /// # Example
9153    /// ```ignore,no_run
9154    /// # use google_cloud_artifactregistry_v1::model::Repository;
9155    /// use google_cloud_artifactregistry_v1::model::RemoteRepositoryConfig;
9156    /// let x = Repository::new().set_remote_repository_config(RemoteRepositoryConfig::default()/* use setters */);
9157    /// assert!(x.remote_repository_config().is_some());
9158    /// assert!(x.virtual_repository_config().is_none());
9159    /// ```
9160    pub fn set_remote_repository_config<
9161        T: std::convert::Into<std::boxed::Box<crate::model::RemoteRepositoryConfig>>,
9162    >(
9163        mut self,
9164        v: T,
9165    ) -> Self {
9166        self.mode_config = std::option::Option::Some(
9167            crate::model::repository::ModeConfig::RemoteRepositoryConfig(v.into()),
9168        );
9169        self
9170    }
9171}
9172
9173impl wkt::message::Message for Repository {
9174    fn typename() -> &'static str {
9175        "type.googleapis.com/google.devtools.artifactregistry.v1.Repository"
9176    }
9177}
9178
9179/// Defines additional types related to [Repository].
9180pub mod repository {
9181    #[allow(unused_imports)]
9182    use super::*;
9183
9184    /// MavenRepositoryConfig is maven related repository details.
9185    /// Provides additional configuration details for repositories of the maven
9186    /// format type.
9187    #[derive(Clone, Default, PartialEq)]
9188    #[non_exhaustive]
9189    pub struct MavenRepositoryConfig {
9190        /// The repository with this flag will allow publishing
9191        /// the same snapshot versions.
9192        pub allow_snapshot_overwrites: bool,
9193
9194        /// Version policy defines the versions that the registry will accept.
9195        pub version_policy: crate::model::repository::maven_repository_config::VersionPolicy,
9196
9197        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9198    }
9199
9200    impl MavenRepositoryConfig {
9201        pub fn new() -> Self {
9202            std::default::Default::default()
9203        }
9204
9205        /// Sets the value of [allow_snapshot_overwrites][crate::model::repository::MavenRepositoryConfig::allow_snapshot_overwrites].
9206        ///
9207        /// # Example
9208        /// ```ignore,no_run
9209        /// # use google_cloud_artifactregistry_v1::model::repository::MavenRepositoryConfig;
9210        /// let x = MavenRepositoryConfig::new().set_allow_snapshot_overwrites(true);
9211        /// ```
9212        pub fn set_allow_snapshot_overwrites<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9213            self.allow_snapshot_overwrites = v.into();
9214            self
9215        }
9216
9217        /// Sets the value of [version_policy][crate::model::repository::MavenRepositoryConfig::version_policy].
9218        ///
9219        /// # Example
9220        /// ```ignore,no_run
9221        /// # use google_cloud_artifactregistry_v1::model::repository::MavenRepositoryConfig;
9222        /// use google_cloud_artifactregistry_v1::model::repository::maven_repository_config::VersionPolicy;
9223        /// let x0 = MavenRepositoryConfig::new().set_version_policy(VersionPolicy::Release);
9224        /// let x1 = MavenRepositoryConfig::new().set_version_policy(VersionPolicy::Snapshot);
9225        /// ```
9226        pub fn set_version_policy<
9227            T: std::convert::Into<crate::model::repository::maven_repository_config::VersionPolicy>,
9228        >(
9229            mut self,
9230            v: T,
9231        ) -> Self {
9232            self.version_policy = v.into();
9233            self
9234        }
9235    }
9236
9237    impl wkt::message::Message for MavenRepositoryConfig {
9238        fn typename() -> &'static str {
9239            "type.googleapis.com/google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig"
9240        }
9241    }
9242
9243    /// Defines additional types related to [MavenRepositoryConfig].
9244    pub mod maven_repository_config {
9245        #[allow(unused_imports)]
9246        use super::*;
9247
9248        /// VersionPolicy is the version policy for the repository.
9249        ///
9250        /// # Working with unknown values
9251        ///
9252        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9253        /// additional enum variants at any time. Adding new variants is not considered
9254        /// a breaking change. Applications should write their code in anticipation of:
9255        ///
9256        /// - New values appearing in future releases of the client library, **and**
9257        /// - New values received dynamically, without application changes.
9258        ///
9259        /// Please consult the [Working with enums] section in the user guide for some
9260        /// guidelines.
9261        ///
9262        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9263        #[derive(Clone, Debug, PartialEq)]
9264        #[non_exhaustive]
9265        pub enum VersionPolicy {
9266            /// VERSION_POLICY_UNSPECIFIED - the version policy is not defined.
9267            /// When the version policy is not defined, no validation is performed
9268            /// for the versions.
9269            Unspecified,
9270            /// RELEASE - repository will accept only Release versions.
9271            Release,
9272            /// SNAPSHOT - repository will accept only Snapshot versions.
9273            Snapshot,
9274            /// If set, the enum was initialized with an unknown value.
9275            ///
9276            /// Applications can examine the value using [VersionPolicy::value] or
9277            /// [VersionPolicy::name].
9278            UnknownValue(version_policy::UnknownValue),
9279        }
9280
9281        #[doc(hidden)]
9282        pub mod version_policy {
9283            #[allow(unused_imports)]
9284            use super::*;
9285            #[derive(Clone, Debug, PartialEq)]
9286            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9287        }
9288
9289        impl VersionPolicy {
9290            /// Gets the enum value.
9291            ///
9292            /// Returns `None` if the enum contains an unknown value deserialized from
9293            /// the string representation of enums.
9294            pub fn value(&self) -> std::option::Option<i32> {
9295                match self {
9296                    Self::Unspecified => std::option::Option::Some(0),
9297                    Self::Release => std::option::Option::Some(1),
9298                    Self::Snapshot => std::option::Option::Some(2),
9299                    Self::UnknownValue(u) => u.0.value(),
9300                }
9301            }
9302
9303            /// Gets the enum value as a string.
9304            ///
9305            /// Returns `None` if the enum contains an unknown value deserialized from
9306            /// the integer representation of enums.
9307            pub fn name(&self) -> std::option::Option<&str> {
9308                match self {
9309                    Self::Unspecified => std::option::Option::Some("VERSION_POLICY_UNSPECIFIED"),
9310                    Self::Release => std::option::Option::Some("RELEASE"),
9311                    Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
9312                    Self::UnknownValue(u) => u.0.name(),
9313                }
9314            }
9315        }
9316
9317        impl std::default::Default for VersionPolicy {
9318            fn default() -> Self {
9319                use std::convert::From;
9320                Self::from(0)
9321            }
9322        }
9323
9324        impl std::fmt::Display for VersionPolicy {
9325            fn fmt(
9326                &self,
9327                f: &mut std::fmt::Formatter<'_>,
9328            ) -> std::result::Result<(), std::fmt::Error> {
9329                wkt::internal::display_enum(f, self.name(), self.value())
9330            }
9331        }
9332
9333        impl std::convert::From<i32> for VersionPolicy {
9334            fn from(value: i32) -> Self {
9335                match value {
9336                    0 => Self::Unspecified,
9337                    1 => Self::Release,
9338                    2 => Self::Snapshot,
9339                    _ => Self::UnknownValue(version_policy::UnknownValue(
9340                        wkt::internal::UnknownEnumValue::Integer(value),
9341                    )),
9342                }
9343            }
9344        }
9345
9346        impl std::convert::From<&str> for VersionPolicy {
9347            fn from(value: &str) -> Self {
9348                use std::string::ToString;
9349                match value {
9350                    "VERSION_POLICY_UNSPECIFIED" => Self::Unspecified,
9351                    "RELEASE" => Self::Release,
9352                    "SNAPSHOT" => Self::Snapshot,
9353                    _ => Self::UnknownValue(version_policy::UnknownValue(
9354                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9355                    )),
9356                }
9357            }
9358        }
9359
9360        impl serde::ser::Serialize for VersionPolicy {
9361            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9362            where
9363                S: serde::Serializer,
9364            {
9365                match self {
9366                    Self::Unspecified => serializer.serialize_i32(0),
9367                    Self::Release => serializer.serialize_i32(1),
9368                    Self::Snapshot => serializer.serialize_i32(2),
9369                    Self::UnknownValue(u) => u.0.serialize(serializer),
9370                }
9371            }
9372        }
9373
9374        impl<'de> serde::de::Deserialize<'de> for VersionPolicy {
9375            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9376            where
9377                D: serde::Deserializer<'de>,
9378            {
9379                deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionPolicy>::new(
9380                    ".google.devtools.artifactregistry.v1.Repository.MavenRepositoryConfig.VersionPolicy"))
9381            }
9382        }
9383    }
9384
9385    /// DockerRepositoryConfig is docker related repository details.
9386    /// Provides additional configuration details for repositories of the docker
9387    /// format type.
9388    #[derive(Clone, Default, PartialEq)]
9389    #[non_exhaustive]
9390    pub struct DockerRepositoryConfig {
9391        /// The repository which enabled this flag prevents all tags from being
9392        /// modified, moved or deleted. This does not prevent tags from being
9393        /// created.
9394        pub immutable_tags: bool,
9395
9396        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9397    }
9398
9399    impl DockerRepositoryConfig {
9400        pub fn new() -> Self {
9401            std::default::Default::default()
9402        }
9403
9404        /// Sets the value of [immutable_tags][crate::model::repository::DockerRepositoryConfig::immutable_tags].
9405        ///
9406        /// # Example
9407        /// ```ignore,no_run
9408        /// # use google_cloud_artifactregistry_v1::model::repository::DockerRepositoryConfig;
9409        /// let x = DockerRepositoryConfig::new().set_immutable_tags(true);
9410        /// ```
9411        pub fn set_immutable_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9412            self.immutable_tags = v.into();
9413            self
9414        }
9415    }
9416
9417    impl wkt::message::Message for DockerRepositoryConfig {
9418        fn typename() -> &'static str {
9419            "type.googleapis.com/google.devtools.artifactregistry.v1.Repository.DockerRepositoryConfig"
9420        }
9421    }
9422
9423    /// Config on whether to perform vulnerability scanning for resources in this
9424    /// repository, as well as output fields describing current state.
9425    #[derive(Clone, Default, PartialEq)]
9426    #[non_exhaustive]
9427    pub struct VulnerabilityScanningConfig {
9428        /// Optional. Config for whether this repository has vulnerability scanning
9429        /// disabled.
9430        pub enablement_config:
9431            crate::model::repository::vulnerability_scanning_config::EnablementConfig,
9432
9433        /// Output only. The last time this repository config was enabled.
9434        pub last_enable_time: std::option::Option<wkt::Timestamp>,
9435
9436        /// Output only. State of feature enablement, combining repository enablement
9437        /// config and API enablement state.
9438        pub enablement_state:
9439            crate::model::repository::vulnerability_scanning_config::EnablementState,
9440
9441        /// Output only. Reason for the repository state.
9442        pub enablement_state_reason: std::string::String,
9443
9444        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9445    }
9446
9447    impl VulnerabilityScanningConfig {
9448        pub fn new() -> Self {
9449            std::default::Default::default()
9450        }
9451
9452        /// Sets the value of [enablement_config][crate::model::repository::VulnerabilityScanningConfig::enablement_config].
9453        ///
9454        /// # Example
9455        /// ```ignore,no_run
9456        /// # use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
9457        /// use google_cloud_artifactregistry_v1::model::repository::vulnerability_scanning_config::EnablementConfig;
9458        /// let x0 = VulnerabilityScanningConfig::new().set_enablement_config(EnablementConfig::Inherited);
9459        /// let x1 = VulnerabilityScanningConfig::new().set_enablement_config(EnablementConfig::Disabled);
9460        /// ```
9461        pub fn set_enablement_config<
9462            T: std::convert::Into<
9463                    crate::model::repository::vulnerability_scanning_config::EnablementConfig,
9464                >,
9465        >(
9466            mut self,
9467            v: T,
9468        ) -> Self {
9469            self.enablement_config = v.into();
9470            self
9471        }
9472
9473        /// Sets the value of [last_enable_time][crate::model::repository::VulnerabilityScanningConfig::last_enable_time].
9474        ///
9475        /// # Example
9476        /// ```ignore,no_run
9477        /// # use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
9478        /// use wkt::Timestamp;
9479        /// let x = VulnerabilityScanningConfig::new().set_last_enable_time(Timestamp::default()/* use setters */);
9480        /// ```
9481        pub fn set_last_enable_time<T>(mut self, v: T) -> Self
9482        where
9483            T: std::convert::Into<wkt::Timestamp>,
9484        {
9485            self.last_enable_time = std::option::Option::Some(v.into());
9486            self
9487        }
9488
9489        /// Sets or clears the value of [last_enable_time][crate::model::repository::VulnerabilityScanningConfig::last_enable_time].
9490        ///
9491        /// # Example
9492        /// ```ignore,no_run
9493        /// # use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
9494        /// use wkt::Timestamp;
9495        /// let x = VulnerabilityScanningConfig::new().set_or_clear_last_enable_time(Some(Timestamp::default()/* use setters */));
9496        /// let x = VulnerabilityScanningConfig::new().set_or_clear_last_enable_time(None::<Timestamp>);
9497        /// ```
9498        pub fn set_or_clear_last_enable_time<T>(mut self, v: std::option::Option<T>) -> Self
9499        where
9500            T: std::convert::Into<wkt::Timestamp>,
9501        {
9502            self.last_enable_time = v.map(|x| x.into());
9503            self
9504        }
9505
9506        /// Sets the value of [enablement_state][crate::model::repository::VulnerabilityScanningConfig::enablement_state].
9507        ///
9508        /// # Example
9509        /// ```ignore,no_run
9510        /// # use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
9511        /// use google_cloud_artifactregistry_v1::model::repository::vulnerability_scanning_config::EnablementState;
9512        /// let x0 = VulnerabilityScanningConfig::new().set_enablement_state(EnablementState::ScanningUnsupported);
9513        /// let x1 = VulnerabilityScanningConfig::new().set_enablement_state(EnablementState::ScanningDisabled);
9514        /// let x2 = VulnerabilityScanningConfig::new().set_enablement_state(EnablementState::ScanningActive);
9515        /// ```
9516        pub fn set_enablement_state<
9517            T: std::convert::Into<
9518                    crate::model::repository::vulnerability_scanning_config::EnablementState,
9519                >,
9520        >(
9521            mut self,
9522            v: T,
9523        ) -> Self {
9524            self.enablement_state = v.into();
9525            self
9526        }
9527
9528        /// Sets the value of [enablement_state_reason][crate::model::repository::VulnerabilityScanningConfig::enablement_state_reason].
9529        ///
9530        /// # Example
9531        /// ```ignore,no_run
9532        /// # use google_cloud_artifactregistry_v1::model::repository::VulnerabilityScanningConfig;
9533        /// let x = VulnerabilityScanningConfig::new().set_enablement_state_reason("example");
9534        /// ```
9535        pub fn set_enablement_state_reason<T: std::convert::Into<std::string::String>>(
9536            mut self,
9537            v: T,
9538        ) -> Self {
9539            self.enablement_state_reason = v.into();
9540            self
9541        }
9542    }
9543
9544    impl wkt::message::Message for VulnerabilityScanningConfig {
9545        fn typename() -> &'static str {
9546            "type.googleapis.com/google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig"
9547        }
9548    }
9549
9550    /// Defines additional types related to [VulnerabilityScanningConfig].
9551    pub mod vulnerability_scanning_config {
9552        #[allow(unused_imports)]
9553        use super::*;
9554
9555        /// Config for vulnerability scanning of resources in this repository.
9556        ///
9557        /// # Working with unknown values
9558        ///
9559        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9560        /// additional enum variants at any time. Adding new variants is not considered
9561        /// a breaking change. Applications should write their code in anticipation of:
9562        ///
9563        /// - New values appearing in future releases of the client library, **and**
9564        /// - New values received dynamically, without application changes.
9565        ///
9566        /// Please consult the [Working with enums] section in the user guide for some
9567        /// guidelines.
9568        ///
9569        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9570        #[derive(Clone, Debug, PartialEq)]
9571        #[non_exhaustive]
9572        pub enum EnablementConfig {
9573            /// Not set. This will be treated as INHERITED for Docker repositories and
9574            /// DISABLED for non-Docker repositories.
9575            Unspecified,
9576            /// Scanning is Enabled, but dependent on API enablement.
9577            Inherited,
9578            /// No automatic vulnerability scanning will be performed for this
9579            /// repository.
9580            Disabled,
9581            /// If set, the enum was initialized with an unknown value.
9582            ///
9583            /// Applications can examine the value using [EnablementConfig::value] or
9584            /// [EnablementConfig::name].
9585            UnknownValue(enablement_config::UnknownValue),
9586        }
9587
9588        #[doc(hidden)]
9589        pub mod enablement_config {
9590            #[allow(unused_imports)]
9591            use super::*;
9592            #[derive(Clone, Debug, PartialEq)]
9593            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9594        }
9595
9596        impl EnablementConfig {
9597            /// Gets the enum value.
9598            ///
9599            /// Returns `None` if the enum contains an unknown value deserialized from
9600            /// the string representation of enums.
9601            pub fn value(&self) -> std::option::Option<i32> {
9602                match self {
9603                    Self::Unspecified => std::option::Option::Some(0),
9604                    Self::Inherited => std::option::Option::Some(1),
9605                    Self::Disabled => std::option::Option::Some(2),
9606                    Self::UnknownValue(u) => u.0.value(),
9607                }
9608            }
9609
9610            /// Gets the enum value as a string.
9611            ///
9612            /// Returns `None` if the enum contains an unknown value deserialized from
9613            /// the integer representation of enums.
9614            pub fn name(&self) -> std::option::Option<&str> {
9615                match self {
9616                    Self::Unspecified => std::option::Option::Some("ENABLEMENT_CONFIG_UNSPECIFIED"),
9617                    Self::Inherited => std::option::Option::Some("INHERITED"),
9618                    Self::Disabled => std::option::Option::Some("DISABLED"),
9619                    Self::UnknownValue(u) => u.0.name(),
9620                }
9621            }
9622        }
9623
9624        impl std::default::Default for EnablementConfig {
9625            fn default() -> Self {
9626                use std::convert::From;
9627                Self::from(0)
9628            }
9629        }
9630
9631        impl std::fmt::Display for EnablementConfig {
9632            fn fmt(
9633                &self,
9634                f: &mut std::fmt::Formatter<'_>,
9635            ) -> std::result::Result<(), std::fmt::Error> {
9636                wkt::internal::display_enum(f, self.name(), self.value())
9637            }
9638        }
9639
9640        impl std::convert::From<i32> for EnablementConfig {
9641            fn from(value: i32) -> Self {
9642                match value {
9643                    0 => Self::Unspecified,
9644                    1 => Self::Inherited,
9645                    2 => Self::Disabled,
9646                    _ => Self::UnknownValue(enablement_config::UnknownValue(
9647                        wkt::internal::UnknownEnumValue::Integer(value),
9648                    )),
9649                }
9650            }
9651        }
9652
9653        impl std::convert::From<&str> for EnablementConfig {
9654            fn from(value: &str) -> Self {
9655                use std::string::ToString;
9656                match value {
9657                    "ENABLEMENT_CONFIG_UNSPECIFIED" => Self::Unspecified,
9658                    "INHERITED" => Self::Inherited,
9659                    "DISABLED" => Self::Disabled,
9660                    _ => Self::UnknownValue(enablement_config::UnknownValue(
9661                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9662                    )),
9663                }
9664            }
9665        }
9666
9667        impl serde::ser::Serialize for EnablementConfig {
9668            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9669            where
9670                S: serde::Serializer,
9671            {
9672                match self {
9673                    Self::Unspecified => serializer.serialize_i32(0),
9674                    Self::Inherited => serializer.serialize_i32(1),
9675                    Self::Disabled => serializer.serialize_i32(2),
9676                    Self::UnknownValue(u) => u.0.serialize(serializer),
9677                }
9678            }
9679        }
9680
9681        impl<'de> serde::de::Deserialize<'de> for EnablementConfig {
9682            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9683            where
9684                D: serde::Deserializer<'de>,
9685            {
9686                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementConfig>::new(
9687                    ".google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig"))
9688            }
9689        }
9690
9691        /// Describes the state of vulnerability scanning in this repository,
9692        /// including both repository enablement and API enablement.
9693        ///
9694        /// # Working with unknown values
9695        ///
9696        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9697        /// additional enum variants at any time. Adding new variants is not considered
9698        /// a breaking change. Applications should write their code in anticipation of:
9699        ///
9700        /// - New values appearing in future releases of the client library, **and**
9701        /// - New values received dynamically, without application changes.
9702        ///
9703        /// Please consult the [Working with enums] section in the user guide for some
9704        /// guidelines.
9705        ///
9706        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9707        #[derive(Clone, Debug, PartialEq)]
9708        #[non_exhaustive]
9709        pub enum EnablementState {
9710            /// Enablement state is unclear.
9711            Unspecified,
9712            /// Repository does not support vulnerability scanning.
9713            ScanningUnsupported,
9714            /// Vulnerability scanning is disabled for this repository.
9715            ScanningDisabled,
9716            /// Vulnerability scanning is active for this repository.
9717            ScanningActive,
9718            /// If set, the enum was initialized with an unknown value.
9719            ///
9720            /// Applications can examine the value using [EnablementState::value] or
9721            /// [EnablementState::name].
9722            UnknownValue(enablement_state::UnknownValue),
9723        }
9724
9725        #[doc(hidden)]
9726        pub mod enablement_state {
9727            #[allow(unused_imports)]
9728            use super::*;
9729            #[derive(Clone, Debug, PartialEq)]
9730            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9731        }
9732
9733        impl EnablementState {
9734            /// Gets the enum value.
9735            ///
9736            /// Returns `None` if the enum contains an unknown value deserialized from
9737            /// the string representation of enums.
9738            pub fn value(&self) -> std::option::Option<i32> {
9739                match self {
9740                    Self::Unspecified => std::option::Option::Some(0),
9741                    Self::ScanningUnsupported => std::option::Option::Some(1),
9742                    Self::ScanningDisabled => std::option::Option::Some(2),
9743                    Self::ScanningActive => std::option::Option::Some(3),
9744                    Self::UnknownValue(u) => u.0.value(),
9745                }
9746            }
9747
9748            /// Gets the enum value as a string.
9749            ///
9750            /// Returns `None` if the enum contains an unknown value deserialized from
9751            /// the integer representation of enums.
9752            pub fn name(&self) -> std::option::Option<&str> {
9753                match self {
9754                    Self::Unspecified => std::option::Option::Some("ENABLEMENT_STATE_UNSPECIFIED"),
9755                    Self::ScanningUnsupported => std::option::Option::Some("SCANNING_UNSUPPORTED"),
9756                    Self::ScanningDisabled => std::option::Option::Some("SCANNING_DISABLED"),
9757                    Self::ScanningActive => std::option::Option::Some("SCANNING_ACTIVE"),
9758                    Self::UnknownValue(u) => u.0.name(),
9759                }
9760            }
9761        }
9762
9763        impl std::default::Default for EnablementState {
9764            fn default() -> Self {
9765                use std::convert::From;
9766                Self::from(0)
9767            }
9768        }
9769
9770        impl std::fmt::Display for EnablementState {
9771            fn fmt(
9772                &self,
9773                f: &mut std::fmt::Formatter<'_>,
9774            ) -> std::result::Result<(), std::fmt::Error> {
9775                wkt::internal::display_enum(f, self.name(), self.value())
9776            }
9777        }
9778
9779        impl std::convert::From<i32> for EnablementState {
9780            fn from(value: i32) -> Self {
9781                match value {
9782                    0 => Self::Unspecified,
9783                    1 => Self::ScanningUnsupported,
9784                    2 => Self::ScanningDisabled,
9785                    3 => Self::ScanningActive,
9786                    _ => Self::UnknownValue(enablement_state::UnknownValue(
9787                        wkt::internal::UnknownEnumValue::Integer(value),
9788                    )),
9789                }
9790            }
9791        }
9792
9793        impl std::convert::From<&str> for EnablementState {
9794            fn from(value: &str) -> Self {
9795                use std::string::ToString;
9796                match value {
9797                    "ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
9798                    "SCANNING_UNSUPPORTED" => Self::ScanningUnsupported,
9799                    "SCANNING_DISABLED" => Self::ScanningDisabled,
9800                    "SCANNING_ACTIVE" => Self::ScanningActive,
9801                    _ => Self::UnknownValue(enablement_state::UnknownValue(
9802                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9803                    )),
9804                }
9805            }
9806        }
9807
9808        impl serde::ser::Serialize for EnablementState {
9809            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9810            where
9811                S: serde::Serializer,
9812            {
9813                match self {
9814                    Self::Unspecified => serializer.serialize_i32(0),
9815                    Self::ScanningUnsupported => serializer.serialize_i32(1),
9816                    Self::ScanningDisabled => serializer.serialize_i32(2),
9817                    Self::ScanningActive => serializer.serialize_i32(3),
9818                    Self::UnknownValue(u) => u.0.serialize(serializer),
9819                }
9820            }
9821        }
9822
9823        impl<'de> serde::de::Deserialize<'de> for EnablementState {
9824            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9825            where
9826                D: serde::Deserializer<'de>,
9827            {
9828                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
9829                    ".google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState"))
9830            }
9831        }
9832    }
9833
9834    /// A package format.
9835    ///
9836    /// # Working with unknown values
9837    ///
9838    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9839    /// additional enum variants at any time. Adding new variants is not considered
9840    /// a breaking change. Applications should write their code in anticipation of:
9841    ///
9842    /// - New values appearing in future releases of the client library, **and**
9843    /// - New values received dynamically, without application changes.
9844    ///
9845    /// Please consult the [Working with enums] section in the user guide for some
9846    /// guidelines.
9847    ///
9848    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9849    #[derive(Clone, Debug, PartialEq)]
9850    #[non_exhaustive]
9851    pub enum Format {
9852        /// Unspecified package format.
9853        Unspecified,
9854        /// Docker package format.
9855        Docker,
9856        /// Maven package format.
9857        Maven,
9858        /// NPM package format.
9859        Npm,
9860        /// APT package format.
9861        Apt,
9862        /// YUM package format.
9863        Yum,
9864        /// Python package format.
9865        Python,
9866        /// Kubeflow Pipelines package format.
9867        Kfp,
9868        /// Go package format.
9869        Go,
9870        /// Generic package format.
9871        Generic,
9872        /// Ruby package format.
9873        Ruby,
9874        /// If set, the enum was initialized with an unknown value.
9875        ///
9876        /// Applications can examine the value using [Format::value] or
9877        /// [Format::name].
9878        UnknownValue(format::UnknownValue),
9879    }
9880
9881    #[doc(hidden)]
9882    pub mod format {
9883        #[allow(unused_imports)]
9884        use super::*;
9885        #[derive(Clone, Debug, PartialEq)]
9886        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9887    }
9888
9889    impl Format {
9890        /// Gets the enum value.
9891        ///
9892        /// Returns `None` if the enum contains an unknown value deserialized from
9893        /// the string representation of enums.
9894        pub fn value(&self) -> std::option::Option<i32> {
9895            match self {
9896                Self::Unspecified => std::option::Option::Some(0),
9897                Self::Docker => std::option::Option::Some(1),
9898                Self::Maven => std::option::Option::Some(2),
9899                Self::Npm => std::option::Option::Some(3),
9900                Self::Apt => std::option::Option::Some(5),
9901                Self::Yum => std::option::Option::Some(6),
9902                Self::Python => std::option::Option::Some(8),
9903                Self::Kfp => std::option::Option::Some(9),
9904                Self::Go => std::option::Option::Some(10),
9905                Self::Generic => std::option::Option::Some(11),
9906                Self::Ruby => std::option::Option::Some(12),
9907                Self::UnknownValue(u) => u.0.value(),
9908            }
9909        }
9910
9911        /// Gets the enum value as a string.
9912        ///
9913        /// Returns `None` if the enum contains an unknown value deserialized from
9914        /// the integer representation of enums.
9915        pub fn name(&self) -> std::option::Option<&str> {
9916            match self {
9917                Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
9918                Self::Docker => std::option::Option::Some("DOCKER"),
9919                Self::Maven => std::option::Option::Some("MAVEN"),
9920                Self::Npm => std::option::Option::Some("NPM"),
9921                Self::Apt => std::option::Option::Some("APT"),
9922                Self::Yum => std::option::Option::Some("YUM"),
9923                Self::Python => std::option::Option::Some("PYTHON"),
9924                Self::Kfp => std::option::Option::Some("KFP"),
9925                Self::Go => std::option::Option::Some("GO"),
9926                Self::Generic => std::option::Option::Some("GENERIC"),
9927                Self::Ruby => std::option::Option::Some("RUBY"),
9928                Self::UnknownValue(u) => u.0.name(),
9929            }
9930        }
9931    }
9932
9933    impl std::default::Default for Format {
9934        fn default() -> Self {
9935            use std::convert::From;
9936            Self::from(0)
9937        }
9938    }
9939
9940    impl std::fmt::Display for Format {
9941        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9942            wkt::internal::display_enum(f, self.name(), self.value())
9943        }
9944    }
9945
9946    impl std::convert::From<i32> for Format {
9947        fn from(value: i32) -> Self {
9948            match value {
9949                0 => Self::Unspecified,
9950                1 => Self::Docker,
9951                2 => Self::Maven,
9952                3 => Self::Npm,
9953                5 => Self::Apt,
9954                6 => Self::Yum,
9955                8 => Self::Python,
9956                9 => Self::Kfp,
9957                10 => Self::Go,
9958                11 => Self::Generic,
9959                12 => Self::Ruby,
9960                _ => Self::UnknownValue(format::UnknownValue(
9961                    wkt::internal::UnknownEnumValue::Integer(value),
9962                )),
9963            }
9964        }
9965    }
9966
9967    impl std::convert::From<&str> for Format {
9968        fn from(value: &str) -> Self {
9969            use std::string::ToString;
9970            match value {
9971                "FORMAT_UNSPECIFIED" => Self::Unspecified,
9972                "DOCKER" => Self::Docker,
9973                "MAVEN" => Self::Maven,
9974                "NPM" => Self::Npm,
9975                "APT" => Self::Apt,
9976                "YUM" => Self::Yum,
9977                "PYTHON" => Self::Python,
9978                "KFP" => Self::Kfp,
9979                "GO" => Self::Go,
9980                "GENERIC" => Self::Generic,
9981                "RUBY" => Self::Ruby,
9982                _ => Self::UnknownValue(format::UnknownValue(
9983                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9984                )),
9985            }
9986        }
9987    }
9988
9989    impl serde::ser::Serialize for Format {
9990        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9991        where
9992            S: serde::Serializer,
9993        {
9994            match self {
9995                Self::Unspecified => serializer.serialize_i32(0),
9996                Self::Docker => serializer.serialize_i32(1),
9997                Self::Maven => serializer.serialize_i32(2),
9998                Self::Npm => serializer.serialize_i32(3),
9999                Self::Apt => serializer.serialize_i32(5),
10000                Self::Yum => serializer.serialize_i32(6),
10001                Self::Python => serializer.serialize_i32(8),
10002                Self::Kfp => serializer.serialize_i32(9),
10003                Self::Go => serializer.serialize_i32(10),
10004                Self::Generic => serializer.serialize_i32(11),
10005                Self::Ruby => serializer.serialize_i32(12),
10006                Self::UnknownValue(u) => u.0.serialize(serializer),
10007            }
10008        }
10009    }
10010
10011    impl<'de> serde::de::Deserialize<'de> for Format {
10012        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10013        where
10014            D: serde::Deserializer<'de>,
10015        {
10016            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
10017                ".google.devtools.artifactregistry.v1.Repository.Format",
10018            ))
10019        }
10020    }
10021
10022    /// The mode configures the repository to serve artifacts from different
10023    /// sources.
10024    ///
10025    /// # Working with unknown values
10026    ///
10027    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10028    /// additional enum variants at any time. Adding new variants is not considered
10029    /// a breaking change. Applications should write their code in anticipation of:
10030    ///
10031    /// - New values appearing in future releases of the client library, **and**
10032    /// - New values received dynamically, without application changes.
10033    ///
10034    /// Please consult the [Working with enums] section in the user guide for some
10035    /// guidelines.
10036    ///
10037    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10038    #[derive(Clone, Debug, PartialEq)]
10039    #[non_exhaustive]
10040    pub enum Mode {
10041        /// Unspecified mode.
10042        Unspecified,
10043        /// A standard repository storing artifacts.
10044        StandardRepository,
10045        /// A virtual repository to serve artifacts from one or more sources.
10046        VirtualRepository,
10047        /// A remote repository to serve artifacts from a remote source.
10048        RemoteRepository,
10049        /// If set, the enum was initialized with an unknown value.
10050        ///
10051        /// Applications can examine the value using [Mode::value] or
10052        /// [Mode::name].
10053        UnknownValue(mode::UnknownValue),
10054    }
10055
10056    #[doc(hidden)]
10057    pub mod mode {
10058        #[allow(unused_imports)]
10059        use super::*;
10060        #[derive(Clone, Debug, PartialEq)]
10061        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10062    }
10063
10064    impl Mode {
10065        /// Gets the enum value.
10066        ///
10067        /// Returns `None` if the enum contains an unknown value deserialized from
10068        /// the string representation of enums.
10069        pub fn value(&self) -> std::option::Option<i32> {
10070            match self {
10071                Self::Unspecified => std::option::Option::Some(0),
10072                Self::StandardRepository => std::option::Option::Some(1),
10073                Self::VirtualRepository => std::option::Option::Some(2),
10074                Self::RemoteRepository => std::option::Option::Some(3),
10075                Self::UnknownValue(u) => u.0.value(),
10076            }
10077        }
10078
10079        /// Gets the enum value as a string.
10080        ///
10081        /// Returns `None` if the enum contains an unknown value deserialized from
10082        /// the integer representation of enums.
10083        pub fn name(&self) -> std::option::Option<&str> {
10084            match self {
10085                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
10086                Self::StandardRepository => std::option::Option::Some("STANDARD_REPOSITORY"),
10087                Self::VirtualRepository => std::option::Option::Some("VIRTUAL_REPOSITORY"),
10088                Self::RemoteRepository => std::option::Option::Some("REMOTE_REPOSITORY"),
10089                Self::UnknownValue(u) => u.0.name(),
10090            }
10091        }
10092    }
10093
10094    impl std::default::Default for Mode {
10095        fn default() -> Self {
10096            use std::convert::From;
10097            Self::from(0)
10098        }
10099    }
10100
10101    impl std::fmt::Display for Mode {
10102        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10103            wkt::internal::display_enum(f, self.name(), self.value())
10104        }
10105    }
10106
10107    impl std::convert::From<i32> for Mode {
10108        fn from(value: i32) -> Self {
10109            match value {
10110                0 => Self::Unspecified,
10111                1 => Self::StandardRepository,
10112                2 => Self::VirtualRepository,
10113                3 => Self::RemoteRepository,
10114                _ => Self::UnknownValue(mode::UnknownValue(
10115                    wkt::internal::UnknownEnumValue::Integer(value),
10116                )),
10117            }
10118        }
10119    }
10120
10121    impl std::convert::From<&str> for Mode {
10122        fn from(value: &str) -> Self {
10123            use std::string::ToString;
10124            match value {
10125                "MODE_UNSPECIFIED" => Self::Unspecified,
10126                "STANDARD_REPOSITORY" => Self::StandardRepository,
10127                "VIRTUAL_REPOSITORY" => Self::VirtualRepository,
10128                "REMOTE_REPOSITORY" => Self::RemoteRepository,
10129                _ => Self::UnknownValue(mode::UnknownValue(
10130                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10131                )),
10132            }
10133        }
10134    }
10135
10136    impl serde::ser::Serialize for Mode {
10137        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10138        where
10139            S: serde::Serializer,
10140        {
10141            match self {
10142                Self::Unspecified => serializer.serialize_i32(0),
10143                Self::StandardRepository => serializer.serialize_i32(1),
10144                Self::VirtualRepository => serializer.serialize_i32(2),
10145                Self::RemoteRepository => serializer.serialize_i32(3),
10146                Self::UnknownValue(u) => u.0.serialize(serializer),
10147            }
10148        }
10149    }
10150
10151    impl<'de> serde::de::Deserialize<'de> for Mode {
10152        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10153        where
10154            D: serde::Deserializer<'de>,
10155        {
10156            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
10157                ".google.devtools.artifactregistry.v1.Repository.Mode",
10158            ))
10159        }
10160    }
10161
10162    /// Repository-specific configurations.
10163    #[derive(Clone, Debug, PartialEq)]
10164    #[non_exhaustive]
10165    pub enum FormatConfig {
10166        /// Maven repository config contains repository level configuration
10167        /// for the repositories of maven type.
10168        MavenConfig(std::boxed::Box<crate::model::repository::MavenRepositoryConfig>),
10169        /// Docker repository config contains repository level configuration
10170        /// for the repositories of docker type.
10171        DockerConfig(std::boxed::Box<crate::model::repository::DockerRepositoryConfig>),
10172    }
10173
10174    /// Repository configuration specific to the Mode value being selected (Remote
10175    /// or Virtual)
10176    #[derive(Clone, Debug, PartialEq)]
10177    #[non_exhaustive]
10178    pub enum ModeConfig {
10179        /// Configuration specific for a Virtual Repository.
10180        VirtualRepositoryConfig(std::boxed::Box<crate::model::VirtualRepositoryConfig>),
10181        /// Configuration specific for a Remote Repository.
10182        RemoteRepositoryConfig(std::boxed::Box<crate::model::RemoteRepositoryConfig>),
10183    }
10184}
10185
10186/// The request to list repositories.
10187#[derive(Clone, Default, PartialEq)]
10188#[non_exhaustive]
10189pub struct ListRepositoriesRequest {
10190    /// Required. The name of the parent resource whose repositories will be
10191    /// listed.
10192    pub parent: std::string::String,
10193
10194    /// The maximum number of repositories to return. Maximum page size is 1,000.
10195    pub page_size: i32,
10196
10197    /// The next_page_token value returned from a previous list request, if any.
10198    pub page_token: std::string::String,
10199
10200    /// Optional. An expression for filtering the results of the request. Filter
10201    /// rules are case insensitive. The fields eligible for filtering are:
10202    ///
10203    /// * `name`
10204    ///
10205    /// Examples of using a filter:
10206    ///
10207    /// To filter the results of your request to repositories with the name
10208    /// `my-repo` in project `my-project` in the `us-central` region, append the
10209    /// following filter expression to your request:
10210    ///
10211    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo"`
10212    ///
10213    /// You can also use wildcards to match any number of characters before or
10214    /// after the value:
10215    ///
10216    /// * `name="projects/my-project/locations/us-central1/repositories/my-*"`
10217    /// * `name="projects/my-project/locations/us-central1/repositories/*repo"`
10218    /// * `name="projects/my-project/locations/us-central1/repositories/*repo*"`
10219    pub filter: std::string::String,
10220
10221    /// Optional. The field to order the results by.
10222    pub order_by: std::string::String,
10223
10224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10225}
10226
10227impl ListRepositoriesRequest {
10228    pub fn new() -> Self {
10229        std::default::Default::default()
10230    }
10231
10232    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
10233    ///
10234    /// # Example
10235    /// ```ignore,no_run
10236    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesRequest;
10237    /// let x = ListRepositoriesRequest::new().set_parent("example");
10238    /// ```
10239    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10240        self.parent = v.into();
10241        self
10242    }
10243
10244    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
10245    ///
10246    /// # Example
10247    /// ```ignore,no_run
10248    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesRequest;
10249    /// let x = ListRepositoriesRequest::new().set_page_size(42);
10250    /// ```
10251    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10252        self.page_size = v.into();
10253        self
10254    }
10255
10256    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
10257    ///
10258    /// # Example
10259    /// ```ignore,no_run
10260    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesRequest;
10261    /// let x = ListRepositoriesRequest::new().set_page_token("example");
10262    /// ```
10263    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10264        self.page_token = v.into();
10265        self
10266    }
10267
10268    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
10269    ///
10270    /// # Example
10271    /// ```ignore,no_run
10272    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesRequest;
10273    /// let x = ListRepositoriesRequest::new().set_filter("example");
10274    /// ```
10275    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10276        self.filter = v.into();
10277        self
10278    }
10279
10280    /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
10281    ///
10282    /// # Example
10283    /// ```ignore,no_run
10284    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesRequest;
10285    /// let x = ListRepositoriesRequest::new().set_order_by("example");
10286    /// ```
10287    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10288        self.order_by = v.into();
10289        self
10290    }
10291}
10292
10293impl wkt::message::Message for ListRepositoriesRequest {
10294    fn typename() -> &'static str {
10295        "type.googleapis.com/google.devtools.artifactregistry.v1.ListRepositoriesRequest"
10296    }
10297}
10298
10299/// The response from listing repositories.
10300#[derive(Clone, Default, PartialEq)]
10301#[non_exhaustive]
10302pub struct ListRepositoriesResponse {
10303    /// The repositories returned.
10304    pub repositories: std::vec::Vec<crate::model::Repository>,
10305
10306    /// The token to retrieve the next page of repositories, or empty if there are
10307    /// no more repositories to return.
10308    pub next_page_token: std::string::String,
10309
10310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10311}
10312
10313impl ListRepositoriesResponse {
10314    pub fn new() -> Self {
10315        std::default::Default::default()
10316    }
10317
10318    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
10319    ///
10320    /// # Example
10321    /// ```ignore,no_run
10322    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesResponse;
10323    /// use google_cloud_artifactregistry_v1::model::Repository;
10324    /// let x = ListRepositoriesResponse::new()
10325    ///     .set_repositories([
10326    ///         Repository::default()/* use setters */,
10327    ///         Repository::default()/* use (different) setters */,
10328    ///     ]);
10329    /// ```
10330    pub fn set_repositories<T, V>(mut self, v: T) -> Self
10331    where
10332        T: std::iter::IntoIterator<Item = V>,
10333        V: std::convert::Into<crate::model::Repository>,
10334    {
10335        use std::iter::Iterator;
10336        self.repositories = v.into_iter().map(|i| i.into()).collect();
10337        self
10338    }
10339
10340    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
10341    ///
10342    /// # Example
10343    /// ```ignore,no_run
10344    /// # use google_cloud_artifactregistry_v1::model::ListRepositoriesResponse;
10345    /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
10346    /// ```
10347    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10348        self.next_page_token = v.into();
10349        self
10350    }
10351}
10352
10353impl wkt::message::Message for ListRepositoriesResponse {
10354    fn typename() -> &'static str {
10355        "type.googleapis.com/google.devtools.artifactregistry.v1.ListRepositoriesResponse"
10356    }
10357}
10358
10359#[doc(hidden)]
10360impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
10361    type PageItem = crate::model::Repository;
10362
10363    fn items(self) -> std::vec::Vec<Self::PageItem> {
10364        self.repositories
10365    }
10366
10367    fn next_page_token(&self) -> std::string::String {
10368        use std::clone::Clone;
10369        self.next_page_token.clone()
10370    }
10371}
10372
10373/// The request to retrieve a repository.
10374#[derive(Clone, Default, PartialEq)]
10375#[non_exhaustive]
10376pub struct GetRepositoryRequest {
10377    /// Required. The name of the repository to retrieve.
10378    pub name: std::string::String,
10379
10380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10381}
10382
10383impl GetRepositoryRequest {
10384    pub fn new() -> Self {
10385        std::default::Default::default()
10386    }
10387
10388    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
10389    ///
10390    /// # Example
10391    /// ```ignore,no_run
10392    /// # use google_cloud_artifactregistry_v1::model::GetRepositoryRequest;
10393    /// let x = GetRepositoryRequest::new().set_name("example");
10394    /// ```
10395    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10396        self.name = v.into();
10397        self
10398    }
10399}
10400
10401impl wkt::message::Message for GetRepositoryRequest {
10402    fn typename() -> &'static str {
10403        "type.googleapis.com/google.devtools.artifactregistry.v1.GetRepositoryRequest"
10404    }
10405}
10406
10407/// The request to create a new repository.
10408#[derive(Clone, Default, PartialEq)]
10409#[non_exhaustive]
10410pub struct CreateRepositoryRequest {
10411    /// Required. The name of the parent resource where the repository will be
10412    /// created.
10413    pub parent: std::string::String,
10414
10415    /// Required. The repository id to use for this repository.
10416    pub repository_id: std::string::String,
10417
10418    /// Required. The repository to be created.
10419    pub repository: std::option::Option<crate::model::Repository>,
10420
10421    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10422}
10423
10424impl CreateRepositoryRequest {
10425    pub fn new() -> Self {
10426        std::default::Default::default()
10427    }
10428
10429    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
10430    ///
10431    /// # Example
10432    /// ```ignore,no_run
10433    /// # use google_cloud_artifactregistry_v1::model::CreateRepositoryRequest;
10434    /// let x = CreateRepositoryRequest::new().set_parent("example");
10435    /// ```
10436    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10437        self.parent = v.into();
10438        self
10439    }
10440
10441    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
10442    ///
10443    /// # Example
10444    /// ```ignore,no_run
10445    /// # use google_cloud_artifactregistry_v1::model::CreateRepositoryRequest;
10446    /// let x = CreateRepositoryRequest::new().set_repository_id("example");
10447    /// ```
10448    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10449        self.repository_id = v.into();
10450        self
10451    }
10452
10453    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
10454    ///
10455    /// # Example
10456    /// ```ignore,no_run
10457    /// # use google_cloud_artifactregistry_v1::model::CreateRepositoryRequest;
10458    /// use google_cloud_artifactregistry_v1::model::Repository;
10459    /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
10460    /// ```
10461    pub fn set_repository<T>(mut self, v: T) -> Self
10462    where
10463        T: std::convert::Into<crate::model::Repository>,
10464    {
10465        self.repository = std::option::Option::Some(v.into());
10466        self
10467    }
10468
10469    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
10470    ///
10471    /// # Example
10472    /// ```ignore,no_run
10473    /// # use google_cloud_artifactregistry_v1::model::CreateRepositoryRequest;
10474    /// use google_cloud_artifactregistry_v1::model::Repository;
10475    /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
10476    /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
10477    /// ```
10478    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
10479    where
10480        T: std::convert::Into<crate::model::Repository>,
10481    {
10482        self.repository = v.map(|x| x.into());
10483        self
10484    }
10485}
10486
10487impl wkt::message::Message for CreateRepositoryRequest {
10488    fn typename() -> &'static str {
10489        "type.googleapis.com/google.devtools.artifactregistry.v1.CreateRepositoryRequest"
10490    }
10491}
10492
10493/// The request to update a repository.
10494#[derive(Clone, Default, PartialEq)]
10495#[non_exhaustive]
10496pub struct UpdateRepositoryRequest {
10497    /// The repository that replaces the resource on the server.
10498    pub repository: std::option::Option<crate::model::Repository>,
10499
10500    /// The update mask applies to the resource. For the `FieldMask` definition,
10501    /// see
10502    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
10503    pub update_mask: std::option::Option<wkt::FieldMask>,
10504
10505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10506}
10507
10508impl UpdateRepositoryRequest {
10509    pub fn new() -> Self {
10510        std::default::Default::default()
10511    }
10512
10513    /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
10514    ///
10515    /// # Example
10516    /// ```ignore,no_run
10517    /// # use google_cloud_artifactregistry_v1::model::UpdateRepositoryRequest;
10518    /// use google_cloud_artifactregistry_v1::model::Repository;
10519    /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
10520    /// ```
10521    pub fn set_repository<T>(mut self, v: T) -> Self
10522    where
10523        T: std::convert::Into<crate::model::Repository>,
10524    {
10525        self.repository = std::option::Option::Some(v.into());
10526        self
10527    }
10528
10529    /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
10530    ///
10531    /// # Example
10532    /// ```ignore,no_run
10533    /// # use google_cloud_artifactregistry_v1::model::UpdateRepositoryRequest;
10534    /// use google_cloud_artifactregistry_v1::model::Repository;
10535    /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
10536    /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
10537    /// ```
10538    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
10539    where
10540        T: std::convert::Into<crate::model::Repository>,
10541    {
10542        self.repository = v.map(|x| x.into());
10543        self
10544    }
10545
10546    /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
10547    ///
10548    /// # Example
10549    /// ```ignore,no_run
10550    /// # use google_cloud_artifactregistry_v1::model::UpdateRepositoryRequest;
10551    /// use wkt::FieldMask;
10552    /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10553    /// ```
10554    pub fn set_update_mask<T>(mut self, v: T) -> Self
10555    where
10556        T: std::convert::Into<wkt::FieldMask>,
10557    {
10558        self.update_mask = std::option::Option::Some(v.into());
10559        self
10560    }
10561
10562    /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
10563    ///
10564    /// # Example
10565    /// ```ignore,no_run
10566    /// # use google_cloud_artifactregistry_v1::model::UpdateRepositoryRequest;
10567    /// use wkt::FieldMask;
10568    /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10569    /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10570    /// ```
10571    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10572    where
10573        T: std::convert::Into<wkt::FieldMask>,
10574    {
10575        self.update_mask = v.map(|x| x.into());
10576        self
10577    }
10578}
10579
10580impl wkt::message::Message for UpdateRepositoryRequest {
10581    fn typename() -> &'static str {
10582        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateRepositoryRequest"
10583    }
10584}
10585
10586/// The request to delete a repository.
10587#[derive(Clone, Default, PartialEq)]
10588#[non_exhaustive]
10589pub struct DeleteRepositoryRequest {
10590    /// Required. The name of the repository to delete.
10591    pub name: std::string::String,
10592
10593    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10594}
10595
10596impl DeleteRepositoryRequest {
10597    pub fn new() -> Self {
10598        std::default::Default::default()
10599    }
10600
10601    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
10602    ///
10603    /// # Example
10604    /// ```ignore,no_run
10605    /// # use google_cloud_artifactregistry_v1::model::DeleteRepositoryRequest;
10606    /// let x = DeleteRepositoryRequest::new().set_name("example");
10607    /// ```
10608    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10609        self.name = v.into();
10610        self
10611    }
10612}
10613
10614impl wkt::message::Message for DeleteRepositoryRequest {
10615    fn typename() -> &'static str {
10616        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteRepositoryRequest"
10617    }
10618}
10619
10620/// A rule defines the deny or allow action of the operation it applies to and
10621/// the conditions required for the rule to apply. You can set one rule for an
10622/// entire repository and one rule for each package within.
10623#[derive(Clone, Default, PartialEq)]
10624#[non_exhaustive]
10625pub struct Rule {
10626    /// The name of the rule, for example:
10627    /// `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
10628    pub name: std::string::String,
10629
10630    /// The action this rule takes.
10631    pub action: crate::model::rule::Action,
10632
10633    pub operation: crate::model::rule::Operation,
10634
10635    /// Optional. A CEL expression for conditions that must be met in order for the
10636    /// rule to apply. If not provided, the rule matches all objects.
10637    pub condition: std::option::Option<google_cloud_type::model::Expr>,
10638
10639    /// The package ID the rule applies to.
10640    /// If empty, this rule applies to all packages inside the repository.
10641    pub package_id: std::string::String,
10642
10643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10644}
10645
10646impl Rule {
10647    pub fn new() -> Self {
10648        std::default::Default::default()
10649    }
10650
10651    /// Sets the value of [name][crate::model::Rule::name].
10652    ///
10653    /// # Example
10654    /// ```ignore,no_run
10655    /// # use google_cloud_artifactregistry_v1::model::Rule;
10656    /// let x = Rule::new().set_name("example");
10657    /// ```
10658    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10659        self.name = v.into();
10660        self
10661    }
10662
10663    /// Sets the value of [action][crate::model::Rule::action].
10664    ///
10665    /// # Example
10666    /// ```ignore,no_run
10667    /// # use google_cloud_artifactregistry_v1::model::Rule;
10668    /// use google_cloud_artifactregistry_v1::model::rule::Action;
10669    /// let x0 = Rule::new().set_action(Action::Allow);
10670    /// let x1 = Rule::new().set_action(Action::Deny);
10671    /// ```
10672    pub fn set_action<T: std::convert::Into<crate::model::rule::Action>>(mut self, v: T) -> Self {
10673        self.action = v.into();
10674        self
10675    }
10676
10677    /// Sets the value of [operation][crate::model::Rule::operation].
10678    ///
10679    /// # Example
10680    /// ```ignore,no_run
10681    /// # use google_cloud_artifactregistry_v1::model::Rule;
10682    /// use google_cloud_artifactregistry_v1::model::rule::Operation;
10683    /// let x0 = Rule::new().set_operation(Operation::Download);
10684    /// ```
10685    pub fn set_operation<T: std::convert::Into<crate::model::rule::Operation>>(
10686        mut self,
10687        v: T,
10688    ) -> Self {
10689        self.operation = v.into();
10690        self
10691    }
10692
10693    /// Sets the value of [condition][crate::model::Rule::condition].
10694    ///
10695    /// # Example
10696    /// ```ignore,no_run
10697    /// # use google_cloud_artifactregistry_v1::model::Rule;
10698    /// use google_cloud_type::model::Expr;
10699    /// let x = Rule::new().set_condition(Expr::default()/* use setters */);
10700    /// ```
10701    pub fn set_condition<T>(mut self, v: T) -> Self
10702    where
10703        T: std::convert::Into<google_cloud_type::model::Expr>,
10704    {
10705        self.condition = std::option::Option::Some(v.into());
10706        self
10707    }
10708
10709    /// Sets or clears the value of [condition][crate::model::Rule::condition].
10710    ///
10711    /// # Example
10712    /// ```ignore,no_run
10713    /// # use google_cloud_artifactregistry_v1::model::Rule;
10714    /// use google_cloud_type::model::Expr;
10715    /// let x = Rule::new().set_or_clear_condition(Some(Expr::default()/* use setters */));
10716    /// let x = Rule::new().set_or_clear_condition(None::<Expr>);
10717    /// ```
10718    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
10719    where
10720        T: std::convert::Into<google_cloud_type::model::Expr>,
10721    {
10722        self.condition = v.map(|x| x.into());
10723        self
10724    }
10725
10726    /// Sets the value of [package_id][crate::model::Rule::package_id].
10727    ///
10728    /// # Example
10729    /// ```ignore,no_run
10730    /// # use google_cloud_artifactregistry_v1::model::Rule;
10731    /// let x = Rule::new().set_package_id("example");
10732    /// ```
10733    pub fn set_package_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10734        self.package_id = v.into();
10735        self
10736    }
10737}
10738
10739impl wkt::message::Message for Rule {
10740    fn typename() -> &'static str {
10741        "type.googleapis.com/google.devtools.artifactregistry.v1.Rule"
10742    }
10743}
10744
10745/// Defines additional types related to [Rule].
10746pub mod rule {
10747    #[allow(unused_imports)]
10748    use super::*;
10749
10750    /// Defines the action of the rule.
10751    ///
10752    /// # Working with unknown values
10753    ///
10754    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10755    /// additional enum variants at any time. Adding new variants is not considered
10756    /// a breaking change. Applications should write their code in anticipation of:
10757    ///
10758    /// - New values appearing in future releases of the client library, **and**
10759    /// - New values received dynamically, without application changes.
10760    ///
10761    /// Please consult the [Working with enums] section in the user guide for some
10762    /// guidelines.
10763    ///
10764    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10765    #[derive(Clone, Debug, PartialEq)]
10766    #[non_exhaustive]
10767    pub enum Action {
10768        /// Action not specified.
10769        Unspecified,
10770        /// Allow the operation.
10771        Allow,
10772        /// Deny the operation.
10773        Deny,
10774        /// If set, the enum was initialized with an unknown value.
10775        ///
10776        /// Applications can examine the value using [Action::value] or
10777        /// [Action::name].
10778        UnknownValue(action::UnknownValue),
10779    }
10780
10781    #[doc(hidden)]
10782    pub mod action {
10783        #[allow(unused_imports)]
10784        use super::*;
10785        #[derive(Clone, Debug, PartialEq)]
10786        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10787    }
10788
10789    impl Action {
10790        /// Gets the enum value.
10791        ///
10792        /// Returns `None` if the enum contains an unknown value deserialized from
10793        /// the string representation of enums.
10794        pub fn value(&self) -> std::option::Option<i32> {
10795            match self {
10796                Self::Unspecified => std::option::Option::Some(0),
10797                Self::Allow => std::option::Option::Some(1),
10798                Self::Deny => std::option::Option::Some(2),
10799                Self::UnknownValue(u) => u.0.value(),
10800            }
10801        }
10802
10803        /// Gets the enum value as a string.
10804        ///
10805        /// Returns `None` if the enum contains an unknown value deserialized from
10806        /// the integer representation of enums.
10807        pub fn name(&self) -> std::option::Option<&str> {
10808            match self {
10809                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
10810                Self::Allow => std::option::Option::Some("ALLOW"),
10811                Self::Deny => std::option::Option::Some("DENY"),
10812                Self::UnknownValue(u) => u.0.name(),
10813            }
10814        }
10815    }
10816
10817    impl std::default::Default for Action {
10818        fn default() -> Self {
10819            use std::convert::From;
10820            Self::from(0)
10821        }
10822    }
10823
10824    impl std::fmt::Display for Action {
10825        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10826            wkt::internal::display_enum(f, self.name(), self.value())
10827        }
10828    }
10829
10830    impl std::convert::From<i32> for Action {
10831        fn from(value: i32) -> Self {
10832            match value {
10833                0 => Self::Unspecified,
10834                1 => Self::Allow,
10835                2 => Self::Deny,
10836                _ => Self::UnknownValue(action::UnknownValue(
10837                    wkt::internal::UnknownEnumValue::Integer(value),
10838                )),
10839            }
10840        }
10841    }
10842
10843    impl std::convert::From<&str> for Action {
10844        fn from(value: &str) -> Self {
10845            use std::string::ToString;
10846            match value {
10847                "ACTION_UNSPECIFIED" => Self::Unspecified,
10848                "ALLOW" => Self::Allow,
10849                "DENY" => Self::Deny,
10850                _ => Self::UnknownValue(action::UnknownValue(
10851                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10852                )),
10853            }
10854        }
10855    }
10856
10857    impl serde::ser::Serialize for Action {
10858        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10859        where
10860            S: serde::Serializer,
10861        {
10862            match self {
10863                Self::Unspecified => serializer.serialize_i32(0),
10864                Self::Allow => serializer.serialize_i32(1),
10865                Self::Deny => serializer.serialize_i32(2),
10866                Self::UnknownValue(u) => u.0.serialize(serializer),
10867            }
10868        }
10869    }
10870
10871    impl<'de> serde::de::Deserialize<'de> for Action {
10872        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10873        where
10874            D: serde::Deserializer<'de>,
10875        {
10876            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
10877                ".google.devtools.artifactregistry.v1.Rule.Action",
10878            ))
10879        }
10880    }
10881
10882    /// The operation the rule applies to.
10883    ///
10884    /// # Working with unknown values
10885    ///
10886    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10887    /// additional enum variants at any time. Adding new variants is not considered
10888    /// a breaking change. Applications should write their code in anticipation of:
10889    ///
10890    /// - New values appearing in future releases of the client library, **and**
10891    /// - New values received dynamically, without application changes.
10892    ///
10893    /// Please consult the [Working with enums] section in the user guide for some
10894    /// guidelines.
10895    ///
10896    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10897    #[derive(Clone, Debug, PartialEq)]
10898    #[non_exhaustive]
10899    pub enum Operation {
10900        /// Operation not specified.
10901        Unspecified,
10902        /// Download operation.
10903        Download,
10904        /// If set, the enum was initialized with an unknown value.
10905        ///
10906        /// Applications can examine the value using [Operation::value] or
10907        /// [Operation::name].
10908        UnknownValue(operation::UnknownValue),
10909    }
10910
10911    #[doc(hidden)]
10912    pub mod operation {
10913        #[allow(unused_imports)]
10914        use super::*;
10915        #[derive(Clone, Debug, PartialEq)]
10916        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10917    }
10918
10919    impl Operation {
10920        /// Gets the enum value.
10921        ///
10922        /// Returns `None` if the enum contains an unknown value deserialized from
10923        /// the string representation of enums.
10924        pub fn value(&self) -> std::option::Option<i32> {
10925            match self {
10926                Self::Unspecified => std::option::Option::Some(0),
10927                Self::Download => std::option::Option::Some(1),
10928                Self::UnknownValue(u) => u.0.value(),
10929            }
10930        }
10931
10932        /// Gets the enum value as a string.
10933        ///
10934        /// Returns `None` if the enum contains an unknown value deserialized from
10935        /// the integer representation of enums.
10936        pub fn name(&self) -> std::option::Option<&str> {
10937            match self {
10938                Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
10939                Self::Download => std::option::Option::Some("DOWNLOAD"),
10940                Self::UnknownValue(u) => u.0.name(),
10941            }
10942        }
10943    }
10944
10945    impl std::default::Default for Operation {
10946        fn default() -> Self {
10947            use std::convert::From;
10948            Self::from(0)
10949        }
10950    }
10951
10952    impl std::fmt::Display for Operation {
10953        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10954            wkt::internal::display_enum(f, self.name(), self.value())
10955        }
10956    }
10957
10958    impl std::convert::From<i32> for Operation {
10959        fn from(value: i32) -> Self {
10960            match value {
10961                0 => Self::Unspecified,
10962                1 => Self::Download,
10963                _ => Self::UnknownValue(operation::UnknownValue(
10964                    wkt::internal::UnknownEnumValue::Integer(value),
10965                )),
10966            }
10967        }
10968    }
10969
10970    impl std::convert::From<&str> for Operation {
10971        fn from(value: &str) -> Self {
10972            use std::string::ToString;
10973            match value {
10974                "OPERATION_UNSPECIFIED" => Self::Unspecified,
10975                "DOWNLOAD" => Self::Download,
10976                _ => Self::UnknownValue(operation::UnknownValue(
10977                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10978                )),
10979            }
10980        }
10981    }
10982
10983    impl serde::ser::Serialize for Operation {
10984        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10985        where
10986            S: serde::Serializer,
10987        {
10988            match self {
10989                Self::Unspecified => serializer.serialize_i32(0),
10990                Self::Download => serializer.serialize_i32(1),
10991                Self::UnknownValue(u) => u.0.serialize(serializer),
10992            }
10993        }
10994    }
10995
10996    impl<'de> serde::de::Deserialize<'de> for Operation {
10997        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10998        where
10999            D: serde::Deserializer<'de>,
11000        {
11001            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
11002                ".google.devtools.artifactregistry.v1.Rule.Operation",
11003            ))
11004        }
11005    }
11006}
11007
11008/// The request to list rules.
11009#[derive(Clone, Default, PartialEq)]
11010#[non_exhaustive]
11011pub struct ListRulesRequest {
11012    /// Required. The name of the parent repository whose rules will be listed.
11013    /// For example:
11014    /// `projects/p1/locations/us-central1/repositories/repo1`.
11015    pub parent: std::string::String,
11016
11017    /// The maximum number of rules to return. Maximum page size is 1,000.
11018    pub page_size: i32,
11019
11020    /// The next_page_token value returned from a previous list request, if any.
11021    pub page_token: std::string::String,
11022
11023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11024}
11025
11026impl ListRulesRequest {
11027    pub fn new() -> Self {
11028        std::default::Default::default()
11029    }
11030
11031    /// Sets the value of [parent][crate::model::ListRulesRequest::parent].
11032    ///
11033    /// # Example
11034    /// ```ignore,no_run
11035    /// # use google_cloud_artifactregistry_v1::model::ListRulesRequest;
11036    /// let x = ListRulesRequest::new().set_parent("example");
11037    /// ```
11038    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11039        self.parent = v.into();
11040        self
11041    }
11042
11043    /// Sets the value of [page_size][crate::model::ListRulesRequest::page_size].
11044    ///
11045    /// # Example
11046    /// ```ignore,no_run
11047    /// # use google_cloud_artifactregistry_v1::model::ListRulesRequest;
11048    /// let x = ListRulesRequest::new().set_page_size(42);
11049    /// ```
11050    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11051        self.page_size = v.into();
11052        self
11053    }
11054
11055    /// Sets the value of [page_token][crate::model::ListRulesRequest::page_token].
11056    ///
11057    /// # Example
11058    /// ```ignore,no_run
11059    /// # use google_cloud_artifactregistry_v1::model::ListRulesRequest;
11060    /// let x = ListRulesRequest::new().set_page_token("example");
11061    /// ```
11062    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11063        self.page_token = v.into();
11064        self
11065    }
11066}
11067
11068impl wkt::message::Message for ListRulesRequest {
11069    fn typename() -> &'static str {
11070        "type.googleapis.com/google.devtools.artifactregistry.v1.ListRulesRequest"
11071    }
11072}
11073
11074/// The response from listing rules.
11075#[derive(Clone, Default, PartialEq)]
11076#[non_exhaustive]
11077pub struct ListRulesResponse {
11078    /// The rules returned.
11079    pub rules: std::vec::Vec<crate::model::Rule>,
11080
11081    /// The token to retrieve the next page of rules, or empty if there are no
11082    /// more rules to return.
11083    pub next_page_token: std::string::String,
11084
11085    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11086}
11087
11088impl ListRulesResponse {
11089    pub fn new() -> Self {
11090        std::default::Default::default()
11091    }
11092
11093    /// Sets the value of [rules][crate::model::ListRulesResponse::rules].
11094    ///
11095    /// # Example
11096    /// ```ignore,no_run
11097    /// # use google_cloud_artifactregistry_v1::model::ListRulesResponse;
11098    /// use google_cloud_artifactregistry_v1::model::Rule;
11099    /// let x = ListRulesResponse::new()
11100    ///     .set_rules([
11101    ///         Rule::default()/* use setters */,
11102    ///         Rule::default()/* use (different) setters */,
11103    ///     ]);
11104    /// ```
11105    pub fn set_rules<T, V>(mut self, v: T) -> Self
11106    where
11107        T: std::iter::IntoIterator<Item = V>,
11108        V: std::convert::Into<crate::model::Rule>,
11109    {
11110        use std::iter::Iterator;
11111        self.rules = v.into_iter().map(|i| i.into()).collect();
11112        self
11113    }
11114
11115    /// Sets the value of [next_page_token][crate::model::ListRulesResponse::next_page_token].
11116    ///
11117    /// # Example
11118    /// ```ignore,no_run
11119    /// # use google_cloud_artifactregistry_v1::model::ListRulesResponse;
11120    /// let x = ListRulesResponse::new().set_next_page_token("example");
11121    /// ```
11122    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11123        self.next_page_token = v.into();
11124        self
11125    }
11126}
11127
11128impl wkt::message::Message for ListRulesResponse {
11129    fn typename() -> &'static str {
11130        "type.googleapis.com/google.devtools.artifactregistry.v1.ListRulesResponse"
11131    }
11132}
11133
11134#[doc(hidden)]
11135impl google_cloud_gax::paginator::internal::PageableResponse for ListRulesResponse {
11136    type PageItem = crate::model::Rule;
11137
11138    fn items(self) -> std::vec::Vec<Self::PageItem> {
11139        self.rules
11140    }
11141
11142    fn next_page_token(&self) -> std::string::String {
11143        use std::clone::Clone;
11144        self.next_page_token.clone()
11145    }
11146}
11147
11148/// The request to retrieve a rule.
11149#[derive(Clone, Default, PartialEq)]
11150#[non_exhaustive]
11151pub struct GetRuleRequest {
11152    /// Required. The name of the rule to retrieve.
11153    pub name: std::string::String,
11154
11155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11156}
11157
11158impl GetRuleRequest {
11159    pub fn new() -> Self {
11160        std::default::Default::default()
11161    }
11162
11163    /// Sets the value of [name][crate::model::GetRuleRequest::name].
11164    ///
11165    /// # Example
11166    /// ```ignore,no_run
11167    /// # use google_cloud_artifactregistry_v1::model::GetRuleRequest;
11168    /// let x = GetRuleRequest::new().set_name("example");
11169    /// ```
11170    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11171        self.name = v.into();
11172        self
11173    }
11174}
11175
11176impl wkt::message::Message for GetRuleRequest {
11177    fn typename() -> &'static str {
11178        "type.googleapis.com/google.devtools.artifactregistry.v1.GetRuleRequest"
11179    }
11180}
11181
11182/// The request to create a new rule.
11183#[derive(Clone, Default, PartialEq)]
11184#[non_exhaustive]
11185pub struct CreateRuleRequest {
11186    /// Required. The name of the parent resource where the rule will be created.
11187    pub parent: std::string::String,
11188
11189    /// The rule id to use for this repository.
11190    pub rule_id: std::string::String,
11191
11192    /// The rule to be created.
11193    pub rule: std::option::Option<crate::model::Rule>,
11194
11195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11196}
11197
11198impl CreateRuleRequest {
11199    pub fn new() -> Self {
11200        std::default::Default::default()
11201    }
11202
11203    /// Sets the value of [parent][crate::model::CreateRuleRequest::parent].
11204    ///
11205    /// # Example
11206    /// ```ignore,no_run
11207    /// # use google_cloud_artifactregistry_v1::model::CreateRuleRequest;
11208    /// let x = CreateRuleRequest::new().set_parent("example");
11209    /// ```
11210    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11211        self.parent = v.into();
11212        self
11213    }
11214
11215    /// Sets the value of [rule_id][crate::model::CreateRuleRequest::rule_id].
11216    ///
11217    /// # Example
11218    /// ```ignore,no_run
11219    /// # use google_cloud_artifactregistry_v1::model::CreateRuleRequest;
11220    /// let x = CreateRuleRequest::new().set_rule_id("example");
11221    /// ```
11222    pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11223        self.rule_id = v.into();
11224        self
11225    }
11226
11227    /// Sets the value of [rule][crate::model::CreateRuleRequest::rule].
11228    ///
11229    /// # Example
11230    /// ```ignore,no_run
11231    /// # use google_cloud_artifactregistry_v1::model::CreateRuleRequest;
11232    /// use google_cloud_artifactregistry_v1::model::Rule;
11233    /// let x = CreateRuleRequest::new().set_rule(Rule::default()/* use setters */);
11234    /// ```
11235    pub fn set_rule<T>(mut self, v: T) -> Self
11236    where
11237        T: std::convert::Into<crate::model::Rule>,
11238    {
11239        self.rule = std::option::Option::Some(v.into());
11240        self
11241    }
11242
11243    /// Sets or clears the value of [rule][crate::model::CreateRuleRequest::rule].
11244    ///
11245    /// # Example
11246    /// ```ignore,no_run
11247    /// # use google_cloud_artifactregistry_v1::model::CreateRuleRequest;
11248    /// use google_cloud_artifactregistry_v1::model::Rule;
11249    /// let x = CreateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
11250    /// let x = CreateRuleRequest::new().set_or_clear_rule(None::<Rule>);
11251    /// ```
11252    pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
11253    where
11254        T: std::convert::Into<crate::model::Rule>,
11255    {
11256        self.rule = v.map(|x| x.into());
11257        self
11258    }
11259}
11260
11261impl wkt::message::Message for CreateRuleRequest {
11262    fn typename() -> &'static str {
11263        "type.googleapis.com/google.devtools.artifactregistry.v1.CreateRuleRequest"
11264    }
11265}
11266
11267/// The request to update a rule.
11268#[derive(Clone, Default, PartialEq)]
11269#[non_exhaustive]
11270pub struct UpdateRuleRequest {
11271    /// The rule that replaces the resource on the server.
11272    pub rule: std::option::Option<crate::model::Rule>,
11273
11274    /// The update mask applies to the resource. For the `FieldMask` definition,
11275    /// see
11276    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
11277    pub update_mask: std::option::Option<wkt::FieldMask>,
11278
11279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11280}
11281
11282impl UpdateRuleRequest {
11283    pub fn new() -> Self {
11284        std::default::Default::default()
11285    }
11286
11287    /// Sets the value of [rule][crate::model::UpdateRuleRequest::rule].
11288    ///
11289    /// # Example
11290    /// ```ignore,no_run
11291    /// # use google_cloud_artifactregistry_v1::model::UpdateRuleRequest;
11292    /// use google_cloud_artifactregistry_v1::model::Rule;
11293    /// let x = UpdateRuleRequest::new().set_rule(Rule::default()/* use setters */);
11294    /// ```
11295    pub fn set_rule<T>(mut self, v: T) -> Self
11296    where
11297        T: std::convert::Into<crate::model::Rule>,
11298    {
11299        self.rule = std::option::Option::Some(v.into());
11300        self
11301    }
11302
11303    /// Sets or clears the value of [rule][crate::model::UpdateRuleRequest::rule].
11304    ///
11305    /// # Example
11306    /// ```ignore,no_run
11307    /// # use google_cloud_artifactregistry_v1::model::UpdateRuleRequest;
11308    /// use google_cloud_artifactregistry_v1::model::Rule;
11309    /// let x = UpdateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
11310    /// let x = UpdateRuleRequest::new().set_or_clear_rule(None::<Rule>);
11311    /// ```
11312    pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
11313    where
11314        T: std::convert::Into<crate::model::Rule>,
11315    {
11316        self.rule = v.map(|x| x.into());
11317        self
11318    }
11319
11320    /// Sets the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
11321    ///
11322    /// # Example
11323    /// ```ignore,no_run
11324    /// # use google_cloud_artifactregistry_v1::model::UpdateRuleRequest;
11325    /// use wkt::FieldMask;
11326    /// let x = UpdateRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11327    /// ```
11328    pub fn set_update_mask<T>(mut self, v: T) -> Self
11329    where
11330        T: std::convert::Into<wkt::FieldMask>,
11331    {
11332        self.update_mask = std::option::Option::Some(v.into());
11333        self
11334    }
11335
11336    /// Sets or clears the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
11337    ///
11338    /// # Example
11339    /// ```ignore,no_run
11340    /// # use google_cloud_artifactregistry_v1::model::UpdateRuleRequest;
11341    /// use wkt::FieldMask;
11342    /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11343    /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11344    /// ```
11345    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11346    where
11347        T: std::convert::Into<wkt::FieldMask>,
11348    {
11349        self.update_mask = v.map(|x| x.into());
11350        self
11351    }
11352}
11353
11354impl wkt::message::Message for UpdateRuleRequest {
11355    fn typename() -> &'static str {
11356        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateRuleRequest"
11357    }
11358}
11359
11360/// The request to delete a rule.
11361#[derive(Clone, Default, PartialEq)]
11362#[non_exhaustive]
11363pub struct DeleteRuleRequest {
11364    /// Required. The name of the rule to delete.
11365    pub name: std::string::String,
11366
11367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11368}
11369
11370impl DeleteRuleRequest {
11371    pub fn new() -> Self {
11372        std::default::Default::default()
11373    }
11374
11375    /// Sets the value of [name][crate::model::DeleteRuleRequest::name].
11376    ///
11377    /// # Example
11378    /// ```ignore,no_run
11379    /// # use google_cloud_artifactregistry_v1::model::DeleteRuleRequest;
11380    /// let x = DeleteRuleRequest::new().set_name("example");
11381    /// ```
11382    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11383        self.name = v.into();
11384        self
11385    }
11386}
11387
11388impl wkt::message::Message for DeleteRuleRequest {
11389    fn typename() -> &'static str {
11390        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteRuleRequest"
11391    }
11392}
11393
11394/// Metadata type for longrunning-operations, currently empty.
11395#[derive(Clone, Default, PartialEq)]
11396#[non_exhaustive]
11397pub struct OperationMetadata {
11398    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11399}
11400
11401impl OperationMetadata {
11402    pub fn new() -> Self {
11403        std::default::Default::default()
11404    }
11405}
11406
11407impl wkt::message::Message for OperationMetadata {
11408    fn typename() -> &'static str {
11409        "type.googleapis.com/google.devtools.artifactregistry.v1.OperationMetadata"
11410    }
11411}
11412
11413/// The Artifact Registry settings that apply to a Project.
11414#[derive(Clone, Default, PartialEq)]
11415#[non_exhaustive]
11416pub struct ProjectSettings {
11417    /// The name of the project's settings.
11418    ///
11419    /// Always of the form:
11420    /// projects/{project-id}/projectSettings
11421    ///
11422    /// In update request: never set
11423    /// In response: always set
11424    pub name: std::string::String,
11425
11426    /// The redirection state of the legacy repositories in this project.
11427    pub legacy_redirection_state: crate::model::project_settings::RedirectionState,
11428
11429    /// The percentage of pull traffic to redirect from GCR to AR when using
11430    /// partial redirection.
11431    pub pull_percent: i32,
11432
11433    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11434}
11435
11436impl ProjectSettings {
11437    pub fn new() -> Self {
11438        std::default::Default::default()
11439    }
11440
11441    /// Sets the value of [name][crate::model::ProjectSettings::name].
11442    ///
11443    /// # Example
11444    /// ```ignore,no_run
11445    /// # use google_cloud_artifactregistry_v1::model::ProjectSettings;
11446    /// let x = ProjectSettings::new().set_name("example");
11447    /// ```
11448    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11449        self.name = v.into();
11450        self
11451    }
11452
11453    /// Sets the value of [legacy_redirection_state][crate::model::ProjectSettings::legacy_redirection_state].
11454    ///
11455    /// # Example
11456    /// ```ignore,no_run
11457    /// # use google_cloud_artifactregistry_v1::model::ProjectSettings;
11458    /// use google_cloud_artifactregistry_v1::model::project_settings::RedirectionState;
11459    /// let x0 = ProjectSettings::new().set_legacy_redirection_state(RedirectionState::RedirectionFromGcrIoDisabled);
11460    /// let x1 = ProjectSettings::new().set_legacy_redirection_state(RedirectionState::RedirectionFromGcrIoEnabled);
11461    /// let x2 = ProjectSettings::new().set_legacy_redirection_state(RedirectionState::RedirectionFromGcrIoEnabledAndCopying);
11462    /// ```
11463    pub fn set_legacy_redirection_state<
11464        T: std::convert::Into<crate::model::project_settings::RedirectionState>,
11465    >(
11466        mut self,
11467        v: T,
11468    ) -> Self {
11469        self.legacy_redirection_state = v.into();
11470        self
11471    }
11472
11473    /// Sets the value of [pull_percent][crate::model::ProjectSettings::pull_percent].
11474    ///
11475    /// # Example
11476    /// ```ignore,no_run
11477    /// # use google_cloud_artifactregistry_v1::model::ProjectSettings;
11478    /// let x = ProjectSettings::new().set_pull_percent(42);
11479    /// ```
11480    pub fn set_pull_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11481        self.pull_percent = v.into();
11482        self
11483    }
11484}
11485
11486impl wkt::message::Message for ProjectSettings {
11487    fn typename() -> &'static str {
11488        "type.googleapis.com/google.devtools.artifactregistry.v1.ProjectSettings"
11489    }
11490}
11491
11492/// Defines additional types related to [ProjectSettings].
11493pub mod project_settings {
11494    #[allow(unused_imports)]
11495    use super::*;
11496
11497    /// The possible redirection states for legacy repositories.
11498    ///
11499    /// # Working with unknown values
11500    ///
11501    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11502    /// additional enum variants at any time. Adding new variants is not considered
11503    /// a breaking change. Applications should write their code in anticipation of:
11504    ///
11505    /// - New values appearing in future releases of the client library, **and**
11506    /// - New values received dynamically, without application changes.
11507    ///
11508    /// Please consult the [Working with enums] section in the user guide for some
11509    /// guidelines.
11510    ///
11511    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11512    #[derive(Clone, Debug, PartialEq)]
11513    #[non_exhaustive]
11514    pub enum RedirectionState {
11515        /// No redirection status has been set.
11516        Unspecified,
11517        /// Redirection is disabled.
11518        RedirectionFromGcrIoDisabled,
11519        /// Redirection is enabled.
11520        RedirectionFromGcrIoEnabled,
11521        /// Redirection is enabled, and has been finalized so cannot be reverted.
11522        #[deprecated]
11523        RedirectionFromGcrIoFinalized,
11524        /// Redirection is enabled and missing images are copied from GCR
11525        RedirectionFromGcrIoEnabledAndCopying,
11526        /// Redirection is partially enabled and missing images are copied from GCR
11527        RedirectionFromGcrIoPartialAndCopying,
11528        /// If set, the enum was initialized with an unknown value.
11529        ///
11530        /// Applications can examine the value using [RedirectionState::value] or
11531        /// [RedirectionState::name].
11532        UnknownValue(redirection_state::UnknownValue),
11533    }
11534
11535    #[doc(hidden)]
11536    pub mod redirection_state {
11537        #[allow(unused_imports)]
11538        use super::*;
11539        #[derive(Clone, Debug, PartialEq)]
11540        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11541    }
11542
11543    impl RedirectionState {
11544        /// Gets the enum value.
11545        ///
11546        /// Returns `None` if the enum contains an unknown value deserialized from
11547        /// the string representation of enums.
11548        pub fn value(&self) -> std::option::Option<i32> {
11549            match self {
11550                Self::Unspecified => std::option::Option::Some(0),
11551                Self::RedirectionFromGcrIoDisabled => std::option::Option::Some(1),
11552                Self::RedirectionFromGcrIoEnabled => std::option::Option::Some(2),
11553                Self::RedirectionFromGcrIoFinalized => std::option::Option::Some(3),
11554                Self::RedirectionFromGcrIoEnabledAndCopying => std::option::Option::Some(5),
11555                Self::RedirectionFromGcrIoPartialAndCopying => std::option::Option::Some(6),
11556                Self::UnknownValue(u) => u.0.value(),
11557            }
11558        }
11559
11560        /// Gets the enum value as a string.
11561        ///
11562        /// Returns `None` if the enum contains an unknown value deserialized from
11563        /// the integer representation of enums.
11564        pub fn name(&self) -> std::option::Option<&str> {
11565            match self {
11566                Self::Unspecified => std::option::Option::Some("REDIRECTION_STATE_UNSPECIFIED"),
11567                Self::RedirectionFromGcrIoDisabled => {
11568                    std::option::Option::Some("REDIRECTION_FROM_GCR_IO_DISABLED")
11569                }
11570                Self::RedirectionFromGcrIoEnabled => {
11571                    std::option::Option::Some("REDIRECTION_FROM_GCR_IO_ENABLED")
11572                }
11573                Self::RedirectionFromGcrIoFinalized => {
11574                    std::option::Option::Some("REDIRECTION_FROM_GCR_IO_FINALIZED")
11575                }
11576                Self::RedirectionFromGcrIoEnabledAndCopying => {
11577                    std::option::Option::Some("REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING")
11578                }
11579                Self::RedirectionFromGcrIoPartialAndCopying => {
11580                    std::option::Option::Some("REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING")
11581                }
11582                Self::UnknownValue(u) => u.0.name(),
11583            }
11584        }
11585    }
11586
11587    impl std::default::Default for RedirectionState {
11588        fn default() -> Self {
11589            use std::convert::From;
11590            Self::from(0)
11591        }
11592    }
11593
11594    impl std::fmt::Display for RedirectionState {
11595        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11596            wkt::internal::display_enum(f, self.name(), self.value())
11597        }
11598    }
11599
11600    impl std::convert::From<i32> for RedirectionState {
11601        fn from(value: i32) -> Self {
11602            match value {
11603                0 => Self::Unspecified,
11604                1 => Self::RedirectionFromGcrIoDisabled,
11605                2 => Self::RedirectionFromGcrIoEnabled,
11606                3 => Self::RedirectionFromGcrIoFinalized,
11607                5 => Self::RedirectionFromGcrIoEnabledAndCopying,
11608                6 => Self::RedirectionFromGcrIoPartialAndCopying,
11609                _ => Self::UnknownValue(redirection_state::UnknownValue(
11610                    wkt::internal::UnknownEnumValue::Integer(value),
11611                )),
11612            }
11613        }
11614    }
11615
11616    impl std::convert::From<&str> for RedirectionState {
11617        fn from(value: &str) -> Self {
11618            use std::string::ToString;
11619            match value {
11620                "REDIRECTION_STATE_UNSPECIFIED" => Self::Unspecified,
11621                "REDIRECTION_FROM_GCR_IO_DISABLED" => Self::RedirectionFromGcrIoDisabled,
11622                "REDIRECTION_FROM_GCR_IO_ENABLED" => Self::RedirectionFromGcrIoEnabled,
11623                "REDIRECTION_FROM_GCR_IO_FINALIZED" => Self::RedirectionFromGcrIoFinalized,
11624                "REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING" => {
11625                    Self::RedirectionFromGcrIoEnabledAndCopying
11626                }
11627                "REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING" => {
11628                    Self::RedirectionFromGcrIoPartialAndCopying
11629                }
11630                _ => Self::UnknownValue(redirection_state::UnknownValue(
11631                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11632                )),
11633            }
11634        }
11635    }
11636
11637    impl serde::ser::Serialize for RedirectionState {
11638        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11639        where
11640            S: serde::Serializer,
11641        {
11642            match self {
11643                Self::Unspecified => serializer.serialize_i32(0),
11644                Self::RedirectionFromGcrIoDisabled => serializer.serialize_i32(1),
11645                Self::RedirectionFromGcrIoEnabled => serializer.serialize_i32(2),
11646                Self::RedirectionFromGcrIoFinalized => serializer.serialize_i32(3),
11647                Self::RedirectionFromGcrIoEnabledAndCopying => serializer.serialize_i32(5),
11648                Self::RedirectionFromGcrIoPartialAndCopying => serializer.serialize_i32(6),
11649                Self::UnknownValue(u) => u.0.serialize(serializer),
11650            }
11651        }
11652    }
11653
11654    impl<'de> serde::de::Deserialize<'de> for RedirectionState {
11655        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11656        where
11657            D: serde::Deserializer<'de>,
11658        {
11659            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RedirectionState>::new(
11660                ".google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState",
11661            ))
11662        }
11663    }
11664}
11665
11666/// Gets the redirection status for a project.
11667#[derive(Clone, Default, PartialEq)]
11668#[non_exhaustive]
11669pub struct GetProjectSettingsRequest {
11670    /// Required. The name of the projectSettings resource.
11671    pub name: std::string::String,
11672
11673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11674}
11675
11676impl GetProjectSettingsRequest {
11677    pub fn new() -> Self {
11678        std::default::Default::default()
11679    }
11680
11681    /// Sets the value of [name][crate::model::GetProjectSettingsRequest::name].
11682    ///
11683    /// # Example
11684    /// ```ignore,no_run
11685    /// # use google_cloud_artifactregistry_v1::model::GetProjectSettingsRequest;
11686    /// let x = GetProjectSettingsRequest::new().set_name("example");
11687    /// ```
11688    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11689        self.name = v.into();
11690        self
11691    }
11692}
11693
11694impl wkt::message::Message for GetProjectSettingsRequest {
11695    fn typename() -> &'static str {
11696        "type.googleapis.com/google.devtools.artifactregistry.v1.GetProjectSettingsRequest"
11697    }
11698}
11699
11700/// Sets the settings of the project.
11701#[derive(Clone, Default, PartialEq)]
11702#[non_exhaustive]
11703pub struct UpdateProjectSettingsRequest {
11704    /// The project settings.
11705    pub project_settings: std::option::Option<crate::model::ProjectSettings>,
11706
11707    /// Field mask to support partial updates.
11708    pub update_mask: std::option::Option<wkt::FieldMask>,
11709
11710    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11711}
11712
11713impl UpdateProjectSettingsRequest {
11714    pub fn new() -> Self {
11715        std::default::Default::default()
11716    }
11717
11718    /// Sets the value of [project_settings][crate::model::UpdateProjectSettingsRequest::project_settings].
11719    ///
11720    /// # Example
11721    /// ```ignore,no_run
11722    /// # use google_cloud_artifactregistry_v1::model::UpdateProjectSettingsRequest;
11723    /// use google_cloud_artifactregistry_v1::model::ProjectSettings;
11724    /// let x = UpdateProjectSettingsRequest::new().set_project_settings(ProjectSettings::default()/* use setters */);
11725    /// ```
11726    pub fn set_project_settings<T>(mut self, v: T) -> Self
11727    where
11728        T: std::convert::Into<crate::model::ProjectSettings>,
11729    {
11730        self.project_settings = std::option::Option::Some(v.into());
11731        self
11732    }
11733
11734    /// Sets or clears the value of [project_settings][crate::model::UpdateProjectSettingsRequest::project_settings].
11735    ///
11736    /// # Example
11737    /// ```ignore,no_run
11738    /// # use google_cloud_artifactregistry_v1::model::UpdateProjectSettingsRequest;
11739    /// use google_cloud_artifactregistry_v1::model::ProjectSettings;
11740    /// let x = UpdateProjectSettingsRequest::new().set_or_clear_project_settings(Some(ProjectSettings::default()/* use setters */));
11741    /// let x = UpdateProjectSettingsRequest::new().set_or_clear_project_settings(None::<ProjectSettings>);
11742    /// ```
11743    pub fn set_or_clear_project_settings<T>(mut self, v: std::option::Option<T>) -> Self
11744    where
11745        T: std::convert::Into<crate::model::ProjectSettings>,
11746    {
11747        self.project_settings = v.map(|x| x.into());
11748        self
11749    }
11750
11751    /// Sets the value of [update_mask][crate::model::UpdateProjectSettingsRequest::update_mask].
11752    ///
11753    /// # Example
11754    /// ```ignore,no_run
11755    /// # use google_cloud_artifactregistry_v1::model::UpdateProjectSettingsRequest;
11756    /// use wkt::FieldMask;
11757    /// let x = UpdateProjectSettingsRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11758    /// ```
11759    pub fn set_update_mask<T>(mut self, v: T) -> Self
11760    where
11761        T: std::convert::Into<wkt::FieldMask>,
11762    {
11763        self.update_mask = std::option::Option::Some(v.into());
11764        self
11765    }
11766
11767    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectSettingsRequest::update_mask].
11768    ///
11769    /// # Example
11770    /// ```ignore,no_run
11771    /// # use google_cloud_artifactregistry_v1::model::UpdateProjectSettingsRequest;
11772    /// use wkt::FieldMask;
11773    /// let x = UpdateProjectSettingsRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11774    /// let x = UpdateProjectSettingsRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11775    /// ```
11776    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11777    where
11778        T: std::convert::Into<wkt::FieldMask>,
11779    {
11780        self.update_mask = v.map(|x| x.into());
11781        self
11782    }
11783}
11784
11785impl wkt::message::Message for UpdateProjectSettingsRequest {
11786    fn typename() -> &'static str {
11787        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest"
11788    }
11789}
11790
11791/// Tags point to a version and represent an alternative name that can be used
11792/// to access the version.
11793#[derive(Clone, Default, PartialEq)]
11794#[non_exhaustive]
11795pub struct Tag {
11796    /// The name of the tag, for example:
11797    /// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1".
11798    /// If the package part contains slashes, the slashes are escaped.
11799    /// The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else
11800    /// must be URL encoded.
11801    pub name: std::string::String,
11802
11803    /// The name of the version the tag refers to, for example:
11804    /// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811`
11805    /// If the package or version ID parts contain slashes, the slashes are
11806    /// escaped.
11807    pub version: std::string::String,
11808
11809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11810}
11811
11812impl Tag {
11813    pub fn new() -> Self {
11814        std::default::Default::default()
11815    }
11816
11817    /// Sets the value of [name][crate::model::Tag::name].
11818    ///
11819    /// # Example
11820    /// ```ignore,no_run
11821    /// # use google_cloud_artifactregistry_v1::model::Tag;
11822    /// let x = Tag::new().set_name("example");
11823    /// ```
11824    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11825        self.name = v.into();
11826        self
11827    }
11828
11829    /// Sets the value of [version][crate::model::Tag::version].
11830    ///
11831    /// # Example
11832    /// ```ignore,no_run
11833    /// # use google_cloud_artifactregistry_v1::model::Tag;
11834    /// let x = Tag::new().set_version("example");
11835    /// ```
11836    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11837        self.version = v.into();
11838        self
11839    }
11840}
11841
11842impl wkt::message::Message for Tag {
11843    fn typename() -> &'static str {
11844        "type.googleapis.com/google.devtools.artifactregistry.v1.Tag"
11845    }
11846}
11847
11848/// The request to list tags.
11849#[derive(Clone, Default, PartialEq)]
11850#[non_exhaustive]
11851pub struct ListTagsRequest {
11852    /// The name of the parent package whose tags will be listed.
11853    /// For example:
11854    /// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.
11855    pub parent: std::string::String,
11856
11857    /// An expression for filtering the results of the request. Filter rules are
11858    /// case insensitive. The fields eligible for filtering are:
11859    ///
11860    /// * `name`
11861    /// * `version`
11862    ///
11863    /// Examples of using a filter:
11864    ///
11865    /// To filter the results of your request to tags with the name `my-tag` in
11866    /// package `my-package` in repository `my-repo` in project "`y-project` in
11867    /// the us-central region, append the following filter expression to your
11868    /// request:
11869    ///
11870    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"`
11871    ///
11872    /// You can also use wildcards to match any number of characters before or
11873    /// after the value:
11874    ///
11875    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"`
11876    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"`
11877    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"`
11878    ///
11879    /// To filter the results of your request to tags applied to the version
11880    /// `1.0` in package `my-package`, append the following filter expression to
11881    /// your request:
11882    ///
11883    /// * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"`
11884    pub filter: std::string::String,
11885
11886    /// The maximum number of tags to return. Maximum page size is 1,000.
11887    pub page_size: i32,
11888
11889    /// The next_page_token value returned from a previous list request, if any.
11890    pub page_token: std::string::String,
11891
11892    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11893}
11894
11895impl ListTagsRequest {
11896    pub fn new() -> Self {
11897        std::default::Default::default()
11898    }
11899
11900    /// Sets the value of [parent][crate::model::ListTagsRequest::parent].
11901    ///
11902    /// # Example
11903    /// ```ignore,no_run
11904    /// # use google_cloud_artifactregistry_v1::model::ListTagsRequest;
11905    /// let x = ListTagsRequest::new().set_parent("example");
11906    /// ```
11907    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11908        self.parent = v.into();
11909        self
11910    }
11911
11912    /// Sets the value of [filter][crate::model::ListTagsRequest::filter].
11913    ///
11914    /// # Example
11915    /// ```ignore,no_run
11916    /// # use google_cloud_artifactregistry_v1::model::ListTagsRequest;
11917    /// let x = ListTagsRequest::new().set_filter("example");
11918    /// ```
11919    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11920        self.filter = v.into();
11921        self
11922    }
11923
11924    /// Sets the value of [page_size][crate::model::ListTagsRequest::page_size].
11925    ///
11926    /// # Example
11927    /// ```ignore,no_run
11928    /// # use google_cloud_artifactregistry_v1::model::ListTagsRequest;
11929    /// let x = ListTagsRequest::new().set_page_size(42);
11930    /// ```
11931    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11932        self.page_size = v.into();
11933        self
11934    }
11935
11936    /// Sets the value of [page_token][crate::model::ListTagsRequest::page_token].
11937    ///
11938    /// # Example
11939    /// ```ignore,no_run
11940    /// # use google_cloud_artifactregistry_v1::model::ListTagsRequest;
11941    /// let x = ListTagsRequest::new().set_page_token("example");
11942    /// ```
11943    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11944        self.page_token = v.into();
11945        self
11946    }
11947}
11948
11949impl wkt::message::Message for ListTagsRequest {
11950    fn typename() -> &'static str {
11951        "type.googleapis.com/google.devtools.artifactregistry.v1.ListTagsRequest"
11952    }
11953}
11954
11955/// The response from listing tags.
11956#[derive(Clone, Default, PartialEq)]
11957#[non_exhaustive]
11958pub struct ListTagsResponse {
11959    /// The tags returned.
11960    pub tags: std::vec::Vec<crate::model::Tag>,
11961
11962    /// The token to retrieve the next page of tags, or empty if there are no
11963    /// more tags to return.
11964    pub next_page_token: std::string::String,
11965
11966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11967}
11968
11969impl ListTagsResponse {
11970    pub fn new() -> Self {
11971        std::default::Default::default()
11972    }
11973
11974    /// Sets the value of [tags][crate::model::ListTagsResponse::tags].
11975    ///
11976    /// # Example
11977    /// ```ignore,no_run
11978    /// # use google_cloud_artifactregistry_v1::model::ListTagsResponse;
11979    /// use google_cloud_artifactregistry_v1::model::Tag;
11980    /// let x = ListTagsResponse::new()
11981    ///     .set_tags([
11982    ///         Tag::default()/* use setters */,
11983    ///         Tag::default()/* use (different) setters */,
11984    ///     ]);
11985    /// ```
11986    pub fn set_tags<T, V>(mut self, v: T) -> Self
11987    where
11988        T: std::iter::IntoIterator<Item = V>,
11989        V: std::convert::Into<crate::model::Tag>,
11990    {
11991        use std::iter::Iterator;
11992        self.tags = v.into_iter().map(|i| i.into()).collect();
11993        self
11994    }
11995
11996    /// Sets the value of [next_page_token][crate::model::ListTagsResponse::next_page_token].
11997    ///
11998    /// # Example
11999    /// ```ignore,no_run
12000    /// # use google_cloud_artifactregistry_v1::model::ListTagsResponse;
12001    /// let x = ListTagsResponse::new().set_next_page_token("example");
12002    /// ```
12003    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12004        self.next_page_token = v.into();
12005        self
12006    }
12007}
12008
12009impl wkt::message::Message for ListTagsResponse {
12010    fn typename() -> &'static str {
12011        "type.googleapis.com/google.devtools.artifactregistry.v1.ListTagsResponse"
12012    }
12013}
12014
12015#[doc(hidden)]
12016impl google_cloud_gax::paginator::internal::PageableResponse for ListTagsResponse {
12017    type PageItem = crate::model::Tag;
12018
12019    fn items(self) -> std::vec::Vec<Self::PageItem> {
12020        self.tags
12021    }
12022
12023    fn next_page_token(&self) -> std::string::String {
12024        use std::clone::Clone;
12025        self.next_page_token.clone()
12026    }
12027}
12028
12029/// The request to retrieve a tag.
12030#[derive(Clone, Default, PartialEq)]
12031#[non_exhaustive]
12032pub struct GetTagRequest {
12033    /// The name of the tag to retrieve.
12034    pub name: std::string::String,
12035
12036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12037}
12038
12039impl GetTagRequest {
12040    pub fn new() -> Self {
12041        std::default::Default::default()
12042    }
12043
12044    /// Sets the value of [name][crate::model::GetTagRequest::name].
12045    ///
12046    /// # Example
12047    /// ```ignore,no_run
12048    /// # use google_cloud_artifactregistry_v1::model::GetTagRequest;
12049    /// let x = GetTagRequest::new().set_name("example");
12050    /// ```
12051    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12052        self.name = v.into();
12053        self
12054    }
12055}
12056
12057impl wkt::message::Message for GetTagRequest {
12058    fn typename() -> &'static str {
12059        "type.googleapis.com/google.devtools.artifactregistry.v1.GetTagRequest"
12060    }
12061}
12062
12063/// The request to create a new tag.
12064#[derive(Clone, Default, PartialEq)]
12065#[non_exhaustive]
12066pub struct CreateTagRequest {
12067    /// The name of the parent resource where the tag will be created.
12068    pub parent: std::string::String,
12069
12070    /// The tag id to use for this repository.
12071    pub tag_id: std::string::String,
12072
12073    /// The tag to be created.
12074    pub tag: std::option::Option<crate::model::Tag>,
12075
12076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12077}
12078
12079impl CreateTagRequest {
12080    pub fn new() -> Self {
12081        std::default::Default::default()
12082    }
12083
12084    /// Sets the value of [parent][crate::model::CreateTagRequest::parent].
12085    ///
12086    /// # Example
12087    /// ```ignore,no_run
12088    /// # use google_cloud_artifactregistry_v1::model::CreateTagRequest;
12089    /// let x = CreateTagRequest::new().set_parent("example");
12090    /// ```
12091    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12092        self.parent = v.into();
12093        self
12094    }
12095
12096    /// Sets the value of [tag_id][crate::model::CreateTagRequest::tag_id].
12097    ///
12098    /// # Example
12099    /// ```ignore,no_run
12100    /// # use google_cloud_artifactregistry_v1::model::CreateTagRequest;
12101    /// let x = CreateTagRequest::new().set_tag_id("example");
12102    /// ```
12103    pub fn set_tag_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12104        self.tag_id = v.into();
12105        self
12106    }
12107
12108    /// Sets the value of [tag][crate::model::CreateTagRequest::tag].
12109    ///
12110    /// # Example
12111    /// ```ignore,no_run
12112    /// # use google_cloud_artifactregistry_v1::model::CreateTagRequest;
12113    /// use google_cloud_artifactregistry_v1::model::Tag;
12114    /// let x = CreateTagRequest::new().set_tag(Tag::default()/* use setters */);
12115    /// ```
12116    pub fn set_tag<T>(mut self, v: T) -> Self
12117    where
12118        T: std::convert::Into<crate::model::Tag>,
12119    {
12120        self.tag = std::option::Option::Some(v.into());
12121        self
12122    }
12123
12124    /// Sets or clears the value of [tag][crate::model::CreateTagRequest::tag].
12125    ///
12126    /// # Example
12127    /// ```ignore,no_run
12128    /// # use google_cloud_artifactregistry_v1::model::CreateTagRequest;
12129    /// use google_cloud_artifactregistry_v1::model::Tag;
12130    /// let x = CreateTagRequest::new().set_or_clear_tag(Some(Tag::default()/* use setters */));
12131    /// let x = CreateTagRequest::new().set_or_clear_tag(None::<Tag>);
12132    /// ```
12133    pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
12134    where
12135        T: std::convert::Into<crate::model::Tag>,
12136    {
12137        self.tag = v.map(|x| x.into());
12138        self
12139    }
12140}
12141
12142impl wkt::message::Message for CreateTagRequest {
12143    fn typename() -> &'static str {
12144        "type.googleapis.com/google.devtools.artifactregistry.v1.CreateTagRequest"
12145    }
12146}
12147
12148/// The request to create or update a tag.
12149#[derive(Clone, Default, PartialEq)]
12150#[non_exhaustive]
12151pub struct UpdateTagRequest {
12152    /// The tag that replaces the resource on the server.
12153    pub tag: std::option::Option<crate::model::Tag>,
12154
12155    /// The update mask applies to the resource. For the `FieldMask` definition,
12156    /// see
12157    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
12158    pub update_mask: std::option::Option<wkt::FieldMask>,
12159
12160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12161}
12162
12163impl UpdateTagRequest {
12164    pub fn new() -> Self {
12165        std::default::Default::default()
12166    }
12167
12168    /// Sets the value of [tag][crate::model::UpdateTagRequest::tag].
12169    ///
12170    /// # Example
12171    /// ```ignore,no_run
12172    /// # use google_cloud_artifactregistry_v1::model::UpdateTagRequest;
12173    /// use google_cloud_artifactregistry_v1::model::Tag;
12174    /// let x = UpdateTagRequest::new().set_tag(Tag::default()/* use setters */);
12175    /// ```
12176    pub fn set_tag<T>(mut self, v: T) -> Self
12177    where
12178        T: std::convert::Into<crate::model::Tag>,
12179    {
12180        self.tag = std::option::Option::Some(v.into());
12181        self
12182    }
12183
12184    /// Sets or clears the value of [tag][crate::model::UpdateTagRequest::tag].
12185    ///
12186    /// # Example
12187    /// ```ignore,no_run
12188    /// # use google_cloud_artifactregistry_v1::model::UpdateTagRequest;
12189    /// use google_cloud_artifactregistry_v1::model::Tag;
12190    /// let x = UpdateTagRequest::new().set_or_clear_tag(Some(Tag::default()/* use setters */));
12191    /// let x = UpdateTagRequest::new().set_or_clear_tag(None::<Tag>);
12192    /// ```
12193    pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
12194    where
12195        T: std::convert::Into<crate::model::Tag>,
12196    {
12197        self.tag = v.map(|x| x.into());
12198        self
12199    }
12200
12201    /// Sets the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
12202    ///
12203    /// # Example
12204    /// ```ignore,no_run
12205    /// # use google_cloud_artifactregistry_v1::model::UpdateTagRequest;
12206    /// use wkt::FieldMask;
12207    /// let x = UpdateTagRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12208    /// ```
12209    pub fn set_update_mask<T>(mut self, v: T) -> Self
12210    where
12211        T: std::convert::Into<wkt::FieldMask>,
12212    {
12213        self.update_mask = std::option::Option::Some(v.into());
12214        self
12215    }
12216
12217    /// Sets or clears the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
12218    ///
12219    /// # Example
12220    /// ```ignore,no_run
12221    /// # use google_cloud_artifactregistry_v1::model::UpdateTagRequest;
12222    /// use wkt::FieldMask;
12223    /// let x = UpdateTagRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12224    /// let x = UpdateTagRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12225    /// ```
12226    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12227    where
12228        T: std::convert::Into<wkt::FieldMask>,
12229    {
12230        self.update_mask = v.map(|x| x.into());
12231        self
12232    }
12233}
12234
12235impl wkt::message::Message for UpdateTagRequest {
12236    fn typename() -> &'static str {
12237        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateTagRequest"
12238    }
12239}
12240
12241/// The request to delete a tag.
12242#[derive(Clone, Default, PartialEq)]
12243#[non_exhaustive]
12244pub struct DeleteTagRequest {
12245    /// The name of the tag to delete.
12246    pub name: std::string::String,
12247
12248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12249}
12250
12251impl DeleteTagRequest {
12252    pub fn new() -> Self {
12253        std::default::Default::default()
12254    }
12255
12256    /// Sets the value of [name][crate::model::DeleteTagRequest::name].
12257    ///
12258    /// # Example
12259    /// ```ignore,no_run
12260    /// # use google_cloud_artifactregistry_v1::model::DeleteTagRequest;
12261    /// let x = DeleteTagRequest::new().set_name("example");
12262    /// ```
12263    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12264        self.name = v.into();
12265        self
12266    }
12267}
12268
12269impl wkt::message::Message for DeleteTagRequest {
12270    fn typename() -> &'static str {
12271        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteTagRequest"
12272    }
12273}
12274
12275/// The body of a version resource. A version resource represents a
12276/// collection of components, such as files and other data. This may correspond
12277/// to a version in many package management schemes.
12278#[derive(Clone, Default, PartialEq)]
12279#[non_exhaustive]
12280pub struct Version {
12281    /// The name of the version, for example:
12282    /// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`.
12283    /// If the package or version ID parts contain slashes, the slashes are
12284    /// escaped.
12285    pub name: std::string::String,
12286
12287    /// Optional. Description of the version, as specified in its metadata.
12288    pub description: std::string::String,
12289
12290    /// The time when the version was created.
12291    pub create_time: std::option::Option<wkt::Timestamp>,
12292
12293    /// The time when the version was last updated.
12294    pub update_time: std::option::Option<wkt::Timestamp>,
12295
12296    /// Output only. A list of related tags. Will contain up to 100 tags that
12297    /// reference this version.
12298    pub related_tags: std::vec::Vec<crate::model::Tag>,
12299
12300    /// Output only. Repository-specific Metadata stored against this version.
12301    /// The fields returned are defined by the underlying repository-specific
12302    /// resource. Currently, the resources could be:
12303    /// [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
12304    /// [MavenArtifact][google.devtools.artifactregistry.v1.MavenArtifact]
12305    ///
12306    /// [google.devtools.artifactregistry.v1.DockerImage]: crate::model::DockerImage
12307    /// [google.devtools.artifactregistry.v1.MavenArtifact]: crate::model::MavenArtifact
12308    pub metadata: std::option::Option<wkt::Struct>,
12309
12310    /// Optional. Client specified annotations.
12311    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
12312
12313    /// Output only. Immutable reference for the version, calculated based on the
12314    /// version's content. Currently we only support dirsum_sha256 hash algorithm.
12315    /// Additional hash algorithms may be added in the future.
12316    pub fingerprints: std::vec::Vec<crate::model::Hash>,
12317
12318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12319}
12320
12321impl Version {
12322    pub fn new() -> Self {
12323        std::default::Default::default()
12324    }
12325
12326    /// Sets the value of [name][crate::model::Version::name].
12327    ///
12328    /// # Example
12329    /// ```ignore,no_run
12330    /// # use google_cloud_artifactregistry_v1::model::Version;
12331    /// let x = Version::new().set_name("example");
12332    /// ```
12333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12334        self.name = v.into();
12335        self
12336    }
12337
12338    /// Sets the value of [description][crate::model::Version::description].
12339    ///
12340    /// # Example
12341    /// ```ignore,no_run
12342    /// # use google_cloud_artifactregistry_v1::model::Version;
12343    /// let x = Version::new().set_description("example");
12344    /// ```
12345    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12346        self.description = v.into();
12347        self
12348    }
12349
12350    /// Sets the value of [create_time][crate::model::Version::create_time].
12351    ///
12352    /// # Example
12353    /// ```ignore,no_run
12354    /// # use google_cloud_artifactregistry_v1::model::Version;
12355    /// use wkt::Timestamp;
12356    /// let x = Version::new().set_create_time(Timestamp::default()/* use setters */);
12357    /// ```
12358    pub fn set_create_time<T>(mut self, v: T) -> Self
12359    where
12360        T: std::convert::Into<wkt::Timestamp>,
12361    {
12362        self.create_time = std::option::Option::Some(v.into());
12363        self
12364    }
12365
12366    /// Sets or clears the value of [create_time][crate::model::Version::create_time].
12367    ///
12368    /// # Example
12369    /// ```ignore,no_run
12370    /// # use google_cloud_artifactregistry_v1::model::Version;
12371    /// use wkt::Timestamp;
12372    /// let x = Version::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12373    /// let x = Version::new().set_or_clear_create_time(None::<Timestamp>);
12374    /// ```
12375    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12376    where
12377        T: std::convert::Into<wkt::Timestamp>,
12378    {
12379        self.create_time = v.map(|x| x.into());
12380        self
12381    }
12382
12383    /// Sets the value of [update_time][crate::model::Version::update_time].
12384    ///
12385    /// # Example
12386    /// ```ignore,no_run
12387    /// # use google_cloud_artifactregistry_v1::model::Version;
12388    /// use wkt::Timestamp;
12389    /// let x = Version::new().set_update_time(Timestamp::default()/* use setters */);
12390    /// ```
12391    pub fn set_update_time<T>(mut self, v: T) -> Self
12392    where
12393        T: std::convert::Into<wkt::Timestamp>,
12394    {
12395        self.update_time = std::option::Option::Some(v.into());
12396        self
12397    }
12398
12399    /// Sets or clears the value of [update_time][crate::model::Version::update_time].
12400    ///
12401    /// # Example
12402    /// ```ignore,no_run
12403    /// # use google_cloud_artifactregistry_v1::model::Version;
12404    /// use wkt::Timestamp;
12405    /// let x = Version::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12406    /// let x = Version::new().set_or_clear_update_time(None::<Timestamp>);
12407    /// ```
12408    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12409    where
12410        T: std::convert::Into<wkt::Timestamp>,
12411    {
12412        self.update_time = v.map(|x| x.into());
12413        self
12414    }
12415
12416    /// Sets the value of [related_tags][crate::model::Version::related_tags].
12417    ///
12418    /// # Example
12419    /// ```ignore,no_run
12420    /// # use google_cloud_artifactregistry_v1::model::Version;
12421    /// use google_cloud_artifactregistry_v1::model::Tag;
12422    /// let x = Version::new()
12423    ///     .set_related_tags([
12424    ///         Tag::default()/* use setters */,
12425    ///         Tag::default()/* use (different) setters */,
12426    ///     ]);
12427    /// ```
12428    pub fn set_related_tags<T, V>(mut self, v: T) -> Self
12429    where
12430        T: std::iter::IntoIterator<Item = V>,
12431        V: std::convert::Into<crate::model::Tag>,
12432    {
12433        use std::iter::Iterator;
12434        self.related_tags = v.into_iter().map(|i| i.into()).collect();
12435        self
12436    }
12437
12438    /// Sets the value of [metadata][crate::model::Version::metadata].
12439    ///
12440    /// # Example
12441    /// ```ignore,no_run
12442    /// # use google_cloud_artifactregistry_v1::model::Version;
12443    /// use wkt::Struct;
12444    /// let x = Version::new().set_metadata(Struct::default()/* use setters */);
12445    /// ```
12446    pub fn set_metadata<T>(mut self, v: T) -> Self
12447    where
12448        T: std::convert::Into<wkt::Struct>,
12449    {
12450        self.metadata = std::option::Option::Some(v.into());
12451        self
12452    }
12453
12454    /// Sets or clears the value of [metadata][crate::model::Version::metadata].
12455    ///
12456    /// # Example
12457    /// ```ignore,no_run
12458    /// # use google_cloud_artifactregistry_v1::model::Version;
12459    /// use wkt::Struct;
12460    /// let x = Version::new().set_or_clear_metadata(Some(Struct::default()/* use setters */));
12461    /// let x = Version::new().set_or_clear_metadata(None::<Struct>);
12462    /// ```
12463    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12464    where
12465        T: std::convert::Into<wkt::Struct>,
12466    {
12467        self.metadata = v.map(|x| x.into());
12468        self
12469    }
12470
12471    /// Sets the value of [annotations][crate::model::Version::annotations].
12472    ///
12473    /// # Example
12474    /// ```ignore,no_run
12475    /// # use google_cloud_artifactregistry_v1::model::Version;
12476    /// let x = Version::new().set_annotations([
12477    ///     ("key0", "abc"),
12478    ///     ("key1", "xyz"),
12479    /// ]);
12480    /// ```
12481    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
12482    where
12483        T: std::iter::IntoIterator<Item = (K, V)>,
12484        K: std::convert::Into<std::string::String>,
12485        V: std::convert::Into<std::string::String>,
12486    {
12487        use std::iter::Iterator;
12488        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12489        self
12490    }
12491
12492    /// Sets the value of [fingerprints][crate::model::Version::fingerprints].
12493    ///
12494    /// # Example
12495    /// ```ignore,no_run
12496    /// # use google_cloud_artifactregistry_v1::model::Version;
12497    /// use google_cloud_artifactregistry_v1::model::Hash;
12498    /// let x = Version::new()
12499    ///     .set_fingerprints([
12500    ///         Hash::default()/* use setters */,
12501    ///         Hash::default()/* use (different) setters */,
12502    ///     ]);
12503    /// ```
12504    pub fn set_fingerprints<T, V>(mut self, v: T) -> Self
12505    where
12506        T: std::iter::IntoIterator<Item = V>,
12507        V: std::convert::Into<crate::model::Hash>,
12508    {
12509        use std::iter::Iterator;
12510        self.fingerprints = v.into_iter().map(|i| i.into()).collect();
12511        self
12512    }
12513}
12514
12515impl wkt::message::Message for Version {
12516    fn typename() -> &'static str {
12517        "type.googleapis.com/google.devtools.artifactregistry.v1.Version"
12518    }
12519}
12520
12521/// The request to list versions.
12522#[derive(Clone, Default, PartialEq)]
12523#[non_exhaustive]
12524pub struct ListVersionsRequest {
12525    /// The name of the parent resource whose versions will be listed.
12526    pub parent: std::string::String,
12527
12528    /// The maximum number of versions to return. Maximum page size is 1,000.
12529    pub page_size: i32,
12530
12531    /// The next_page_token value returned from a previous list request, if any.
12532    pub page_token: std::string::String,
12533
12534    /// The view that should be returned in the response.
12535    pub view: crate::model::VersionView,
12536
12537    /// Optional. The field to order the results by.
12538    pub order_by: std::string::String,
12539
12540    /// Optional. An expression for filtering the results of the request. Filter
12541    /// rules are case insensitive. The fields eligible for filtering are:
12542    ///
12543    /// * `name`
12544    /// * `annotations`
12545    ///
12546    /// Examples of using a filter:
12547    ///
12548    /// To filter the results of your request to versions with the name
12549    /// `my-version` in project `my-project` in the `us-central` region, in
12550    /// repository `my-repo`, append the following filter expression to your
12551    /// request:
12552    ///
12553    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"`
12554    ///
12555    /// You can also use wildcards to match any number of characters before or
12556    /// after the value:
12557    ///
12558    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"`
12559    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"`
12560    /// * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"`
12561    ///
12562    /// To filter the results of your request to versions with the annotation
12563    /// key-value pair [`external_link`: `external_link_value`], append the
12564    /// following filter expression to your request:
12565    ///
12566    /// * `"annotations.external_link:external_link_value"`
12567    ///
12568    /// To filter just for a specific annotation key `external_link`, append the
12569    /// following filter expression to your request:
12570    ///
12571    /// * `"annotations.external_link"`
12572    ///
12573    /// If the annotation key or value contains special characters, you can escape
12574    /// them by surrounding the value with backticks. For example, to filter the
12575    /// results of your request to versions with the annotation key-value pair
12576    /// [`external.link`:`<https://example.com/my-version>`], append the following
12577    /// filter expression to your request:
12578    ///
12579    /// * `` "annotations.`external.link`:`<https://example.com/my-version>`" ``
12580    ///
12581    /// You can also filter with annotations with a wildcard to
12582    /// match any number of characters before or after the value:
12583    ///
12584    /// * `` "annotations.*_link:`*example.com*`" ``
12585    pub filter: std::string::String,
12586
12587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12588}
12589
12590impl ListVersionsRequest {
12591    pub fn new() -> Self {
12592        std::default::Default::default()
12593    }
12594
12595    /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
12596    ///
12597    /// # Example
12598    /// ```ignore,no_run
12599    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12600    /// let x = ListVersionsRequest::new().set_parent("example");
12601    /// ```
12602    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12603        self.parent = v.into();
12604        self
12605    }
12606
12607    /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
12608    ///
12609    /// # Example
12610    /// ```ignore,no_run
12611    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12612    /// let x = ListVersionsRequest::new().set_page_size(42);
12613    /// ```
12614    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12615        self.page_size = v.into();
12616        self
12617    }
12618
12619    /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
12620    ///
12621    /// # Example
12622    /// ```ignore,no_run
12623    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12624    /// let x = ListVersionsRequest::new().set_page_token("example");
12625    /// ```
12626    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12627        self.page_token = v.into();
12628        self
12629    }
12630
12631    /// Sets the value of [view][crate::model::ListVersionsRequest::view].
12632    ///
12633    /// # Example
12634    /// ```ignore,no_run
12635    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12636    /// use google_cloud_artifactregistry_v1::model::VersionView;
12637    /// let x0 = ListVersionsRequest::new().set_view(VersionView::Basic);
12638    /// let x1 = ListVersionsRequest::new().set_view(VersionView::Full);
12639    /// ```
12640    pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
12641        self.view = v.into();
12642        self
12643    }
12644
12645    /// Sets the value of [order_by][crate::model::ListVersionsRequest::order_by].
12646    ///
12647    /// # Example
12648    /// ```ignore,no_run
12649    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12650    /// let x = ListVersionsRequest::new().set_order_by("example");
12651    /// ```
12652    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12653        self.order_by = v.into();
12654        self
12655    }
12656
12657    /// Sets the value of [filter][crate::model::ListVersionsRequest::filter].
12658    ///
12659    /// # Example
12660    /// ```ignore,no_run
12661    /// # use google_cloud_artifactregistry_v1::model::ListVersionsRequest;
12662    /// let x = ListVersionsRequest::new().set_filter("example");
12663    /// ```
12664    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12665        self.filter = v.into();
12666        self
12667    }
12668}
12669
12670impl wkt::message::Message for ListVersionsRequest {
12671    fn typename() -> &'static str {
12672        "type.googleapis.com/google.devtools.artifactregistry.v1.ListVersionsRequest"
12673    }
12674}
12675
12676/// The response from listing versions.
12677#[derive(Clone, Default, PartialEq)]
12678#[non_exhaustive]
12679pub struct ListVersionsResponse {
12680    /// The versions returned.
12681    pub versions: std::vec::Vec<crate::model::Version>,
12682
12683    /// The token to retrieve the next page of versions, or empty if there are no
12684    /// more versions to return.
12685    pub next_page_token: std::string::String,
12686
12687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12688}
12689
12690impl ListVersionsResponse {
12691    pub fn new() -> Self {
12692        std::default::Default::default()
12693    }
12694
12695    /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
12696    ///
12697    /// # Example
12698    /// ```ignore,no_run
12699    /// # use google_cloud_artifactregistry_v1::model::ListVersionsResponse;
12700    /// use google_cloud_artifactregistry_v1::model::Version;
12701    /// let x = ListVersionsResponse::new()
12702    ///     .set_versions([
12703    ///         Version::default()/* use setters */,
12704    ///         Version::default()/* use (different) setters */,
12705    ///     ]);
12706    /// ```
12707    pub fn set_versions<T, V>(mut self, v: T) -> Self
12708    where
12709        T: std::iter::IntoIterator<Item = V>,
12710        V: std::convert::Into<crate::model::Version>,
12711    {
12712        use std::iter::Iterator;
12713        self.versions = v.into_iter().map(|i| i.into()).collect();
12714        self
12715    }
12716
12717    /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
12718    ///
12719    /// # Example
12720    /// ```ignore,no_run
12721    /// # use google_cloud_artifactregistry_v1::model::ListVersionsResponse;
12722    /// let x = ListVersionsResponse::new().set_next_page_token("example");
12723    /// ```
12724    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12725        self.next_page_token = v.into();
12726        self
12727    }
12728}
12729
12730impl wkt::message::Message for ListVersionsResponse {
12731    fn typename() -> &'static str {
12732        "type.googleapis.com/google.devtools.artifactregistry.v1.ListVersionsResponse"
12733    }
12734}
12735
12736#[doc(hidden)]
12737impl google_cloud_gax::paginator::internal::PageableResponse for ListVersionsResponse {
12738    type PageItem = crate::model::Version;
12739
12740    fn items(self) -> std::vec::Vec<Self::PageItem> {
12741        self.versions
12742    }
12743
12744    fn next_page_token(&self) -> std::string::String {
12745        use std::clone::Clone;
12746        self.next_page_token.clone()
12747    }
12748}
12749
12750/// The request to retrieve a version.
12751#[derive(Clone, Default, PartialEq)]
12752#[non_exhaustive]
12753pub struct GetVersionRequest {
12754    /// The name of the version to retrieve.
12755    pub name: std::string::String,
12756
12757    /// The view that should be returned in the response.
12758    pub view: crate::model::VersionView,
12759
12760    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12761}
12762
12763impl GetVersionRequest {
12764    pub fn new() -> Self {
12765        std::default::Default::default()
12766    }
12767
12768    /// Sets the value of [name][crate::model::GetVersionRequest::name].
12769    ///
12770    /// # Example
12771    /// ```ignore,no_run
12772    /// # use google_cloud_artifactregistry_v1::model::GetVersionRequest;
12773    /// let x = GetVersionRequest::new().set_name("example");
12774    /// ```
12775    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12776        self.name = v.into();
12777        self
12778    }
12779
12780    /// Sets the value of [view][crate::model::GetVersionRequest::view].
12781    ///
12782    /// # Example
12783    /// ```ignore,no_run
12784    /// # use google_cloud_artifactregistry_v1::model::GetVersionRequest;
12785    /// use google_cloud_artifactregistry_v1::model::VersionView;
12786    /// let x0 = GetVersionRequest::new().set_view(VersionView::Basic);
12787    /// let x1 = GetVersionRequest::new().set_view(VersionView::Full);
12788    /// ```
12789    pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
12790        self.view = v.into();
12791        self
12792    }
12793}
12794
12795impl wkt::message::Message for GetVersionRequest {
12796    fn typename() -> &'static str {
12797        "type.googleapis.com/google.devtools.artifactregistry.v1.GetVersionRequest"
12798    }
12799}
12800
12801/// The request to delete a version.
12802#[derive(Clone, Default, PartialEq)]
12803#[non_exhaustive]
12804pub struct DeleteVersionRequest {
12805    /// The name of the version to delete.
12806    pub name: std::string::String,
12807
12808    /// By default, a version that is tagged may not be deleted. If force=true, the
12809    /// version and any tags pointing to the version are deleted.
12810    pub force: bool,
12811
12812    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12813}
12814
12815impl DeleteVersionRequest {
12816    pub fn new() -> Self {
12817        std::default::Default::default()
12818    }
12819
12820    /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
12821    ///
12822    /// # Example
12823    /// ```ignore,no_run
12824    /// # use google_cloud_artifactregistry_v1::model::DeleteVersionRequest;
12825    /// let x = DeleteVersionRequest::new().set_name("example");
12826    /// ```
12827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12828        self.name = v.into();
12829        self
12830    }
12831
12832    /// Sets the value of [force][crate::model::DeleteVersionRequest::force].
12833    ///
12834    /// # Example
12835    /// ```ignore,no_run
12836    /// # use google_cloud_artifactregistry_v1::model::DeleteVersionRequest;
12837    /// let x = DeleteVersionRequest::new().set_force(true);
12838    /// ```
12839    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12840        self.force = v.into();
12841        self
12842    }
12843}
12844
12845impl wkt::message::Message for DeleteVersionRequest {
12846    fn typename() -> &'static str {
12847        "type.googleapis.com/google.devtools.artifactregistry.v1.DeleteVersionRequest"
12848    }
12849}
12850
12851/// The request to delete multiple versions across a repository.
12852#[derive(Clone, Default, PartialEq)]
12853#[non_exhaustive]
12854pub struct BatchDeleteVersionsRequest {
12855    /// The name of the repository holding all requested versions.
12856    pub parent: std::string::String,
12857
12858    /// Required. The names of the versions to delete.
12859    /// The maximum number of versions deleted per batch is determined by the
12860    /// service and is dependent on the available resources in the region.
12861    pub names: std::vec::Vec<std::string::String>,
12862
12863    /// If true, the request is performed without deleting data, following AIP-163.
12864    pub validate_only: bool,
12865
12866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12867}
12868
12869impl BatchDeleteVersionsRequest {
12870    pub fn new() -> Self {
12871        std::default::Default::default()
12872    }
12873
12874    /// Sets the value of [parent][crate::model::BatchDeleteVersionsRequest::parent].
12875    ///
12876    /// # Example
12877    /// ```ignore,no_run
12878    /// # use google_cloud_artifactregistry_v1::model::BatchDeleteVersionsRequest;
12879    /// let x = BatchDeleteVersionsRequest::new().set_parent("example");
12880    /// ```
12881    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12882        self.parent = v.into();
12883        self
12884    }
12885
12886    /// Sets the value of [names][crate::model::BatchDeleteVersionsRequest::names].
12887    ///
12888    /// # Example
12889    /// ```ignore,no_run
12890    /// # use google_cloud_artifactregistry_v1::model::BatchDeleteVersionsRequest;
12891    /// let x = BatchDeleteVersionsRequest::new().set_names(["a", "b", "c"]);
12892    /// ```
12893    pub fn set_names<T, V>(mut self, v: T) -> Self
12894    where
12895        T: std::iter::IntoIterator<Item = V>,
12896        V: std::convert::Into<std::string::String>,
12897    {
12898        use std::iter::Iterator;
12899        self.names = v.into_iter().map(|i| i.into()).collect();
12900        self
12901    }
12902
12903    /// Sets the value of [validate_only][crate::model::BatchDeleteVersionsRequest::validate_only].
12904    ///
12905    /// # Example
12906    /// ```ignore,no_run
12907    /// # use google_cloud_artifactregistry_v1::model::BatchDeleteVersionsRequest;
12908    /// let x = BatchDeleteVersionsRequest::new().set_validate_only(true);
12909    /// ```
12910    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12911        self.validate_only = v.into();
12912        self
12913    }
12914}
12915
12916impl wkt::message::Message for BatchDeleteVersionsRequest {
12917    fn typename() -> &'static str {
12918        "type.googleapis.com/google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest"
12919    }
12920}
12921
12922/// The metadata of an LRO from deleting multiple versions.
12923#[derive(Clone, Default, PartialEq)]
12924#[non_exhaustive]
12925pub struct BatchDeleteVersionsMetadata {
12926    /// The versions the operation failed to delete.
12927    pub failed_versions: std::vec::Vec<std::string::String>,
12928
12929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12930}
12931
12932impl BatchDeleteVersionsMetadata {
12933    pub fn new() -> Self {
12934        std::default::Default::default()
12935    }
12936
12937    /// Sets the value of [failed_versions][crate::model::BatchDeleteVersionsMetadata::failed_versions].
12938    ///
12939    /// # Example
12940    /// ```ignore,no_run
12941    /// # use google_cloud_artifactregistry_v1::model::BatchDeleteVersionsMetadata;
12942    /// let x = BatchDeleteVersionsMetadata::new().set_failed_versions(["a", "b", "c"]);
12943    /// ```
12944    pub fn set_failed_versions<T, V>(mut self, v: T) -> Self
12945    where
12946        T: std::iter::IntoIterator<Item = V>,
12947        V: std::convert::Into<std::string::String>,
12948    {
12949        use std::iter::Iterator;
12950        self.failed_versions = v.into_iter().map(|i| i.into()).collect();
12951        self
12952    }
12953}
12954
12955impl wkt::message::Message for BatchDeleteVersionsMetadata {
12956    fn typename() -> &'static str {
12957        "type.googleapis.com/google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadata"
12958    }
12959}
12960
12961/// The request to update a version.
12962#[derive(Clone, Default, PartialEq)]
12963#[non_exhaustive]
12964pub struct UpdateVersionRequest {
12965    /// Required. The Version that replaces the resource on the server.
12966    pub version: std::option::Option<crate::model::Version>,
12967
12968    /// The update mask applies to the resource. For the `FieldMask` definition,
12969    /// see
12970    /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>
12971    pub update_mask: std::option::Option<wkt::FieldMask>,
12972
12973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12974}
12975
12976impl UpdateVersionRequest {
12977    pub fn new() -> Self {
12978        std::default::Default::default()
12979    }
12980
12981    /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
12982    ///
12983    /// # Example
12984    /// ```ignore,no_run
12985    /// # use google_cloud_artifactregistry_v1::model::UpdateVersionRequest;
12986    /// use google_cloud_artifactregistry_v1::model::Version;
12987    /// let x = UpdateVersionRequest::new().set_version(Version::default()/* use setters */);
12988    /// ```
12989    pub fn set_version<T>(mut self, v: T) -> Self
12990    where
12991        T: std::convert::Into<crate::model::Version>,
12992    {
12993        self.version = std::option::Option::Some(v.into());
12994        self
12995    }
12996
12997    /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
12998    ///
12999    /// # Example
13000    /// ```ignore,no_run
13001    /// # use google_cloud_artifactregistry_v1::model::UpdateVersionRequest;
13002    /// use google_cloud_artifactregistry_v1::model::Version;
13003    /// let x = UpdateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
13004    /// let x = UpdateVersionRequest::new().set_or_clear_version(None::<Version>);
13005    /// ```
13006    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
13007    where
13008        T: std::convert::Into<crate::model::Version>,
13009    {
13010        self.version = v.map(|x| x.into());
13011        self
13012    }
13013
13014    /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
13015    ///
13016    /// # Example
13017    /// ```ignore,no_run
13018    /// # use google_cloud_artifactregistry_v1::model::UpdateVersionRequest;
13019    /// use wkt::FieldMask;
13020    /// let x = UpdateVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13021    /// ```
13022    pub fn set_update_mask<T>(mut self, v: T) -> Self
13023    where
13024        T: std::convert::Into<wkt::FieldMask>,
13025    {
13026        self.update_mask = std::option::Option::Some(v.into());
13027        self
13028    }
13029
13030    /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
13031    ///
13032    /// # Example
13033    /// ```ignore,no_run
13034    /// # use google_cloud_artifactregistry_v1::model::UpdateVersionRequest;
13035    /// use wkt::FieldMask;
13036    /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13037    /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13038    /// ```
13039    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13040    where
13041        T: std::convert::Into<wkt::FieldMask>,
13042    {
13043        self.update_mask = v.map(|x| x.into());
13044        self
13045    }
13046}
13047
13048impl wkt::message::Message for UpdateVersionRequest {
13049    fn typename() -> &'static str {
13050        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateVersionRequest"
13051    }
13052}
13053
13054/// The Artifact Registry VPC SC config that apply to a Project.
13055#[derive(Clone, Default, PartialEq)]
13056#[non_exhaustive]
13057pub struct VPCSCConfig {
13058    /// The name of the project's VPC SC Config.
13059    ///
13060    /// Always of the form:
13061    /// projects/{projectID}/locations/{location}/vpcscConfig
13062    ///
13063    /// In update request: never set
13064    /// In response: always set
13065    pub name: std::string::String,
13066
13067    /// The project per location VPC SC policy that defines the VPC SC behavior for
13068    /// the Remote Repository (Allow/Deny).
13069    pub vpcsc_policy: crate::model::vpcsc_config::VPCSCPolicy,
13070
13071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13072}
13073
13074impl VPCSCConfig {
13075    pub fn new() -> Self {
13076        std::default::Default::default()
13077    }
13078
13079    /// Sets the value of [name][crate::model::VPCSCConfig::name].
13080    ///
13081    /// # Example
13082    /// ```ignore,no_run
13083    /// # use google_cloud_artifactregistry_v1::model::VPCSCConfig;
13084    /// let x = VPCSCConfig::new().set_name("example");
13085    /// ```
13086    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13087        self.name = v.into();
13088        self
13089    }
13090
13091    /// Sets the value of [vpcsc_policy][crate::model::VPCSCConfig::vpcsc_policy].
13092    ///
13093    /// # Example
13094    /// ```ignore,no_run
13095    /// # use google_cloud_artifactregistry_v1::model::VPCSCConfig;
13096    /// use google_cloud_artifactregistry_v1::model::vpcsc_config::VPCSCPolicy;
13097    /// let x0 = VPCSCConfig::new().set_vpcsc_policy(VPCSCPolicy::Deny);
13098    /// let x1 = VPCSCConfig::new().set_vpcsc_policy(VPCSCPolicy::Allow);
13099    /// ```
13100    pub fn set_vpcsc_policy<T: std::convert::Into<crate::model::vpcsc_config::VPCSCPolicy>>(
13101        mut self,
13102        v: T,
13103    ) -> Self {
13104        self.vpcsc_policy = v.into();
13105        self
13106    }
13107}
13108
13109impl wkt::message::Message for VPCSCConfig {
13110    fn typename() -> &'static str {
13111        "type.googleapis.com/google.devtools.artifactregistry.v1.VPCSCConfig"
13112    }
13113}
13114
13115/// Defines additional types related to [VPCSCConfig].
13116pub mod vpcsc_config {
13117    #[allow(unused_imports)]
13118    use super::*;
13119
13120    /// VPCSCPolicy is the VPC SC policy for project and location.
13121    ///
13122    /// # Working with unknown values
13123    ///
13124    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13125    /// additional enum variants at any time. Adding new variants is not considered
13126    /// a breaking change. Applications should write their code in anticipation of:
13127    ///
13128    /// - New values appearing in future releases of the client library, **and**
13129    /// - New values received dynamically, without application changes.
13130    ///
13131    /// Please consult the [Working with enums] section in the user guide for some
13132    /// guidelines.
13133    ///
13134    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13135    #[derive(Clone, Debug, PartialEq)]
13136    #[non_exhaustive]
13137    pub enum VPCSCPolicy {
13138        /// VPCSC_POLICY_UNSPECIFIED - the VPS SC policy is not defined.
13139        /// When VPS SC policy is not defined - the Service will use the default
13140        /// behavior (VPCSC_DENY).
13141        Unspecified,
13142        /// VPCSC_DENY - repository will block the requests to the Upstreams for the
13143        /// Remote Repositories if the resource is in the perimeter.
13144        Deny,
13145        /// VPCSC_ALLOW - repository will allow the requests to the Upstreams for the
13146        /// Remote Repositories if the resource is in the perimeter.
13147        Allow,
13148        /// If set, the enum was initialized with an unknown value.
13149        ///
13150        /// Applications can examine the value using [VPCSCPolicy::value] or
13151        /// [VPCSCPolicy::name].
13152        UnknownValue(vpcsc_policy::UnknownValue),
13153    }
13154
13155    #[doc(hidden)]
13156    pub mod vpcsc_policy {
13157        #[allow(unused_imports)]
13158        use super::*;
13159        #[derive(Clone, Debug, PartialEq)]
13160        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13161    }
13162
13163    impl VPCSCPolicy {
13164        /// Gets the enum value.
13165        ///
13166        /// Returns `None` if the enum contains an unknown value deserialized from
13167        /// the string representation of enums.
13168        pub fn value(&self) -> std::option::Option<i32> {
13169            match self {
13170                Self::Unspecified => std::option::Option::Some(0),
13171                Self::Deny => std::option::Option::Some(1),
13172                Self::Allow => std::option::Option::Some(2),
13173                Self::UnknownValue(u) => u.0.value(),
13174            }
13175        }
13176
13177        /// Gets the enum value as a string.
13178        ///
13179        /// Returns `None` if the enum contains an unknown value deserialized from
13180        /// the integer representation of enums.
13181        pub fn name(&self) -> std::option::Option<&str> {
13182            match self {
13183                Self::Unspecified => std::option::Option::Some("VPCSC_POLICY_UNSPECIFIED"),
13184                Self::Deny => std::option::Option::Some("DENY"),
13185                Self::Allow => std::option::Option::Some("ALLOW"),
13186                Self::UnknownValue(u) => u.0.name(),
13187            }
13188        }
13189    }
13190
13191    impl std::default::Default for VPCSCPolicy {
13192        fn default() -> Self {
13193            use std::convert::From;
13194            Self::from(0)
13195        }
13196    }
13197
13198    impl std::fmt::Display for VPCSCPolicy {
13199        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13200            wkt::internal::display_enum(f, self.name(), self.value())
13201        }
13202    }
13203
13204    impl std::convert::From<i32> for VPCSCPolicy {
13205        fn from(value: i32) -> Self {
13206            match value {
13207                0 => Self::Unspecified,
13208                1 => Self::Deny,
13209                2 => Self::Allow,
13210                _ => Self::UnknownValue(vpcsc_policy::UnknownValue(
13211                    wkt::internal::UnknownEnumValue::Integer(value),
13212                )),
13213            }
13214        }
13215    }
13216
13217    impl std::convert::From<&str> for VPCSCPolicy {
13218        fn from(value: &str) -> Self {
13219            use std::string::ToString;
13220            match value {
13221                "VPCSC_POLICY_UNSPECIFIED" => Self::Unspecified,
13222                "DENY" => Self::Deny,
13223                "ALLOW" => Self::Allow,
13224                _ => Self::UnknownValue(vpcsc_policy::UnknownValue(
13225                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13226                )),
13227            }
13228        }
13229    }
13230
13231    impl serde::ser::Serialize for VPCSCPolicy {
13232        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13233        where
13234            S: serde::Serializer,
13235        {
13236            match self {
13237                Self::Unspecified => serializer.serialize_i32(0),
13238                Self::Deny => serializer.serialize_i32(1),
13239                Self::Allow => serializer.serialize_i32(2),
13240                Self::UnknownValue(u) => u.0.serialize(serializer),
13241            }
13242        }
13243    }
13244
13245    impl<'de> serde::de::Deserialize<'de> for VPCSCPolicy {
13246        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13247        where
13248            D: serde::Deserializer<'de>,
13249        {
13250            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VPCSCPolicy>::new(
13251                ".google.devtools.artifactregistry.v1.VPCSCConfig.VPCSCPolicy",
13252            ))
13253        }
13254    }
13255}
13256
13257/// Gets the VPC SC config for a project.
13258#[derive(Clone, Default, PartialEq)]
13259#[non_exhaustive]
13260pub struct GetVPCSCConfigRequest {
13261    /// Required. The name of the VPCSCConfig resource.
13262    pub name: std::string::String,
13263
13264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13265}
13266
13267impl GetVPCSCConfigRequest {
13268    pub fn new() -> Self {
13269        std::default::Default::default()
13270    }
13271
13272    /// Sets the value of [name][crate::model::GetVPCSCConfigRequest::name].
13273    ///
13274    /// # Example
13275    /// ```ignore,no_run
13276    /// # use google_cloud_artifactregistry_v1::model::GetVPCSCConfigRequest;
13277    /// let x = GetVPCSCConfigRequest::new().set_name("example");
13278    /// ```
13279    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13280        self.name = v.into();
13281        self
13282    }
13283}
13284
13285impl wkt::message::Message for GetVPCSCConfigRequest {
13286    fn typename() -> &'static str {
13287        "type.googleapis.com/google.devtools.artifactregistry.v1.GetVPCSCConfigRequest"
13288    }
13289}
13290
13291/// Sets the VPCSC config of the project.
13292#[derive(Clone, Default, PartialEq)]
13293#[non_exhaustive]
13294pub struct UpdateVPCSCConfigRequest {
13295    /// The project config.
13296    pub vpcsc_config: std::option::Option<crate::model::VPCSCConfig>,
13297
13298    /// Field mask to support partial updates.
13299    pub update_mask: std::option::Option<wkt::FieldMask>,
13300
13301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13302}
13303
13304impl UpdateVPCSCConfigRequest {
13305    pub fn new() -> Self {
13306        std::default::Default::default()
13307    }
13308
13309    /// Sets the value of [vpcsc_config][crate::model::UpdateVPCSCConfigRequest::vpcsc_config].
13310    ///
13311    /// # Example
13312    /// ```ignore,no_run
13313    /// # use google_cloud_artifactregistry_v1::model::UpdateVPCSCConfigRequest;
13314    /// use google_cloud_artifactregistry_v1::model::VPCSCConfig;
13315    /// let x = UpdateVPCSCConfigRequest::new().set_vpcsc_config(VPCSCConfig::default()/* use setters */);
13316    /// ```
13317    pub fn set_vpcsc_config<T>(mut self, v: T) -> Self
13318    where
13319        T: std::convert::Into<crate::model::VPCSCConfig>,
13320    {
13321        self.vpcsc_config = std::option::Option::Some(v.into());
13322        self
13323    }
13324
13325    /// Sets or clears the value of [vpcsc_config][crate::model::UpdateVPCSCConfigRequest::vpcsc_config].
13326    ///
13327    /// # Example
13328    /// ```ignore,no_run
13329    /// # use google_cloud_artifactregistry_v1::model::UpdateVPCSCConfigRequest;
13330    /// use google_cloud_artifactregistry_v1::model::VPCSCConfig;
13331    /// let x = UpdateVPCSCConfigRequest::new().set_or_clear_vpcsc_config(Some(VPCSCConfig::default()/* use setters */));
13332    /// let x = UpdateVPCSCConfigRequest::new().set_or_clear_vpcsc_config(None::<VPCSCConfig>);
13333    /// ```
13334    pub fn set_or_clear_vpcsc_config<T>(mut self, v: std::option::Option<T>) -> Self
13335    where
13336        T: std::convert::Into<crate::model::VPCSCConfig>,
13337    {
13338        self.vpcsc_config = v.map(|x| x.into());
13339        self
13340    }
13341
13342    /// Sets the value of [update_mask][crate::model::UpdateVPCSCConfigRequest::update_mask].
13343    ///
13344    /// # Example
13345    /// ```ignore,no_run
13346    /// # use google_cloud_artifactregistry_v1::model::UpdateVPCSCConfigRequest;
13347    /// use wkt::FieldMask;
13348    /// let x = UpdateVPCSCConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13349    /// ```
13350    pub fn set_update_mask<T>(mut self, v: T) -> Self
13351    where
13352        T: std::convert::Into<wkt::FieldMask>,
13353    {
13354        self.update_mask = std::option::Option::Some(v.into());
13355        self
13356    }
13357
13358    /// Sets or clears the value of [update_mask][crate::model::UpdateVPCSCConfigRequest::update_mask].
13359    ///
13360    /// # Example
13361    /// ```ignore,no_run
13362    /// # use google_cloud_artifactregistry_v1::model::UpdateVPCSCConfigRequest;
13363    /// use wkt::FieldMask;
13364    /// let x = UpdateVPCSCConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13365    /// let x = UpdateVPCSCConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13366    /// ```
13367    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13368    where
13369        T: std::convert::Into<wkt::FieldMask>,
13370    {
13371        self.update_mask = v.map(|x| x.into());
13372        self
13373    }
13374}
13375
13376impl wkt::message::Message for UpdateVPCSCConfigRequest {
13377    fn typename() -> &'static str {
13378        "type.googleapis.com/google.devtools.artifactregistry.v1.UpdateVPCSCConfigRequest"
13379    }
13380}
13381
13382/// A detailed representation of a Yum artifact.
13383#[derive(Clone, Default, PartialEq)]
13384#[non_exhaustive]
13385pub struct YumArtifact {
13386    /// Output only. The Artifact Registry resource name of the artifact.
13387    pub name: std::string::String,
13388
13389    /// Output only. The yum package name of the artifact.
13390    pub package_name: std::string::String,
13391
13392    /// Output only. An artifact is a binary or source package.
13393    pub package_type: crate::model::yum_artifact::PackageType,
13394
13395    /// Output only. Operating system architecture of the artifact.
13396    pub architecture: std::string::String,
13397
13398    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13399}
13400
13401impl YumArtifact {
13402    pub fn new() -> Self {
13403        std::default::Default::default()
13404    }
13405
13406    /// Sets the value of [name][crate::model::YumArtifact::name].
13407    ///
13408    /// # Example
13409    /// ```ignore,no_run
13410    /// # use google_cloud_artifactregistry_v1::model::YumArtifact;
13411    /// let x = YumArtifact::new().set_name("example");
13412    /// ```
13413    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13414        self.name = v.into();
13415        self
13416    }
13417
13418    /// Sets the value of [package_name][crate::model::YumArtifact::package_name].
13419    ///
13420    /// # Example
13421    /// ```ignore,no_run
13422    /// # use google_cloud_artifactregistry_v1::model::YumArtifact;
13423    /// let x = YumArtifact::new().set_package_name("example");
13424    /// ```
13425    pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13426        self.package_name = v.into();
13427        self
13428    }
13429
13430    /// Sets the value of [package_type][crate::model::YumArtifact::package_type].
13431    ///
13432    /// # Example
13433    /// ```ignore,no_run
13434    /// # use google_cloud_artifactregistry_v1::model::YumArtifact;
13435    /// use google_cloud_artifactregistry_v1::model::yum_artifact::PackageType;
13436    /// let x0 = YumArtifact::new().set_package_type(PackageType::Binary);
13437    /// let x1 = YumArtifact::new().set_package_type(PackageType::Source);
13438    /// ```
13439    pub fn set_package_type<T: std::convert::Into<crate::model::yum_artifact::PackageType>>(
13440        mut self,
13441        v: T,
13442    ) -> Self {
13443        self.package_type = v.into();
13444        self
13445    }
13446
13447    /// Sets the value of [architecture][crate::model::YumArtifact::architecture].
13448    ///
13449    /// # Example
13450    /// ```ignore,no_run
13451    /// # use google_cloud_artifactregistry_v1::model::YumArtifact;
13452    /// let x = YumArtifact::new().set_architecture("example");
13453    /// ```
13454    pub fn set_architecture<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13455        self.architecture = v.into();
13456        self
13457    }
13458}
13459
13460impl wkt::message::Message for YumArtifact {
13461    fn typename() -> &'static str {
13462        "type.googleapis.com/google.devtools.artifactregistry.v1.YumArtifact"
13463    }
13464}
13465
13466/// Defines additional types related to [YumArtifact].
13467pub mod yum_artifact {
13468    #[allow(unused_imports)]
13469    use super::*;
13470
13471    /// Package type is either binary or source.
13472    ///
13473    /// # Working with unknown values
13474    ///
13475    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13476    /// additional enum variants at any time. Adding new variants is not considered
13477    /// a breaking change. Applications should write their code in anticipation of:
13478    ///
13479    /// - New values appearing in future releases of the client library, **and**
13480    /// - New values received dynamically, without application changes.
13481    ///
13482    /// Please consult the [Working with enums] section in the user guide for some
13483    /// guidelines.
13484    ///
13485    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13486    #[derive(Clone, Debug, PartialEq)]
13487    #[non_exhaustive]
13488    pub enum PackageType {
13489        /// Package type is not specified.
13490        Unspecified,
13491        /// Binary package (.rpm).
13492        Binary,
13493        /// Source package (.srpm).
13494        Source,
13495        /// If set, the enum was initialized with an unknown value.
13496        ///
13497        /// Applications can examine the value using [PackageType::value] or
13498        /// [PackageType::name].
13499        UnknownValue(package_type::UnknownValue),
13500    }
13501
13502    #[doc(hidden)]
13503    pub mod package_type {
13504        #[allow(unused_imports)]
13505        use super::*;
13506        #[derive(Clone, Debug, PartialEq)]
13507        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13508    }
13509
13510    impl PackageType {
13511        /// Gets the enum value.
13512        ///
13513        /// Returns `None` if the enum contains an unknown value deserialized from
13514        /// the string representation of enums.
13515        pub fn value(&self) -> std::option::Option<i32> {
13516            match self {
13517                Self::Unspecified => std::option::Option::Some(0),
13518                Self::Binary => std::option::Option::Some(1),
13519                Self::Source => std::option::Option::Some(2),
13520                Self::UnknownValue(u) => u.0.value(),
13521            }
13522        }
13523
13524        /// Gets the enum value as a string.
13525        ///
13526        /// Returns `None` if the enum contains an unknown value deserialized from
13527        /// the integer representation of enums.
13528        pub fn name(&self) -> std::option::Option<&str> {
13529            match self {
13530                Self::Unspecified => std::option::Option::Some("PACKAGE_TYPE_UNSPECIFIED"),
13531                Self::Binary => std::option::Option::Some("BINARY"),
13532                Self::Source => std::option::Option::Some("SOURCE"),
13533                Self::UnknownValue(u) => u.0.name(),
13534            }
13535        }
13536    }
13537
13538    impl std::default::Default for PackageType {
13539        fn default() -> Self {
13540            use std::convert::From;
13541            Self::from(0)
13542        }
13543    }
13544
13545    impl std::fmt::Display for PackageType {
13546        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13547            wkt::internal::display_enum(f, self.name(), self.value())
13548        }
13549    }
13550
13551    impl std::convert::From<i32> for PackageType {
13552        fn from(value: i32) -> Self {
13553            match value {
13554                0 => Self::Unspecified,
13555                1 => Self::Binary,
13556                2 => Self::Source,
13557                _ => Self::UnknownValue(package_type::UnknownValue(
13558                    wkt::internal::UnknownEnumValue::Integer(value),
13559                )),
13560            }
13561        }
13562    }
13563
13564    impl std::convert::From<&str> for PackageType {
13565        fn from(value: &str) -> Self {
13566            use std::string::ToString;
13567            match value {
13568                "PACKAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
13569                "BINARY" => Self::Binary,
13570                "SOURCE" => Self::Source,
13571                _ => Self::UnknownValue(package_type::UnknownValue(
13572                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13573                )),
13574            }
13575        }
13576    }
13577
13578    impl serde::ser::Serialize for PackageType {
13579        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13580        where
13581            S: serde::Serializer,
13582        {
13583            match self {
13584                Self::Unspecified => serializer.serialize_i32(0),
13585                Self::Binary => serializer.serialize_i32(1),
13586                Self::Source => serializer.serialize_i32(2),
13587                Self::UnknownValue(u) => u.0.serialize(serializer),
13588            }
13589        }
13590    }
13591
13592    impl<'de> serde::de::Deserialize<'de> for PackageType {
13593        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13594        where
13595            D: serde::Deserializer<'de>,
13596        {
13597            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PackageType>::new(
13598                ".google.devtools.artifactregistry.v1.YumArtifact.PackageType",
13599            ))
13600        }
13601    }
13602}
13603
13604/// Google Cloud Storage location where the artifacts currently reside.
13605#[derive(Clone, Default, PartialEq)]
13606#[non_exhaustive]
13607pub struct ImportYumArtifactsGcsSource {
13608    /// Cloud Storage paths URI (e.g., gs://my_bucket//my_object).
13609    pub uris: std::vec::Vec<std::string::String>,
13610
13611    /// Supports URI wildcards for matching multiple objects from a single URI.
13612    pub use_wildcards: bool,
13613
13614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13615}
13616
13617impl ImportYumArtifactsGcsSource {
13618    pub fn new() -> Self {
13619        std::default::Default::default()
13620    }
13621
13622    /// Sets the value of [uris][crate::model::ImportYumArtifactsGcsSource::uris].
13623    ///
13624    /// # Example
13625    /// ```ignore,no_run
13626    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13627    /// let x = ImportYumArtifactsGcsSource::new().set_uris(["a", "b", "c"]);
13628    /// ```
13629    pub fn set_uris<T, V>(mut self, v: T) -> Self
13630    where
13631        T: std::iter::IntoIterator<Item = V>,
13632        V: std::convert::Into<std::string::String>,
13633    {
13634        use std::iter::Iterator;
13635        self.uris = v.into_iter().map(|i| i.into()).collect();
13636        self
13637    }
13638
13639    /// Sets the value of [use_wildcards][crate::model::ImportYumArtifactsGcsSource::use_wildcards].
13640    ///
13641    /// # Example
13642    /// ```ignore,no_run
13643    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13644    /// let x = ImportYumArtifactsGcsSource::new().set_use_wildcards(true);
13645    /// ```
13646    pub fn set_use_wildcards<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13647        self.use_wildcards = v.into();
13648        self
13649    }
13650}
13651
13652impl wkt::message::Message for ImportYumArtifactsGcsSource {
13653    fn typename() -> &'static str {
13654        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportYumArtifactsGcsSource"
13655    }
13656}
13657
13658/// The request to import new yum artifacts.
13659#[derive(Clone, Default, PartialEq)]
13660#[non_exhaustive]
13661pub struct ImportYumArtifactsRequest {
13662    /// The name of the parent resource where the artifacts will be imported.
13663    pub parent: std::string::String,
13664
13665    /// The source location of the package binaries.
13666    pub source: std::option::Option<crate::model::import_yum_artifacts_request::Source>,
13667
13668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13669}
13670
13671impl ImportYumArtifactsRequest {
13672    pub fn new() -> Self {
13673        std::default::Default::default()
13674    }
13675
13676    /// Sets the value of [parent][crate::model::ImportYumArtifactsRequest::parent].
13677    ///
13678    /// # Example
13679    /// ```ignore,no_run
13680    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsRequest;
13681    /// let x = ImportYumArtifactsRequest::new().set_parent("example");
13682    /// ```
13683    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13684        self.parent = v.into();
13685        self
13686    }
13687
13688    /// Sets the value of [source][crate::model::ImportYumArtifactsRequest::source].
13689    ///
13690    /// Note that all the setters affecting `source` are mutually
13691    /// exclusive.
13692    ///
13693    /// # Example
13694    /// ```ignore,no_run
13695    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsRequest;
13696    /// use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13697    /// let x = ImportYumArtifactsRequest::new().set_source(Some(
13698    ///     google_cloud_artifactregistry_v1::model::import_yum_artifacts_request::Source::GcsSource(ImportYumArtifactsGcsSource::default().into())));
13699    /// ```
13700    pub fn set_source<
13701        T: std::convert::Into<std::option::Option<crate::model::import_yum_artifacts_request::Source>>,
13702    >(
13703        mut self,
13704        v: T,
13705    ) -> Self {
13706        self.source = v.into();
13707        self
13708    }
13709
13710    /// The value of [source][crate::model::ImportYumArtifactsRequest::source]
13711    /// if it holds a `GcsSource`, `None` if the field is not set or
13712    /// holds a different branch.
13713    pub fn gcs_source(
13714        &self,
13715    ) -> std::option::Option<&std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>> {
13716        #[allow(unreachable_patterns)]
13717        self.source.as_ref().and_then(|v| match v {
13718            crate::model::import_yum_artifacts_request::Source::GcsSource(v) => {
13719                std::option::Option::Some(v)
13720            }
13721            _ => std::option::Option::None,
13722        })
13723    }
13724
13725    /// Sets the value of [source][crate::model::ImportYumArtifactsRequest::source]
13726    /// to hold a `GcsSource`.
13727    ///
13728    /// Note that all the setters affecting `source` are
13729    /// mutually exclusive.
13730    ///
13731    /// # Example
13732    /// ```ignore,no_run
13733    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsRequest;
13734    /// use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13735    /// let x = ImportYumArtifactsRequest::new().set_gcs_source(ImportYumArtifactsGcsSource::default()/* use setters */);
13736    /// assert!(x.gcs_source().is_some());
13737    /// ```
13738    pub fn set_gcs_source<
13739        T: std::convert::Into<std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>>,
13740    >(
13741        mut self,
13742        v: T,
13743    ) -> Self {
13744        self.source = std::option::Option::Some(
13745            crate::model::import_yum_artifacts_request::Source::GcsSource(v.into()),
13746        );
13747        self
13748    }
13749}
13750
13751impl wkt::message::Message for ImportYumArtifactsRequest {
13752    fn typename() -> &'static str {
13753        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportYumArtifactsRequest"
13754    }
13755}
13756
13757/// Defines additional types related to [ImportYumArtifactsRequest].
13758pub mod import_yum_artifacts_request {
13759    #[allow(unused_imports)]
13760    use super::*;
13761
13762    /// The source location of the package binaries.
13763    #[derive(Clone, Debug, PartialEq)]
13764    #[non_exhaustive]
13765    pub enum Source {
13766        /// Google Cloud Storage location where input content is located.
13767        GcsSource(std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>),
13768    }
13769}
13770
13771/// Error information explaining why a package was not imported.
13772#[derive(Clone, Default, PartialEq)]
13773#[non_exhaustive]
13774pub struct ImportYumArtifactsErrorInfo {
13775    /// The detailed error status.
13776    pub error: std::option::Option<google_cloud_rpc::model::Status>,
13777
13778    /// The source that was not imported.
13779    pub source: std::option::Option<crate::model::import_yum_artifacts_error_info::Source>,
13780
13781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13782}
13783
13784impl ImportYumArtifactsErrorInfo {
13785    pub fn new() -> Self {
13786        std::default::Default::default()
13787    }
13788
13789    /// Sets the value of [error][crate::model::ImportYumArtifactsErrorInfo::error].
13790    ///
13791    /// # Example
13792    /// ```ignore,no_run
13793    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsErrorInfo;
13794    /// use google_cloud_rpc::model::Status;
13795    /// let x = ImportYumArtifactsErrorInfo::new().set_error(Status::default()/* use setters */);
13796    /// ```
13797    pub fn set_error<T>(mut self, v: T) -> Self
13798    where
13799        T: std::convert::Into<google_cloud_rpc::model::Status>,
13800    {
13801        self.error = std::option::Option::Some(v.into());
13802        self
13803    }
13804
13805    /// Sets or clears the value of [error][crate::model::ImportYumArtifactsErrorInfo::error].
13806    ///
13807    /// # Example
13808    /// ```ignore,no_run
13809    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsErrorInfo;
13810    /// use google_cloud_rpc::model::Status;
13811    /// let x = ImportYumArtifactsErrorInfo::new().set_or_clear_error(Some(Status::default()/* use setters */));
13812    /// let x = ImportYumArtifactsErrorInfo::new().set_or_clear_error(None::<Status>);
13813    /// ```
13814    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
13815    where
13816        T: std::convert::Into<google_cloud_rpc::model::Status>,
13817    {
13818        self.error = v.map(|x| x.into());
13819        self
13820    }
13821
13822    /// Sets the value of [source][crate::model::ImportYumArtifactsErrorInfo::source].
13823    ///
13824    /// Note that all the setters affecting `source` are mutually
13825    /// exclusive.
13826    ///
13827    /// # Example
13828    /// ```ignore,no_run
13829    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsErrorInfo;
13830    /// use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13831    /// let x = ImportYumArtifactsErrorInfo::new().set_source(Some(
13832    ///     google_cloud_artifactregistry_v1::model::import_yum_artifacts_error_info::Source::GcsSource(ImportYumArtifactsGcsSource::default().into())));
13833    /// ```
13834    pub fn set_source<
13835        T: std::convert::Into<
13836                std::option::Option<crate::model::import_yum_artifacts_error_info::Source>,
13837            >,
13838    >(
13839        mut self,
13840        v: T,
13841    ) -> Self {
13842        self.source = v.into();
13843        self
13844    }
13845
13846    /// The value of [source][crate::model::ImportYumArtifactsErrorInfo::source]
13847    /// if it holds a `GcsSource`, `None` if the field is not set or
13848    /// holds a different branch.
13849    pub fn gcs_source(
13850        &self,
13851    ) -> std::option::Option<&std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>> {
13852        #[allow(unreachable_patterns)]
13853        self.source.as_ref().and_then(|v| match v {
13854            crate::model::import_yum_artifacts_error_info::Source::GcsSource(v) => {
13855                std::option::Option::Some(v)
13856            }
13857            _ => std::option::Option::None,
13858        })
13859    }
13860
13861    /// Sets the value of [source][crate::model::ImportYumArtifactsErrorInfo::source]
13862    /// to hold a `GcsSource`.
13863    ///
13864    /// Note that all the setters affecting `source` are
13865    /// mutually exclusive.
13866    ///
13867    /// # Example
13868    /// ```ignore,no_run
13869    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsErrorInfo;
13870    /// use google_cloud_artifactregistry_v1::model::ImportYumArtifactsGcsSource;
13871    /// let x = ImportYumArtifactsErrorInfo::new().set_gcs_source(ImportYumArtifactsGcsSource::default()/* use setters */);
13872    /// assert!(x.gcs_source().is_some());
13873    /// ```
13874    pub fn set_gcs_source<
13875        T: std::convert::Into<std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>>,
13876    >(
13877        mut self,
13878        v: T,
13879    ) -> Self {
13880        self.source = std::option::Option::Some(
13881            crate::model::import_yum_artifacts_error_info::Source::GcsSource(v.into()),
13882        );
13883        self
13884    }
13885}
13886
13887impl wkt::message::Message for ImportYumArtifactsErrorInfo {
13888    fn typename() -> &'static str {
13889        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportYumArtifactsErrorInfo"
13890    }
13891}
13892
13893/// Defines additional types related to [ImportYumArtifactsErrorInfo].
13894pub mod import_yum_artifacts_error_info {
13895    #[allow(unused_imports)]
13896    use super::*;
13897
13898    /// The source that was not imported.
13899    #[derive(Clone, Debug, PartialEq)]
13900    #[non_exhaustive]
13901    pub enum Source {
13902        /// Google Cloud Storage location requested.
13903        GcsSource(std::boxed::Box<crate::model::ImportYumArtifactsGcsSource>),
13904    }
13905}
13906
13907/// The response message from importing YUM artifacts.
13908#[derive(Clone, Default, PartialEq)]
13909#[non_exhaustive]
13910pub struct ImportYumArtifactsResponse {
13911    /// The yum artifacts imported.
13912    pub yum_artifacts: std::vec::Vec<crate::model::YumArtifact>,
13913
13914    /// Detailed error info for packages that were not imported.
13915    pub errors: std::vec::Vec<crate::model::ImportYumArtifactsErrorInfo>,
13916
13917    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13918}
13919
13920impl ImportYumArtifactsResponse {
13921    pub fn new() -> Self {
13922        std::default::Default::default()
13923    }
13924
13925    /// Sets the value of [yum_artifacts][crate::model::ImportYumArtifactsResponse::yum_artifacts].
13926    ///
13927    /// # Example
13928    /// ```ignore,no_run
13929    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsResponse;
13930    /// use google_cloud_artifactregistry_v1::model::YumArtifact;
13931    /// let x = ImportYumArtifactsResponse::new()
13932    ///     .set_yum_artifacts([
13933    ///         YumArtifact::default()/* use setters */,
13934    ///         YumArtifact::default()/* use (different) setters */,
13935    ///     ]);
13936    /// ```
13937    pub fn set_yum_artifacts<T, V>(mut self, v: T) -> Self
13938    where
13939        T: std::iter::IntoIterator<Item = V>,
13940        V: std::convert::Into<crate::model::YumArtifact>,
13941    {
13942        use std::iter::Iterator;
13943        self.yum_artifacts = v.into_iter().map(|i| i.into()).collect();
13944        self
13945    }
13946
13947    /// Sets the value of [errors][crate::model::ImportYumArtifactsResponse::errors].
13948    ///
13949    /// # Example
13950    /// ```ignore,no_run
13951    /// # use google_cloud_artifactregistry_v1::model::ImportYumArtifactsResponse;
13952    /// use google_cloud_artifactregistry_v1::model::ImportYumArtifactsErrorInfo;
13953    /// let x = ImportYumArtifactsResponse::new()
13954    ///     .set_errors([
13955    ///         ImportYumArtifactsErrorInfo::default()/* use setters */,
13956    ///         ImportYumArtifactsErrorInfo::default()/* use (different) setters */,
13957    ///     ]);
13958    /// ```
13959    pub fn set_errors<T, V>(mut self, v: T) -> Self
13960    where
13961        T: std::iter::IntoIterator<Item = V>,
13962        V: std::convert::Into<crate::model::ImportYumArtifactsErrorInfo>,
13963    {
13964        use std::iter::Iterator;
13965        self.errors = v.into_iter().map(|i| i.into()).collect();
13966        self
13967    }
13968}
13969
13970impl wkt::message::Message for ImportYumArtifactsResponse {
13971    fn typename() -> &'static str {
13972        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportYumArtifactsResponse"
13973    }
13974}
13975
13976/// The operation metadata for importing artifacts.
13977#[derive(Clone, Default, PartialEq)]
13978#[non_exhaustive]
13979pub struct ImportYumArtifactsMetadata {
13980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13981}
13982
13983impl ImportYumArtifactsMetadata {
13984    pub fn new() -> Self {
13985        std::default::Default::default()
13986    }
13987}
13988
13989impl wkt::message::Message for ImportYumArtifactsMetadata {
13990    fn typename() -> &'static str {
13991        "type.googleapis.com/google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata"
13992    }
13993}
13994
13995/// The view, which determines what version information is returned in a
13996/// response.
13997///
13998/// # Working with unknown values
13999///
14000/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14001/// additional enum variants at any time. Adding new variants is not considered
14002/// a breaking change. Applications should write their code in anticipation of:
14003///
14004/// - New values appearing in future releases of the client library, **and**
14005/// - New values received dynamically, without application changes.
14006///
14007/// Please consult the [Working with enums] section in the user guide for some
14008/// guidelines.
14009///
14010/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14011#[derive(Clone, Debug, PartialEq)]
14012#[non_exhaustive]
14013pub enum VersionView {
14014    /// The default / unset value.
14015    /// The API will default to the BASIC view.
14016    Unspecified,
14017    /// Includes basic information about the version, but not any related tags.
14018    Basic,
14019    /// Include everything.
14020    Full,
14021    /// If set, the enum was initialized with an unknown value.
14022    ///
14023    /// Applications can examine the value using [VersionView::value] or
14024    /// [VersionView::name].
14025    UnknownValue(version_view::UnknownValue),
14026}
14027
14028#[doc(hidden)]
14029pub mod version_view {
14030    #[allow(unused_imports)]
14031    use super::*;
14032    #[derive(Clone, Debug, PartialEq)]
14033    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14034}
14035
14036impl VersionView {
14037    /// Gets the enum value.
14038    ///
14039    /// Returns `None` if the enum contains an unknown value deserialized from
14040    /// the string representation of enums.
14041    pub fn value(&self) -> std::option::Option<i32> {
14042        match self {
14043            Self::Unspecified => std::option::Option::Some(0),
14044            Self::Basic => std::option::Option::Some(1),
14045            Self::Full => std::option::Option::Some(2),
14046            Self::UnknownValue(u) => u.0.value(),
14047        }
14048    }
14049
14050    /// Gets the enum value as a string.
14051    ///
14052    /// Returns `None` if the enum contains an unknown value deserialized from
14053    /// the integer representation of enums.
14054    pub fn name(&self) -> std::option::Option<&str> {
14055        match self {
14056            Self::Unspecified => std::option::Option::Some("VERSION_VIEW_UNSPECIFIED"),
14057            Self::Basic => std::option::Option::Some("BASIC"),
14058            Self::Full => std::option::Option::Some("FULL"),
14059            Self::UnknownValue(u) => u.0.name(),
14060        }
14061    }
14062}
14063
14064impl std::default::Default for VersionView {
14065    fn default() -> Self {
14066        use std::convert::From;
14067        Self::from(0)
14068    }
14069}
14070
14071impl std::fmt::Display for VersionView {
14072    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14073        wkt::internal::display_enum(f, self.name(), self.value())
14074    }
14075}
14076
14077impl std::convert::From<i32> for VersionView {
14078    fn from(value: i32) -> Self {
14079        match value {
14080            0 => Self::Unspecified,
14081            1 => Self::Basic,
14082            2 => Self::Full,
14083            _ => Self::UnknownValue(version_view::UnknownValue(
14084                wkt::internal::UnknownEnumValue::Integer(value),
14085            )),
14086        }
14087    }
14088}
14089
14090impl std::convert::From<&str> for VersionView {
14091    fn from(value: &str) -> Self {
14092        use std::string::ToString;
14093        match value {
14094            "VERSION_VIEW_UNSPECIFIED" => Self::Unspecified,
14095            "BASIC" => Self::Basic,
14096            "FULL" => Self::Full,
14097            _ => Self::UnknownValue(version_view::UnknownValue(
14098                wkt::internal::UnknownEnumValue::String(value.to_string()),
14099            )),
14100        }
14101    }
14102}
14103
14104impl serde::ser::Serialize for VersionView {
14105    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14106    where
14107        S: serde::Serializer,
14108    {
14109        match self {
14110            Self::Unspecified => serializer.serialize_i32(0),
14111            Self::Basic => serializer.serialize_i32(1),
14112            Self::Full => serializer.serialize_i32(2),
14113            Self::UnknownValue(u) => u.0.serialize(serializer),
14114        }
14115    }
14116}
14117
14118impl<'de> serde::de::Deserialize<'de> for VersionView {
14119    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14120    where
14121        D: serde::Deserializer<'de>,
14122    {
14123        deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionView>::new(
14124            ".google.devtools.artifactregistry.v1.VersionView",
14125        ))
14126    }
14127}