google_cloud_domains_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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// The `Registration` resource facilitates managing and configuring domain name
41/// registrations.
42///
43/// There are several ways to create a new `Registration` resource:
44///
45/// To create a new `Registration` resource, find a suitable domain name by
46/// calling the `SearchDomains` method with a query to see available domain name
47/// options. After choosing a name, call `RetrieveRegisterParameters` to
48/// ensure availability and obtain information like pricing, which is needed to
49/// build a call to `RegisterDomain`.
50///
51/// Another way to create a new `Registration` is to transfer an existing
52/// domain from another registrar. First, go to the current registrar to unlock
53/// the domain for transfer and retrieve the domain's transfer authorization
54/// code. Then call `RetrieveTransferParameters` to confirm that the domain is
55/// unlocked and to get values needed to build a call to `TransferDomain`.
56#[derive(Clone, Default, PartialEq)]
57#[non_exhaustive]
58pub struct Registration {
59 /// Output only. Name of the `Registration` resource, in the format
60 /// `projects/*/locations/*/registrations/<domain_name>`.
61 pub name: std::string::String,
62
63 /// Required. Immutable. The domain name. Unicode domain names must be expressed in Punycode format.
64 pub domain_name: std::string::String,
65
66 /// Output only. The creation timestamp of the `Registration` resource.
67 pub create_time: std::option::Option<wkt::Timestamp>,
68
69 /// Output only. The expiration timestamp of the `Registration`.
70 pub expire_time: std::option::Option<wkt::Timestamp>,
71
72 /// Output only. The state of the `Registration`
73 pub state: crate::model::registration::State,
74
75 /// Output only. The set of issues with the `Registration` that require attention.
76 pub issues: std::vec::Vec<crate::model::registration::Issue>,
77
78 /// Set of labels associated with the `Registration`.
79 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
80
81 /// Settings for management of the `Registration`, including renewal, billing,
82 /// and transfer. You cannot update these with the `UpdateRegistration`
83 /// method. To update these settings, use the `ConfigureManagementSettings`
84 /// method.
85 pub management_settings: std::option::Option<crate::model::ManagementSettings>,
86
87 /// Settings controlling the DNS configuration of the `Registration`. You
88 /// cannot update these with the `UpdateRegistration` method. To update these
89 /// settings, use the `ConfigureDnsSettings` method.
90 pub dns_settings: std::option::Option<crate::model::DnsSettings>,
91
92 /// Required. Settings for contact information linked to the `Registration`. You cannot
93 /// update these with the `UpdateRegistration` method. To update these
94 /// settings, use the `ConfigureContactSettings` method.
95 pub contact_settings: std::option::Option<crate::model::ContactSettings>,
96
97 /// Output only. Pending contact settings for the `Registration`. Updates to the
98 /// `contact_settings` field that change its `registrant_contact` or `privacy`
99 /// fields require email confirmation by the `registrant_contact`
100 /// before taking effect. This field is set only if there are pending updates
101 /// to the `contact_settings` that have not been confirmed. To confirm the
102 /// changes, the `registrant_contact` must follow the instructions in the
103 /// email they receive.
104 pub pending_contact_settings: std::option::Option<crate::model::ContactSettings>,
105
106 /// Output only. Set of options for the `contact_settings.privacy` field that this
107 /// `Registration` supports.
108 pub supported_privacy: std::vec::Vec<crate::model::ContactPrivacy>,
109
110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
111}
112
113impl Registration {
114 /// Creates a new default instance.
115 pub fn new() -> Self {
116 std::default::Default::default()
117 }
118
119 /// Sets the value of [name][crate::model::Registration::name].
120 ///
121 /// # Example
122 /// ```ignore,no_run
123 /// # use google_cloud_domains_v1::model::Registration;
124 /// # let project_id = "project_id";
125 /// # let location_id = "location_id";
126 /// # let registration_id = "registration_id";
127 /// let x = Registration::new().set_name(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
128 /// ```
129 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
130 self.name = v.into();
131 self
132 }
133
134 /// Sets the value of [domain_name][crate::model::Registration::domain_name].
135 ///
136 /// # Example
137 /// ```ignore,no_run
138 /// # use google_cloud_domains_v1::model::Registration;
139 /// let x = Registration::new().set_domain_name("example");
140 /// ```
141 pub fn set_domain_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142 self.domain_name = v.into();
143 self
144 }
145
146 /// Sets the value of [create_time][crate::model::Registration::create_time].
147 ///
148 /// # Example
149 /// ```ignore,no_run
150 /// # use google_cloud_domains_v1::model::Registration;
151 /// use wkt::Timestamp;
152 /// let x = Registration::new().set_create_time(Timestamp::default()/* use setters */);
153 /// ```
154 pub fn set_create_time<T>(mut self, v: T) -> Self
155 where
156 T: std::convert::Into<wkt::Timestamp>,
157 {
158 self.create_time = std::option::Option::Some(v.into());
159 self
160 }
161
162 /// Sets or clears the value of [create_time][crate::model::Registration::create_time].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_domains_v1::model::Registration;
167 /// use wkt::Timestamp;
168 /// let x = Registration::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
169 /// let x = Registration::new().set_or_clear_create_time(None::<Timestamp>);
170 /// ```
171 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
172 where
173 T: std::convert::Into<wkt::Timestamp>,
174 {
175 self.create_time = v.map(|x| x.into());
176 self
177 }
178
179 /// Sets the value of [expire_time][crate::model::Registration::expire_time].
180 ///
181 /// # Example
182 /// ```ignore,no_run
183 /// # use google_cloud_domains_v1::model::Registration;
184 /// use wkt::Timestamp;
185 /// let x = Registration::new().set_expire_time(Timestamp::default()/* use setters */);
186 /// ```
187 pub fn set_expire_time<T>(mut self, v: T) -> Self
188 where
189 T: std::convert::Into<wkt::Timestamp>,
190 {
191 self.expire_time = std::option::Option::Some(v.into());
192 self
193 }
194
195 /// Sets or clears the value of [expire_time][crate::model::Registration::expire_time].
196 ///
197 /// # Example
198 /// ```ignore,no_run
199 /// # use google_cloud_domains_v1::model::Registration;
200 /// use wkt::Timestamp;
201 /// let x = Registration::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
202 /// let x = Registration::new().set_or_clear_expire_time(None::<Timestamp>);
203 /// ```
204 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
205 where
206 T: std::convert::Into<wkt::Timestamp>,
207 {
208 self.expire_time = v.map(|x| x.into());
209 self
210 }
211
212 /// Sets the value of [state][crate::model::Registration::state].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_domains_v1::model::Registration;
217 /// use google_cloud_domains_v1::model::registration::State;
218 /// let x0 = Registration::new().set_state(State::RegistrationPending);
219 /// let x1 = Registration::new().set_state(State::RegistrationFailed);
220 /// let x2 = Registration::new().set_state(State::TransferPending);
221 /// ```
222 pub fn set_state<T: std::convert::Into<crate::model::registration::State>>(
223 mut self,
224 v: T,
225 ) -> Self {
226 self.state = v.into();
227 self
228 }
229
230 /// Sets the value of [issues][crate::model::Registration::issues].
231 ///
232 /// # Example
233 /// ```ignore,no_run
234 /// # use google_cloud_domains_v1::model::Registration;
235 /// use google_cloud_domains_v1::model::registration::Issue;
236 /// let x = Registration::new().set_issues([
237 /// Issue::ContactSupport,
238 /// Issue::UnverifiedEmail,
239 /// ]);
240 /// ```
241 pub fn set_issues<T, V>(mut self, v: T) -> Self
242 where
243 T: std::iter::IntoIterator<Item = V>,
244 V: std::convert::Into<crate::model::registration::Issue>,
245 {
246 use std::iter::Iterator;
247 self.issues = v.into_iter().map(|i| i.into()).collect();
248 self
249 }
250
251 /// Sets the value of [labels][crate::model::Registration::labels].
252 ///
253 /// # Example
254 /// ```ignore,no_run
255 /// # use google_cloud_domains_v1::model::Registration;
256 /// let x = Registration::new().set_labels([
257 /// ("key0", "abc"),
258 /// ("key1", "xyz"),
259 /// ]);
260 /// ```
261 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
262 where
263 T: std::iter::IntoIterator<Item = (K, V)>,
264 K: std::convert::Into<std::string::String>,
265 V: std::convert::Into<std::string::String>,
266 {
267 use std::iter::Iterator;
268 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
269 self
270 }
271
272 /// Sets the value of [management_settings][crate::model::Registration::management_settings].
273 ///
274 /// # Example
275 /// ```ignore,no_run
276 /// # use google_cloud_domains_v1::model::Registration;
277 /// use google_cloud_domains_v1::model::ManagementSettings;
278 /// let x = Registration::new().set_management_settings(ManagementSettings::default()/* use setters */);
279 /// ```
280 pub fn set_management_settings<T>(mut self, v: T) -> Self
281 where
282 T: std::convert::Into<crate::model::ManagementSettings>,
283 {
284 self.management_settings = std::option::Option::Some(v.into());
285 self
286 }
287
288 /// Sets or clears the value of [management_settings][crate::model::Registration::management_settings].
289 ///
290 /// # Example
291 /// ```ignore,no_run
292 /// # use google_cloud_domains_v1::model::Registration;
293 /// use google_cloud_domains_v1::model::ManagementSettings;
294 /// let x = Registration::new().set_or_clear_management_settings(Some(ManagementSettings::default()/* use setters */));
295 /// let x = Registration::new().set_or_clear_management_settings(None::<ManagementSettings>);
296 /// ```
297 pub fn set_or_clear_management_settings<T>(mut self, v: std::option::Option<T>) -> Self
298 where
299 T: std::convert::Into<crate::model::ManagementSettings>,
300 {
301 self.management_settings = v.map(|x| x.into());
302 self
303 }
304
305 /// Sets the value of [dns_settings][crate::model::Registration::dns_settings].
306 ///
307 /// # Example
308 /// ```ignore,no_run
309 /// # use google_cloud_domains_v1::model::Registration;
310 /// use google_cloud_domains_v1::model::DnsSettings;
311 /// let x = Registration::new().set_dns_settings(DnsSettings::default()/* use setters */);
312 /// ```
313 pub fn set_dns_settings<T>(mut self, v: T) -> Self
314 where
315 T: std::convert::Into<crate::model::DnsSettings>,
316 {
317 self.dns_settings = std::option::Option::Some(v.into());
318 self
319 }
320
321 /// Sets or clears the value of [dns_settings][crate::model::Registration::dns_settings].
322 ///
323 /// # Example
324 /// ```ignore,no_run
325 /// # use google_cloud_domains_v1::model::Registration;
326 /// use google_cloud_domains_v1::model::DnsSettings;
327 /// let x = Registration::new().set_or_clear_dns_settings(Some(DnsSettings::default()/* use setters */));
328 /// let x = Registration::new().set_or_clear_dns_settings(None::<DnsSettings>);
329 /// ```
330 pub fn set_or_clear_dns_settings<T>(mut self, v: std::option::Option<T>) -> Self
331 where
332 T: std::convert::Into<crate::model::DnsSettings>,
333 {
334 self.dns_settings = v.map(|x| x.into());
335 self
336 }
337
338 /// Sets the value of [contact_settings][crate::model::Registration::contact_settings].
339 ///
340 /// # Example
341 /// ```ignore,no_run
342 /// # use google_cloud_domains_v1::model::Registration;
343 /// use google_cloud_domains_v1::model::ContactSettings;
344 /// let x = Registration::new().set_contact_settings(ContactSettings::default()/* use setters */);
345 /// ```
346 pub fn set_contact_settings<T>(mut self, v: T) -> Self
347 where
348 T: std::convert::Into<crate::model::ContactSettings>,
349 {
350 self.contact_settings = std::option::Option::Some(v.into());
351 self
352 }
353
354 /// Sets or clears the value of [contact_settings][crate::model::Registration::contact_settings].
355 ///
356 /// # Example
357 /// ```ignore,no_run
358 /// # use google_cloud_domains_v1::model::Registration;
359 /// use google_cloud_domains_v1::model::ContactSettings;
360 /// let x = Registration::new().set_or_clear_contact_settings(Some(ContactSettings::default()/* use setters */));
361 /// let x = Registration::new().set_or_clear_contact_settings(None::<ContactSettings>);
362 /// ```
363 pub fn set_or_clear_contact_settings<T>(mut self, v: std::option::Option<T>) -> Self
364 where
365 T: std::convert::Into<crate::model::ContactSettings>,
366 {
367 self.contact_settings = v.map(|x| x.into());
368 self
369 }
370
371 /// Sets the value of [pending_contact_settings][crate::model::Registration::pending_contact_settings].
372 ///
373 /// # Example
374 /// ```ignore,no_run
375 /// # use google_cloud_domains_v1::model::Registration;
376 /// use google_cloud_domains_v1::model::ContactSettings;
377 /// let x = Registration::new().set_pending_contact_settings(ContactSettings::default()/* use setters */);
378 /// ```
379 pub fn set_pending_contact_settings<T>(mut self, v: T) -> Self
380 where
381 T: std::convert::Into<crate::model::ContactSettings>,
382 {
383 self.pending_contact_settings = std::option::Option::Some(v.into());
384 self
385 }
386
387 /// Sets or clears the value of [pending_contact_settings][crate::model::Registration::pending_contact_settings].
388 ///
389 /// # Example
390 /// ```ignore,no_run
391 /// # use google_cloud_domains_v1::model::Registration;
392 /// use google_cloud_domains_v1::model::ContactSettings;
393 /// let x = Registration::new().set_or_clear_pending_contact_settings(Some(ContactSettings::default()/* use setters */));
394 /// let x = Registration::new().set_or_clear_pending_contact_settings(None::<ContactSettings>);
395 /// ```
396 pub fn set_or_clear_pending_contact_settings<T>(mut self, v: std::option::Option<T>) -> Self
397 where
398 T: std::convert::Into<crate::model::ContactSettings>,
399 {
400 self.pending_contact_settings = v.map(|x| x.into());
401 self
402 }
403
404 /// Sets the value of [supported_privacy][crate::model::Registration::supported_privacy].
405 ///
406 /// # Example
407 /// ```ignore,no_run
408 /// # use google_cloud_domains_v1::model::Registration;
409 /// use google_cloud_domains_v1::model::ContactPrivacy;
410 /// let x = Registration::new().set_supported_privacy([
411 /// ContactPrivacy::PublicContactData,
412 /// ContactPrivacy::PrivateContactData,
413 /// ContactPrivacy::RedactedContactData,
414 /// ]);
415 /// ```
416 pub fn set_supported_privacy<T, V>(mut self, v: T) -> Self
417 where
418 T: std::iter::IntoIterator<Item = V>,
419 V: std::convert::Into<crate::model::ContactPrivacy>,
420 {
421 use std::iter::Iterator;
422 self.supported_privacy = v.into_iter().map(|i| i.into()).collect();
423 self
424 }
425}
426
427impl wkt::message::Message for Registration {
428 fn typename() -> &'static str {
429 "type.googleapis.com/google.cloud.domains.v1.Registration"
430 }
431}
432
433/// Defines additional types related to [Registration].
434pub mod registration {
435 #[allow(unused_imports)]
436 use super::*;
437
438 /// Possible states of a `Registration`.
439 ///
440 /// # Working with unknown values
441 ///
442 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
443 /// additional enum variants at any time. Adding new variants is not considered
444 /// a breaking change. Applications should write their code in anticipation of:
445 ///
446 /// - New values appearing in future releases of the client library, **and**
447 /// - New values received dynamically, without application changes.
448 ///
449 /// Please consult the [Working with enums] section in the user guide for some
450 /// guidelines.
451 ///
452 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
453 #[derive(Clone, Debug, PartialEq)]
454 #[non_exhaustive]
455 pub enum State {
456 /// The state is undefined.
457 Unspecified,
458 /// The domain is being registered.
459 RegistrationPending,
460 /// The domain registration failed. You can delete resources in this state
461 /// to allow registration to be retried.
462 RegistrationFailed,
463 /// The domain is being transferred from another registrar to Cloud Domains.
464 TransferPending,
465 /// The attempt to transfer the domain from another registrar to
466 /// Cloud Domains failed. You can delete resources in this state and retry
467 /// the transfer.
468 TransferFailed,
469 /// The domain is registered and operational. The domain renews automatically
470 /// as long as it remains in this state.
471 Active,
472 /// The domain is suspended and inoperative. For more details, see the
473 /// `issues` field.
474 Suspended,
475 /// The domain is no longer managed with Cloud Domains. It may have been
476 /// transferred to another registrar or exported for management in
477 /// [Google Domains](https://domains.google/). You can no longer update it
478 /// with this API, and information shown about it may be stale. Domains in
479 /// this state are not automatically renewed by Cloud Domains.
480 Exported,
481 /// If set, the enum was initialized with an unknown value.
482 ///
483 /// Applications can examine the value using [State::value] or
484 /// [State::name].
485 UnknownValue(state::UnknownValue),
486 }
487
488 #[doc(hidden)]
489 pub mod state {
490 #[allow(unused_imports)]
491 use super::*;
492 #[derive(Clone, Debug, PartialEq)]
493 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
494 }
495
496 impl State {
497 /// Gets the enum value.
498 ///
499 /// Returns `None` if the enum contains an unknown value deserialized from
500 /// the string representation of enums.
501 pub fn value(&self) -> std::option::Option<i32> {
502 match self {
503 Self::Unspecified => std::option::Option::Some(0),
504 Self::RegistrationPending => std::option::Option::Some(1),
505 Self::RegistrationFailed => std::option::Option::Some(2),
506 Self::TransferPending => std::option::Option::Some(3),
507 Self::TransferFailed => std::option::Option::Some(4),
508 Self::Active => std::option::Option::Some(6),
509 Self::Suspended => std::option::Option::Some(7),
510 Self::Exported => std::option::Option::Some(8),
511 Self::UnknownValue(u) => u.0.value(),
512 }
513 }
514
515 /// Gets the enum value as a string.
516 ///
517 /// Returns `None` if the enum contains an unknown value deserialized from
518 /// the integer representation of enums.
519 pub fn name(&self) -> std::option::Option<&str> {
520 match self {
521 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
522 Self::RegistrationPending => std::option::Option::Some("REGISTRATION_PENDING"),
523 Self::RegistrationFailed => std::option::Option::Some("REGISTRATION_FAILED"),
524 Self::TransferPending => std::option::Option::Some("TRANSFER_PENDING"),
525 Self::TransferFailed => std::option::Option::Some("TRANSFER_FAILED"),
526 Self::Active => std::option::Option::Some("ACTIVE"),
527 Self::Suspended => std::option::Option::Some("SUSPENDED"),
528 Self::Exported => std::option::Option::Some("EXPORTED"),
529 Self::UnknownValue(u) => u.0.name(),
530 }
531 }
532 }
533
534 impl std::default::Default for State {
535 fn default() -> Self {
536 use std::convert::From;
537 Self::from(0)
538 }
539 }
540
541 impl std::fmt::Display for State {
542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
543 wkt::internal::display_enum(f, self.name(), self.value())
544 }
545 }
546
547 impl std::convert::From<i32> for State {
548 fn from(value: i32) -> Self {
549 match value {
550 0 => Self::Unspecified,
551 1 => Self::RegistrationPending,
552 2 => Self::RegistrationFailed,
553 3 => Self::TransferPending,
554 4 => Self::TransferFailed,
555 6 => Self::Active,
556 7 => Self::Suspended,
557 8 => Self::Exported,
558 _ => Self::UnknownValue(state::UnknownValue(
559 wkt::internal::UnknownEnumValue::Integer(value),
560 )),
561 }
562 }
563 }
564
565 impl std::convert::From<&str> for State {
566 fn from(value: &str) -> Self {
567 use std::string::ToString;
568 match value {
569 "STATE_UNSPECIFIED" => Self::Unspecified,
570 "REGISTRATION_PENDING" => Self::RegistrationPending,
571 "REGISTRATION_FAILED" => Self::RegistrationFailed,
572 "TRANSFER_PENDING" => Self::TransferPending,
573 "TRANSFER_FAILED" => Self::TransferFailed,
574 "ACTIVE" => Self::Active,
575 "SUSPENDED" => Self::Suspended,
576 "EXPORTED" => Self::Exported,
577 _ => Self::UnknownValue(state::UnknownValue(
578 wkt::internal::UnknownEnumValue::String(value.to_string()),
579 )),
580 }
581 }
582 }
583
584 impl serde::ser::Serialize for State {
585 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
586 where
587 S: serde::Serializer,
588 {
589 match self {
590 Self::Unspecified => serializer.serialize_i32(0),
591 Self::RegistrationPending => serializer.serialize_i32(1),
592 Self::RegistrationFailed => serializer.serialize_i32(2),
593 Self::TransferPending => serializer.serialize_i32(3),
594 Self::TransferFailed => serializer.serialize_i32(4),
595 Self::Active => serializer.serialize_i32(6),
596 Self::Suspended => serializer.serialize_i32(7),
597 Self::Exported => serializer.serialize_i32(8),
598 Self::UnknownValue(u) => u.0.serialize(serializer),
599 }
600 }
601 }
602
603 impl<'de> serde::de::Deserialize<'de> for State {
604 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
605 where
606 D: serde::Deserializer<'de>,
607 {
608 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
609 ".google.cloud.domains.v1.Registration.State",
610 ))
611 }
612 }
613
614 /// Possible issues with a `Registration` that require attention.
615 ///
616 /// # Working with unknown values
617 ///
618 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
619 /// additional enum variants at any time. Adding new variants is not considered
620 /// a breaking change. Applications should write their code in anticipation of:
621 ///
622 /// - New values appearing in future releases of the client library, **and**
623 /// - New values received dynamically, without application changes.
624 ///
625 /// Please consult the [Working with enums] section in the user guide for some
626 /// guidelines.
627 ///
628 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
629 #[derive(Clone, Debug, PartialEq)]
630 #[non_exhaustive]
631 pub enum Issue {
632 /// The issue is undefined.
633 Unspecified,
634 /// Contact the Cloud Support team to resolve a problem with this domain.
635 ContactSupport,
636 /// [ICANN](https://icann.org/) requires verification of the email address
637 /// in the `Registration`'s `contact_settings.registrant_contact` field. To
638 /// verify the email address, follow the
639 /// instructions in the email the `registrant_contact` receives following
640 /// registration. If you do not complete email verification within
641 /// 15 days of registration, the domain is suspended. To resend the
642 /// verification email, call ConfigureContactSettings and provide the current
643 /// `registrant_contact.email`.
644 UnverifiedEmail,
645 /// If set, the enum was initialized with an unknown value.
646 ///
647 /// Applications can examine the value using [Issue::value] or
648 /// [Issue::name].
649 UnknownValue(issue::UnknownValue),
650 }
651
652 #[doc(hidden)]
653 pub mod issue {
654 #[allow(unused_imports)]
655 use super::*;
656 #[derive(Clone, Debug, PartialEq)]
657 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
658 }
659
660 impl Issue {
661 /// Gets the enum value.
662 ///
663 /// Returns `None` if the enum contains an unknown value deserialized from
664 /// the string representation of enums.
665 pub fn value(&self) -> std::option::Option<i32> {
666 match self {
667 Self::Unspecified => std::option::Option::Some(0),
668 Self::ContactSupport => std::option::Option::Some(1),
669 Self::UnverifiedEmail => std::option::Option::Some(2),
670 Self::UnknownValue(u) => u.0.value(),
671 }
672 }
673
674 /// Gets the enum value as a string.
675 ///
676 /// Returns `None` if the enum contains an unknown value deserialized from
677 /// the integer representation of enums.
678 pub fn name(&self) -> std::option::Option<&str> {
679 match self {
680 Self::Unspecified => std::option::Option::Some("ISSUE_UNSPECIFIED"),
681 Self::ContactSupport => std::option::Option::Some("CONTACT_SUPPORT"),
682 Self::UnverifiedEmail => std::option::Option::Some("UNVERIFIED_EMAIL"),
683 Self::UnknownValue(u) => u.0.name(),
684 }
685 }
686 }
687
688 impl std::default::Default for Issue {
689 fn default() -> Self {
690 use std::convert::From;
691 Self::from(0)
692 }
693 }
694
695 impl std::fmt::Display for Issue {
696 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
697 wkt::internal::display_enum(f, self.name(), self.value())
698 }
699 }
700
701 impl std::convert::From<i32> for Issue {
702 fn from(value: i32) -> Self {
703 match value {
704 0 => Self::Unspecified,
705 1 => Self::ContactSupport,
706 2 => Self::UnverifiedEmail,
707 _ => Self::UnknownValue(issue::UnknownValue(
708 wkt::internal::UnknownEnumValue::Integer(value),
709 )),
710 }
711 }
712 }
713
714 impl std::convert::From<&str> for Issue {
715 fn from(value: &str) -> Self {
716 use std::string::ToString;
717 match value {
718 "ISSUE_UNSPECIFIED" => Self::Unspecified,
719 "CONTACT_SUPPORT" => Self::ContactSupport,
720 "UNVERIFIED_EMAIL" => Self::UnverifiedEmail,
721 _ => Self::UnknownValue(issue::UnknownValue(
722 wkt::internal::UnknownEnumValue::String(value.to_string()),
723 )),
724 }
725 }
726 }
727
728 impl serde::ser::Serialize for Issue {
729 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
730 where
731 S: serde::Serializer,
732 {
733 match self {
734 Self::Unspecified => serializer.serialize_i32(0),
735 Self::ContactSupport => serializer.serialize_i32(1),
736 Self::UnverifiedEmail => serializer.serialize_i32(2),
737 Self::UnknownValue(u) => u.0.serialize(serializer),
738 }
739 }
740 }
741
742 impl<'de> serde::de::Deserialize<'de> for Issue {
743 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
744 where
745 D: serde::Deserializer<'de>,
746 {
747 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Issue>::new(
748 ".google.cloud.domains.v1.Registration.Issue",
749 ))
750 }
751 }
752}
753
754/// Defines renewal, billing, and transfer settings for a `Registration`.
755#[derive(Clone, Default, PartialEq)]
756#[non_exhaustive]
757pub struct ManagementSettings {
758 /// Output only. The renewal method for this `Registration`.
759 pub renewal_method: crate::model::management_settings::RenewalMethod,
760
761 /// Controls whether the domain can be transferred to another registrar.
762 pub transfer_lock_state: crate::model::TransferLockState,
763
764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
765}
766
767impl ManagementSettings {
768 /// Creates a new default instance.
769 pub fn new() -> Self {
770 std::default::Default::default()
771 }
772
773 /// Sets the value of [renewal_method][crate::model::ManagementSettings::renewal_method].
774 ///
775 /// # Example
776 /// ```ignore,no_run
777 /// # use google_cloud_domains_v1::model::ManagementSettings;
778 /// use google_cloud_domains_v1::model::management_settings::RenewalMethod;
779 /// let x0 = ManagementSettings::new().set_renewal_method(RenewalMethod::AutomaticRenewal);
780 /// let x1 = ManagementSettings::new().set_renewal_method(RenewalMethod::ManualRenewal);
781 /// ```
782 pub fn set_renewal_method<
783 T: std::convert::Into<crate::model::management_settings::RenewalMethod>,
784 >(
785 mut self,
786 v: T,
787 ) -> Self {
788 self.renewal_method = v.into();
789 self
790 }
791
792 /// Sets the value of [transfer_lock_state][crate::model::ManagementSettings::transfer_lock_state].
793 ///
794 /// # Example
795 /// ```ignore,no_run
796 /// # use google_cloud_domains_v1::model::ManagementSettings;
797 /// use google_cloud_domains_v1::model::TransferLockState;
798 /// let x0 = ManagementSettings::new().set_transfer_lock_state(TransferLockState::Unlocked);
799 /// let x1 = ManagementSettings::new().set_transfer_lock_state(TransferLockState::Locked);
800 /// ```
801 pub fn set_transfer_lock_state<T: std::convert::Into<crate::model::TransferLockState>>(
802 mut self,
803 v: T,
804 ) -> Self {
805 self.transfer_lock_state = v.into();
806 self
807 }
808}
809
810impl wkt::message::Message for ManagementSettings {
811 fn typename() -> &'static str {
812 "type.googleapis.com/google.cloud.domains.v1.ManagementSettings"
813 }
814}
815
816/// Defines additional types related to [ManagementSettings].
817pub mod management_settings {
818 #[allow(unused_imports)]
819 use super::*;
820
821 /// Defines how the `Registration` is renewed.
822 ///
823 /// # Working with unknown values
824 ///
825 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
826 /// additional enum variants at any time. Adding new variants is not considered
827 /// a breaking change. Applications should write their code in anticipation of:
828 ///
829 /// - New values appearing in future releases of the client library, **and**
830 /// - New values received dynamically, without application changes.
831 ///
832 /// Please consult the [Working with enums] section in the user guide for some
833 /// guidelines.
834 ///
835 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
836 #[derive(Clone, Debug, PartialEq)]
837 #[non_exhaustive]
838 pub enum RenewalMethod {
839 /// The renewal method is undefined.
840 Unspecified,
841 /// The domain is automatically renewed each year .
842 ///
843 /// To disable automatic renewals, delete the resource by calling
844 /// `DeleteRegistration` or export it by calling `ExportRegistration`.
845 AutomaticRenewal,
846 /// The domain must be explicitly renewed each year before its
847 /// `expire_time`. This option is only available when the `Registration`
848 /// is in state `EXPORTED`.
849 ///
850 /// To manage the domain's current billing and
851 /// renewal settings, go to [Google Domains](https://domains.google/).
852 ManualRenewal,
853 /// If set, the enum was initialized with an unknown value.
854 ///
855 /// Applications can examine the value using [RenewalMethod::value] or
856 /// [RenewalMethod::name].
857 UnknownValue(renewal_method::UnknownValue),
858 }
859
860 #[doc(hidden)]
861 pub mod renewal_method {
862 #[allow(unused_imports)]
863 use super::*;
864 #[derive(Clone, Debug, PartialEq)]
865 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
866 }
867
868 impl RenewalMethod {
869 /// Gets the enum value.
870 ///
871 /// Returns `None` if the enum contains an unknown value deserialized from
872 /// the string representation of enums.
873 pub fn value(&self) -> std::option::Option<i32> {
874 match self {
875 Self::Unspecified => std::option::Option::Some(0),
876 Self::AutomaticRenewal => std::option::Option::Some(1),
877 Self::ManualRenewal => std::option::Option::Some(2),
878 Self::UnknownValue(u) => u.0.value(),
879 }
880 }
881
882 /// Gets the enum value as a string.
883 ///
884 /// Returns `None` if the enum contains an unknown value deserialized from
885 /// the integer representation of enums.
886 pub fn name(&self) -> std::option::Option<&str> {
887 match self {
888 Self::Unspecified => std::option::Option::Some("RENEWAL_METHOD_UNSPECIFIED"),
889 Self::AutomaticRenewal => std::option::Option::Some("AUTOMATIC_RENEWAL"),
890 Self::ManualRenewal => std::option::Option::Some("MANUAL_RENEWAL"),
891 Self::UnknownValue(u) => u.0.name(),
892 }
893 }
894 }
895
896 impl std::default::Default for RenewalMethod {
897 fn default() -> Self {
898 use std::convert::From;
899 Self::from(0)
900 }
901 }
902
903 impl std::fmt::Display for RenewalMethod {
904 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
905 wkt::internal::display_enum(f, self.name(), self.value())
906 }
907 }
908
909 impl std::convert::From<i32> for RenewalMethod {
910 fn from(value: i32) -> Self {
911 match value {
912 0 => Self::Unspecified,
913 1 => Self::AutomaticRenewal,
914 2 => Self::ManualRenewal,
915 _ => Self::UnknownValue(renewal_method::UnknownValue(
916 wkt::internal::UnknownEnumValue::Integer(value),
917 )),
918 }
919 }
920 }
921
922 impl std::convert::From<&str> for RenewalMethod {
923 fn from(value: &str) -> Self {
924 use std::string::ToString;
925 match value {
926 "RENEWAL_METHOD_UNSPECIFIED" => Self::Unspecified,
927 "AUTOMATIC_RENEWAL" => Self::AutomaticRenewal,
928 "MANUAL_RENEWAL" => Self::ManualRenewal,
929 _ => Self::UnknownValue(renewal_method::UnknownValue(
930 wkt::internal::UnknownEnumValue::String(value.to_string()),
931 )),
932 }
933 }
934 }
935
936 impl serde::ser::Serialize for RenewalMethod {
937 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
938 where
939 S: serde::Serializer,
940 {
941 match self {
942 Self::Unspecified => serializer.serialize_i32(0),
943 Self::AutomaticRenewal => serializer.serialize_i32(1),
944 Self::ManualRenewal => serializer.serialize_i32(2),
945 Self::UnknownValue(u) => u.0.serialize(serializer),
946 }
947 }
948 }
949
950 impl<'de> serde::de::Deserialize<'de> for RenewalMethod {
951 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
952 where
953 D: serde::Deserializer<'de>,
954 {
955 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenewalMethod>::new(
956 ".google.cloud.domains.v1.ManagementSettings.RenewalMethod",
957 ))
958 }
959 }
960}
961
962/// Defines the DNS configuration of a `Registration`, including name servers,
963/// DNSSEC, and glue records.
964#[derive(Clone, Default, PartialEq)]
965#[non_exhaustive]
966pub struct DnsSettings {
967 /// The list of glue records for this `Registration`. Commonly empty.
968 pub glue_records: std::vec::Vec<crate::model::dns_settings::GlueRecord>,
969
970 /// The DNS provider of the registration.
971 pub dns_provider: std::option::Option<crate::model::dns_settings::DnsProvider>,
972
973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
974}
975
976impl DnsSettings {
977 /// Creates a new default instance.
978 pub fn new() -> Self {
979 std::default::Default::default()
980 }
981
982 /// Sets the value of [glue_records][crate::model::DnsSettings::glue_records].
983 ///
984 /// # Example
985 /// ```ignore,no_run
986 /// # use google_cloud_domains_v1::model::DnsSettings;
987 /// use google_cloud_domains_v1::model::dns_settings::GlueRecord;
988 /// let x = DnsSettings::new()
989 /// .set_glue_records([
990 /// GlueRecord::default()/* use setters */,
991 /// GlueRecord::default()/* use (different) setters */,
992 /// ]);
993 /// ```
994 pub fn set_glue_records<T, V>(mut self, v: T) -> Self
995 where
996 T: std::iter::IntoIterator<Item = V>,
997 V: std::convert::Into<crate::model::dns_settings::GlueRecord>,
998 {
999 use std::iter::Iterator;
1000 self.glue_records = v.into_iter().map(|i| i.into()).collect();
1001 self
1002 }
1003
1004 /// Sets the value of [dns_provider][crate::model::DnsSettings::dns_provider].
1005 ///
1006 /// Note that all the setters affecting `dns_provider` are mutually
1007 /// exclusive.
1008 ///
1009 /// # Example
1010 /// ```ignore,no_run
1011 /// # use google_cloud_domains_v1::model::DnsSettings;
1012 /// use google_cloud_domains_v1::model::dns_settings::CustomDns;
1013 /// let x = DnsSettings::new().set_dns_provider(Some(
1014 /// google_cloud_domains_v1::model::dns_settings::DnsProvider::CustomDns(CustomDns::default().into())));
1015 /// ```
1016 pub fn set_dns_provider<
1017 T: std::convert::Into<std::option::Option<crate::model::dns_settings::DnsProvider>>,
1018 >(
1019 mut self,
1020 v: T,
1021 ) -> Self {
1022 self.dns_provider = v.into();
1023 self
1024 }
1025
1026 /// The value of [dns_provider][crate::model::DnsSettings::dns_provider]
1027 /// if it holds a `CustomDns`, `None` if the field is not set or
1028 /// holds a different branch.
1029 pub fn custom_dns(
1030 &self,
1031 ) -> std::option::Option<&std::boxed::Box<crate::model::dns_settings::CustomDns>> {
1032 #[allow(unreachable_patterns)]
1033 self.dns_provider.as_ref().and_then(|v| match v {
1034 crate::model::dns_settings::DnsProvider::CustomDns(v) => std::option::Option::Some(v),
1035 _ => std::option::Option::None,
1036 })
1037 }
1038
1039 /// Sets the value of [dns_provider][crate::model::DnsSettings::dns_provider]
1040 /// to hold a `CustomDns`.
1041 ///
1042 /// Note that all the setters affecting `dns_provider` are
1043 /// mutually exclusive.
1044 ///
1045 /// # Example
1046 /// ```ignore,no_run
1047 /// # use google_cloud_domains_v1::model::DnsSettings;
1048 /// use google_cloud_domains_v1::model::dns_settings::CustomDns;
1049 /// let x = DnsSettings::new().set_custom_dns(CustomDns::default()/* use setters */);
1050 /// assert!(x.custom_dns().is_some());
1051 /// assert!(x.google_domains_dns().is_none());
1052 /// ```
1053 pub fn set_custom_dns<
1054 T: std::convert::Into<std::boxed::Box<crate::model::dns_settings::CustomDns>>,
1055 >(
1056 mut self,
1057 v: T,
1058 ) -> Self {
1059 self.dns_provider =
1060 std::option::Option::Some(crate::model::dns_settings::DnsProvider::CustomDns(v.into()));
1061 self
1062 }
1063
1064 /// The value of [dns_provider][crate::model::DnsSettings::dns_provider]
1065 /// if it holds a `GoogleDomainsDns`, `None` if the field is not set or
1066 /// holds a different branch.
1067 pub fn google_domains_dns(
1068 &self,
1069 ) -> std::option::Option<&std::boxed::Box<crate::model::dns_settings::GoogleDomainsDns>> {
1070 #[allow(unreachable_patterns)]
1071 self.dns_provider.as_ref().and_then(|v| match v {
1072 crate::model::dns_settings::DnsProvider::GoogleDomainsDns(v) => {
1073 std::option::Option::Some(v)
1074 }
1075 _ => std::option::Option::None,
1076 })
1077 }
1078
1079 /// Sets the value of [dns_provider][crate::model::DnsSettings::dns_provider]
1080 /// to hold a `GoogleDomainsDns`.
1081 ///
1082 /// Note that all the setters affecting `dns_provider` are
1083 /// mutually exclusive.
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_domains_v1::model::DnsSettings;
1088 /// use google_cloud_domains_v1::model::dns_settings::GoogleDomainsDns;
1089 /// let x = DnsSettings::new().set_google_domains_dns(GoogleDomainsDns::default()/* use setters */);
1090 /// assert!(x.google_domains_dns().is_some());
1091 /// assert!(x.custom_dns().is_none());
1092 /// ```
1093 pub fn set_google_domains_dns<
1094 T: std::convert::Into<std::boxed::Box<crate::model::dns_settings::GoogleDomainsDns>>,
1095 >(
1096 mut self,
1097 v: T,
1098 ) -> Self {
1099 self.dns_provider = std::option::Option::Some(
1100 crate::model::dns_settings::DnsProvider::GoogleDomainsDns(v.into()),
1101 );
1102 self
1103 }
1104}
1105
1106impl wkt::message::Message for DnsSettings {
1107 fn typename() -> &'static str {
1108 "type.googleapis.com/google.cloud.domains.v1.DnsSettings"
1109 }
1110}
1111
1112/// Defines additional types related to [DnsSettings].
1113pub mod dns_settings {
1114 #[allow(unused_imports)]
1115 use super::*;
1116
1117 /// Configuration for an arbitrary DNS provider.
1118 #[derive(Clone, Default, PartialEq)]
1119 #[non_exhaustive]
1120 pub struct CustomDns {
1121 /// Required. A list of name servers that store the DNS zone for this domain. Each name
1122 /// server is a domain name, with Unicode domain names expressed in
1123 /// Punycode format.
1124 pub name_servers: std::vec::Vec<std::string::String>,
1125
1126 /// The list of DS records for this domain, which are used to enable DNSSEC.
1127 /// The domain's DNS provider can provide the values to set here. If this
1128 /// field is empty, DNSSEC is disabled.
1129 pub ds_records: std::vec::Vec<crate::model::dns_settings::DsRecord>,
1130
1131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1132 }
1133
1134 impl CustomDns {
1135 /// Creates a new default instance.
1136 pub fn new() -> Self {
1137 std::default::Default::default()
1138 }
1139
1140 /// Sets the value of [name_servers][crate::model::dns_settings::CustomDns::name_servers].
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_domains_v1::model::dns_settings::CustomDns;
1145 /// let x = CustomDns::new().set_name_servers(["a", "b", "c"]);
1146 /// ```
1147 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
1148 where
1149 T: std::iter::IntoIterator<Item = V>,
1150 V: std::convert::Into<std::string::String>,
1151 {
1152 use std::iter::Iterator;
1153 self.name_servers = v.into_iter().map(|i| i.into()).collect();
1154 self
1155 }
1156
1157 /// Sets the value of [ds_records][crate::model::dns_settings::CustomDns::ds_records].
1158 ///
1159 /// # Example
1160 /// ```ignore,no_run
1161 /// # use google_cloud_domains_v1::model::dns_settings::CustomDns;
1162 /// use google_cloud_domains_v1::model::dns_settings::DsRecord;
1163 /// let x = CustomDns::new()
1164 /// .set_ds_records([
1165 /// DsRecord::default()/* use setters */,
1166 /// DsRecord::default()/* use (different) setters */,
1167 /// ]);
1168 /// ```
1169 pub fn set_ds_records<T, V>(mut self, v: T) -> Self
1170 where
1171 T: std::iter::IntoIterator<Item = V>,
1172 V: std::convert::Into<crate::model::dns_settings::DsRecord>,
1173 {
1174 use std::iter::Iterator;
1175 self.ds_records = v.into_iter().map(|i| i.into()).collect();
1176 self
1177 }
1178 }
1179
1180 impl wkt::message::Message for CustomDns {
1181 fn typename() -> &'static str {
1182 "type.googleapis.com/google.cloud.domains.v1.DnsSettings.CustomDns"
1183 }
1184 }
1185
1186 /// Configuration for using the free DNS zone provided by Google Domains as a
1187 /// `Registration`'s `dns_provider`. You cannot configure the DNS zone itself
1188 /// using the API. To configure the DNS zone, go to
1189 /// [Google Domains](https://domains.google/).
1190 #[derive(Clone, Default, PartialEq)]
1191 #[non_exhaustive]
1192 pub struct GoogleDomainsDns {
1193 /// Output only. A list of name servers that store the DNS zone for this domain. Each name
1194 /// server is a domain name, with Unicode domain names expressed in
1195 /// Punycode format. This field is automatically populated with the name
1196 /// servers assigned to the Google Domains DNS zone.
1197 pub name_servers: std::vec::Vec<std::string::String>,
1198
1199 /// Required. The state of DS records for this domain. Used to enable or disable
1200 /// automatic DNSSEC.
1201 pub ds_state: crate::model::dns_settings::DsState,
1202
1203 /// Output only. The list of DS records published for this domain. The list is
1204 /// automatically populated when `ds_state` is `DS_RECORDS_PUBLISHED`,
1205 /// otherwise it remains empty.
1206 pub ds_records: std::vec::Vec<crate::model::dns_settings::DsRecord>,
1207
1208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1209 }
1210
1211 impl GoogleDomainsDns {
1212 /// Creates a new default instance.
1213 pub fn new() -> Self {
1214 std::default::Default::default()
1215 }
1216
1217 /// Sets the value of [name_servers][crate::model::dns_settings::GoogleDomainsDns::name_servers].
1218 ///
1219 /// # Example
1220 /// ```ignore,no_run
1221 /// # use google_cloud_domains_v1::model::dns_settings::GoogleDomainsDns;
1222 /// let x = GoogleDomainsDns::new().set_name_servers(["a", "b", "c"]);
1223 /// ```
1224 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
1225 where
1226 T: std::iter::IntoIterator<Item = V>,
1227 V: std::convert::Into<std::string::String>,
1228 {
1229 use std::iter::Iterator;
1230 self.name_servers = v.into_iter().map(|i| i.into()).collect();
1231 self
1232 }
1233
1234 /// Sets the value of [ds_state][crate::model::dns_settings::GoogleDomainsDns::ds_state].
1235 ///
1236 /// # Example
1237 /// ```ignore,no_run
1238 /// # use google_cloud_domains_v1::model::dns_settings::GoogleDomainsDns;
1239 /// use google_cloud_domains_v1::model::dns_settings::DsState;
1240 /// let x0 = GoogleDomainsDns::new().set_ds_state(DsState::DsRecordsUnpublished);
1241 /// let x1 = GoogleDomainsDns::new().set_ds_state(DsState::DsRecordsPublished);
1242 /// ```
1243 pub fn set_ds_state<T: std::convert::Into<crate::model::dns_settings::DsState>>(
1244 mut self,
1245 v: T,
1246 ) -> Self {
1247 self.ds_state = v.into();
1248 self
1249 }
1250
1251 /// Sets the value of [ds_records][crate::model::dns_settings::GoogleDomainsDns::ds_records].
1252 ///
1253 /// # Example
1254 /// ```ignore,no_run
1255 /// # use google_cloud_domains_v1::model::dns_settings::GoogleDomainsDns;
1256 /// use google_cloud_domains_v1::model::dns_settings::DsRecord;
1257 /// let x = GoogleDomainsDns::new()
1258 /// .set_ds_records([
1259 /// DsRecord::default()/* use setters */,
1260 /// DsRecord::default()/* use (different) setters */,
1261 /// ]);
1262 /// ```
1263 pub fn set_ds_records<T, V>(mut self, v: T) -> Self
1264 where
1265 T: std::iter::IntoIterator<Item = V>,
1266 V: std::convert::Into<crate::model::dns_settings::DsRecord>,
1267 {
1268 use std::iter::Iterator;
1269 self.ds_records = v.into_iter().map(|i| i.into()).collect();
1270 self
1271 }
1272 }
1273
1274 impl wkt::message::Message for GoogleDomainsDns {
1275 fn typename() -> &'static str {
1276 "type.googleapis.com/google.cloud.domains.v1.DnsSettings.GoogleDomainsDns"
1277 }
1278 }
1279
1280 /// Defines a Delegation Signer (DS) record, which is needed to enable DNSSEC
1281 /// for a domain. It contains a digest (hash) of a DNSKEY record that must be
1282 /// present in the domain's DNS zone.
1283 #[derive(Clone, Default, PartialEq)]
1284 #[non_exhaustive]
1285 pub struct DsRecord {
1286 /// The key tag of the record. Must be set in range 0 -- 65535.
1287 pub key_tag: i32,
1288
1289 /// The algorithm used to generate the referenced DNSKEY.
1290 pub algorithm: crate::model::dns_settings::ds_record::Algorithm,
1291
1292 /// The hash function used to generate the digest of the referenced DNSKEY.
1293 pub digest_type: crate::model::dns_settings::ds_record::DigestType,
1294
1295 /// The digest generated from the referenced DNSKEY.
1296 pub digest: std::string::String,
1297
1298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1299 }
1300
1301 impl DsRecord {
1302 /// Creates a new default instance.
1303 pub fn new() -> Self {
1304 std::default::Default::default()
1305 }
1306
1307 /// Sets the value of [key_tag][crate::model::dns_settings::DsRecord::key_tag].
1308 ///
1309 /// # Example
1310 /// ```ignore,no_run
1311 /// # use google_cloud_domains_v1::model::dns_settings::DsRecord;
1312 /// let x = DsRecord::new().set_key_tag(42);
1313 /// ```
1314 pub fn set_key_tag<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1315 self.key_tag = v.into();
1316 self
1317 }
1318
1319 /// Sets the value of [algorithm][crate::model::dns_settings::DsRecord::algorithm].
1320 ///
1321 /// # Example
1322 /// ```ignore,no_run
1323 /// # use google_cloud_domains_v1::model::dns_settings::DsRecord;
1324 /// use google_cloud_domains_v1::model::dns_settings::ds_record::Algorithm;
1325 /// let x0 = DsRecord::new().set_algorithm(Algorithm::Rsamd5);
1326 /// let x1 = DsRecord::new().set_algorithm(Algorithm::Dh);
1327 /// let x2 = DsRecord::new().set_algorithm(Algorithm::Dsa);
1328 /// ```
1329 pub fn set_algorithm<
1330 T: std::convert::Into<crate::model::dns_settings::ds_record::Algorithm>,
1331 >(
1332 mut self,
1333 v: T,
1334 ) -> Self {
1335 self.algorithm = v.into();
1336 self
1337 }
1338
1339 /// Sets the value of [digest_type][crate::model::dns_settings::DsRecord::digest_type].
1340 ///
1341 /// # Example
1342 /// ```ignore,no_run
1343 /// # use google_cloud_domains_v1::model::dns_settings::DsRecord;
1344 /// use google_cloud_domains_v1::model::dns_settings::ds_record::DigestType;
1345 /// let x0 = DsRecord::new().set_digest_type(DigestType::Sha1);
1346 /// let x1 = DsRecord::new().set_digest_type(DigestType::Sha256);
1347 /// let x2 = DsRecord::new().set_digest_type(DigestType::Gost3411);
1348 /// ```
1349 pub fn set_digest_type<
1350 T: std::convert::Into<crate::model::dns_settings::ds_record::DigestType>,
1351 >(
1352 mut self,
1353 v: T,
1354 ) -> Self {
1355 self.digest_type = v.into();
1356 self
1357 }
1358
1359 /// Sets the value of [digest][crate::model::dns_settings::DsRecord::digest].
1360 ///
1361 /// # Example
1362 /// ```ignore,no_run
1363 /// # use google_cloud_domains_v1::model::dns_settings::DsRecord;
1364 /// let x = DsRecord::new().set_digest("example");
1365 /// ```
1366 pub fn set_digest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.digest = v.into();
1368 self
1369 }
1370 }
1371
1372 impl wkt::message::Message for DsRecord {
1373 fn typename() -> &'static str {
1374 "type.googleapis.com/google.cloud.domains.v1.DnsSettings.DsRecord"
1375 }
1376 }
1377
1378 /// Defines additional types related to [DsRecord].
1379 pub mod ds_record {
1380 #[allow(unused_imports)]
1381 use super::*;
1382
1383 /// List of algorithms used to create a DNSKEY. Certain
1384 /// algorithms are not supported for particular domains.
1385 ///
1386 /// # Working with unknown values
1387 ///
1388 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1389 /// additional enum variants at any time. Adding new variants is not considered
1390 /// a breaking change. Applications should write their code in anticipation of:
1391 ///
1392 /// - New values appearing in future releases of the client library, **and**
1393 /// - New values received dynamically, without application changes.
1394 ///
1395 /// Please consult the [Working with enums] section in the user guide for some
1396 /// guidelines.
1397 ///
1398 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1399 #[derive(Clone, Debug, PartialEq)]
1400 #[non_exhaustive]
1401 pub enum Algorithm {
1402 /// The algorithm is unspecified.
1403 Unspecified,
1404 /// RSA/MD5. Cannot be used for new deployments.
1405 Rsamd5,
1406 /// Diffie-Hellman. Cannot be used for new deployments.
1407 Dh,
1408 /// DSA/SHA1. Not recommended for new deployments.
1409 Dsa,
1410 /// ECC. Not recommended for new deployments.
1411 Ecc,
1412 /// RSA/SHA-1. Not recommended for new deployments.
1413 Rsasha1,
1414 /// DSA-NSEC3-SHA1. Not recommended for new deployments.
1415 Dsansec3Sha1,
1416 /// RSA/SHA1-NSEC3-SHA1. Not recommended for new deployments.
1417 Rsasha1Nsec3Sha1,
1418 /// RSA/SHA-256.
1419 Rsasha256,
1420 /// RSA/SHA-512.
1421 Rsasha512,
1422 /// GOST R 34.10-2001.
1423 Eccgost,
1424 /// ECDSA Curve P-256 with SHA-256.
1425 Ecdsap256Sha256,
1426 /// ECDSA Curve P-384 with SHA-384.
1427 Ecdsap384Sha384,
1428 /// Ed25519.
1429 Ed25519,
1430 /// Ed448.
1431 Ed448,
1432 /// Reserved for Indirect Keys. Cannot be used for new deployments.
1433 Indirect,
1434 /// Private algorithm. Cannot be used for new deployments.
1435 Privatedns,
1436 /// Private algorithm OID. Cannot be used for new deployments.
1437 Privateoid,
1438 /// If set, the enum was initialized with an unknown value.
1439 ///
1440 /// Applications can examine the value using [Algorithm::value] or
1441 /// [Algorithm::name].
1442 UnknownValue(algorithm::UnknownValue),
1443 }
1444
1445 #[doc(hidden)]
1446 pub mod algorithm {
1447 #[allow(unused_imports)]
1448 use super::*;
1449 #[derive(Clone, Debug, PartialEq)]
1450 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1451 }
1452
1453 impl Algorithm {
1454 /// Gets the enum value.
1455 ///
1456 /// Returns `None` if the enum contains an unknown value deserialized from
1457 /// the string representation of enums.
1458 pub fn value(&self) -> std::option::Option<i32> {
1459 match self {
1460 Self::Unspecified => std::option::Option::Some(0),
1461 Self::Rsamd5 => std::option::Option::Some(1),
1462 Self::Dh => std::option::Option::Some(2),
1463 Self::Dsa => std::option::Option::Some(3),
1464 Self::Ecc => std::option::Option::Some(4),
1465 Self::Rsasha1 => std::option::Option::Some(5),
1466 Self::Dsansec3Sha1 => std::option::Option::Some(6),
1467 Self::Rsasha1Nsec3Sha1 => std::option::Option::Some(7),
1468 Self::Rsasha256 => std::option::Option::Some(8),
1469 Self::Rsasha512 => std::option::Option::Some(10),
1470 Self::Eccgost => std::option::Option::Some(12),
1471 Self::Ecdsap256Sha256 => std::option::Option::Some(13),
1472 Self::Ecdsap384Sha384 => std::option::Option::Some(14),
1473 Self::Ed25519 => std::option::Option::Some(15),
1474 Self::Ed448 => std::option::Option::Some(16),
1475 Self::Indirect => std::option::Option::Some(252),
1476 Self::Privatedns => std::option::Option::Some(253),
1477 Self::Privateoid => std::option::Option::Some(254),
1478 Self::UnknownValue(u) => u.0.value(),
1479 }
1480 }
1481
1482 /// Gets the enum value as a string.
1483 ///
1484 /// Returns `None` if the enum contains an unknown value deserialized from
1485 /// the integer representation of enums.
1486 pub fn name(&self) -> std::option::Option<&str> {
1487 match self {
1488 Self::Unspecified => std::option::Option::Some("ALGORITHM_UNSPECIFIED"),
1489 Self::Rsamd5 => std::option::Option::Some("RSAMD5"),
1490 Self::Dh => std::option::Option::Some("DH"),
1491 Self::Dsa => std::option::Option::Some("DSA"),
1492 Self::Ecc => std::option::Option::Some("ECC"),
1493 Self::Rsasha1 => std::option::Option::Some("RSASHA1"),
1494 Self::Dsansec3Sha1 => std::option::Option::Some("DSANSEC3SHA1"),
1495 Self::Rsasha1Nsec3Sha1 => std::option::Option::Some("RSASHA1NSEC3SHA1"),
1496 Self::Rsasha256 => std::option::Option::Some("RSASHA256"),
1497 Self::Rsasha512 => std::option::Option::Some("RSASHA512"),
1498 Self::Eccgost => std::option::Option::Some("ECCGOST"),
1499 Self::Ecdsap256Sha256 => std::option::Option::Some("ECDSAP256SHA256"),
1500 Self::Ecdsap384Sha384 => std::option::Option::Some("ECDSAP384SHA384"),
1501 Self::Ed25519 => std::option::Option::Some("ED25519"),
1502 Self::Ed448 => std::option::Option::Some("ED448"),
1503 Self::Indirect => std::option::Option::Some("INDIRECT"),
1504 Self::Privatedns => std::option::Option::Some("PRIVATEDNS"),
1505 Self::Privateoid => std::option::Option::Some("PRIVATEOID"),
1506 Self::UnknownValue(u) => u.0.name(),
1507 }
1508 }
1509 }
1510
1511 impl std::default::Default for Algorithm {
1512 fn default() -> Self {
1513 use std::convert::From;
1514 Self::from(0)
1515 }
1516 }
1517
1518 impl std::fmt::Display for Algorithm {
1519 fn fmt(
1520 &self,
1521 f: &mut std::fmt::Formatter<'_>,
1522 ) -> std::result::Result<(), std::fmt::Error> {
1523 wkt::internal::display_enum(f, self.name(), self.value())
1524 }
1525 }
1526
1527 impl std::convert::From<i32> for Algorithm {
1528 fn from(value: i32) -> Self {
1529 match value {
1530 0 => Self::Unspecified,
1531 1 => Self::Rsamd5,
1532 2 => Self::Dh,
1533 3 => Self::Dsa,
1534 4 => Self::Ecc,
1535 5 => Self::Rsasha1,
1536 6 => Self::Dsansec3Sha1,
1537 7 => Self::Rsasha1Nsec3Sha1,
1538 8 => Self::Rsasha256,
1539 10 => Self::Rsasha512,
1540 12 => Self::Eccgost,
1541 13 => Self::Ecdsap256Sha256,
1542 14 => Self::Ecdsap384Sha384,
1543 15 => Self::Ed25519,
1544 16 => Self::Ed448,
1545 252 => Self::Indirect,
1546 253 => Self::Privatedns,
1547 254 => Self::Privateoid,
1548 _ => Self::UnknownValue(algorithm::UnknownValue(
1549 wkt::internal::UnknownEnumValue::Integer(value),
1550 )),
1551 }
1552 }
1553 }
1554
1555 impl std::convert::From<&str> for Algorithm {
1556 fn from(value: &str) -> Self {
1557 use std::string::ToString;
1558 match value {
1559 "ALGORITHM_UNSPECIFIED" => Self::Unspecified,
1560 "RSAMD5" => Self::Rsamd5,
1561 "DH" => Self::Dh,
1562 "DSA" => Self::Dsa,
1563 "ECC" => Self::Ecc,
1564 "RSASHA1" => Self::Rsasha1,
1565 "DSANSEC3SHA1" => Self::Dsansec3Sha1,
1566 "RSASHA1NSEC3SHA1" => Self::Rsasha1Nsec3Sha1,
1567 "RSASHA256" => Self::Rsasha256,
1568 "RSASHA512" => Self::Rsasha512,
1569 "ECCGOST" => Self::Eccgost,
1570 "ECDSAP256SHA256" => Self::Ecdsap256Sha256,
1571 "ECDSAP384SHA384" => Self::Ecdsap384Sha384,
1572 "ED25519" => Self::Ed25519,
1573 "ED448" => Self::Ed448,
1574 "INDIRECT" => Self::Indirect,
1575 "PRIVATEDNS" => Self::Privatedns,
1576 "PRIVATEOID" => Self::Privateoid,
1577 _ => Self::UnknownValue(algorithm::UnknownValue(
1578 wkt::internal::UnknownEnumValue::String(value.to_string()),
1579 )),
1580 }
1581 }
1582 }
1583
1584 impl serde::ser::Serialize for Algorithm {
1585 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1586 where
1587 S: serde::Serializer,
1588 {
1589 match self {
1590 Self::Unspecified => serializer.serialize_i32(0),
1591 Self::Rsamd5 => serializer.serialize_i32(1),
1592 Self::Dh => serializer.serialize_i32(2),
1593 Self::Dsa => serializer.serialize_i32(3),
1594 Self::Ecc => serializer.serialize_i32(4),
1595 Self::Rsasha1 => serializer.serialize_i32(5),
1596 Self::Dsansec3Sha1 => serializer.serialize_i32(6),
1597 Self::Rsasha1Nsec3Sha1 => serializer.serialize_i32(7),
1598 Self::Rsasha256 => serializer.serialize_i32(8),
1599 Self::Rsasha512 => serializer.serialize_i32(10),
1600 Self::Eccgost => serializer.serialize_i32(12),
1601 Self::Ecdsap256Sha256 => serializer.serialize_i32(13),
1602 Self::Ecdsap384Sha384 => serializer.serialize_i32(14),
1603 Self::Ed25519 => serializer.serialize_i32(15),
1604 Self::Ed448 => serializer.serialize_i32(16),
1605 Self::Indirect => serializer.serialize_i32(252),
1606 Self::Privatedns => serializer.serialize_i32(253),
1607 Self::Privateoid => serializer.serialize_i32(254),
1608 Self::UnknownValue(u) => u.0.serialize(serializer),
1609 }
1610 }
1611 }
1612
1613 impl<'de> serde::de::Deserialize<'de> for Algorithm {
1614 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1615 where
1616 D: serde::Deserializer<'de>,
1617 {
1618 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Algorithm>::new(
1619 ".google.cloud.domains.v1.DnsSettings.DsRecord.Algorithm",
1620 ))
1621 }
1622 }
1623
1624 /// List of hash functions that may have been used to generate a digest of a
1625 /// DNSKEY.
1626 ///
1627 /// # Working with unknown values
1628 ///
1629 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1630 /// additional enum variants at any time. Adding new variants is not considered
1631 /// a breaking change. Applications should write their code in anticipation of:
1632 ///
1633 /// - New values appearing in future releases of the client library, **and**
1634 /// - New values received dynamically, without application changes.
1635 ///
1636 /// Please consult the [Working with enums] section in the user guide for some
1637 /// guidelines.
1638 ///
1639 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1640 #[derive(Clone, Debug, PartialEq)]
1641 #[non_exhaustive]
1642 pub enum DigestType {
1643 /// The DigestType is unspecified.
1644 Unspecified,
1645 /// SHA-1. Not recommended for new deployments.
1646 Sha1,
1647 /// SHA-256.
1648 Sha256,
1649 /// GOST R 34.11-94.
1650 Gost3411,
1651 /// SHA-384.
1652 Sha384,
1653 /// If set, the enum was initialized with an unknown value.
1654 ///
1655 /// Applications can examine the value using [DigestType::value] or
1656 /// [DigestType::name].
1657 UnknownValue(digest_type::UnknownValue),
1658 }
1659
1660 #[doc(hidden)]
1661 pub mod digest_type {
1662 #[allow(unused_imports)]
1663 use super::*;
1664 #[derive(Clone, Debug, PartialEq)]
1665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1666 }
1667
1668 impl DigestType {
1669 /// Gets the enum value.
1670 ///
1671 /// Returns `None` if the enum contains an unknown value deserialized from
1672 /// the string representation of enums.
1673 pub fn value(&self) -> std::option::Option<i32> {
1674 match self {
1675 Self::Unspecified => std::option::Option::Some(0),
1676 Self::Sha1 => std::option::Option::Some(1),
1677 Self::Sha256 => std::option::Option::Some(2),
1678 Self::Gost3411 => std::option::Option::Some(3),
1679 Self::Sha384 => std::option::Option::Some(4),
1680 Self::UnknownValue(u) => u.0.value(),
1681 }
1682 }
1683
1684 /// Gets the enum value as a string.
1685 ///
1686 /// Returns `None` if the enum contains an unknown value deserialized from
1687 /// the integer representation of enums.
1688 pub fn name(&self) -> std::option::Option<&str> {
1689 match self {
1690 Self::Unspecified => std::option::Option::Some("DIGEST_TYPE_UNSPECIFIED"),
1691 Self::Sha1 => std::option::Option::Some("SHA1"),
1692 Self::Sha256 => std::option::Option::Some("SHA256"),
1693 Self::Gost3411 => std::option::Option::Some("GOST3411"),
1694 Self::Sha384 => std::option::Option::Some("SHA384"),
1695 Self::UnknownValue(u) => u.0.name(),
1696 }
1697 }
1698 }
1699
1700 impl std::default::Default for DigestType {
1701 fn default() -> Self {
1702 use std::convert::From;
1703 Self::from(0)
1704 }
1705 }
1706
1707 impl std::fmt::Display for DigestType {
1708 fn fmt(
1709 &self,
1710 f: &mut std::fmt::Formatter<'_>,
1711 ) -> std::result::Result<(), std::fmt::Error> {
1712 wkt::internal::display_enum(f, self.name(), self.value())
1713 }
1714 }
1715
1716 impl std::convert::From<i32> for DigestType {
1717 fn from(value: i32) -> Self {
1718 match value {
1719 0 => Self::Unspecified,
1720 1 => Self::Sha1,
1721 2 => Self::Sha256,
1722 3 => Self::Gost3411,
1723 4 => Self::Sha384,
1724 _ => Self::UnknownValue(digest_type::UnknownValue(
1725 wkt::internal::UnknownEnumValue::Integer(value),
1726 )),
1727 }
1728 }
1729 }
1730
1731 impl std::convert::From<&str> for DigestType {
1732 fn from(value: &str) -> Self {
1733 use std::string::ToString;
1734 match value {
1735 "DIGEST_TYPE_UNSPECIFIED" => Self::Unspecified,
1736 "SHA1" => Self::Sha1,
1737 "SHA256" => Self::Sha256,
1738 "GOST3411" => Self::Gost3411,
1739 "SHA384" => Self::Sha384,
1740 _ => Self::UnknownValue(digest_type::UnknownValue(
1741 wkt::internal::UnknownEnumValue::String(value.to_string()),
1742 )),
1743 }
1744 }
1745 }
1746
1747 impl serde::ser::Serialize for DigestType {
1748 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1749 where
1750 S: serde::Serializer,
1751 {
1752 match self {
1753 Self::Unspecified => serializer.serialize_i32(0),
1754 Self::Sha1 => serializer.serialize_i32(1),
1755 Self::Sha256 => serializer.serialize_i32(2),
1756 Self::Gost3411 => serializer.serialize_i32(3),
1757 Self::Sha384 => serializer.serialize_i32(4),
1758 Self::UnknownValue(u) => u.0.serialize(serializer),
1759 }
1760 }
1761 }
1762
1763 impl<'de> serde::de::Deserialize<'de> for DigestType {
1764 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1765 where
1766 D: serde::Deserializer<'de>,
1767 {
1768 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DigestType>::new(
1769 ".google.cloud.domains.v1.DnsSettings.DsRecord.DigestType",
1770 ))
1771 }
1772 }
1773 }
1774
1775 /// Defines a host on your domain that is a DNS name server for your domain
1776 /// and/or other domains. Glue records are a way of making the IP address of a
1777 /// name server known, even when it serves DNS queries for its parent domain.
1778 /// For example, when `ns.example.com` is a name server for `example.com`, the
1779 /// host `ns.example.com` must have a glue record to break the circular DNS
1780 /// reference.
1781 #[derive(Clone, Default, PartialEq)]
1782 #[non_exhaustive]
1783 pub struct GlueRecord {
1784 /// Required. Domain name of the host in Punycode format.
1785 pub host_name: std::string::String,
1786
1787 /// List of IPv4 addresses corresponding to this host in the standard decimal
1788 /// format (e.g. `198.51.100.1`). At least one of `ipv4_address` and
1789 /// `ipv6_address` must be set.
1790 pub ipv4_addresses: std::vec::Vec<std::string::String>,
1791
1792 /// List of IPv6 addresses corresponding to this host in the standard
1793 /// hexadecimal format (e.g. `2001:db8::`). At least one of
1794 /// `ipv4_address` and `ipv6_address` must be set.
1795 pub ipv6_addresses: std::vec::Vec<std::string::String>,
1796
1797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1798 }
1799
1800 impl GlueRecord {
1801 /// Creates a new default instance.
1802 pub fn new() -> Self {
1803 std::default::Default::default()
1804 }
1805
1806 /// Sets the value of [host_name][crate::model::dns_settings::GlueRecord::host_name].
1807 ///
1808 /// # Example
1809 /// ```ignore,no_run
1810 /// # use google_cloud_domains_v1::model::dns_settings::GlueRecord;
1811 /// let x = GlueRecord::new().set_host_name("example");
1812 /// ```
1813 pub fn set_host_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1814 self.host_name = v.into();
1815 self
1816 }
1817
1818 /// Sets the value of [ipv4_addresses][crate::model::dns_settings::GlueRecord::ipv4_addresses].
1819 ///
1820 /// # Example
1821 /// ```ignore,no_run
1822 /// # use google_cloud_domains_v1::model::dns_settings::GlueRecord;
1823 /// let x = GlueRecord::new().set_ipv4_addresses(["a", "b", "c"]);
1824 /// ```
1825 pub fn set_ipv4_addresses<T, V>(mut self, v: T) -> Self
1826 where
1827 T: std::iter::IntoIterator<Item = V>,
1828 V: std::convert::Into<std::string::String>,
1829 {
1830 use std::iter::Iterator;
1831 self.ipv4_addresses = v.into_iter().map(|i| i.into()).collect();
1832 self
1833 }
1834
1835 /// Sets the value of [ipv6_addresses][crate::model::dns_settings::GlueRecord::ipv6_addresses].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_domains_v1::model::dns_settings::GlueRecord;
1840 /// let x = GlueRecord::new().set_ipv6_addresses(["a", "b", "c"]);
1841 /// ```
1842 pub fn set_ipv6_addresses<T, V>(mut self, v: T) -> Self
1843 where
1844 T: std::iter::IntoIterator<Item = V>,
1845 V: std::convert::Into<std::string::String>,
1846 {
1847 use std::iter::Iterator;
1848 self.ipv6_addresses = v.into_iter().map(|i| i.into()).collect();
1849 self
1850 }
1851 }
1852
1853 impl wkt::message::Message for GlueRecord {
1854 fn typename() -> &'static str {
1855 "type.googleapis.com/google.cloud.domains.v1.DnsSettings.GlueRecord"
1856 }
1857 }
1858
1859 /// The publication state of DS records for a `Registration`.
1860 ///
1861 /// # Working with unknown values
1862 ///
1863 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1864 /// additional enum variants at any time. Adding new variants is not considered
1865 /// a breaking change. Applications should write their code in anticipation of:
1866 ///
1867 /// - New values appearing in future releases of the client library, **and**
1868 /// - New values received dynamically, without application changes.
1869 ///
1870 /// Please consult the [Working with enums] section in the user guide for some
1871 /// guidelines.
1872 ///
1873 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1874 #[derive(Clone, Debug, PartialEq)]
1875 #[non_exhaustive]
1876 pub enum DsState {
1877 /// DS state is unspecified.
1878 Unspecified,
1879 /// DNSSEC is disabled for this domain. No DS records for this domain are
1880 /// published in the parent DNS zone.
1881 DsRecordsUnpublished,
1882 /// DNSSEC is enabled for this domain. Appropriate DS records for this domain
1883 /// are published in the parent DNS zone. This option is valid only if the
1884 /// DNS zone referenced in the `Registration`'s `dns_provider` field is
1885 /// already DNSSEC-signed.
1886 DsRecordsPublished,
1887 /// If set, the enum was initialized with an unknown value.
1888 ///
1889 /// Applications can examine the value using [DsState::value] or
1890 /// [DsState::name].
1891 UnknownValue(ds_state::UnknownValue),
1892 }
1893
1894 #[doc(hidden)]
1895 pub mod ds_state {
1896 #[allow(unused_imports)]
1897 use super::*;
1898 #[derive(Clone, Debug, PartialEq)]
1899 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1900 }
1901
1902 impl DsState {
1903 /// Gets the enum value.
1904 ///
1905 /// Returns `None` if the enum contains an unknown value deserialized from
1906 /// the string representation of enums.
1907 pub fn value(&self) -> std::option::Option<i32> {
1908 match self {
1909 Self::Unspecified => std::option::Option::Some(0),
1910 Self::DsRecordsUnpublished => std::option::Option::Some(1),
1911 Self::DsRecordsPublished => std::option::Option::Some(2),
1912 Self::UnknownValue(u) => u.0.value(),
1913 }
1914 }
1915
1916 /// Gets the enum value as a string.
1917 ///
1918 /// Returns `None` if the enum contains an unknown value deserialized from
1919 /// the integer representation of enums.
1920 pub fn name(&self) -> std::option::Option<&str> {
1921 match self {
1922 Self::Unspecified => std::option::Option::Some("DS_STATE_UNSPECIFIED"),
1923 Self::DsRecordsUnpublished => std::option::Option::Some("DS_RECORDS_UNPUBLISHED"),
1924 Self::DsRecordsPublished => std::option::Option::Some("DS_RECORDS_PUBLISHED"),
1925 Self::UnknownValue(u) => u.0.name(),
1926 }
1927 }
1928 }
1929
1930 impl std::default::Default for DsState {
1931 fn default() -> Self {
1932 use std::convert::From;
1933 Self::from(0)
1934 }
1935 }
1936
1937 impl std::fmt::Display for DsState {
1938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1939 wkt::internal::display_enum(f, self.name(), self.value())
1940 }
1941 }
1942
1943 impl std::convert::From<i32> for DsState {
1944 fn from(value: i32) -> Self {
1945 match value {
1946 0 => Self::Unspecified,
1947 1 => Self::DsRecordsUnpublished,
1948 2 => Self::DsRecordsPublished,
1949 _ => Self::UnknownValue(ds_state::UnknownValue(
1950 wkt::internal::UnknownEnumValue::Integer(value),
1951 )),
1952 }
1953 }
1954 }
1955
1956 impl std::convert::From<&str> for DsState {
1957 fn from(value: &str) -> Self {
1958 use std::string::ToString;
1959 match value {
1960 "DS_STATE_UNSPECIFIED" => Self::Unspecified,
1961 "DS_RECORDS_UNPUBLISHED" => Self::DsRecordsUnpublished,
1962 "DS_RECORDS_PUBLISHED" => Self::DsRecordsPublished,
1963 _ => Self::UnknownValue(ds_state::UnknownValue(
1964 wkt::internal::UnknownEnumValue::String(value.to_string()),
1965 )),
1966 }
1967 }
1968 }
1969
1970 impl serde::ser::Serialize for DsState {
1971 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1972 where
1973 S: serde::Serializer,
1974 {
1975 match self {
1976 Self::Unspecified => serializer.serialize_i32(0),
1977 Self::DsRecordsUnpublished => serializer.serialize_i32(1),
1978 Self::DsRecordsPublished => serializer.serialize_i32(2),
1979 Self::UnknownValue(u) => u.0.serialize(serializer),
1980 }
1981 }
1982 }
1983
1984 impl<'de> serde::de::Deserialize<'de> for DsState {
1985 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1986 where
1987 D: serde::Deserializer<'de>,
1988 {
1989 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DsState>::new(
1990 ".google.cloud.domains.v1.DnsSettings.DsState",
1991 ))
1992 }
1993 }
1994
1995 /// The DNS provider of the registration.
1996 #[derive(Clone, Debug, PartialEq)]
1997 #[non_exhaustive]
1998 pub enum DnsProvider {
1999 /// An arbitrary DNS provider identified by its name servers.
2000 CustomDns(std::boxed::Box<crate::model::dns_settings::CustomDns>),
2001 /// The free DNS zone provided by
2002 /// [Google Domains](https://domains.google/).
2003 GoogleDomainsDns(std::boxed::Box<crate::model::dns_settings::GoogleDomainsDns>),
2004 }
2005}
2006
2007/// Defines the contact information associated with a `Registration`.
2008///
2009/// [ICANN](https://icann.org/) requires all domain names to have associated
2010/// contact information. The `registrant_contact` is considered the
2011/// domain's legal owner, and often the other contacts are identical.
2012#[derive(Clone, Default, PartialEq)]
2013#[non_exhaustive]
2014pub struct ContactSettings {
2015 /// Required. Privacy setting for the contacts associated with the `Registration`.
2016 pub privacy: crate::model::ContactPrivacy,
2017
2018 /// Required. The registrant contact for the `Registration`.
2019 ///
2020 /// *Caution: Anyone with access to this email address, phone number,
2021 /// and/or postal address can take control of the domain.*
2022 ///
2023 /// *Warning: For new `Registration`s, the registrant receives an email
2024 /// confirmation that they must complete within 15 days to avoid domain
2025 /// suspension.*
2026 pub registrant_contact: std::option::Option<crate::model::contact_settings::Contact>,
2027
2028 /// Required. The administrative contact for the `Registration`.
2029 pub admin_contact: std::option::Option<crate::model::contact_settings::Contact>,
2030
2031 /// Required. The technical contact for the `Registration`.
2032 pub technical_contact: std::option::Option<crate::model::contact_settings::Contact>,
2033
2034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2035}
2036
2037impl ContactSettings {
2038 /// Creates a new default instance.
2039 pub fn new() -> Self {
2040 std::default::Default::default()
2041 }
2042
2043 /// Sets the value of [privacy][crate::model::ContactSettings::privacy].
2044 ///
2045 /// # Example
2046 /// ```ignore,no_run
2047 /// # use google_cloud_domains_v1::model::ContactSettings;
2048 /// use google_cloud_domains_v1::model::ContactPrivacy;
2049 /// let x0 = ContactSettings::new().set_privacy(ContactPrivacy::PublicContactData);
2050 /// let x1 = ContactSettings::new().set_privacy(ContactPrivacy::PrivateContactData);
2051 /// let x2 = ContactSettings::new().set_privacy(ContactPrivacy::RedactedContactData);
2052 /// ```
2053 pub fn set_privacy<T: std::convert::Into<crate::model::ContactPrivacy>>(
2054 mut self,
2055 v: T,
2056 ) -> Self {
2057 self.privacy = v.into();
2058 self
2059 }
2060
2061 /// Sets the value of [registrant_contact][crate::model::ContactSettings::registrant_contact].
2062 ///
2063 /// # Example
2064 /// ```ignore,no_run
2065 /// # use google_cloud_domains_v1::model::ContactSettings;
2066 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2067 /// let x = ContactSettings::new().set_registrant_contact(Contact::default()/* use setters */);
2068 /// ```
2069 pub fn set_registrant_contact<T>(mut self, v: T) -> Self
2070 where
2071 T: std::convert::Into<crate::model::contact_settings::Contact>,
2072 {
2073 self.registrant_contact = std::option::Option::Some(v.into());
2074 self
2075 }
2076
2077 /// Sets or clears the value of [registrant_contact][crate::model::ContactSettings::registrant_contact].
2078 ///
2079 /// # Example
2080 /// ```ignore,no_run
2081 /// # use google_cloud_domains_v1::model::ContactSettings;
2082 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2083 /// let x = ContactSettings::new().set_or_clear_registrant_contact(Some(Contact::default()/* use setters */));
2084 /// let x = ContactSettings::new().set_or_clear_registrant_contact(None::<Contact>);
2085 /// ```
2086 pub fn set_or_clear_registrant_contact<T>(mut self, v: std::option::Option<T>) -> Self
2087 where
2088 T: std::convert::Into<crate::model::contact_settings::Contact>,
2089 {
2090 self.registrant_contact = v.map(|x| x.into());
2091 self
2092 }
2093
2094 /// Sets the value of [admin_contact][crate::model::ContactSettings::admin_contact].
2095 ///
2096 /// # Example
2097 /// ```ignore,no_run
2098 /// # use google_cloud_domains_v1::model::ContactSettings;
2099 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2100 /// let x = ContactSettings::new().set_admin_contact(Contact::default()/* use setters */);
2101 /// ```
2102 pub fn set_admin_contact<T>(mut self, v: T) -> Self
2103 where
2104 T: std::convert::Into<crate::model::contact_settings::Contact>,
2105 {
2106 self.admin_contact = std::option::Option::Some(v.into());
2107 self
2108 }
2109
2110 /// Sets or clears the value of [admin_contact][crate::model::ContactSettings::admin_contact].
2111 ///
2112 /// # Example
2113 /// ```ignore,no_run
2114 /// # use google_cloud_domains_v1::model::ContactSettings;
2115 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2116 /// let x = ContactSettings::new().set_or_clear_admin_contact(Some(Contact::default()/* use setters */));
2117 /// let x = ContactSettings::new().set_or_clear_admin_contact(None::<Contact>);
2118 /// ```
2119 pub fn set_or_clear_admin_contact<T>(mut self, v: std::option::Option<T>) -> Self
2120 where
2121 T: std::convert::Into<crate::model::contact_settings::Contact>,
2122 {
2123 self.admin_contact = v.map(|x| x.into());
2124 self
2125 }
2126
2127 /// Sets the value of [technical_contact][crate::model::ContactSettings::technical_contact].
2128 ///
2129 /// # Example
2130 /// ```ignore,no_run
2131 /// # use google_cloud_domains_v1::model::ContactSettings;
2132 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2133 /// let x = ContactSettings::new().set_technical_contact(Contact::default()/* use setters */);
2134 /// ```
2135 pub fn set_technical_contact<T>(mut self, v: T) -> Self
2136 where
2137 T: std::convert::Into<crate::model::contact_settings::Contact>,
2138 {
2139 self.technical_contact = std::option::Option::Some(v.into());
2140 self
2141 }
2142
2143 /// Sets or clears the value of [technical_contact][crate::model::ContactSettings::technical_contact].
2144 ///
2145 /// # Example
2146 /// ```ignore,no_run
2147 /// # use google_cloud_domains_v1::model::ContactSettings;
2148 /// use google_cloud_domains_v1::model::contact_settings::Contact;
2149 /// let x = ContactSettings::new().set_or_clear_technical_contact(Some(Contact::default()/* use setters */));
2150 /// let x = ContactSettings::new().set_or_clear_technical_contact(None::<Contact>);
2151 /// ```
2152 pub fn set_or_clear_technical_contact<T>(mut self, v: std::option::Option<T>) -> Self
2153 where
2154 T: std::convert::Into<crate::model::contact_settings::Contact>,
2155 {
2156 self.technical_contact = v.map(|x| x.into());
2157 self
2158 }
2159}
2160
2161impl wkt::message::Message for ContactSettings {
2162 fn typename() -> &'static str {
2163 "type.googleapis.com/google.cloud.domains.v1.ContactSettings"
2164 }
2165}
2166
2167/// Defines additional types related to [ContactSettings].
2168pub mod contact_settings {
2169 #[allow(unused_imports)]
2170 use super::*;
2171
2172 /// Details required for a contact associated with a `Registration`.
2173 #[derive(Clone, Default, PartialEq)]
2174 #[non_exhaustive]
2175 pub struct Contact {
2176 /// Required. Postal address of the contact.
2177 pub postal_address: std::option::Option<google_cloud_type::model::PostalAddress>,
2178
2179 /// Required. Email address of the contact.
2180 pub email: std::string::String,
2181
2182 /// Required. Phone number of the contact in international format. For example,
2183 /// `"+1-800-555-0123"`.
2184 pub phone_number: std::string::String,
2185
2186 /// Fax number of the contact in international format. For example,
2187 /// `"+1-800-555-0123"`.
2188 pub fax_number: std::string::String,
2189
2190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2191 }
2192
2193 impl Contact {
2194 /// Creates a new default instance.
2195 pub fn new() -> Self {
2196 std::default::Default::default()
2197 }
2198
2199 /// Sets the value of [postal_address][crate::model::contact_settings::Contact::postal_address].
2200 ///
2201 /// # Example
2202 /// ```ignore,no_run
2203 /// # use google_cloud_domains_v1::model::contact_settings::Contact;
2204 /// use google_cloud_type::model::PostalAddress;
2205 /// let x = Contact::new().set_postal_address(PostalAddress::default()/* use setters */);
2206 /// ```
2207 pub fn set_postal_address<T>(mut self, v: T) -> Self
2208 where
2209 T: std::convert::Into<google_cloud_type::model::PostalAddress>,
2210 {
2211 self.postal_address = std::option::Option::Some(v.into());
2212 self
2213 }
2214
2215 /// Sets or clears the value of [postal_address][crate::model::contact_settings::Contact::postal_address].
2216 ///
2217 /// # Example
2218 /// ```ignore,no_run
2219 /// # use google_cloud_domains_v1::model::contact_settings::Contact;
2220 /// use google_cloud_type::model::PostalAddress;
2221 /// let x = Contact::new().set_or_clear_postal_address(Some(PostalAddress::default()/* use setters */));
2222 /// let x = Contact::new().set_or_clear_postal_address(None::<PostalAddress>);
2223 /// ```
2224 pub fn set_or_clear_postal_address<T>(mut self, v: std::option::Option<T>) -> Self
2225 where
2226 T: std::convert::Into<google_cloud_type::model::PostalAddress>,
2227 {
2228 self.postal_address = v.map(|x| x.into());
2229 self
2230 }
2231
2232 /// Sets the value of [email][crate::model::contact_settings::Contact::email].
2233 ///
2234 /// # Example
2235 /// ```ignore,no_run
2236 /// # use google_cloud_domains_v1::model::contact_settings::Contact;
2237 /// let x = Contact::new().set_email("example");
2238 /// ```
2239 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2240 self.email = v.into();
2241 self
2242 }
2243
2244 /// Sets the value of [phone_number][crate::model::contact_settings::Contact::phone_number].
2245 ///
2246 /// # Example
2247 /// ```ignore,no_run
2248 /// # use google_cloud_domains_v1::model::contact_settings::Contact;
2249 /// let x = Contact::new().set_phone_number("example");
2250 /// ```
2251 pub fn set_phone_number<T: std::convert::Into<std::string::String>>(
2252 mut self,
2253 v: T,
2254 ) -> Self {
2255 self.phone_number = v.into();
2256 self
2257 }
2258
2259 /// Sets the value of [fax_number][crate::model::contact_settings::Contact::fax_number].
2260 ///
2261 /// # Example
2262 /// ```ignore,no_run
2263 /// # use google_cloud_domains_v1::model::contact_settings::Contact;
2264 /// let x = Contact::new().set_fax_number("example");
2265 /// ```
2266 pub fn set_fax_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2267 self.fax_number = v.into();
2268 self
2269 }
2270 }
2271
2272 impl wkt::message::Message for Contact {
2273 fn typename() -> &'static str {
2274 "type.googleapis.com/google.cloud.domains.v1.ContactSettings.Contact"
2275 }
2276 }
2277}
2278
2279/// Request for the `SearchDomains` method.
2280#[derive(Clone, Default, PartialEq)]
2281#[non_exhaustive]
2282pub struct SearchDomainsRequest {
2283 /// Required. String used to search for available domain names.
2284 pub query: std::string::String,
2285
2286 /// Required. The location. Must be in the format `projects/*/locations/*`.
2287 pub location: std::string::String,
2288
2289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2290}
2291
2292impl SearchDomainsRequest {
2293 /// Creates a new default instance.
2294 pub fn new() -> Self {
2295 std::default::Default::default()
2296 }
2297
2298 /// Sets the value of [query][crate::model::SearchDomainsRequest::query].
2299 ///
2300 /// # Example
2301 /// ```ignore,no_run
2302 /// # use google_cloud_domains_v1::model::SearchDomainsRequest;
2303 /// let x = SearchDomainsRequest::new().set_query("example");
2304 /// ```
2305 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.query = v.into();
2307 self
2308 }
2309
2310 /// Sets the value of [location][crate::model::SearchDomainsRequest::location].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_domains_v1::model::SearchDomainsRequest;
2315 /// let x = SearchDomainsRequest::new().set_location("example");
2316 /// ```
2317 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.location = v.into();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for SearchDomainsRequest {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.domains.v1.SearchDomainsRequest"
2326 }
2327}
2328
2329/// Response for the `SearchDomains` method.
2330#[derive(Clone, Default, PartialEq)]
2331#[non_exhaustive]
2332pub struct SearchDomainsResponse {
2333 /// Results of the domain name search.
2334 pub register_parameters: std::vec::Vec<crate::model::RegisterParameters>,
2335
2336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2337}
2338
2339impl SearchDomainsResponse {
2340 /// Creates a new default instance.
2341 pub fn new() -> Self {
2342 std::default::Default::default()
2343 }
2344
2345 /// Sets the value of [register_parameters][crate::model::SearchDomainsResponse::register_parameters].
2346 ///
2347 /// # Example
2348 /// ```ignore,no_run
2349 /// # use google_cloud_domains_v1::model::SearchDomainsResponse;
2350 /// use google_cloud_domains_v1::model::RegisterParameters;
2351 /// let x = SearchDomainsResponse::new()
2352 /// .set_register_parameters([
2353 /// RegisterParameters::default()/* use setters */,
2354 /// RegisterParameters::default()/* use (different) setters */,
2355 /// ]);
2356 /// ```
2357 pub fn set_register_parameters<T, V>(mut self, v: T) -> Self
2358 where
2359 T: std::iter::IntoIterator<Item = V>,
2360 V: std::convert::Into<crate::model::RegisterParameters>,
2361 {
2362 use std::iter::Iterator;
2363 self.register_parameters = v.into_iter().map(|i| i.into()).collect();
2364 self
2365 }
2366}
2367
2368impl wkt::message::Message for SearchDomainsResponse {
2369 fn typename() -> &'static str {
2370 "type.googleapis.com/google.cloud.domains.v1.SearchDomainsResponse"
2371 }
2372}
2373
2374/// Request for the `RetrieveRegisterParameters` method.
2375#[derive(Clone, Default, PartialEq)]
2376#[non_exhaustive]
2377pub struct RetrieveRegisterParametersRequest {
2378 /// Required. The domain name. Unicode domain names must be expressed in Punycode format.
2379 pub domain_name: std::string::String,
2380
2381 /// Required. The location. Must be in the format `projects/*/locations/*`.
2382 pub location: std::string::String,
2383
2384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2385}
2386
2387impl RetrieveRegisterParametersRequest {
2388 /// Creates a new default instance.
2389 pub fn new() -> Self {
2390 std::default::Default::default()
2391 }
2392
2393 /// Sets the value of [domain_name][crate::model::RetrieveRegisterParametersRequest::domain_name].
2394 ///
2395 /// # Example
2396 /// ```ignore,no_run
2397 /// # use google_cloud_domains_v1::model::RetrieveRegisterParametersRequest;
2398 /// let x = RetrieveRegisterParametersRequest::new().set_domain_name("example");
2399 /// ```
2400 pub fn set_domain_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2401 self.domain_name = v.into();
2402 self
2403 }
2404
2405 /// Sets the value of [location][crate::model::RetrieveRegisterParametersRequest::location].
2406 ///
2407 /// # Example
2408 /// ```ignore,no_run
2409 /// # use google_cloud_domains_v1::model::RetrieveRegisterParametersRequest;
2410 /// let x = RetrieveRegisterParametersRequest::new().set_location("example");
2411 /// ```
2412 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2413 self.location = v.into();
2414 self
2415 }
2416}
2417
2418impl wkt::message::Message for RetrieveRegisterParametersRequest {
2419 fn typename() -> &'static str {
2420 "type.googleapis.com/google.cloud.domains.v1.RetrieveRegisterParametersRequest"
2421 }
2422}
2423
2424/// Response for the `RetrieveRegisterParameters` method.
2425#[derive(Clone, Default, PartialEq)]
2426#[non_exhaustive]
2427pub struct RetrieveRegisterParametersResponse {
2428 /// Parameters to use when calling the `RegisterDomain` method.
2429 pub register_parameters: std::option::Option<crate::model::RegisterParameters>,
2430
2431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2432}
2433
2434impl RetrieveRegisterParametersResponse {
2435 /// Creates a new default instance.
2436 pub fn new() -> Self {
2437 std::default::Default::default()
2438 }
2439
2440 /// Sets the value of [register_parameters][crate::model::RetrieveRegisterParametersResponse::register_parameters].
2441 ///
2442 /// # Example
2443 /// ```ignore,no_run
2444 /// # use google_cloud_domains_v1::model::RetrieveRegisterParametersResponse;
2445 /// use google_cloud_domains_v1::model::RegisterParameters;
2446 /// let x = RetrieveRegisterParametersResponse::new().set_register_parameters(RegisterParameters::default()/* use setters */);
2447 /// ```
2448 pub fn set_register_parameters<T>(mut self, v: T) -> Self
2449 where
2450 T: std::convert::Into<crate::model::RegisterParameters>,
2451 {
2452 self.register_parameters = std::option::Option::Some(v.into());
2453 self
2454 }
2455
2456 /// Sets or clears the value of [register_parameters][crate::model::RetrieveRegisterParametersResponse::register_parameters].
2457 ///
2458 /// # Example
2459 /// ```ignore,no_run
2460 /// # use google_cloud_domains_v1::model::RetrieveRegisterParametersResponse;
2461 /// use google_cloud_domains_v1::model::RegisterParameters;
2462 /// let x = RetrieveRegisterParametersResponse::new().set_or_clear_register_parameters(Some(RegisterParameters::default()/* use setters */));
2463 /// let x = RetrieveRegisterParametersResponse::new().set_or_clear_register_parameters(None::<RegisterParameters>);
2464 /// ```
2465 pub fn set_or_clear_register_parameters<T>(mut self, v: std::option::Option<T>) -> Self
2466 where
2467 T: std::convert::Into<crate::model::RegisterParameters>,
2468 {
2469 self.register_parameters = v.map(|x| x.into());
2470 self
2471 }
2472}
2473
2474impl wkt::message::Message for RetrieveRegisterParametersResponse {
2475 fn typename() -> &'static str {
2476 "type.googleapis.com/google.cloud.domains.v1.RetrieveRegisterParametersResponse"
2477 }
2478}
2479
2480/// Request for the `RegisterDomain` method.
2481#[derive(Clone, Default, PartialEq)]
2482#[non_exhaustive]
2483pub struct RegisterDomainRequest {
2484 /// Required. The parent resource of the `Registration`. Must be in the
2485 /// format `projects/*/locations/*`.
2486 pub parent: std::string::String,
2487
2488 /// Required. The complete `Registration` resource to be created.
2489 pub registration: std::option::Option<crate::model::Registration>,
2490
2491 /// The list of domain notices that you acknowledge. Call
2492 /// `RetrieveRegisterParameters` to see the notices that need acknowledgement.
2493 pub domain_notices: std::vec::Vec<crate::model::DomainNotice>,
2494
2495 /// The list of contact notices that the caller acknowledges. The notices
2496 /// needed here depend on the values specified in
2497 /// `registration.contact_settings`.
2498 pub contact_notices: std::vec::Vec<crate::model::ContactNotice>,
2499
2500 /// Required. Yearly price to register or renew the domain.
2501 /// The value that should be put here can be obtained from
2502 /// RetrieveRegisterParameters or SearchDomains calls.
2503 pub yearly_price: std::option::Option<google_cloud_type::model::Money>,
2504
2505 /// When true, only validation is performed, without actually registering
2506 /// the domain. Follows:
2507 /// <https://cloud.google.com/apis/design/design_patterns#request_validation>
2508 pub validate_only: bool,
2509
2510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2511}
2512
2513impl RegisterDomainRequest {
2514 /// Creates a new default instance.
2515 pub fn new() -> Self {
2516 std::default::Default::default()
2517 }
2518
2519 /// Sets the value of [parent][crate::model::RegisterDomainRequest::parent].
2520 ///
2521 /// # Example
2522 /// ```ignore,no_run
2523 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2524 /// let x = RegisterDomainRequest::new().set_parent("example");
2525 /// ```
2526 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2527 self.parent = v.into();
2528 self
2529 }
2530
2531 /// Sets the value of [registration][crate::model::RegisterDomainRequest::registration].
2532 ///
2533 /// # Example
2534 /// ```ignore,no_run
2535 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2536 /// use google_cloud_domains_v1::model::Registration;
2537 /// let x = RegisterDomainRequest::new().set_registration(Registration::default()/* use setters */);
2538 /// ```
2539 pub fn set_registration<T>(mut self, v: T) -> Self
2540 where
2541 T: std::convert::Into<crate::model::Registration>,
2542 {
2543 self.registration = std::option::Option::Some(v.into());
2544 self
2545 }
2546
2547 /// Sets or clears the value of [registration][crate::model::RegisterDomainRequest::registration].
2548 ///
2549 /// # Example
2550 /// ```ignore,no_run
2551 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2552 /// use google_cloud_domains_v1::model::Registration;
2553 /// let x = RegisterDomainRequest::new().set_or_clear_registration(Some(Registration::default()/* use setters */));
2554 /// let x = RegisterDomainRequest::new().set_or_clear_registration(None::<Registration>);
2555 /// ```
2556 pub fn set_or_clear_registration<T>(mut self, v: std::option::Option<T>) -> Self
2557 where
2558 T: std::convert::Into<crate::model::Registration>,
2559 {
2560 self.registration = v.map(|x| x.into());
2561 self
2562 }
2563
2564 /// Sets the value of [domain_notices][crate::model::RegisterDomainRequest::domain_notices].
2565 ///
2566 /// # Example
2567 /// ```ignore,no_run
2568 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2569 /// use google_cloud_domains_v1::model::DomainNotice;
2570 /// let x = RegisterDomainRequest::new().set_domain_notices([
2571 /// DomainNotice::HstsPreloaded,
2572 /// ]);
2573 /// ```
2574 pub fn set_domain_notices<T, V>(mut self, v: T) -> Self
2575 where
2576 T: std::iter::IntoIterator<Item = V>,
2577 V: std::convert::Into<crate::model::DomainNotice>,
2578 {
2579 use std::iter::Iterator;
2580 self.domain_notices = v.into_iter().map(|i| i.into()).collect();
2581 self
2582 }
2583
2584 /// Sets the value of [contact_notices][crate::model::RegisterDomainRequest::contact_notices].
2585 ///
2586 /// # Example
2587 /// ```ignore,no_run
2588 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2589 /// use google_cloud_domains_v1::model::ContactNotice;
2590 /// let x = RegisterDomainRequest::new().set_contact_notices([
2591 /// ContactNotice::PublicContactDataAcknowledgement,
2592 /// ]);
2593 /// ```
2594 pub fn set_contact_notices<T, V>(mut self, v: T) -> Self
2595 where
2596 T: std::iter::IntoIterator<Item = V>,
2597 V: std::convert::Into<crate::model::ContactNotice>,
2598 {
2599 use std::iter::Iterator;
2600 self.contact_notices = v.into_iter().map(|i| i.into()).collect();
2601 self
2602 }
2603
2604 /// Sets the value of [yearly_price][crate::model::RegisterDomainRequest::yearly_price].
2605 ///
2606 /// # Example
2607 /// ```ignore,no_run
2608 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2609 /// use google_cloud_type::model::Money;
2610 /// let x = RegisterDomainRequest::new().set_yearly_price(Money::default()/* use setters */);
2611 /// ```
2612 pub fn set_yearly_price<T>(mut self, v: T) -> Self
2613 where
2614 T: std::convert::Into<google_cloud_type::model::Money>,
2615 {
2616 self.yearly_price = std::option::Option::Some(v.into());
2617 self
2618 }
2619
2620 /// Sets or clears the value of [yearly_price][crate::model::RegisterDomainRequest::yearly_price].
2621 ///
2622 /// # Example
2623 /// ```ignore,no_run
2624 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2625 /// use google_cloud_type::model::Money;
2626 /// let x = RegisterDomainRequest::new().set_or_clear_yearly_price(Some(Money::default()/* use setters */));
2627 /// let x = RegisterDomainRequest::new().set_or_clear_yearly_price(None::<Money>);
2628 /// ```
2629 pub fn set_or_clear_yearly_price<T>(mut self, v: std::option::Option<T>) -> Self
2630 where
2631 T: std::convert::Into<google_cloud_type::model::Money>,
2632 {
2633 self.yearly_price = v.map(|x| x.into());
2634 self
2635 }
2636
2637 /// Sets the value of [validate_only][crate::model::RegisterDomainRequest::validate_only].
2638 ///
2639 /// # Example
2640 /// ```ignore,no_run
2641 /// # use google_cloud_domains_v1::model::RegisterDomainRequest;
2642 /// let x = RegisterDomainRequest::new().set_validate_only(true);
2643 /// ```
2644 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2645 self.validate_only = v.into();
2646 self
2647 }
2648}
2649
2650impl wkt::message::Message for RegisterDomainRequest {
2651 fn typename() -> &'static str {
2652 "type.googleapis.com/google.cloud.domains.v1.RegisterDomainRequest"
2653 }
2654}
2655
2656/// Request for the `RetrieveTransferParameters` method.
2657#[derive(Clone, Default, PartialEq)]
2658#[non_exhaustive]
2659pub struct RetrieveTransferParametersRequest {
2660 /// Required. The domain name. Unicode domain names must be expressed in Punycode format.
2661 pub domain_name: std::string::String,
2662
2663 /// Required. The location. Must be in the format `projects/*/locations/*`.
2664 pub location: std::string::String,
2665
2666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2667}
2668
2669impl RetrieveTransferParametersRequest {
2670 /// Creates a new default instance.
2671 pub fn new() -> Self {
2672 std::default::Default::default()
2673 }
2674
2675 /// Sets the value of [domain_name][crate::model::RetrieveTransferParametersRequest::domain_name].
2676 ///
2677 /// # Example
2678 /// ```ignore,no_run
2679 /// # use google_cloud_domains_v1::model::RetrieveTransferParametersRequest;
2680 /// let x = RetrieveTransferParametersRequest::new().set_domain_name("example");
2681 /// ```
2682 pub fn set_domain_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2683 self.domain_name = v.into();
2684 self
2685 }
2686
2687 /// Sets the value of [location][crate::model::RetrieveTransferParametersRequest::location].
2688 ///
2689 /// # Example
2690 /// ```ignore,no_run
2691 /// # use google_cloud_domains_v1::model::RetrieveTransferParametersRequest;
2692 /// let x = RetrieveTransferParametersRequest::new().set_location("example");
2693 /// ```
2694 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2695 self.location = v.into();
2696 self
2697 }
2698}
2699
2700impl wkt::message::Message for RetrieveTransferParametersRequest {
2701 fn typename() -> &'static str {
2702 "type.googleapis.com/google.cloud.domains.v1.RetrieveTransferParametersRequest"
2703 }
2704}
2705
2706/// Response for the `RetrieveTransferParameters` method.
2707#[derive(Clone, Default, PartialEq)]
2708#[non_exhaustive]
2709pub struct RetrieveTransferParametersResponse {
2710 /// Parameters to use when calling the `TransferDomain` method.
2711 pub transfer_parameters: std::option::Option<crate::model::TransferParameters>,
2712
2713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2714}
2715
2716impl RetrieveTransferParametersResponse {
2717 /// Creates a new default instance.
2718 pub fn new() -> Self {
2719 std::default::Default::default()
2720 }
2721
2722 /// Sets the value of [transfer_parameters][crate::model::RetrieveTransferParametersResponse::transfer_parameters].
2723 ///
2724 /// # Example
2725 /// ```ignore,no_run
2726 /// # use google_cloud_domains_v1::model::RetrieveTransferParametersResponse;
2727 /// use google_cloud_domains_v1::model::TransferParameters;
2728 /// let x = RetrieveTransferParametersResponse::new().set_transfer_parameters(TransferParameters::default()/* use setters */);
2729 /// ```
2730 pub fn set_transfer_parameters<T>(mut self, v: T) -> Self
2731 where
2732 T: std::convert::Into<crate::model::TransferParameters>,
2733 {
2734 self.transfer_parameters = std::option::Option::Some(v.into());
2735 self
2736 }
2737
2738 /// Sets or clears the value of [transfer_parameters][crate::model::RetrieveTransferParametersResponse::transfer_parameters].
2739 ///
2740 /// # Example
2741 /// ```ignore,no_run
2742 /// # use google_cloud_domains_v1::model::RetrieveTransferParametersResponse;
2743 /// use google_cloud_domains_v1::model::TransferParameters;
2744 /// let x = RetrieveTransferParametersResponse::new().set_or_clear_transfer_parameters(Some(TransferParameters::default()/* use setters */));
2745 /// let x = RetrieveTransferParametersResponse::new().set_or_clear_transfer_parameters(None::<TransferParameters>);
2746 /// ```
2747 pub fn set_or_clear_transfer_parameters<T>(mut self, v: std::option::Option<T>) -> Self
2748 where
2749 T: std::convert::Into<crate::model::TransferParameters>,
2750 {
2751 self.transfer_parameters = v.map(|x| x.into());
2752 self
2753 }
2754}
2755
2756impl wkt::message::Message for RetrieveTransferParametersResponse {
2757 fn typename() -> &'static str {
2758 "type.googleapis.com/google.cloud.domains.v1.RetrieveTransferParametersResponse"
2759 }
2760}
2761
2762/// Request for the `TransferDomain` method.
2763#[derive(Clone, Default, PartialEq)]
2764#[non_exhaustive]
2765pub struct TransferDomainRequest {
2766 /// Required. The parent resource of the `Registration`. Must be in the
2767 /// format `projects/*/locations/*`.
2768 pub parent: std::string::String,
2769
2770 /// Required. The complete `Registration` resource to be created.
2771 ///
2772 /// You can leave `registration.dns_settings` unset to import the
2773 /// domain's current DNS configuration from its current registrar. Use this
2774 /// option only if you are sure that the domain's current DNS service
2775 /// does not cease upon transfer, as is often the case for DNS services
2776 /// provided for free by the registrar.
2777 pub registration: std::option::Option<crate::model::Registration>,
2778
2779 /// The list of contact notices that you acknowledge. The notices
2780 /// needed here depend on the values specified in
2781 /// `registration.contact_settings`.
2782 pub contact_notices: std::vec::Vec<crate::model::ContactNotice>,
2783
2784 /// Required. Acknowledgement of the price to transfer or renew the domain for one year.
2785 /// Call `RetrieveTransferParameters` to obtain the price, which you must
2786 /// acknowledge.
2787 pub yearly_price: std::option::Option<google_cloud_type::model::Money>,
2788
2789 /// The domain's transfer authorization code. You can obtain this from the
2790 /// domain's current registrar.
2791 pub authorization_code: std::option::Option<crate::model::AuthorizationCode>,
2792
2793 /// Validate the request without actually transferring the domain.
2794 pub validate_only: bool,
2795
2796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2797}
2798
2799impl TransferDomainRequest {
2800 /// Creates a new default instance.
2801 pub fn new() -> Self {
2802 std::default::Default::default()
2803 }
2804
2805 /// Sets the value of [parent][crate::model::TransferDomainRequest::parent].
2806 ///
2807 /// # Example
2808 /// ```ignore,no_run
2809 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2810 /// let x = TransferDomainRequest::new().set_parent("example");
2811 /// ```
2812 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.parent = v.into();
2814 self
2815 }
2816
2817 /// Sets the value of [registration][crate::model::TransferDomainRequest::registration].
2818 ///
2819 /// # Example
2820 /// ```ignore,no_run
2821 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2822 /// use google_cloud_domains_v1::model::Registration;
2823 /// let x = TransferDomainRequest::new().set_registration(Registration::default()/* use setters */);
2824 /// ```
2825 pub fn set_registration<T>(mut self, v: T) -> Self
2826 where
2827 T: std::convert::Into<crate::model::Registration>,
2828 {
2829 self.registration = std::option::Option::Some(v.into());
2830 self
2831 }
2832
2833 /// Sets or clears the value of [registration][crate::model::TransferDomainRequest::registration].
2834 ///
2835 /// # Example
2836 /// ```ignore,no_run
2837 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2838 /// use google_cloud_domains_v1::model::Registration;
2839 /// let x = TransferDomainRequest::new().set_or_clear_registration(Some(Registration::default()/* use setters */));
2840 /// let x = TransferDomainRequest::new().set_or_clear_registration(None::<Registration>);
2841 /// ```
2842 pub fn set_or_clear_registration<T>(mut self, v: std::option::Option<T>) -> Self
2843 where
2844 T: std::convert::Into<crate::model::Registration>,
2845 {
2846 self.registration = v.map(|x| x.into());
2847 self
2848 }
2849
2850 /// Sets the value of [contact_notices][crate::model::TransferDomainRequest::contact_notices].
2851 ///
2852 /// # Example
2853 /// ```ignore,no_run
2854 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2855 /// use google_cloud_domains_v1::model::ContactNotice;
2856 /// let x = TransferDomainRequest::new().set_contact_notices([
2857 /// ContactNotice::PublicContactDataAcknowledgement,
2858 /// ]);
2859 /// ```
2860 pub fn set_contact_notices<T, V>(mut self, v: T) -> Self
2861 where
2862 T: std::iter::IntoIterator<Item = V>,
2863 V: std::convert::Into<crate::model::ContactNotice>,
2864 {
2865 use std::iter::Iterator;
2866 self.contact_notices = v.into_iter().map(|i| i.into()).collect();
2867 self
2868 }
2869
2870 /// Sets the value of [yearly_price][crate::model::TransferDomainRequest::yearly_price].
2871 ///
2872 /// # Example
2873 /// ```ignore,no_run
2874 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2875 /// use google_cloud_type::model::Money;
2876 /// let x = TransferDomainRequest::new().set_yearly_price(Money::default()/* use setters */);
2877 /// ```
2878 pub fn set_yearly_price<T>(mut self, v: T) -> Self
2879 where
2880 T: std::convert::Into<google_cloud_type::model::Money>,
2881 {
2882 self.yearly_price = std::option::Option::Some(v.into());
2883 self
2884 }
2885
2886 /// Sets or clears the value of [yearly_price][crate::model::TransferDomainRequest::yearly_price].
2887 ///
2888 /// # Example
2889 /// ```ignore,no_run
2890 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2891 /// use google_cloud_type::model::Money;
2892 /// let x = TransferDomainRequest::new().set_or_clear_yearly_price(Some(Money::default()/* use setters */));
2893 /// let x = TransferDomainRequest::new().set_or_clear_yearly_price(None::<Money>);
2894 /// ```
2895 pub fn set_or_clear_yearly_price<T>(mut self, v: std::option::Option<T>) -> Self
2896 where
2897 T: std::convert::Into<google_cloud_type::model::Money>,
2898 {
2899 self.yearly_price = v.map(|x| x.into());
2900 self
2901 }
2902
2903 /// Sets the value of [authorization_code][crate::model::TransferDomainRequest::authorization_code].
2904 ///
2905 /// # Example
2906 /// ```ignore,no_run
2907 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2908 /// use google_cloud_domains_v1::model::AuthorizationCode;
2909 /// let x = TransferDomainRequest::new().set_authorization_code(AuthorizationCode::default()/* use setters */);
2910 /// ```
2911 pub fn set_authorization_code<T>(mut self, v: T) -> Self
2912 where
2913 T: std::convert::Into<crate::model::AuthorizationCode>,
2914 {
2915 self.authorization_code = std::option::Option::Some(v.into());
2916 self
2917 }
2918
2919 /// Sets or clears the value of [authorization_code][crate::model::TransferDomainRequest::authorization_code].
2920 ///
2921 /// # Example
2922 /// ```ignore,no_run
2923 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2924 /// use google_cloud_domains_v1::model::AuthorizationCode;
2925 /// let x = TransferDomainRequest::new().set_or_clear_authorization_code(Some(AuthorizationCode::default()/* use setters */));
2926 /// let x = TransferDomainRequest::new().set_or_clear_authorization_code(None::<AuthorizationCode>);
2927 /// ```
2928 pub fn set_or_clear_authorization_code<T>(mut self, v: std::option::Option<T>) -> Self
2929 where
2930 T: std::convert::Into<crate::model::AuthorizationCode>,
2931 {
2932 self.authorization_code = v.map(|x| x.into());
2933 self
2934 }
2935
2936 /// Sets the value of [validate_only][crate::model::TransferDomainRequest::validate_only].
2937 ///
2938 /// # Example
2939 /// ```ignore,no_run
2940 /// # use google_cloud_domains_v1::model::TransferDomainRequest;
2941 /// let x = TransferDomainRequest::new().set_validate_only(true);
2942 /// ```
2943 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2944 self.validate_only = v.into();
2945 self
2946 }
2947}
2948
2949impl wkt::message::Message for TransferDomainRequest {
2950 fn typename() -> &'static str {
2951 "type.googleapis.com/google.cloud.domains.v1.TransferDomainRequest"
2952 }
2953}
2954
2955/// Request for the `ListRegistrations` method.
2956#[derive(Clone, Default, PartialEq)]
2957#[non_exhaustive]
2958pub struct ListRegistrationsRequest {
2959 /// Required. The project and location from which to list `Registration`s, specified in
2960 /// the format `projects/*/locations/*`.
2961 pub parent: std::string::String,
2962
2963 /// Maximum number of results to return.
2964 pub page_size: i32,
2965
2966 /// When set to the `next_page_token` from a prior response, provides the next
2967 /// page of results.
2968 pub page_token: std::string::String,
2969
2970 /// Filter expression to restrict the `Registration`s returned.
2971 ///
2972 /// The expression must specify the field name, a comparison operator, and the
2973 /// value that you want to use for filtering. The value must be a string, a
2974 /// number, a boolean, or an enum value. The comparison operator should be one
2975 /// of =, !=, >, <, >=, <=, or : for prefix or wildcard matches.
2976 ///
2977 /// For example, to filter to a specific domain name, use an expression like
2978 /// `domainName="example.com"`. You can also check for the existence of a
2979 /// field; for example, to find domains using custom DNS settings, use an
2980 /// expression like `dnsSettings.customDns:*`.
2981 ///
2982 /// You can also create compound filters by combining expressions with the
2983 /// `AND` and `OR` operators. For example, to find domains that are suspended
2984 /// or have specific issues flagged, use an expression like
2985 /// `(state=SUSPENDED) OR (issue:*)`.
2986 pub filter: std::string::String,
2987
2988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2989}
2990
2991impl ListRegistrationsRequest {
2992 /// Creates a new default instance.
2993 pub fn new() -> Self {
2994 std::default::Default::default()
2995 }
2996
2997 /// Sets the value of [parent][crate::model::ListRegistrationsRequest::parent].
2998 ///
2999 /// # Example
3000 /// ```ignore,no_run
3001 /// # use google_cloud_domains_v1::model::ListRegistrationsRequest;
3002 /// let x = ListRegistrationsRequest::new().set_parent("example");
3003 /// ```
3004 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3005 self.parent = v.into();
3006 self
3007 }
3008
3009 /// Sets the value of [page_size][crate::model::ListRegistrationsRequest::page_size].
3010 ///
3011 /// # Example
3012 /// ```ignore,no_run
3013 /// # use google_cloud_domains_v1::model::ListRegistrationsRequest;
3014 /// let x = ListRegistrationsRequest::new().set_page_size(42);
3015 /// ```
3016 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3017 self.page_size = v.into();
3018 self
3019 }
3020
3021 /// Sets the value of [page_token][crate::model::ListRegistrationsRequest::page_token].
3022 ///
3023 /// # Example
3024 /// ```ignore,no_run
3025 /// # use google_cloud_domains_v1::model::ListRegistrationsRequest;
3026 /// let x = ListRegistrationsRequest::new().set_page_token("example");
3027 /// ```
3028 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3029 self.page_token = v.into();
3030 self
3031 }
3032
3033 /// Sets the value of [filter][crate::model::ListRegistrationsRequest::filter].
3034 ///
3035 /// # Example
3036 /// ```ignore,no_run
3037 /// # use google_cloud_domains_v1::model::ListRegistrationsRequest;
3038 /// let x = ListRegistrationsRequest::new().set_filter("example");
3039 /// ```
3040 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041 self.filter = v.into();
3042 self
3043 }
3044}
3045
3046impl wkt::message::Message for ListRegistrationsRequest {
3047 fn typename() -> &'static str {
3048 "type.googleapis.com/google.cloud.domains.v1.ListRegistrationsRequest"
3049 }
3050}
3051
3052/// Response for the `ListRegistrations` method.
3053#[derive(Clone, Default, PartialEq)]
3054#[non_exhaustive]
3055pub struct ListRegistrationsResponse {
3056 /// A list of `Registration`s.
3057 pub registrations: std::vec::Vec<crate::model::Registration>,
3058
3059 /// When present, there are more results to retrieve. Set `page_token` to this
3060 /// value on a subsequent call to get the next page of results.
3061 pub next_page_token: std::string::String,
3062
3063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3064}
3065
3066impl ListRegistrationsResponse {
3067 /// Creates a new default instance.
3068 pub fn new() -> Self {
3069 std::default::Default::default()
3070 }
3071
3072 /// Sets the value of [registrations][crate::model::ListRegistrationsResponse::registrations].
3073 ///
3074 /// # Example
3075 /// ```ignore,no_run
3076 /// # use google_cloud_domains_v1::model::ListRegistrationsResponse;
3077 /// use google_cloud_domains_v1::model::Registration;
3078 /// let x = ListRegistrationsResponse::new()
3079 /// .set_registrations([
3080 /// Registration::default()/* use setters */,
3081 /// Registration::default()/* use (different) setters */,
3082 /// ]);
3083 /// ```
3084 pub fn set_registrations<T, V>(mut self, v: T) -> Self
3085 where
3086 T: std::iter::IntoIterator<Item = V>,
3087 V: std::convert::Into<crate::model::Registration>,
3088 {
3089 use std::iter::Iterator;
3090 self.registrations = v.into_iter().map(|i| i.into()).collect();
3091 self
3092 }
3093
3094 /// Sets the value of [next_page_token][crate::model::ListRegistrationsResponse::next_page_token].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_domains_v1::model::ListRegistrationsResponse;
3099 /// let x = ListRegistrationsResponse::new().set_next_page_token("example");
3100 /// ```
3101 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3102 self.next_page_token = v.into();
3103 self
3104 }
3105}
3106
3107impl wkt::message::Message for ListRegistrationsResponse {
3108 fn typename() -> &'static str {
3109 "type.googleapis.com/google.cloud.domains.v1.ListRegistrationsResponse"
3110 }
3111}
3112
3113#[doc(hidden)]
3114impl google_cloud_gax::paginator::internal::PageableResponse for ListRegistrationsResponse {
3115 type PageItem = crate::model::Registration;
3116
3117 fn items(self) -> std::vec::Vec<Self::PageItem> {
3118 self.registrations
3119 }
3120
3121 fn next_page_token(&self) -> std::string::String {
3122 use std::clone::Clone;
3123 self.next_page_token.clone()
3124 }
3125}
3126
3127/// Request for the `GetRegistration` method.
3128#[derive(Clone, Default, PartialEq)]
3129#[non_exhaustive]
3130pub struct GetRegistrationRequest {
3131 /// Required. The name of the `Registration` to get, in the format
3132 /// `projects/*/locations/*/registrations/*`.
3133 pub name: std::string::String,
3134
3135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3136}
3137
3138impl GetRegistrationRequest {
3139 /// Creates a new default instance.
3140 pub fn new() -> Self {
3141 std::default::Default::default()
3142 }
3143
3144 /// Sets the value of [name][crate::model::GetRegistrationRequest::name].
3145 ///
3146 /// # Example
3147 /// ```ignore,no_run
3148 /// # use google_cloud_domains_v1::model::GetRegistrationRequest;
3149 /// # let project_id = "project_id";
3150 /// # let location_id = "location_id";
3151 /// # let registration_id = "registration_id";
3152 /// let x = GetRegistrationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3153 /// ```
3154 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3155 self.name = v.into();
3156 self
3157 }
3158}
3159
3160impl wkt::message::Message for GetRegistrationRequest {
3161 fn typename() -> &'static str {
3162 "type.googleapis.com/google.cloud.domains.v1.GetRegistrationRequest"
3163 }
3164}
3165
3166/// Request for the `UpdateRegistration` method.
3167#[derive(Clone, Default, PartialEq)]
3168#[non_exhaustive]
3169pub struct UpdateRegistrationRequest {
3170 /// Fields of the `Registration` to update.
3171 pub registration: std::option::Option<crate::model::Registration>,
3172
3173 /// Required. The field mask describing which fields to update as a comma-separated list.
3174 /// For example, if only the labels are being updated, the `update_mask` is
3175 /// `"labels"`.
3176 pub update_mask: std::option::Option<wkt::FieldMask>,
3177
3178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3179}
3180
3181impl UpdateRegistrationRequest {
3182 /// Creates a new default instance.
3183 pub fn new() -> Self {
3184 std::default::Default::default()
3185 }
3186
3187 /// Sets the value of [registration][crate::model::UpdateRegistrationRequest::registration].
3188 ///
3189 /// # Example
3190 /// ```ignore,no_run
3191 /// # use google_cloud_domains_v1::model::UpdateRegistrationRequest;
3192 /// use google_cloud_domains_v1::model::Registration;
3193 /// let x = UpdateRegistrationRequest::new().set_registration(Registration::default()/* use setters */);
3194 /// ```
3195 pub fn set_registration<T>(mut self, v: T) -> Self
3196 where
3197 T: std::convert::Into<crate::model::Registration>,
3198 {
3199 self.registration = std::option::Option::Some(v.into());
3200 self
3201 }
3202
3203 /// Sets or clears the value of [registration][crate::model::UpdateRegistrationRequest::registration].
3204 ///
3205 /// # Example
3206 /// ```ignore,no_run
3207 /// # use google_cloud_domains_v1::model::UpdateRegistrationRequest;
3208 /// use google_cloud_domains_v1::model::Registration;
3209 /// let x = UpdateRegistrationRequest::new().set_or_clear_registration(Some(Registration::default()/* use setters */));
3210 /// let x = UpdateRegistrationRequest::new().set_or_clear_registration(None::<Registration>);
3211 /// ```
3212 pub fn set_or_clear_registration<T>(mut self, v: std::option::Option<T>) -> Self
3213 where
3214 T: std::convert::Into<crate::model::Registration>,
3215 {
3216 self.registration = v.map(|x| x.into());
3217 self
3218 }
3219
3220 /// Sets the value of [update_mask][crate::model::UpdateRegistrationRequest::update_mask].
3221 ///
3222 /// # Example
3223 /// ```ignore,no_run
3224 /// # use google_cloud_domains_v1::model::UpdateRegistrationRequest;
3225 /// use wkt::FieldMask;
3226 /// let x = UpdateRegistrationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3227 /// ```
3228 pub fn set_update_mask<T>(mut self, v: T) -> Self
3229 where
3230 T: std::convert::Into<wkt::FieldMask>,
3231 {
3232 self.update_mask = std::option::Option::Some(v.into());
3233 self
3234 }
3235
3236 /// Sets or clears the value of [update_mask][crate::model::UpdateRegistrationRequest::update_mask].
3237 ///
3238 /// # Example
3239 /// ```ignore,no_run
3240 /// # use google_cloud_domains_v1::model::UpdateRegistrationRequest;
3241 /// use wkt::FieldMask;
3242 /// let x = UpdateRegistrationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3243 /// let x = UpdateRegistrationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3244 /// ```
3245 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3246 where
3247 T: std::convert::Into<wkt::FieldMask>,
3248 {
3249 self.update_mask = v.map(|x| x.into());
3250 self
3251 }
3252}
3253
3254impl wkt::message::Message for UpdateRegistrationRequest {
3255 fn typename() -> &'static str {
3256 "type.googleapis.com/google.cloud.domains.v1.UpdateRegistrationRequest"
3257 }
3258}
3259
3260/// Request for the `ConfigureManagementSettings` method.
3261#[derive(Clone, Default, PartialEq)]
3262#[non_exhaustive]
3263pub struct ConfigureManagementSettingsRequest {
3264 /// Required. The name of the `Registration` whose management settings are being updated,
3265 /// in the format `projects/*/locations/*/registrations/*`.
3266 pub registration: std::string::String,
3267
3268 /// Fields of the `ManagementSettings` to update.
3269 pub management_settings: std::option::Option<crate::model::ManagementSettings>,
3270
3271 /// Required. The field mask describing which fields to update as a comma-separated list.
3272 /// For example, if only the transfer lock is being updated, the `update_mask`
3273 /// is `"transfer_lock_state"`.
3274 pub update_mask: std::option::Option<wkt::FieldMask>,
3275
3276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3277}
3278
3279impl ConfigureManagementSettingsRequest {
3280 /// Creates a new default instance.
3281 pub fn new() -> Self {
3282 std::default::Default::default()
3283 }
3284
3285 /// Sets the value of [registration][crate::model::ConfigureManagementSettingsRequest::registration].
3286 ///
3287 /// # Example
3288 /// ```ignore,no_run
3289 /// # use google_cloud_domains_v1::model::ConfigureManagementSettingsRequest;
3290 /// # let project_id = "project_id";
3291 /// # let location_id = "location_id";
3292 /// # let registration_id = "registration_id";
3293 /// let x = ConfigureManagementSettingsRequest::new().set_registration(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3294 /// ```
3295 pub fn set_registration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.registration = v.into();
3297 self
3298 }
3299
3300 /// Sets the value of [management_settings][crate::model::ConfigureManagementSettingsRequest::management_settings].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_domains_v1::model::ConfigureManagementSettingsRequest;
3305 /// use google_cloud_domains_v1::model::ManagementSettings;
3306 /// let x = ConfigureManagementSettingsRequest::new().set_management_settings(ManagementSettings::default()/* use setters */);
3307 /// ```
3308 pub fn set_management_settings<T>(mut self, v: T) -> Self
3309 where
3310 T: std::convert::Into<crate::model::ManagementSettings>,
3311 {
3312 self.management_settings = std::option::Option::Some(v.into());
3313 self
3314 }
3315
3316 /// Sets or clears the value of [management_settings][crate::model::ConfigureManagementSettingsRequest::management_settings].
3317 ///
3318 /// # Example
3319 /// ```ignore,no_run
3320 /// # use google_cloud_domains_v1::model::ConfigureManagementSettingsRequest;
3321 /// use google_cloud_domains_v1::model::ManagementSettings;
3322 /// let x = ConfigureManagementSettingsRequest::new().set_or_clear_management_settings(Some(ManagementSettings::default()/* use setters */));
3323 /// let x = ConfigureManagementSettingsRequest::new().set_or_clear_management_settings(None::<ManagementSettings>);
3324 /// ```
3325 pub fn set_or_clear_management_settings<T>(mut self, v: std::option::Option<T>) -> Self
3326 where
3327 T: std::convert::Into<crate::model::ManagementSettings>,
3328 {
3329 self.management_settings = v.map(|x| x.into());
3330 self
3331 }
3332
3333 /// Sets the value of [update_mask][crate::model::ConfigureManagementSettingsRequest::update_mask].
3334 ///
3335 /// # Example
3336 /// ```ignore,no_run
3337 /// # use google_cloud_domains_v1::model::ConfigureManagementSettingsRequest;
3338 /// use wkt::FieldMask;
3339 /// let x = ConfigureManagementSettingsRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3340 /// ```
3341 pub fn set_update_mask<T>(mut self, v: T) -> Self
3342 where
3343 T: std::convert::Into<wkt::FieldMask>,
3344 {
3345 self.update_mask = std::option::Option::Some(v.into());
3346 self
3347 }
3348
3349 /// Sets or clears the value of [update_mask][crate::model::ConfigureManagementSettingsRequest::update_mask].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_domains_v1::model::ConfigureManagementSettingsRequest;
3354 /// use wkt::FieldMask;
3355 /// let x = ConfigureManagementSettingsRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3356 /// let x = ConfigureManagementSettingsRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3357 /// ```
3358 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3359 where
3360 T: std::convert::Into<wkt::FieldMask>,
3361 {
3362 self.update_mask = v.map(|x| x.into());
3363 self
3364 }
3365}
3366
3367impl wkt::message::Message for ConfigureManagementSettingsRequest {
3368 fn typename() -> &'static str {
3369 "type.googleapis.com/google.cloud.domains.v1.ConfigureManagementSettingsRequest"
3370 }
3371}
3372
3373/// Request for the `ConfigureDnsSettings` method.
3374#[derive(Clone, Default, PartialEq)]
3375#[non_exhaustive]
3376pub struct ConfigureDnsSettingsRequest {
3377 /// Required. The name of the `Registration` whose DNS settings are being updated,
3378 /// in the format `projects/*/locations/*/registrations/*`.
3379 pub registration: std::string::String,
3380
3381 /// Fields of the `DnsSettings` to update.
3382 pub dns_settings: std::option::Option<crate::model::DnsSettings>,
3383
3384 /// Required. The field mask describing which fields to update as a comma-separated list.
3385 /// For example, if only the name servers are being updated for an existing
3386 /// Custom DNS configuration, the `update_mask` is
3387 /// `"custom_dns.name_servers"`.
3388 ///
3389 /// When changing the DNS provider from one type to another, pass the new
3390 /// provider's field name as part of the field mask. For example, when changing
3391 /// from a Google Domains DNS configuration to a Custom DNS configuration, the
3392 /// `update_mask` is `"custom_dns"`. //
3393 pub update_mask: std::option::Option<wkt::FieldMask>,
3394
3395 /// Validate the request without actually updating the DNS settings.
3396 pub validate_only: bool,
3397
3398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3399}
3400
3401impl ConfigureDnsSettingsRequest {
3402 /// Creates a new default instance.
3403 pub fn new() -> Self {
3404 std::default::Default::default()
3405 }
3406
3407 /// Sets the value of [registration][crate::model::ConfigureDnsSettingsRequest::registration].
3408 ///
3409 /// # Example
3410 /// ```ignore,no_run
3411 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3412 /// # let project_id = "project_id";
3413 /// # let location_id = "location_id";
3414 /// # let registration_id = "registration_id";
3415 /// let x = ConfigureDnsSettingsRequest::new().set_registration(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3416 /// ```
3417 pub fn set_registration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3418 self.registration = v.into();
3419 self
3420 }
3421
3422 /// Sets the value of [dns_settings][crate::model::ConfigureDnsSettingsRequest::dns_settings].
3423 ///
3424 /// # Example
3425 /// ```ignore,no_run
3426 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3427 /// use google_cloud_domains_v1::model::DnsSettings;
3428 /// let x = ConfigureDnsSettingsRequest::new().set_dns_settings(DnsSettings::default()/* use setters */);
3429 /// ```
3430 pub fn set_dns_settings<T>(mut self, v: T) -> Self
3431 where
3432 T: std::convert::Into<crate::model::DnsSettings>,
3433 {
3434 self.dns_settings = std::option::Option::Some(v.into());
3435 self
3436 }
3437
3438 /// Sets or clears the value of [dns_settings][crate::model::ConfigureDnsSettingsRequest::dns_settings].
3439 ///
3440 /// # Example
3441 /// ```ignore,no_run
3442 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3443 /// use google_cloud_domains_v1::model::DnsSettings;
3444 /// let x = ConfigureDnsSettingsRequest::new().set_or_clear_dns_settings(Some(DnsSettings::default()/* use setters */));
3445 /// let x = ConfigureDnsSettingsRequest::new().set_or_clear_dns_settings(None::<DnsSettings>);
3446 /// ```
3447 pub fn set_or_clear_dns_settings<T>(mut self, v: std::option::Option<T>) -> Self
3448 where
3449 T: std::convert::Into<crate::model::DnsSettings>,
3450 {
3451 self.dns_settings = v.map(|x| x.into());
3452 self
3453 }
3454
3455 /// Sets the value of [update_mask][crate::model::ConfigureDnsSettingsRequest::update_mask].
3456 ///
3457 /// # Example
3458 /// ```ignore,no_run
3459 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3460 /// use wkt::FieldMask;
3461 /// let x = ConfigureDnsSettingsRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3462 /// ```
3463 pub fn set_update_mask<T>(mut self, v: T) -> Self
3464 where
3465 T: std::convert::Into<wkt::FieldMask>,
3466 {
3467 self.update_mask = std::option::Option::Some(v.into());
3468 self
3469 }
3470
3471 /// Sets or clears the value of [update_mask][crate::model::ConfigureDnsSettingsRequest::update_mask].
3472 ///
3473 /// # Example
3474 /// ```ignore,no_run
3475 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3476 /// use wkt::FieldMask;
3477 /// let x = ConfigureDnsSettingsRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3478 /// let x = ConfigureDnsSettingsRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3479 /// ```
3480 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3481 where
3482 T: std::convert::Into<wkt::FieldMask>,
3483 {
3484 self.update_mask = v.map(|x| x.into());
3485 self
3486 }
3487
3488 /// Sets the value of [validate_only][crate::model::ConfigureDnsSettingsRequest::validate_only].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_domains_v1::model::ConfigureDnsSettingsRequest;
3493 /// let x = ConfigureDnsSettingsRequest::new().set_validate_only(true);
3494 /// ```
3495 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3496 self.validate_only = v.into();
3497 self
3498 }
3499}
3500
3501impl wkt::message::Message for ConfigureDnsSettingsRequest {
3502 fn typename() -> &'static str {
3503 "type.googleapis.com/google.cloud.domains.v1.ConfigureDnsSettingsRequest"
3504 }
3505}
3506
3507/// Request for the `ConfigureContactSettings` method.
3508#[derive(Clone, Default, PartialEq)]
3509#[non_exhaustive]
3510pub struct ConfigureContactSettingsRequest {
3511 /// Required. The name of the `Registration` whose contact settings are being updated,
3512 /// in the format `projects/*/locations/*/registrations/*`.
3513 pub registration: std::string::String,
3514
3515 /// Fields of the `ContactSettings` to update.
3516 pub contact_settings: std::option::Option<crate::model::ContactSettings>,
3517
3518 /// Required. The field mask describing which fields to update as a comma-separated list.
3519 /// For example, if only the registrant contact is being updated, the
3520 /// `update_mask` is `"registrant_contact"`.
3521 pub update_mask: std::option::Option<wkt::FieldMask>,
3522
3523 /// The list of contact notices that the caller acknowledges. The notices
3524 /// needed here depend on the values specified in `contact_settings`.
3525 pub contact_notices: std::vec::Vec<crate::model::ContactNotice>,
3526
3527 /// Validate the request without actually updating the contact settings.
3528 pub validate_only: bool,
3529
3530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3531}
3532
3533impl ConfigureContactSettingsRequest {
3534 /// Creates a new default instance.
3535 pub fn new() -> Self {
3536 std::default::Default::default()
3537 }
3538
3539 /// Sets the value of [registration][crate::model::ConfigureContactSettingsRequest::registration].
3540 ///
3541 /// # Example
3542 /// ```ignore,no_run
3543 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3544 /// # let project_id = "project_id";
3545 /// # let location_id = "location_id";
3546 /// # let registration_id = "registration_id";
3547 /// let x = ConfigureContactSettingsRequest::new().set_registration(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3548 /// ```
3549 pub fn set_registration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3550 self.registration = v.into();
3551 self
3552 }
3553
3554 /// Sets the value of [contact_settings][crate::model::ConfigureContactSettingsRequest::contact_settings].
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3559 /// use google_cloud_domains_v1::model::ContactSettings;
3560 /// let x = ConfigureContactSettingsRequest::new().set_contact_settings(ContactSettings::default()/* use setters */);
3561 /// ```
3562 pub fn set_contact_settings<T>(mut self, v: T) -> Self
3563 where
3564 T: std::convert::Into<crate::model::ContactSettings>,
3565 {
3566 self.contact_settings = std::option::Option::Some(v.into());
3567 self
3568 }
3569
3570 /// Sets or clears the value of [contact_settings][crate::model::ConfigureContactSettingsRequest::contact_settings].
3571 ///
3572 /// # Example
3573 /// ```ignore,no_run
3574 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3575 /// use google_cloud_domains_v1::model::ContactSettings;
3576 /// let x = ConfigureContactSettingsRequest::new().set_or_clear_contact_settings(Some(ContactSettings::default()/* use setters */));
3577 /// let x = ConfigureContactSettingsRequest::new().set_or_clear_contact_settings(None::<ContactSettings>);
3578 /// ```
3579 pub fn set_or_clear_contact_settings<T>(mut self, v: std::option::Option<T>) -> Self
3580 where
3581 T: std::convert::Into<crate::model::ContactSettings>,
3582 {
3583 self.contact_settings = v.map(|x| x.into());
3584 self
3585 }
3586
3587 /// Sets the value of [update_mask][crate::model::ConfigureContactSettingsRequest::update_mask].
3588 ///
3589 /// # Example
3590 /// ```ignore,no_run
3591 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3592 /// use wkt::FieldMask;
3593 /// let x = ConfigureContactSettingsRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3594 /// ```
3595 pub fn set_update_mask<T>(mut self, v: T) -> Self
3596 where
3597 T: std::convert::Into<wkt::FieldMask>,
3598 {
3599 self.update_mask = std::option::Option::Some(v.into());
3600 self
3601 }
3602
3603 /// Sets or clears the value of [update_mask][crate::model::ConfigureContactSettingsRequest::update_mask].
3604 ///
3605 /// # Example
3606 /// ```ignore,no_run
3607 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3608 /// use wkt::FieldMask;
3609 /// let x = ConfigureContactSettingsRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3610 /// let x = ConfigureContactSettingsRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3611 /// ```
3612 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3613 where
3614 T: std::convert::Into<wkt::FieldMask>,
3615 {
3616 self.update_mask = v.map(|x| x.into());
3617 self
3618 }
3619
3620 /// Sets the value of [contact_notices][crate::model::ConfigureContactSettingsRequest::contact_notices].
3621 ///
3622 /// # Example
3623 /// ```ignore,no_run
3624 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3625 /// use google_cloud_domains_v1::model::ContactNotice;
3626 /// let x = ConfigureContactSettingsRequest::new().set_contact_notices([
3627 /// ContactNotice::PublicContactDataAcknowledgement,
3628 /// ]);
3629 /// ```
3630 pub fn set_contact_notices<T, V>(mut self, v: T) -> Self
3631 where
3632 T: std::iter::IntoIterator<Item = V>,
3633 V: std::convert::Into<crate::model::ContactNotice>,
3634 {
3635 use std::iter::Iterator;
3636 self.contact_notices = v.into_iter().map(|i| i.into()).collect();
3637 self
3638 }
3639
3640 /// Sets the value of [validate_only][crate::model::ConfigureContactSettingsRequest::validate_only].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_domains_v1::model::ConfigureContactSettingsRequest;
3645 /// let x = ConfigureContactSettingsRequest::new().set_validate_only(true);
3646 /// ```
3647 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3648 self.validate_only = v.into();
3649 self
3650 }
3651}
3652
3653impl wkt::message::Message for ConfigureContactSettingsRequest {
3654 fn typename() -> &'static str {
3655 "type.googleapis.com/google.cloud.domains.v1.ConfigureContactSettingsRequest"
3656 }
3657}
3658
3659/// Request for the `ExportRegistration` method.
3660#[derive(Clone, Default, PartialEq)]
3661#[non_exhaustive]
3662pub struct ExportRegistrationRequest {
3663 /// Required. The name of the `Registration` to export,
3664 /// in the format `projects/*/locations/*/registrations/*`.
3665 pub name: std::string::String,
3666
3667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3668}
3669
3670impl ExportRegistrationRequest {
3671 /// Creates a new default instance.
3672 pub fn new() -> Self {
3673 std::default::Default::default()
3674 }
3675
3676 /// Sets the value of [name][crate::model::ExportRegistrationRequest::name].
3677 ///
3678 /// # Example
3679 /// ```ignore,no_run
3680 /// # use google_cloud_domains_v1::model::ExportRegistrationRequest;
3681 /// # let project_id = "project_id";
3682 /// # let location_id = "location_id";
3683 /// # let registration_id = "registration_id";
3684 /// let x = ExportRegistrationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3685 /// ```
3686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3687 self.name = v.into();
3688 self
3689 }
3690}
3691
3692impl wkt::message::Message for ExportRegistrationRequest {
3693 fn typename() -> &'static str {
3694 "type.googleapis.com/google.cloud.domains.v1.ExportRegistrationRequest"
3695 }
3696}
3697
3698/// Request for the `DeleteRegistration` method.
3699#[derive(Clone, Default, PartialEq)]
3700#[non_exhaustive]
3701pub struct DeleteRegistrationRequest {
3702 /// Required. The name of the `Registration` to delete,
3703 /// in the format `projects/*/locations/*/registrations/*`.
3704 pub name: std::string::String,
3705
3706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3707}
3708
3709impl DeleteRegistrationRequest {
3710 /// Creates a new default instance.
3711 pub fn new() -> Self {
3712 std::default::Default::default()
3713 }
3714
3715 /// Sets the value of [name][crate::model::DeleteRegistrationRequest::name].
3716 ///
3717 /// # Example
3718 /// ```ignore,no_run
3719 /// # use google_cloud_domains_v1::model::DeleteRegistrationRequest;
3720 /// # let project_id = "project_id";
3721 /// # let location_id = "location_id";
3722 /// # let registration_id = "registration_id";
3723 /// let x = DeleteRegistrationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3724 /// ```
3725 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3726 self.name = v.into();
3727 self
3728 }
3729}
3730
3731impl wkt::message::Message for DeleteRegistrationRequest {
3732 fn typename() -> &'static str {
3733 "type.googleapis.com/google.cloud.domains.v1.DeleteRegistrationRequest"
3734 }
3735}
3736
3737/// Request for the `RetrieveAuthorizationCode` method.
3738#[derive(Clone, Default, PartialEq)]
3739#[non_exhaustive]
3740pub struct RetrieveAuthorizationCodeRequest {
3741 /// Required. The name of the `Registration` whose authorization code is being retrieved,
3742 /// in the format `projects/*/locations/*/registrations/*`.
3743 pub registration: std::string::String,
3744
3745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3746}
3747
3748impl RetrieveAuthorizationCodeRequest {
3749 /// Creates a new default instance.
3750 pub fn new() -> Self {
3751 std::default::Default::default()
3752 }
3753
3754 /// Sets the value of [registration][crate::model::RetrieveAuthorizationCodeRequest::registration].
3755 ///
3756 /// # Example
3757 /// ```ignore,no_run
3758 /// # use google_cloud_domains_v1::model::RetrieveAuthorizationCodeRequest;
3759 /// # let project_id = "project_id";
3760 /// # let location_id = "location_id";
3761 /// # let registration_id = "registration_id";
3762 /// let x = RetrieveAuthorizationCodeRequest::new().set_registration(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3763 /// ```
3764 pub fn set_registration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3765 self.registration = v.into();
3766 self
3767 }
3768}
3769
3770impl wkt::message::Message for RetrieveAuthorizationCodeRequest {
3771 fn typename() -> &'static str {
3772 "type.googleapis.com/google.cloud.domains.v1.RetrieveAuthorizationCodeRequest"
3773 }
3774}
3775
3776/// Request for the `ResetAuthorizationCode` method.
3777#[derive(Clone, Default, PartialEq)]
3778#[non_exhaustive]
3779pub struct ResetAuthorizationCodeRequest {
3780 /// Required. The name of the `Registration` whose authorization code is being reset,
3781 /// in the format `projects/*/locations/*/registrations/*`.
3782 pub registration: std::string::String,
3783
3784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3785}
3786
3787impl ResetAuthorizationCodeRequest {
3788 /// Creates a new default instance.
3789 pub fn new() -> Self {
3790 std::default::Default::default()
3791 }
3792
3793 /// Sets the value of [registration][crate::model::ResetAuthorizationCodeRequest::registration].
3794 ///
3795 /// # Example
3796 /// ```ignore,no_run
3797 /// # use google_cloud_domains_v1::model::ResetAuthorizationCodeRequest;
3798 /// # let project_id = "project_id";
3799 /// # let location_id = "location_id";
3800 /// # let registration_id = "registration_id";
3801 /// let x = ResetAuthorizationCodeRequest::new().set_registration(format!("projects/{project_id}/locations/{location_id}/registrations/{registration_id}"));
3802 /// ```
3803 pub fn set_registration<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3804 self.registration = v.into();
3805 self
3806 }
3807}
3808
3809impl wkt::message::Message for ResetAuthorizationCodeRequest {
3810 fn typename() -> &'static str {
3811 "type.googleapis.com/google.cloud.domains.v1.ResetAuthorizationCodeRequest"
3812 }
3813}
3814
3815/// Parameters required to register a new domain.
3816#[derive(Clone, Default, PartialEq)]
3817#[non_exhaustive]
3818pub struct RegisterParameters {
3819 /// The domain name. Unicode domain names are expressed in Punycode format.
3820 pub domain_name: std::string::String,
3821
3822 /// Indicates whether the domain is available for registration. This value is
3823 /// accurate when obtained by calling `RetrieveRegisterParameters`, but is
3824 /// approximate when obtained by calling `SearchDomains`.
3825 pub availability: crate::model::register_parameters::Availability,
3826
3827 /// Contact privacy options that the domain supports.
3828 pub supported_privacy: std::vec::Vec<crate::model::ContactPrivacy>,
3829
3830 /// Notices about special properties of the domain.
3831 pub domain_notices: std::vec::Vec<crate::model::DomainNotice>,
3832
3833 /// Price to register or renew the domain for one year.
3834 pub yearly_price: std::option::Option<google_cloud_type::model::Money>,
3835
3836 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3837}
3838
3839impl RegisterParameters {
3840 /// Creates a new default instance.
3841 pub fn new() -> Self {
3842 std::default::Default::default()
3843 }
3844
3845 /// Sets the value of [domain_name][crate::model::RegisterParameters::domain_name].
3846 ///
3847 /// # Example
3848 /// ```ignore,no_run
3849 /// # use google_cloud_domains_v1::model::RegisterParameters;
3850 /// let x = RegisterParameters::new().set_domain_name("example");
3851 /// ```
3852 pub fn set_domain_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.domain_name = v.into();
3854 self
3855 }
3856
3857 /// Sets the value of [availability][crate::model::RegisterParameters::availability].
3858 ///
3859 /// # Example
3860 /// ```ignore,no_run
3861 /// # use google_cloud_domains_v1::model::RegisterParameters;
3862 /// use google_cloud_domains_v1::model::register_parameters::Availability;
3863 /// let x0 = RegisterParameters::new().set_availability(Availability::Available);
3864 /// let x1 = RegisterParameters::new().set_availability(Availability::Unavailable);
3865 /// let x2 = RegisterParameters::new().set_availability(Availability::Unsupported);
3866 /// ```
3867 pub fn set_availability<
3868 T: std::convert::Into<crate::model::register_parameters::Availability>,
3869 >(
3870 mut self,
3871 v: T,
3872 ) -> Self {
3873 self.availability = v.into();
3874 self
3875 }
3876
3877 /// Sets the value of [supported_privacy][crate::model::RegisterParameters::supported_privacy].
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_domains_v1::model::RegisterParameters;
3882 /// use google_cloud_domains_v1::model::ContactPrivacy;
3883 /// let x = RegisterParameters::new().set_supported_privacy([
3884 /// ContactPrivacy::PublicContactData,
3885 /// ContactPrivacy::PrivateContactData,
3886 /// ContactPrivacy::RedactedContactData,
3887 /// ]);
3888 /// ```
3889 pub fn set_supported_privacy<T, V>(mut self, v: T) -> Self
3890 where
3891 T: std::iter::IntoIterator<Item = V>,
3892 V: std::convert::Into<crate::model::ContactPrivacy>,
3893 {
3894 use std::iter::Iterator;
3895 self.supported_privacy = v.into_iter().map(|i| i.into()).collect();
3896 self
3897 }
3898
3899 /// Sets the value of [domain_notices][crate::model::RegisterParameters::domain_notices].
3900 ///
3901 /// # Example
3902 /// ```ignore,no_run
3903 /// # use google_cloud_domains_v1::model::RegisterParameters;
3904 /// use google_cloud_domains_v1::model::DomainNotice;
3905 /// let x = RegisterParameters::new().set_domain_notices([
3906 /// DomainNotice::HstsPreloaded,
3907 /// ]);
3908 /// ```
3909 pub fn set_domain_notices<T, V>(mut self, v: T) -> Self
3910 where
3911 T: std::iter::IntoIterator<Item = V>,
3912 V: std::convert::Into<crate::model::DomainNotice>,
3913 {
3914 use std::iter::Iterator;
3915 self.domain_notices = v.into_iter().map(|i| i.into()).collect();
3916 self
3917 }
3918
3919 /// Sets the value of [yearly_price][crate::model::RegisterParameters::yearly_price].
3920 ///
3921 /// # Example
3922 /// ```ignore,no_run
3923 /// # use google_cloud_domains_v1::model::RegisterParameters;
3924 /// use google_cloud_type::model::Money;
3925 /// let x = RegisterParameters::new().set_yearly_price(Money::default()/* use setters */);
3926 /// ```
3927 pub fn set_yearly_price<T>(mut self, v: T) -> Self
3928 where
3929 T: std::convert::Into<google_cloud_type::model::Money>,
3930 {
3931 self.yearly_price = std::option::Option::Some(v.into());
3932 self
3933 }
3934
3935 /// Sets or clears the value of [yearly_price][crate::model::RegisterParameters::yearly_price].
3936 ///
3937 /// # Example
3938 /// ```ignore,no_run
3939 /// # use google_cloud_domains_v1::model::RegisterParameters;
3940 /// use google_cloud_type::model::Money;
3941 /// let x = RegisterParameters::new().set_or_clear_yearly_price(Some(Money::default()/* use setters */));
3942 /// let x = RegisterParameters::new().set_or_clear_yearly_price(None::<Money>);
3943 /// ```
3944 pub fn set_or_clear_yearly_price<T>(mut self, v: std::option::Option<T>) -> Self
3945 where
3946 T: std::convert::Into<google_cloud_type::model::Money>,
3947 {
3948 self.yearly_price = v.map(|x| x.into());
3949 self
3950 }
3951}
3952
3953impl wkt::message::Message for RegisterParameters {
3954 fn typename() -> &'static str {
3955 "type.googleapis.com/google.cloud.domains.v1.RegisterParameters"
3956 }
3957}
3958
3959/// Defines additional types related to [RegisterParameters].
3960pub mod register_parameters {
3961 #[allow(unused_imports)]
3962 use super::*;
3963
3964 /// Possible availability states of a domain name.
3965 ///
3966 /// # Working with unknown values
3967 ///
3968 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3969 /// additional enum variants at any time. Adding new variants is not considered
3970 /// a breaking change. Applications should write their code in anticipation of:
3971 ///
3972 /// - New values appearing in future releases of the client library, **and**
3973 /// - New values received dynamically, without application changes.
3974 ///
3975 /// Please consult the [Working with enums] section in the user guide for some
3976 /// guidelines.
3977 ///
3978 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3979 #[derive(Clone, Debug, PartialEq)]
3980 #[non_exhaustive]
3981 pub enum Availability {
3982 /// The availability is unspecified.
3983 Unspecified,
3984 /// The domain is available for registration.
3985 Available,
3986 /// The domain is not available for registration. Generally this means it is
3987 /// already registered to another party.
3988 Unavailable,
3989 /// The domain is not currently supported by Cloud Domains, but may
3990 /// be available elsewhere.
3991 Unsupported,
3992 /// Cloud Domains is unable to determine domain availability, generally
3993 /// due to system maintenance at the domain name registry.
3994 Unknown,
3995 /// If set, the enum was initialized with an unknown value.
3996 ///
3997 /// Applications can examine the value using [Availability::value] or
3998 /// [Availability::name].
3999 UnknownValue(availability::UnknownValue),
4000 }
4001
4002 #[doc(hidden)]
4003 pub mod availability {
4004 #[allow(unused_imports)]
4005 use super::*;
4006 #[derive(Clone, Debug, PartialEq)]
4007 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4008 }
4009
4010 impl Availability {
4011 /// Gets the enum value.
4012 ///
4013 /// Returns `None` if the enum contains an unknown value deserialized from
4014 /// the string representation of enums.
4015 pub fn value(&self) -> std::option::Option<i32> {
4016 match self {
4017 Self::Unspecified => std::option::Option::Some(0),
4018 Self::Available => std::option::Option::Some(1),
4019 Self::Unavailable => std::option::Option::Some(2),
4020 Self::Unsupported => std::option::Option::Some(3),
4021 Self::Unknown => std::option::Option::Some(4),
4022 Self::UnknownValue(u) => u.0.value(),
4023 }
4024 }
4025
4026 /// Gets the enum value as a string.
4027 ///
4028 /// Returns `None` if the enum contains an unknown value deserialized from
4029 /// the integer representation of enums.
4030 pub fn name(&self) -> std::option::Option<&str> {
4031 match self {
4032 Self::Unspecified => std::option::Option::Some("AVAILABILITY_UNSPECIFIED"),
4033 Self::Available => std::option::Option::Some("AVAILABLE"),
4034 Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
4035 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
4036 Self::Unknown => std::option::Option::Some("UNKNOWN"),
4037 Self::UnknownValue(u) => u.0.name(),
4038 }
4039 }
4040 }
4041
4042 impl std::default::Default for Availability {
4043 fn default() -> Self {
4044 use std::convert::From;
4045 Self::from(0)
4046 }
4047 }
4048
4049 impl std::fmt::Display for Availability {
4050 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4051 wkt::internal::display_enum(f, self.name(), self.value())
4052 }
4053 }
4054
4055 impl std::convert::From<i32> for Availability {
4056 fn from(value: i32) -> Self {
4057 match value {
4058 0 => Self::Unspecified,
4059 1 => Self::Available,
4060 2 => Self::Unavailable,
4061 3 => Self::Unsupported,
4062 4 => Self::Unknown,
4063 _ => Self::UnknownValue(availability::UnknownValue(
4064 wkt::internal::UnknownEnumValue::Integer(value),
4065 )),
4066 }
4067 }
4068 }
4069
4070 impl std::convert::From<&str> for Availability {
4071 fn from(value: &str) -> Self {
4072 use std::string::ToString;
4073 match value {
4074 "AVAILABILITY_UNSPECIFIED" => Self::Unspecified,
4075 "AVAILABLE" => Self::Available,
4076 "UNAVAILABLE" => Self::Unavailable,
4077 "UNSUPPORTED" => Self::Unsupported,
4078 "UNKNOWN" => Self::Unknown,
4079 _ => Self::UnknownValue(availability::UnknownValue(
4080 wkt::internal::UnknownEnumValue::String(value.to_string()),
4081 )),
4082 }
4083 }
4084 }
4085
4086 impl serde::ser::Serialize for Availability {
4087 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4088 where
4089 S: serde::Serializer,
4090 {
4091 match self {
4092 Self::Unspecified => serializer.serialize_i32(0),
4093 Self::Available => serializer.serialize_i32(1),
4094 Self::Unavailable => serializer.serialize_i32(2),
4095 Self::Unsupported => serializer.serialize_i32(3),
4096 Self::Unknown => serializer.serialize_i32(4),
4097 Self::UnknownValue(u) => u.0.serialize(serializer),
4098 }
4099 }
4100 }
4101
4102 impl<'de> serde::de::Deserialize<'de> for Availability {
4103 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4104 where
4105 D: serde::Deserializer<'de>,
4106 {
4107 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Availability>::new(
4108 ".google.cloud.domains.v1.RegisterParameters.Availability",
4109 ))
4110 }
4111 }
4112}
4113
4114/// Parameters required to transfer a domain from another registrar.
4115#[derive(Clone, Default, PartialEq)]
4116#[non_exhaustive]
4117pub struct TransferParameters {
4118 /// The domain name. Unicode domain names are expressed in Punycode format.
4119 pub domain_name: std::string::String,
4120
4121 /// The registrar that currently manages the domain.
4122 pub current_registrar: std::string::String,
4123
4124 /// The name servers that currently store the configuration of the domain.
4125 pub name_servers: std::vec::Vec<std::string::String>,
4126
4127 /// Indicates whether the domain is protected by a transfer lock. For a
4128 /// transfer to succeed, this must show `UNLOCKED`. To unlock a domain,
4129 /// go to its current registrar.
4130 pub transfer_lock_state: crate::model::TransferLockState,
4131
4132 /// Contact privacy options that the domain supports.
4133 pub supported_privacy: std::vec::Vec<crate::model::ContactPrivacy>,
4134
4135 /// Price to transfer or renew the domain for one year.
4136 pub yearly_price: std::option::Option<google_cloud_type::model::Money>,
4137
4138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4139}
4140
4141impl TransferParameters {
4142 /// Creates a new default instance.
4143 pub fn new() -> Self {
4144 std::default::Default::default()
4145 }
4146
4147 /// Sets the value of [domain_name][crate::model::TransferParameters::domain_name].
4148 ///
4149 /// # Example
4150 /// ```ignore,no_run
4151 /// # use google_cloud_domains_v1::model::TransferParameters;
4152 /// let x = TransferParameters::new().set_domain_name("example");
4153 /// ```
4154 pub fn set_domain_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4155 self.domain_name = v.into();
4156 self
4157 }
4158
4159 /// Sets the value of [current_registrar][crate::model::TransferParameters::current_registrar].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_domains_v1::model::TransferParameters;
4164 /// let x = TransferParameters::new().set_current_registrar("example");
4165 /// ```
4166 pub fn set_current_registrar<T: std::convert::Into<std::string::String>>(
4167 mut self,
4168 v: T,
4169 ) -> Self {
4170 self.current_registrar = v.into();
4171 self
4172 }
4173
4174 /// Sets the value of [name_servers][crate::model::TransferParameters::name_servers].
4175 ///
4176 /// # Example
4177 /// ```ignore,no_run
4178 /// # use google_cloud_domains_v1::model::TransferParameters;
4179 /// let x = TransferParameters::new().set_name_servers(["a", "b", "c"]);
4180 /// ```
4181 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
4182 where
4183 T: std::iter::IntoIterator<Item = V>,
4184 V: std::convert::Into<std::string::String>,
4185 {
4186 use std::iter::Iterator;
4187 self.name_servers = v.into_iter().map(|i| i.into()).collect();
4188 self
4189 }
4190
4191 /// Sets the value of [transfer_lock_state][crate::model::TransferParameters::transfer_lock_state].
4192 ///
4193 /// # Example
4194 /// ```ignore,no_run
4195 /// # use google_cloud_domains_v1::model::TransferParameters;
4196 /// use google_cloud_domains_v1::model::TransferLockState;
4197 /// let x0 = TransferParameters::new().set_transfer_lock_state(TransferLockState::Unlocked);
4198 /// let x1 = TransferParameters::new().set_transfer_lock_state(TransferLockState::Locked);
4199 /// ```
4200 pub fn set_transfer_lock_state<T: std::convert::Into<crate::model::TransferLockState>>(
4201 mut self,
4202 v: T,
4203 ) -> Self {
4204 self.transfer_lock_state = v.into();
4205 self
4206 }
4207
4208 /// Sets the value of [supported_privacy][crate::model::TransferParameters::supported_privacy].
4209 ///
4210 /// # Example
4211 /// ```ignore,no_run
4212 /// # use google_cloud_domains_v1::model::TransferParameters;
4213 /// use google_cloud_domains_v1::model::ContactPrivacy;
4214 /// let x = TransferParameters::new().set_supported_privacy([
4215 /// ContactPrivacy::PublicContactData,
4216 /// ContactPrivacy::PrivateContactData,
4217 /// ContactPrivacy::RedactedContactData,
4218 /// ]);
4219 /// ```
4220 pub fn set_supported_privacy<T, V>(mut self, v: T) -> Self
4221 where
4222 T: std::iter::IntoIterator<Item = V>,
4223 V: std::convert::Into<crate::model::ContactPrivacy>,
4224 {
4225 use std::iter::Iterator;
4226 self.supported_privacy = v.into_iter().map(|i| i.into()).collect();
4227 self
4228 }
4229
4230 /// Sets the value of [yearly_price][crate::model::TransferParameters::yearly_price].
4231 ///
4232 /// # Example
4233 /// ```ignore,no_run
4234 /// # use google_cloud_domains_v1::model::TransferParameters;
4235 /// use google_cloud_type::model::Money;
4236 /// let x = TransferParameters::new().set_yearly_price(Money::default()/* use setters */);
4237 /// ```
4238 pub fn set_yearly_price<T>(mut self, v: T) -> Self
4239 where
4240 T: std::convert::Into<google_cloud_type::model::Money>,
4241 {
4242 self.yearly_price = std::option::Option::Some(v.into());
4243 self
4244 }
4245
4246 /// Sets or clears the value of [yearly_price][crate::model::TransferParameters::yearly_price].
4247 ///
4248 /// # Example
4249 /// ```ignore,no_run
4250 /// # use google_cloud_domains_v1::model::TransferParameters;
4251 /// use google_cloud_type::model::Money;
4252 /// let x = TransferParameters::new().set_or_clear_yearly_price(Some(Money::default()/* use setters */));
4253 /// let x = TransferParameters::new().set_or_clear_yearly_price(None::<Money>);
4254 /// ```
4255 pub fn set_or_clear_yearly_price<T>(mut self, v: std::option::Option<T>) -> Self
4256 where
4257 T: std::convert::Into<google_cloud_type::model::Money>,
4258 {
4259 self.yearly_price = v.map(|x| x.into());
4260 self
4261 }
4262}
4263
4264impl wkt::message::Message for TransferParameters {
4265 fn typename() -> &'static str {
4266 "type.googleapis.com/google.cloud.domains.v1.TransferParameters"
4267 }
4268}
4269
4270/// Defines an authorization code.
4271#[derive(Clone, Default, PartialEq)]
4272#[non_exhaustive]
4273pub struct AuthorizationCode {
4274 /// The Authorization Code in ASCII. It can be used to transfer the domain
4275 /// to or from another registrar.
4276 pub code: std::string::String,
4277
4278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4279}
4280
4281impl AuthorizationCode {
4282 /// Creates a new default instance.
4283 pub fn new() -> Self {
4284 std::default::Default::default()
4285 }
4286
4287 /// Sets the value of [code][crate::model::AuthorizationCode::code].
4288 ///
4289 /// # Example
4290 /// ```ignore,no_run
4291 /// # use google_cloud_domains_v1::model::AuthorizationCode;
4292 /// let x = AuthorizationCode::new().set_code("example");
4293 /// ```
4294 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4295 self.code = v.into();
4296 self
4297 }
4298}
4299
4300impl wkt::message::Message for AuthorizationCode {
4301 fn typename() -> &'static str {
4302 "type.googleapis.com/google.cloud.domains.v1.AuthorizationCode"
4303 }
4304}
4305
4306/// Represents the metadata of the long-running operation. Output only.
4307#[derive(Clone, Default, PartialEq)]
4308#[non_exhaustive]
4309pub struct OperationMetadata {
4310 /// The time the operation was created.
4311 pub create_time: std::option::Option<wkt::Timestamp>,
4312
4313 /// The time the operation finished running.
4314 pub end_time: std::option::Option<wkt::Timestamp>,
4315
4316 /// Server-defined resource path for the target of the operation.
4317 pub target: std::string::String,
4318
4319 /// Name of the verb executed by the operation.
4320 pub verb: std::string::String,
4321
4322 /// Human-readable status of the operation, if any.
4323 pub status_detail: std::string::String,
4324
4325 /// API version used to start the operation.
4326 pub api_version: std::string::String,
4327
4328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4329}
4330
4331impl OperationMetadata {
4332 /// Creates a new default instance.
4333 pub fn new() -> Self {
4334 std::default::Default::default()
4335 }
4336
4337 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4338 ///
4339 /// # Example
4340 /// ```ignore,no_run
4341 /// # use google_cloud_domains_v1::model::OperationMetadata;
4342 /// use wkt::Timestamp;
4343 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4344 /// ```
4345 pub fn set_create_time<T>(mut self, v: T) -> Self
4346 where
4347 T: std::convert::Into<wkt::Timestamp>,
4348 {
4349 self.create_time = std::option::Option::Some(v.into());
4350 self
4351 }
4352
4353 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4354 ///
4355 /// # Example
4356 /// ```ignore,no_run
4357 /// # use google_cloud_domains_v1::model::OperationMetadata;
4358 /// use wkt::Timestamp;
4359 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4360 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4361 /// ```
4362 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4363 where
4364 T: std::convert::Into<wkt::Timestamp>,
4365 {
4366 self.create_time = v.map(|x| x.into());
4367 self
4368 }
4369
4370 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4371 ///
4372 /// # Example
4373 /// ```ignore,no_run
4374 /// # use google_cloud_domains_v1::model::OperationMetadata;
4375 /// use wkt::Timestamp;
4376 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4377 /// ```
4378 pub fn set_end_time<T>(mut self, v: T) -> Self
4379 where
4380 T: std::convert::Into<wkt::Timestamp>,
4381 {
4382 self.end_time = std::option::Option::Some(v.into());
4383 self
4384 }
4385
4386 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4387 ///
4388 /// # Example
4389 /// ```ignore,no_run
4390 /// # use google_cloud_domains_v1::model::OperationMetadata;
4391 /// use wkt::Timestamp;
4392 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4393 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4394 /// ```
4395 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4396 where
4397 T: std::convert::Into<wkt::Timestamp>,
4398 {
4399 self.end_time = v.map(|x| x.into());
4400 self
4401 }
4402
4403 /// Sets the value of [target][crate::model::OperationMetadata::target].
4404 ///
4405 /// # Example
4406 /// ```ignore,no_run
4407 /// # use google_cloud_domains_v1::model::OperationMetadata;
4408 /// let x = OperationMetadata::new().set_target("example");
4409 /// ```
4410 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4411 self.target = v.into();
4412 self
4413 }
4414
4415 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4416 ///
4417 /// # Example
4418 /// ```ignore,no_run
4419 /// # use google_cloud_domains_v1::model::OperationMetadata;
4420 /// let x = OperationMetadata::new().set_verb("example");
4421 /// ```
4422 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4423 self.verb = v.into();
4424 self
4425 }
4426
4427 /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
4428 ///
4429 /// # Example
4430 /// ```ignore,no_run
4431 /// # use google_cloud_domains_v1::model::OperationMetadata;
4432 /// let x = OperationMetadata::new().set_status_detail("example");
4433 /// ```
4434 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.status_detail = v.into();
4436 self
4437 }
4438
4439 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4440 ///
4441 /// # Example
4442 /// ```ignore,no_run
4443 /// # use google_cloud_domains_v1::model::OperationMetadata;
4444 /// let x = OperationMetadata::new().set_api_version("example");
4445 /// ```
4446 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4447 self.api_version = v.into();
4448 self
4449 }
4450}
4451
4452impl wkt::message::Message for OperationMetadata {
4453 fn typename() -> &'static str {
4454 "type.googleapis.com/google.cloud.domains.v1.OperationMetadata"
4455 }
4456}
4457
4458/// Defines a set of possible contact privacy settings for a `Registration`.
4459///
4460/// [ICANN](https://icann.org/) maintains the WHOIS database, a publicly
4461/// accessible mapping from domain name to contact information, and requires that
4462/// each domain name have an entry. Choose from these options to control how much
4463/// information in your `ContactSettings` is published.
4464///
4465/// # Working with unknown values
4466///
4467/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4468/// additional enum variants at any time. Adding new variants is not considered
4469/// a breaking change. Applications should write their code in anticipation of:
4470///
4471/// - New values appearing in future releases of the client library, **and**
4472/// - New values received dynamically, without application changes.
4473///
4474/// Please consult the [Working with enums] section in the user guide for some
4475/// guidelines.
4476///
4477/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4478#[derive(Clone, Debug, PartialEq)]
4479#[non_exhaustive]
4480pub enum ContactPrivacy {
4481 /// The contact privacy settings are undefined.
4482 Unspecified,
4483 /// All the data from `ContactSettings` is publicly available. When setting
4484 /// this option, you must also provide a
4485 /// `PUBLIC_CONTACT_DATA_ACKNOWLEDGEMENT` in the `contact_notices` field of the
4486 /// request.
4487 PublicContactData,
4488 /// None of the data from `ContactSettings` is publicly available. Instead,
4489 /// proxy contact data is published for your domain. Email sent to the proxy
4490 /// email address is forwarded to the registrant's email address. Cloud Domains
4491 /// provides this privacy proxy service at no additional cost.
4492 PrivateContactData,
4493 /// Some data from `ContactSettings` is publicly available. The actual
4494 /// information redacted depends on the domain. For details, see [the
4495 /// registration privacy
4496 /// article](https://support.google.com/domains/answer/3251242).
4497 RedactedContactData,
4498 /// If set, the enum was initialized with an unknown value.
4499 ///
4500 /// Applications can examine the value using [ContactPrivacy::value] or
4501 /// [ContactPrivacy::name].
4502 UnknownValue(contact_privacy::UnknownValue),
4503}
4504
4505#[doc(hidden)]
4506pub mod contact_privacy {
4507 #[allow(unused_imports)]
4508 use super::*;
4509 #[derive(Clone, Debug, PartialEq)]
4510 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4511}
4512
4513impl ContactPrivacy {
4514 /// Gets the enum value.
4515 ///
4516 /// Returns `None` if the enum contains an unknown value deserialized from
4517 /// the string representation of enums.
4518 pub fn value(&self) -> std::option::Option<i32> {
4519 match self {
4520 Self::Unspecified => std::option::Option::Some(0),
4521 Self::PublicContactData => std::option::Option::Some(1),
4522 Self::PrivateContactData => std::option::Option::Some(2),
4523 Self::RedactedContactData => std::option::Option::Some(3),
4524 Self::UnknownValue(u) => u.0.value(),
4525 }
4526 }
4527
4528 /// Gets the enum value as a string.
4529 ///
4530 /// Returns `None` if the enum contains an unknown value deserialized from
4531 /// the integer representation of enums.
4532 pub fn name(&self) -> std::option::Option<&str> {
4533 match self {
4534 Self::Unspecified => std::option::Option::Some("CONTACT_PRIVACY_UNSPECIFIED"),
4535 Self::PublicContactData => std::option::Option::Some("PUBLIC_CONTACT_DATA"),
4536 Self::PrivateContactData => std::option::Option::Some("PRIVATE_CONTACT_DATA"),
4537 Self::RedactedContactData => std::option::Option::Some("REDACTED_CONTACT_DATA"),
4538 Self::UnknownValue(u) => u.0.name(),
4539 }
4540 }
4541}
4542
4543impl std::default::Default for ContactPrivacy {
4544 fn default() -> Self {
4545 use std::convert::From;
4546 Self::from(0)
4547 }
4548}
4549
4550impl std::fmt::Display for ContactPrivacy {
4551 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4552 wkt::internal::display_enum(f, self.name(), self.value())
4553 }
4554}
4555
4556impl std::convert::From<i32> for ContactPrivacy {
4557 fn from(value: i32) -> Self {
4558 match value {
4559 0 => Self::Unspecified,
4560 1 => Self::PublicContactData,
4561 2 => Self::PrivateContactData,
4562 3 => Self::RedactedContactData,
4563 _ => Self::UnknownValue(contact_privacy::UnknownValue(
4564 wkt::internal::UnknownEnumValue::Integer(value),
4565 )),
4566 }
4567 }
4568}
4569
4570impl std::convert::From<&str> for ContactPrivacy {
4571 fn from(value: &str) -> Self {
4572 use std::string::ToString;
4573 match value {
4574 "CONTACT_PRIVACY_UNSPECIFIED" => Self::Unspecified,
4575 "PUBLIC_CONTACT_DATA" => Self::PublicContactData,
4576 "PRIVATE_CONTACT_DATA" => Self::PrivateContactData,
4577 "REDACTED_CONTACT_DATA" => Self::RedactedContactData,
4578 _ => Self::UnknownValue(contact_privacy::UnknownValue(
4579 wkt::internal::UnknownEnumValue::String(value.to_string()),
4580 )),
4581 }
4582 }
4583}
4584
4585impl serde::ser::Serialize for ContactPrivacy {
4586 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4587 where
4588 S: serde::Serializer,
4589 {
4590 match self {
4591 Self::Unspecified => serializer.serialize_i32(0),
4592 Self::PublicContactData => serializer.serialize_i32(1),
4593 Self::PrivateContactData => serializer.serialize_i32(2),
4594 Self::RedactedContactData => serializer.serialize_i32(3),
4595 Self::UnknownValue(u) => u.0.serialize(serializer),
4596 }
4597 }
4598}
4599
4600impl<'de> serde::de::Deserialize<'de> for ContactPrivacy {
4601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4602 where
4603 D: serde::Deserializer<'de>,
4604 {
4605 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ContactPrivacy>::new(
4606 ".google.cloud.domains.v1.ContactPrivacy",
4607 ))
4608 }
4609}
4610
4611/// Notices about special properties of certain domains.
4612///
4613/// # Working with unknown values
4614///
4615/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4616/// additional enum variants at any time. Adding new variants is not considered
4617/// a breaking change. Applications should write their code in anticipation of:
4618///
4619/// - New values appearing in future releases of the client library, **and**
4620/// - New values received dynamically, without application changes.
4621///
4622/// Please consult the [Working with enums] section in the user guide for some
4623/// guidelines.
4624///
4625/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4626#[derive(Clone, Debug, PartialEq)]
4627#[non_exhaustive]
4628pub enum DomainNotice {
4629 /// The notice is undefined.
4630 Unspecified,
4631 /// Indicates that the domain is preloaded on the HTTP Strict Transport
4632 /// Security list in browsers. Serving a website on such domain requires
4633 /// an SSL certificate. For details, see
4634 /// [how to get an SSL
4635 /// certificate](https://support.google.com/domains/answer/7638036).
4636 HstsPreloaded,
4637 /// If set, the enum was initialized with an unknown value.
4638 ///
4639 /// Applications can examine the value using [DomainNotice::value] or
4640 /// [DomainNotice::name].
4641 UnknownValue(domain_notice::UnknownValue),
4642}
4643
4644#[doc(hidden)]
4645pub mod domain_notice {
4646 #[allow(unused_imports)]
4647 use super::*;
4648 #[derive(Clone, Debug, PartialEq)]
4649 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4650}
4651
4652impl DomainNotice {
4653 /// Gets the enum value.
4654 ///
4655 /// Returns `None` if the enum contains an unknown value deserialized from
4656 /// the string representation of enums.
4657 pub fn value(&self) -> std::option::Option<i32> {
4658 match self {
4659 Self::Unspecified => std::option::Option::Some(0),
4660 Self::HstsPreloaded => std::option::Option::Some(1),
4661 Self::UnknownValue(u) => u.0.value(),
4662 }
4663 }
4664
4665 /// Gets the enum value as a string.
4666 ///
4667 /// Returns `None` if the enum contains an unknown value deserialized from
4668 /// the integer representation of enums.
4669 pub fn name(&self) -> std::option::Option<&str> {
4670 match self {
4671 Self::Unspecified => std::option::Option::Some("DOMAIN_NOTICE_UNSPECIFIED"),
4672 Self::HstsPreloaded => std::option::Option::Some("HSTS_PRELOADED"),
4673 Self::UnknownValue(u) => u.0.name(),
4674 }
4675 }
4676}
4677
4678impl std::default::Default for DomainNotice {
4679 fn default() -> Self {
4680 use std::convert::From;
4681 Self::from(0)
4682 }
4683}
4684
4685impl std::fmt::Display for DomainNotice {
4686 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4687 wkt::internal::display_enum(f, self.name(), self.value())
4688 }
4689}
4690
4691impl std::convert::From<i32> for DomainNotice {
4692 fn from(value: i32) -> Self {
4693 match value {
4694 0 => Self::Unspecified,
4695 1 => Self::HstsPreloaded,
4696 _ => Self::UnknownValue(domain_notice::UnknownValue(
4697 wkt::internal::UnknownEnumValue::Integer(value),
4698 )),
4699 }
4700 }
4701}
4702
4703impl std::convert::From<&str> for DomainNotice {
4704 fn from(value: &str) -> Self {
4705 use std::string::ToString;
4706 match value {
4707 "DOMAIN_NOTICE_UNSPECIFIED" => Self::Unspecified,
4708 "HSTS_PRELOADED" => Self::HstsPreloaded,
4709 _ => Self::UnknownValue(domain_notice::UnknownValue(
4710 wkt::internal::UnknownEnumValue::String(value.to_string()),
4711 )),
4712 }
4713 }
4714}
4715
4716impl serde::ser::Serialize for DomainNotice {
4717 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4718 where
4719 S: serde::Serializer,
4720 {
4721 match self {
4722 Self::Unspecified => serializer.serialize_i32(0),
4723 Self::HstsPreloaded => serializer.serialize_i32(1),
4724 Self::UnknownValue(u) => u.0.serialize(serializer),
4725 }
4726 }
4727}
4728
4729impl<'de> serde::de::Deserialize<'de> for DomainNotice {
4730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4731 where
4732 D: serde::Deserializer<'de>,
4733 {
4734 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DomainNotice>::new(
4735 ".google.cloud.domains.v1.DomainNotice",
4736 ))
4737 }
4738}
4739
4740/// Notices related to contact information.
4741///
4742/// # Working with unknown values
4743///
4744/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4745/// additional enum variants at any time. Adding new variants is not considered
4746/// a breaking change. Applications should write their code in anticipation of:
4747///
4748/// - New values appearing in future releases of the client library, **and**
4749/// - New values received dynamically, without application changes.
4750///
4751/// Please consult the [Working with enums] section in the user guide for some
4752/// guidelines.
4753///
4754/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4755#[derive(Clone, Debug, PartialEq)]
4756#[non_exhaustive]
4757pub enum ContactNotice {
4758 /// The notice is undefined.
4759 Unspecified,
4760 /// Required when setting the `privacy` field of `ContactSettings` to
4761 /// `PUBLIC_CONTACT_DATA`, which exposes contact data publicly.
4762 PublicContactDataAcknowledgement,
4763 /// If set, the enum was initialized with an unknown value.
4764 ///
4765 /// Applications can examine the value using [ContactNotice::value] or
4766 /// [ContactNotice::name].
4767 UnknownValue(contact_notice::UnknownValue),
4768}
4769
4770#[doc(hidden)]
4771pub mod contact_notice {
4772 #[allow(unused_imports)]
4773 use super::*;
4774 #[derive(Clone, Debug, PartialEq)]
4775 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4776}
4777
4778impl ContactNotice {
4779 /// Gets the enum value.
4780 ///
4781 /// Returns `None` if the enum contains an unknown value deserialized from
4782 /// the string representation of enums.
4783 pub fn value(&self) -> std::option::Option<i32> {
4784 match self {
4785 Self::Unspecified => std::option::Option::Some(0),
4786 Self::PublicContactDataAcknowledgement => std::option::Option::Some(1),
4787 Self::UnknownValue(u) => u.0.value(),
4788 }
4789 }
4790
4791 /// Gets the enum value as a string.
4792 ///
4793 /// Returns `None` if the enum contains an unknown value deserialized from
4794 /// the integer representation of enums.
4795 pub fn name(&self) -> std::option::Option<&str> {
4796 match self {
4797 Self::Unspecified => std::option::Option::Some("CONTACT_NOTICE_UNSPECIFIED"),
4798 Self::PublicContactDataAcknowledgement => {
4799 std::option::Option::Some("PUBLIC_CONTACT_DATA_ACKNOWLEDGEMENT")
4800 }
4801 Self::UnknownValue(u) => u.0.name(),
4802 }
4803 }
4804}
4805
4806impl std::default::Default for ContactNotice {
4807 fn default() -> Self {
4808 use std::convert::From;
4809 Self::from(0)
4810 }
4811}
4812
4813impl std::fmt::Display for ContactNotice {
4814 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4815 wkt::internal::display_enum(f, self.name(), self.value())
4816 }
4817}
4818
4819impl std::convert::From<i32> for ContactNotice {
4820 fn from(value: i32) -> Self {
4821 match value {
4822 0 => Self::Unspecified,
4823 1 => Self::PublicContactDataAcknowledgement,
4824 _ => Self::UnknownValue(contact_notice::UnknownValue(
4825 wkt::internal::UnknownEnumValue::Integer(value),
4826 )),
4827 }
4828 }
4829}
4830
4831impl std::convert::From<&str> for ContactNotice {
4832 fn from(value: &str) -> Self {
4833 use std::string::ToString;
4834 match value {
4835 "CONTACT_NOTICE_UNSPECIFIED" => Self::Unspecified,
4836 "PUBLIC_CONTACT_DATA_ACKNOWLEDGEMENT" => Self::PublicContactDataAcknowledgement,
4837 _ => Self::UnknownValue(contact_notice::UnknownValue(
4838 wkt::internal::UnknownEnumValue::String(value.to_string()),
4839 )),
4840 }
4841 }
4842}
4843
4844impl serde::ser::Serialize for ContactNotice {
4845 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4846 where
4847 S: serde::Serializer,
4848 {
4849 match self {
4850 Self::Unspecified => serializer.serialize_i32(0),
4851 Self::PublicContactDataAcknowledgement => serializer.serialize_i32(1),
4852 Self::UnknownValue(u) => u.0.serialize(serializer),
4853 }
4854 }
4855}
4856
4857impl<'de> serde::de::Deserialize<'de> for ContactNotice {
4858 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4859 where
4860 D: serde::Deserializer<'de>,
4861 {
4862 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ContactNotice>::new(
4863 ".google.cloud.domains.v1.ContactNotice",
4864 ))
4865 }
4866}
4867
4868/// Possible states of a `Registration`'s transfer lock.
4869///
4870/// # Working with unknown values
4871///
4872/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4873/// additional enum variants at any time. Adding new variants is not considered
4874/// a breaking change. Applications should write their code in anticipation of:
4875///
4876/// - New values appearing in future releases of the client library, **and**
4877/// - New values received dynamically, without application changes.
4878///
4879/// Please consult the [Working with enums] section in the user guide for some
4880/// guidelines.
4881///
4882/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4883#[derive(Clone, Debug, PartialEq)]
4884#[non_exhaustive]
4885pub enum TransferLockState {
4886 /// The state is unspecified.
4887 Unspecified,
4888 /// The domain is unlocked and can be transferred to another registrar.
4889 Unlocked,
4890 /// The domain is locked and cannot be transferred to another registrar.
4891 Locked,
4892 /// If set, the enum was initialized with an unknown value.
4893 ///
4894 /// Applications can examine the value using [TransferLockState::value] or
4895 /// [TransferLockState::name].
4896 UnknownValue(transfer_lock_state::UnknownValue),
4897}
4898
4899#[doc(hidden)]
4900pub mod transfer_lock_state {
4901 #[allow(unused_imports)]
4902 use super::*;
4903 #[derive(Clone, Debug, PartialEq)]
4904 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4905}
4906
4907impl TransferLockState {
4908 /// Gets the enum value.
4909 ///
4910 /// Returns `None` if the enum contains an unknown value deserialized from
4911 /// the string representation of enums.
4912 pub fn value(&self) -> std::option::Option<i32> {
4913 match self {
4914 Self::Unspecified => std::option::Option::Some(0),
4915 Self::Unlocked => std::option::Option::Some(1),
4916 Self::Locked => std::option::Option::Some(2),
4917 Self::UnknownValue(u) => u.0.value(),
4918 }
4919 }
4920
4921 /// Gets the enum value as a string.
4922 ///
4923 /// Returns `None` if the enum contains an unknown value deserialized from
4924 /// the integer representation of enums.
4925 pub fn name(&self) -> std::option::Option<&str> {
4926 match self {
4927 Self::Unspecified => std::option::Option::Some("TRANSFER_LOCK_STATE_UNSPECIFIED"),
4928 Self::Unlocked => std::option::Option::Some("UNLOCKED"),
4929 Self::Locked => std::option::Option::Some("LOCKED"),
4930 Self::UnknownValue(u) => u.0.name(),
4931 }
4932 }
4933}
4934
4935impl std::default::Default for TransferLockState {
4936 fn default() -> Self {
4937 use std::convert::From;
4938 Self::from(0)
4939 }
4940}
4941
4942impl std::fmt::Display for TransferLockState {
4943 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4944 wkt::internal::display_enum(f, self.name(), self.value())
4945 }
4946}
4947
4948impl std::convert::From<i32> for TransferLockState {
4949 fn from(value: i32) -> Self {
4950 match value {
4951 0 => Self::Unspecified,
4952 1 => Self::Unlocked,
4953 2 => Self::Locked,
4954 _ => Self::UnknownValue(transfer_lock_state::UnknownValue(
4955 wkt::internal::UnknownEnumValue::Integer(value),
4956 )),
4957 }
4958 }
4959}
4960
4961impl std::convert::From<&str> for TransferLockState {
4962 fn from(value: &str) -> Self {
4963 use std::string::ToString;
4964 match value {
4965 "TRANSFER_LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
4966 "UNLOCKED" => Self::Unlocked,
4967 "LOCKED" => Self::Locked,
4968 _ => Self::UnknownValue(transfer_lock_state::UnknownValue(
4969 wkt::internal::UnknownEnumValue::String(value.to_string()),
4970 )),
4971 }
4972 }
4973}
4974
4975impl serde::ser::Serialize for TransferLockState {
4976 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4977 where
4978 S: serde::Serializer,
4979 {
4980 match self {
4981 Self::Unspecified => serializer.serialize_i32(0),
4982 Self::Unlocked => serializer.serialize_i32(1),
4983 Self::Locked => serializer.serialize_i32(2),
4984 Self::UnknownValue(u) => u.0.serialize(serializer),
4985 }
4986 }
4987}
4988
4989impl<'de> serde::de::Deserialize<'de> for TransferLockState {
4990 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4991 where
4992 D: serde::Deserializer<'de>,
4993 {
4994 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferLockState>::new(
4995 ".google.cloud.domains.v1.TransferLockState",
4996 ))
4997 }
4998}