google_domainsrdap1/
api.rs

1#![allow(clippy::ptr_arg)]
2
3use std::collections::{BTreeSet, HashMap};
4
5use tokio::time::sleep;
6
7// ##############
8// UTILITIES ###
9// ############
10
11// ########
12// HUB ###
13// ######
14
15/// Central instance to access all DomainsRDAP related resource activities
16///
17/// # Examples
18///
19/// Instantiate a new hub
20///
21/// ```test_harness,no_run
22/// extern crate hyper;
23/// extern crate hyper_rustls;
24/// extern crate google_domainsrdap1 as domainsrdap1;
25/// use domainsrdap1::{Result, Error};
26/// # async fn dox() {
27/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
28///
29/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
30/// // `client_secret`, among other things.
31/// let secret: yup_oauth2::ApplicationSecret = Default::default();
32/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
33/// // unless you replace  `None` with the desired Flow.
34/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
35/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
36/// // retrieve them from storage.
37/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
38///     .with_native_roots()
39///     .unwrap()
40///     .https_only()
41///     .enable_http2()
42///     .build();
43///
44/// let executor = hyper_util::rt::TokioExecutor::new();
45/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
46///     secret,
47///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
48///     yup_oauth2::client::CustomHyperClientBuilder::from(
49///         hyper_util::client::legacy::Client::builder(executor).build(connector),
50///     ),
51/// ).build().await.unwrap();
52///
53/// let client = hyper_util::client::legacy::Client::builder(
54///     hyper_util::rt::TokioExecutor::new()
55/// )
56/// .build(
57///     hyper_rustls::HttpsConnectorBuilder::new()
58///         .with_native_roots()
59///         .unwrap()
60///         .https_or_http()
61///         .enable_http2()
62///         .build()
63/// );
64/// let mut hub = DomainsRDAP::new(client, auth);
65/// // You can configure optional parameters by calling the respective setters at will, and
66/// // execute the final call using `doit()`.
67/// // Values shown here are possibly random and not representative !
68/// let result = hub.ip().get("ipId", "ipId1")
69///              .doit().await;
70///
71/// match result {
72///     Err(e) => match e {
73///         // The Error enum provides details about what exactly happened.
74///         // You can also just use its `Debug`, `Display` or `Error` traits
75///          Error::HttpError(_)
76///         |Error::Io(_)
77///         |Error::MissingAPIKey
78///         |Error::MissingToken(_)
79///         |Error::Cancelled
80///         |Error::UploadSizeLimitExceeded(_, _)
81///         |Error::Failure(_)
82///         |Error::BadRequest(_)
83///         |Error::FieldClash(_)
84///         |Error::JsonDecodeError(_, _) => println!("{}", e),
85///     },
86///     Ok(res) => println!("Success: {:?}", res),
87/// }
88/// # }
89/// ```
90#[derive(Clone)]
91pub struct DomainsRDAP<C> {
92    pub client: common::Client<C>,
93    pub auth: Box<dyn common::GetToken>,
94    _user_agent: String,
95    _base_url: String,
96    _root_url: String,
97}
98
99impl<C> common::Hub for DomainsRDAP<C> {}
100
101impl<'a, C> DomainsRDAP<C> {
102    pub fn new<A: 'static + common::GetToken>(
103        client: common::Client<C>,
104        auth: A,
105    ) -> DomainsRDAP<C> {
106        DomainsRDAP {
107            client,
108            auth: Box::new(auth),
109            _user_agent: "google-api-rust-client/7.0.0".to_string(),
110            _base_url: "https://domainsrdap.googleapis.com/".to_string(),
111            _root_url: "https://domainsrdap.googleapis.com/".to_string(),
112        }
113    }
114
115    pub fn autnum(&'a self) -> AutnumMethods<'a, C> {
116        AutnumMethods { hub: self }
117    }
118    pub fn domain(&'a self) -> DomainMethods<'a, C> {
119        DomainMethods { hub: self }
120    }
121    pub fn entity(&'a self) -> EntityMethods<'a, C> {
122        EntityMethods { hub: self }
123    }
124    pub fn ip(&'a self) -> IpMethods<'a, C> {
125        IpMethods { hub: self }
126    }
127    pub fn methods(&'a self) -> MethodMethods<'a, C> {
128        MethodMethods { hub: self }
129    }
130    pub fn nameserver(&'a self) -> NameserverMethods<'a, C> {
131        NameserverMethods { hub: self }
132    }
133
134    /// Set the user-agent header field to use in all requests to the server.
135    /// It defaults to `google-api-rust-client/7.0.0`.
136    ///
137    /// Returns the previously set user-agent.
138    pub fn user_agent(&mut self, agent_name: String) -> String {
139        std::mem::replace(&mut self._user_agent, agent_name)
140    }
141
142    /// Set the base url to use in all requests to the server.
143    /// It defaults to `https://domainsrdap.googleapis.com/`.
144    ///
145    /// Returns the previously set base url.
146    pub fn base_url(&mut self, new_base_url: String) -> String {
147        std::mem::replace(&mut self._base_url, new_base_url)
148    }
149
150    /// Set the root url to use in all requests to the server.
151    /// It defaults to `https://domainsrdap.googleapis.com/`.
152    ///
153    /// Returns the previously set root url.
154    pub fn root_url(&mut self, new_root_url: String) -> String {
155        std::mem::replace(&mut self._root_url, new_root_url)
156    }
157}
158
159// ############
160// SCHEMAS ###
161// ##########
162/// Message that represents an arbitrary HTTP body. It should only be used for payload formats that can’t be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
163///
164/// # Activities
165///
166/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
167/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
168///
169/// * [get domain](DomainGetCall) (response)
170/// * [get help](MethodGetHelpCall) (response)
171/// * [get ip](MethodGetIpCall) (response)
172#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
173#[serde_with::serde_as]
174#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
175pub struct HttpBody {
176    /// The HTTP Content-Type header value specifying the content type of the body.
177    #[serde(rename = "contentType")]
178    pub content_type: Option<String>,
179    /// The HTTP request/response body as raw binary.
180    #[serde_as(as = "Option<common::serde::standard_base64::Wrapper>")]
181    pub data: Option<Vec<u8>>,
182    /// Application specific response metadata. Must be set in the first response for streaming APIs.
183    pub extensions: Option<Vec<HashMap<String, serde_json::Value>>>,
184}
185
186impl common::ResponseResult for HttpBody {}
187
188/// Links object defined in [section 4.2 of RFC 7483](https://tools.ietf.org/html/rfc7483#section-4.2).
189///
190/// This type is not used in any activity, and only used as *part* of another schema.
191///
192#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
193#[serde_with::serde_as]
194#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
195pub struct Link {
196    /// Target URL of a link. Example: "http://example.com/previous".
197    pub href: Option<String>,
198    /// Language code of a link. Example: "en".
199    pub hreflang: Option<String>,
200    /// Media type of the link destination. Example: "screen".
201    pub media: Option<String>,
202    /// Relation type of a link. Example: "previous".
203    pub rel: Option<String>,
204    /// Title of this link. Example: "title".
205    pub title: Option<String>,
206    /// Content type of the link. Example: "application/json".
207    #[serde(rename = "type")]
208    pub type_: Option<String>,
209    /// URL giving context for the link. Example: "http://example.com/current".
210    pub value: Option<String>,
211}
212
213impl common::Part for Link {}
214
215/// Notices object defined in [section 4.3 of RFC 7483](https://tools.ietf.org/html/rfc7483#section-4.3).
216///
217/// This type is not used in any activity, and only used as *part* of another schema.
218///
219#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
220#[serde_with::serde_as]
221#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
222pub struct Notice {
223    /// Description of the notice.
224    pub description: Option<Vec<String>>,
225    /// Link to a document containing more information.
226    pub links: Option<Vec<Link>>,
227    /// Title of a notice. Example: "Terms of Service".
228    pub title: Option<String>,
229    /// Type values defined in [section 10.2.1 of RFC 7483](https://tools.ietf.org/html/rfc7483#section-10.2.1) specific to a whole response: "result set truncated due to authorization", "result set truncated due to excessive load", "result set truncated due to unexplainable reasons".
230    #[serde(rename = "type")]
231    pub type_: Option<String>,
232}
233
234impl common::Part for Notice {}
235
236/// Response to a general RDAP query.
237///
238/// # Activities
239///
240/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
241/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
242///
243/// * [get autnum](AutnumGetCall) (response)
244/// * [get entity](EntityGetCall) (response)
245/// * [get ip](IpGetCall) (response)
246/// * [get nameserver](NameserverGetCall) (response)
247/// * [get domains](MethodGetDomainCall) (response)
248/// * [get entities](MethodGetEntityCall) (response)
249/// * [get nameservers](MethodGetNameserverCall) (response)
250#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
251#[serde_with::serde_as]
252#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
253pub struct RdapResponse {
254    /// Error description.
255    pub description: Option<Vec<String>>,
256    /// Error HTTP code. Example: "501".
257    #[serde(rename = "errorCode")]
258    pub error_code: Option<i32>,
259    /// HTTP response with content type set to "application/json+rdap".
260    #[serde(rename = "jsonResponse")]
261    pub json_response: Option<HttpBody>,
262    /// Error language code. Error response info fields are defined in [section 6 of RFC 7483](https://tools.ietf.org/html/rfc7483#section-6).
263    pub lang: Option<String>,
264    /// Notices applying to this response.
265    pub notices: Option<Vec<Notice>>,
266    /// RDAP conformance level.
267    #[serde(rename = "rdapConformance")]
268    pub rdap_conformance: Option<Vec<String>>,
269    /// Error title.
270    pub title: Option<String>,
271}
272
273impl common::ResponseResult for RdapResponse {}
274
275// ###################
276// MethodBuilders ###
277// #################
278
279/// A builder providing access to all methods supported on *autnum* resources.
280/// It is not used directly, but through the [`DomainsRDAP`] hub.
281///
282/// # Example
283///
284/// Instantiate a resource builder
285///
286/// ```test_harness,no_run
287/// extern crate hyper;
288/// extern crate hyper_rustls;
289/// extern crate google_domainsrdap1 as domainsrdap1;
290///
291/// # async fn dox() {
292/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
293///
294/// let secret: yup_oauth2::ApplicationSecret = Default::default();
295/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
296///     .with_native_roots()
297///     .unwrap()
298///     .https_only()
299///     .enable_http2()
300///     .build();
301///
302/// let executor = hyper_util::rt::TokioExecutor::new();
303/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
304///     secret,
305///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
306///     yup_oauth2::client::CustomHyperClientBuilder::from(
307///         hyper_util::client::legacy::Client::builder(executor).build(connector),
308///     ),
309/// ).build().await.unwrap();
310///
311/// let client = hyper_util::client::legacy::Client::builder(
312///     hyper_util::rt::TokioExecutor::new()
313/// )
314/// .build(
315///     hyper_rustls::HttpsConnectorBuilder::new()
316///         .with_native_roots()
317///         .unwrap()
318///         .https_or_http()
319///         .enable_http2()
320///         .build()
321/// );
322/// let mut hub = DomainsRDAP::new(client, auth);
323/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
324/// // like `get(...)`
325/// // to build up your call.
326/// let rb = hub.autnum();
327/// # }
328/// ```
329pub struct AutnumMethods<'a, C>
330where
331    C: 'a,
332{
333    hub: &'a DomainsRDAP<C>,
334}
335
336impl<'a, C> common::MethodsBuilder for AutnumMethods<'a, C> {}
337
338impl<'a, C> AutnumMethods<'a, C> {
339    /// Create a builder to help you perform the following task:
340    ///
341    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
342    ///
343    /// # Arguments
344    ///
345    /// * `autnumId` - No description provided.
346    pub fn get(&self, autnum_id: &str) -> AutnumGetCall<'a, C> {
347        AutnumGetCall {
348            hub: self.hub,
349            _autnum_id: autnum_id.to_string(),
350            _delegate: Default::default(),
351            _additional_params: Default::default(),
352        }
353    }
354}
355
356/// A builder providing access to all methods supported on *domain* resources.
357/// It is not used directly, but through the [`DomainsRDAP`] hub.
358///
359/// # Example
360///
361/// Instantiate a resource builder
362///
363/// ```test_harness,no_run
364/// extern crate hyper;
365/// extern crate hyper_rustls;
366/// extern crate google_domainsrdap1 as domainsrdap1;
367///
368/// # async fn dox() {
369/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
370///
371/// let secret: yup_oauth2::ApplicationSecret = Default::default();
372/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
373///     .with_native_roots()
374///     .unwrap()
375///     .https_only()
376///     .enable_http2()
377///     .build();
378///
379/// let executor = hyper_util::rt::TokioExecutor::new();
380/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
381///     secret,
382///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
383///     yup_oauth2::client::CustomHyperClientBuilder::from(
384///         hyper_util::client::legacy::Client::builder(executor).build(connector),
385///     ),
386/// ).build().await.unwrap();
387///
388/// let client = hyper_util::client::legacy::Client::builder(
389///     hyper_util::rt::TokioExecutor::new()
390/// )
391/// .build(
392///     hyper_rustls::HttpsConnectorBuilder::new()
393///         .with_native_roots()
394///         .unwrap()
395///         .https_or_http()
396///         .enable_http2()
397///         .build()
398/// );
399/// let mut hub = DomainsRDAP::new(client, auth);
400/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
401/// // like `get(...)`
402/// // to build up your call.
403/// let rb = hub.domain();
404/// # }
405/// ```
406pub struct DomainMethods<'a, C>
407where
408    C: 'a,
409{
410    hub: &'a DomainsRDAP<C>,
411}
412
413impl<'a, C> common::MethodsBuilder for DomainMethods<'a, C> {}
414
415impl<'a, C> DomainMethods<'a, C> {
416    /// Create a builder to help you perform the following task:
417    ///
418    /// Look up RDAP information for a domain by name.
419    ///
420    /// # Arguments
421    ///
422    /// * `domainName` - Full domain name to look up. Example: "example.com"
423    pub fn get(&self, domain_name: &str) -> DomainGetCall<'a, C> {
424        DomainGetCall {
425            hub: self.hub,
426            _domain_name: domain_name.to_string(),
427            _delegate: Default::default(),
428            _additional_params: Default::default(),
429        }
430    }
431}
432
433/// A builder providing access to all methods supported on *entity* resources.
434/// It is not used directly, but through the [`DomainsRDAP`] hub.
435///
436/// # Example
437///
438/// Instantiate a resource builder
439///
440/// ```test_harness,no_run
441/// extern crate hyper;
442/// extern crate hyper_rustls;
443/// extern crate google_domainsrdap1 as domainsrdap1;
444///
445/// # async fn dox() {
446/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
447///
448/// let secret: yup_oauth2::ApplicationSecret = Default::default();
449/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
450///     .with_native_roots()
451///     .unwrap()
452///     .https_only()
453///     .enable_http2()
454///     .build();
455///
456/// let executor = hyper_util::rt::TokioExecutor::new();
457/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
458///     secret,
459///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
460///     yup_oauth2::client::CustomHyperClientBuilder::from(
461///         hyper_util::client::legacy::Client::builder(executor).build(connector),
462///     ),
463/// ).build().await.unwrap();
464///
465/// let client = hyper_util::client::legacy::Client::builder(
466///     hyper_util::rt::TokioExecutor::new()
467/// )
468/// .build(
469///     hyper_rustls::HttpsConnectorBuilder::new()
470///         .with_native_roots()
471///         .unwrap()
472///         .https_or_http()
473///         .enable_http2()
474///         .build()
475/// );
476/// let mut hub = DomainsRDAP::new(client, auth);
477/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
478/// // like `get(...)`
479/// // to build up your call.
480/// let rb = hub.entity();
481/// # }
482/// ```
483pub struct EntityMethods<'a, C>
484where
485    C: 'a,
486{
487    hub: &'a DomainsRDAP<C>,
488}
489
490impl<'a, C> common::MethodsBuilder for EntityMethods<'a, C> {}
491
492impl<'a, C> EntityMethods<'a, C> {
493    /// Create a builder to help you perform the following task:
494    ///
495    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
496    ///
497    /// # Arguments
498    ///
499    /// * `entityId` - No description provided.
500    pub fn get(&self, entity_id: &str) -> EntityGetCall<'a, C> {
501        EntityGetCall {
502            hub: self.hub,
503            _entity_id: entity_id.to_string(),
504            _delegate: Default::default(),
505            _additional_params: Default::default(),
506        }
507    }
508}
509
510/// A builder providing access to all methods supported on *ip* resources.
511/// It is not used directly, but through the [`DomainsRDAP`] hub.
512///
513/// # Example
514///
515/// Instantiate a resource builder
516///
517/// ```test_harness,no_run
518/// extern crate hyper;
519/// extern crate hyper_rustls;
520/// extern crate google_domainsrdap1 as domainsrdap1;
521///
522/// # async fn dox() {
523/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
524///
525/// let secret: yup_oauth2::ApplicationSecret = Default::default();
526/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
527///     .with_native_roots()
528///     .unwrap()
529///     .https_only()
530///     .enable_http2()
531///     .build();
532///
533/// let executor = hyper_util::rt::TokioExecutor::new();
534/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
535///     secret,
536///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
537///     yup_oauth2::client::CustomHyperClientBuilder::from(
538///         hyper_util::client::legacy::Client::builder(executor).build(connector),
539///     ),
540/// ).build().await.unwrap();
541///
542/// let client = hyper_util::client::legacy::Client::builder(
543///     hyper_util::rt::TokioExecutor::new()
544/// )
545/// .build(
546///     hyper_rustls::HttpsConnectorBuilder::new()
547///         .with_native_roots()
548///         .unwrap()
549///         .https_or_http()
550///         .enable_http2()
551///         .build()
552/// );
553/// let mut hub = DomainsRDAP::new(client, auth);
554/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
555/// // like `get(...)`
556/// // to build up your call.
557/// let rb = hub.ip();
558/// # }
559/// ```
560pub struct IpMethods<'a, C>
561where
562    C: 'a,
563{
564    hub: &'a DomainsRDAP<C>,
565}
566
567impl<'a, C> common::MethodsBuilder for IpMethods<'a, C> {}
568
569impl<'a, C> IpMethods<'a, C> {
570    /// Create a builder to help you perform the following task:
571    ///
572    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
573    ///
574    /// # Arguments
575    ///
576    /// * `ipId` - No description provided.
577    /// * `ipId1` - No description provided.
578    pub fn get(&self, ip_id: &str, ip_id1: &str) -> IpGetCall<'a, C> {
579        IpGetCall {
580            hub: self.hub,
581            _ip_id: ip_id.to_string(),
582            _ip_id1: ip_id1.to_string(),
583            _delegate: Default::default(),
584            _additional_params: Default::default(),
585        }
586    }
587}
588
589/// A builder providing access to all methods supported on *nameserver* resources.
590/// It is not used directly, but through the [`DomainsRDAP`] hub.
591///
592/// # Example
593///
594/// Instantiate a resource builder
595///
596/// ```test_harness,no_run
597/// extern crate hyper;
598/// extern crate hyper_rustls;
599/// extern crate google_domainsrdap1 as domainsrdap1;
600///
601/// # async fn dox() {
602/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
603///
604/// let secret: yup_oauth2::ApplicationSecret = Default::default();
605/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
606///     .with_native_roots()
607///     .unwrap()
608///     .https_only()
609///     .enable_http2()
610///     .build();
611///
612/// let executor = hyper_util::rt::TokioExecutor::new();
613/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
614///     secret,
615///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
616///     yup_oauth2::client::CustomHyperClientBuilder::from(
617///         hyper_util::client::legacy::Client::builder(executor).build(connector),
618///     ),
619/// ).build().await.unwrap();
620///
621/// let client = hyper_util::client::legacy::Client::builder(
622///     hyper_util::rt::TokioExecutor::new()
623/// )
624/// .build(
625///     hyper_rustls::HttpsConnectorBuilder::new()
626///         .with_native_roots()
627///         .unwrap()
628///         .https_or_http()
629///         .enable_http2()
630///         .build()
631/// );
632/// let mut hub = DomainsRDAP::new(client, auth);
633/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
634/// // like `get(...)`
635/// // to build up your call.
636/// let rb = hub.nameserver();
637/// # }
638/// ```
639pub struct NameserverMethods<'a, C>
640where
641    C: 'a,
642{
643    hub: &'a DomainsRDAP<C>,
644}
645
646impl<'a, C> common::MethodsBuilder for NameserverMethods<'a, C> {}
647
648impl<'a, C> NameserverMethods<'a, C> {
649    /// Create a builder to help you perform the following task:
650    ///
651    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
652    ///
653    /// # Arguments
654    ///
655    /// * `nameserverId` - No description provided.
656    pub fn get(&self, nameserver_id: &str) -> NameserverGetCall<'a, C> {
657        NameserverGetCall {
658            hub: self.hub,
659            _nameserver_id: nameserver_id.to_string(),
660            _delegate: Default::default(),
661            _additional_params: Default::default(),
662        }
663    }
664}
665
666/// A builder providing access to all free methods, which are not associated with a particular resource.
667/// It is not used directly, but through the [`DomainsRDAP`] hub.
668///
669/// # Example
670///
671/// Instantiate a resource builder
672///
673/// ```test_harness,no_run
674/// extern crate hyper;
675/// extern crate hyper_rustls;
676/// extern crate google_domainsrdap1 as domainsrdap1;
677///
678/// # async fn dox() {
679/// use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
680///
681/// let secret: yup_oauth2::ApplicationSecret = Default::default();
682/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
683///     .with_native_roots()
684///     .unwrap()
685///     .https_only()
686///     .enable_http2()
687///     .build();
688///
689/// let executor = hyper_util::rt::TokioExecutor::new();
690/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
691///     secret,
692///     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
693///     yup_oauth2::client::CustomHyperClientBuilder::from(
694///         hyper_util::client::legacy::Client::builder(executor).build(connector),
695///     ),
696/// ).build().await.unwrap();
697///
698/// let client = hyper_util::client::legacy::Client::builder(
699///     hyper_util::rt::TokioExecutor::new()
700/// )
701/// .build(
702///     hyper_rustls::HttpsConnectorBuilder::new()
703///         .with_native_roots()
704///         .unwrap()
705///         .https_or_http()
706///         .enable_http2()
707///         .build()
708/// );
709/// let mut hub = DomainsRDAP::new(client, auth);
710/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
711/// // like `get_domains(...)`, `get_entities(...)`, `get_help(...)`, `get_ip(...)` and `get_nameservers(...)`
712/// // to build up your call.
713/// let rb = hub.methods();
714/// # }
715/// ```
716pub struct MethodMethods<'a, C>
717where
718    C: 'a,
719{
720    hub: &'a DomainsRDAP<C>,
721}
722
723impl<'a, C> common::MethodsBuilder for MethodMethods<'a, C> {}
724
725impl<'a, C> MethodMethods<'a, C> {
726    /// Create a builder to help you perform the following task:
727    ///
728    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
729    pub fn get_domains(&self) -> MethodGetDomainCall<'a, C> {
730        MethodGetDomainCall {
731            hub: self.hub,
732            _delegate: Default::default(),
733            _additional_params: Default::default(),
734        }
735    }
736
737    /// Create a builder to help you perform the following task:
738    ///
739    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
740    pub fn get_entities(&self) -> MethodGetEntityCall<'a, C> {
741        MethodGetEntityCall {
742            hub: self.hub,
743            _delegate: Default::default(),
744            _additional_params: Default::default(),
745        }
746    }
747
748    /// Create a builder to help you perform the following task:
749    ///
750    /// Get help information for the RDAP API, including links to documentation.
751    pub fn get_help(&self) -> MethodGetHelpCall<'a, C> {
752        MethodGetHelpCall {
753            hub: self.hub,
754            _delegate: Default::default(),
755            _additional_params: Default::default(),
756        }
757    }
758
759    /// Create a builder to help you perform the following task:
760    ///
761    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
762    pub fn get_ip(&self) -> MethodGetIpCall<'a, C> {
763        MethodGetIpCall {
764            hub: self.hub,
765            _delegate: Default::default(),
766            _additional_params: Default::default(),
767        }
768    }
769
770    /// Create a builder to help you perform the following task:
771    ///
772    /// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
773    pub fn get_nameservers(&self) -> MethodGetNameserverCall<'a, C> {
774        MethodGetNameserverCall {
775            hub: self.hub,
776            _delegate: Default::default(),
777            _additional_params: Default::default(),
778        }
779    }
780}
781
782// ###################
783// CallBuilders   ###
784// #################
785
786/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
787///
788/// A builder for the *get* method supported by a *autnum* resource.
789/// It is not used directly, but through a [`AutnumMethods`] instance.
790///
791/// # Example
792///
793/// Instantiate a resource method builder
794///
795/// ```test_harness,no_run
796/// # extern crate hyper;
797/// # extern crate hyper_rustls;
798/// # extern crate google_domainsrdap1 as domainsrdap1;
799/// # async fn dox() {
800/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
801///
802/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
803/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
804/// #     .with_native_roots()
805/// #     .unwrap()
806/// #     .https_only()
807/// #     .enable_http2()
808/// #     .build();
809///
810/// # let executor = hyper_util::rt::TokioExecutor::new();
811/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
812/// #     secret,
813/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
814/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
815/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
816/// #     ),
817/// # ).build().await.unwrap();
818///
819/// # let client = hyper_util::client::legacy::Client::builder(
820/// #     hyper_util::rt::TokioExecutor::new()
821/// # )
822/// # .build(
823/// #     hyper_rustls::HttpsConnectorBuilder::new()
824/// #         .with_native_roots()
825/// #         .unwrap()
826/// #         .https_or_http()
827/// #         .enable_http2()
828/// #         .build()
829/// # );
830/// # let mut hub = DomainsRDAP::new(client, auth);
831/// // You can configure optional parameters by calling the respective setters at will, and
832/// // execute the final call using `doit()`.
833/// // Values shown here are possibly random and not representative !
834/// let result = hub.autnum().get("autnumId")
835///              .doit().await;
836/// # }
837/// ```
838pub struct AutnumGetCall<'a, C>
839where
840    C: 'a,
841{
842    hub: &'a DomainsRDAP<C>,
843    _autnum_id: String,
844    _delegate: Option<&'a mut dyn common::Delegate>,
845    _additional_params: HashMap<String, String>,
846}
847
848impl<'a, C> common::CallBuilder for AutnumGetCall<'a, C> {}
849
850impl<'a, C> AutnumGetCall<'a, C>
851where
852    C: common::Connector,
853{
854    /// Perform the operation you have build so far.
855    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
856        use std::borrow::Cow;
857        use std::io::{Read, Seek};
858
859        use common::{url::Params, ToParts};
860        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
861
862        let mut dd = common::DefaultDelegate;
863        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
864        dlg.begin(common::MethodInfo {
865            id: "domainsrdap.autnum.get",
866            http_method: hyper::Method::GET,
867        });
868
869        for &field in ["alt", "autnumId"].iter() {
870            if self._additional_params.contains_key(field) {
871                dlg.finished(false);
872                return Err(common::Error::FieldClash(field));
873            }
874        }
875
876        let mut params = Params::with_capacity(3 + self._additional_params.len());
877        params.push("autnumId", self._autnum_id);
878
879        params.extend(self._additional_params.iter());
880
881        params.push("alt", "json");
882        let mut url = self.hub._base_url.clone() + "v1/autnum/{autnumId}";
883
884        match dlg.api_key() {
885            Some(value) => params.push("key", value),
886            None => {
887                dlg.finished(false);
888                return Err(common::Error::MissingAPIKey);
889            }
890        }
891
892        #[allow(clippy::single_element_loop)]
893        for &(find_this, param_name) in [("{autnumId}", "autnumId")].iter() {
894            url = params.uri_replacement(url, param_name, find_this, false);
895        }
896        {
897            let to_remove = ["autnumId"];
898            params.remove_params(&to_remove);
899        }
900
901        let url = params.parse_with_url(&url);
902
903        loop {
904            let mut req_result = {
905                let client = &self.hub.client;
906                dlg.pre_request();
907                let mut req_builder = hyper::Request::builder()
908                    .method(hyper::Method::GET)
909                    .uri(url.as_str())
910                    .header(USER_AGENT, self.hub._user_agent.clone());
911
912                let request = req_builder
913                    .header(CONTENT_LENGTH, 0_u64)
914                    .body(common::to_body::<String>(None));
915
916                client.request(request.unwrap()).await
917            };
918
919            match req_result {
920                Err(err) => {
921                    if let common::Retry::After(d) = dlg.http_error(&err) {
922                        sleep(d).await;
923                        continue;
924                    }
925                    dlg.finished(false);
926                    return Err(common::Error::HttpError(err));
927                }
928                Ok(res) => {
929                    let (mut parts, body) = res.into_parts();
930                    let mut body = common::Body::new(body);
931                    if !parts.status.is_success() {
932                        let bytes = common::to_bytes(body).await.unwrap_or_default();
933                        let error = serde_json::from_str(&common::to_string(&bytes));
934                        let response = common::to_response(parts, bytes.into());
935
936                        if let common::Retry::After(d) =
937                            dlg.http_failure(&response, error.as_ref().ok())
938                        {
939                            sleep(d).await;
940                            continue;
941                        }
942
943                        dlg.finished(false);
944
945                        return Err(match error {
946                            Ok(value) => common::Error::BadRequest(value),
947                            _ => common::Error::Failure(response),
948                        });
949                    }
950                    let response = {
951                        let bytes = common::to_bytes(body).await.unwrap_or_default();
952                        let encoded = common::to_string(&bytes);
953                        match serde_json::from_str(&encoded) {
954                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
955                            Err(error) => {
956                                dlg.response_json_decode_error(&encoded, &error);
957                                return Err(common::Error::JsonDecodeError(
958                                    encoded.to_string(),
959                                    error,
960                                ));
961                            }
962                        }
963                    };
964
965                    dlg.finished(true);
966                    return Ok(response);
967                }
968            }
969        }
970    }
971
972    ///
973    /// Sets the *autnum id* path property to the given value.
974    ///
975    /// Even though the property as already been set when instantiating this call,
976    /// we provide this method for API completeness.
977    pub fn autnum_id(mut self, new_value: &str) -> AutnumGetCall<'a, C> {
978        self._autnum_id = new_value.to_string();
979        self
980    }
981    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
982    /// while executing the actual API request.
983    ///
984    /// ````text
985    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
986    /// ````
987    ///
988    /// Sets the *delegate* property to the given value.
989    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> AutnumGetCall<'a, C> {
990        self._delegate = Some(new_value);
991        self
992    }
993
994    /// Set any additional parameter of the query string used in the request.
995    /// It should be used to set parameters which are not yet available through their own
996    /// setters.
997    ///
998    /// Please note that this method must not be used to set any of the known parameters
999    /// which have their own setter method. If done anyway, the request will fail.
1000    ///
1001    /// # Additional Parameters
1002    ///
1003    /// * *$.xgafv* (query-string) - V1 error format.
1004    /// * *access_token* (query-string) - OAuth access token.
1005    /// * *alt* (query-string) - Data format for response.
1006    /// * *callback* (query-string) - JSONP
1007    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1008    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1009    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1010    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1011    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1012    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1013    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1014    pub fn param<T>(mut self, name: T, value: T) -> AutnumGetCall<'a, C>
1015    where
1016        T: AsRef<str>,
1017    {
1018        self._additional_params
1019            .insert(name.as_ref().to_string(), value.as_ref().to_string());
1020        self
1021    }
1022}
1023
1024/// Look up RDAP information for a domain by name.
1025///
1026/// A builder for the *get* method supported by a *domain* resource.
1027/// It is not used directly, but through a [`DomainMethods`] instance.
1028///
1029/// # Example
1030///
1031/// Instantiate a resource method builder
1032///
1033/// ```test_harness,no_run
1034/// # extern crate hyper;
1035/// # extern crate hyper_rustls;
1036/// # extern crate google_domainsrdap1 as domainsrdap1;
1037/// # async fn dox() {
1038/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1039///
1040/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1041/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1042/// #     .with_native_roots()
1043/// #     .unwrap()
1044/// #     .https_only()
1045/// #     .enable_http2()
1046/// #     .build();
1047///
1048/// # let executor = hyper_util::rt::TokioExecutor::new();
1049/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1050/// #     secret,
1051/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1052/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
1053/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
1054/// #     ),
1055/// # ).build().await.unwrap();
1056///
1057/// # let client = hyper_util::client::legacy::Client::builder(
1058/// #     hyper_util::rt::TokioExecutor::new()
1059/// # )
1060/// # .build(
1061/// #     hyper_rustls::HttpsConnectorBuilder::new()
1062/// #         .with_native_roots()
1063/// #         .unwrap()
1064/// #         .https_or_http()
1065/// #         .enable_http2()
1066/// #         .build()
1067/// # );
1068/// # let mut hub = DomainsRDAP::new(client, auth);
1069/// // You can configure optional parameters by calling the respective setters at will, and
1070/// // execute the final call using `doit()`.
1071/// // Values shown here are possibly random and not representative !
1072/// let result = hub.domain().get("domainName")
1073///              .doit().await;
1074/// # }
1075/// ```
1076pub struct DomainGetCall<'a, C>
1077where
1078    C: 'a,
1079{
1080    hub: &'a DomainsRDAP<C>,
1081    _domain_name: String,
1082    _delegate: Option<&'a mut dyn common::Delegate>,
1083    _additional_params: HashMap<String, String>,
1084}
1085
1086impl<'a, C> common::CallBuilder for DomainGetCall<'a, C> {}
1087
1088impl<'a, C> DomainGetCall<'a, C>
1089where
1090    C: common::Connector,
1091{
1092    /// Perform the operation you have build so far.
1093    pub async fn doit(mut self) -> common::Result<(common::Response, HttpBody)> {
1094        use std::borrow::Cow;
1095        use std::io::{Read, Seek};
1096
1097        use common::{url::Params, ToParts};
1098        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1099
1100        let mut dd = common::DefaultDelegate;
1101        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1102        dlg.begin(common::MethodInfo {
1103            id: "domainsrdap.domain.get",
1104            http_method: hyper::Method::GET,
1105        });
1106
1107        for &field in ["alt", "domainName"].iter() {
1108            if self._additional_params.contains_key(field) {
1109                dlg.finished(false);
1110                return Err(common::Error::FieldClash(field));
1111            }
1112        }
1113
1114        let mut params = Params::with_capacity(3 + self._additional_params.len());
1115        params.push("domainName", self._domain_name);
1116
1117        params.extend(self._additional_params.iter());
1118
1119        params.push("alt", "json");
1120        let mut url = self.hub._base_url.clone() + "v1/domain/{+domainName}";
1121
1122        match dlg.api_key() {
1123            Some(value) => params.push("key", value),
1124            None => {
1125                dlg.finished(false);
1126                return Err(common::Error::MissingAPIKey);
1127            }
1128        }
1129
1130        #[allow(clippy::single_element_loop)]
1131        for &(find_this, param_name) in [("{+domainName}", "domainName")].iter() {
1132            url = params.uri_replacement(url, param_name, find_this, true);
1133        }
1134        {
1135            let to_remove = ["domainName"];
1136            params.remove_params(&to_remove);
1137        }
1138
1139        let url = params.parse_with_url(&url);
1140
1141        loop {
1142            let mut req_result = {
1143                let client = &self.hub.client;
1144                dlg.pre_request();
1145                let mut req_builder = hyper::Request::builder()
1146                    .method(hyper::Method::GET)
1147                    .uri(url.as_str())
1148                    .header(USER_AGENT, self.hub._user_agent.clone());
1149
1150                let request = req_builder
1151                    .header(CONTENT_LENGTH, 0_u64)
1152                    .body(common::to_body::<String>(None));
1153
1154                client.request(request.unwrap()).await
1155            };
1156
1157            match req_result {
1158                Err(err) => {
1159                    if let common::Retry::After(d) = dlg.http_error(&err) {
1160                        sleep(d).await;
1161                        continue;
1162                    }
1163                    dlg.finished(false);
1164                    return Err(common::Error::HttpError(err));
1165                }
1166                Ok(res) => {
1167                    let (mut parts, body) = res.into_parts();
1168                    let mut body = common::Body::new(body);
1169                    if !parts.status.is_success() {
1170                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1171                        let error = serde_json::from_str(&common::to_string(&bytes));
1172                        let response = common::to_response(parts, bytes.into());
1173
1174                        if let common::Retry::After(d) =
1175                            dlg.http_failure(&response, error.as_ref().ok())
1176                        {
1177                            sleep(d).await;
1178                            continue;
1179                        }
1180
1181                        dlg.finished(false);
1182
1183                        return Err(match error {
1184                            Ok(value) => common::Error::BadRequest(value),
1185                            _ => common::Error::Failure(response),
1186                        });
1187                    }
1188                    let response = {
1189                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1190                        let encoded = common::to_string(&bytes);
1191                        match serde_json::from_str(&encoded) {
1192                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1193                            Err(error) => {
1194                                dlg.response_json_decode_error(&encoded, &error);
1195                                return Err(common::Error::JsonDecodeError(
1196                                    encoded.to_string(),
1197                                    error,
1198                                ));
1199                            }
1200                        }
1201                    };
1202
1203                    dlg.finished(true);
1204                    return Ok(response);
1205                }
1206            }
1207        }
1208    }
1209
1210    /// Full domain name to look up. Example: "example.com"
1211    ///
1212    /// Sets the *domain name* path property to the given value.
1213    ///
1214    /// Even though the property as already been set when instantiating this call,
1215    /// we provide this method for API completeness.
1216    pub fn domain_name(mut self, new_value: &str) -> DomainGetCall<'a, C> {
1217        self._domain_name = new_value.to_string();
1218        self
1219    }
1220    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1221    /// while executing the actual API request.
1222    ///
1223    /// ````text
1224    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
1225    /// ````
1226    ///
1227    /// Sets the *delegate* property to the given value.
1228    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> DomainGetCall<'a, C> {
1229        self._delegate = Some(new_value);
1230        self
1231    }
1232
1233    /// Set any additional parameter of the query string used in the request.
1234    /// It should be used to set parameters which are not yet available through their own
1235    /// setters.
1236    ///
1237    /// Please note that this method must not be used to set any of the known parameters
1238    /// which have their own setter method. If done anyway, the request will fail.
1239    ///
1240    /// # Additional Parameters
1241    ///
1242    /// * *$.xgafv* (query-string) - V1 error format.
1243    /// * *access_token* (query-string) - OAuth access token.
1244    /// * *alt* (query-string) - Data format for response.
1245    /// * *callback* (query-string) - JSONP
1246    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1247    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1248    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1249    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1250    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1251    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1252    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1253    pub fn param<T>(mut self, name: T, value: T) -> DomainGetCall<'a, C>
1254    where
1255        T: AsRef<str>,
1256    {
1257        self._additional_params
1258            .insert(name.as_ref().to_string(), value.as_ref().to_string());
1259        self
1260    }
1261}
1262
1263/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
1264///
1265/// A builder for the *get* method supported by a *entity* resource.
1266/// It is not used directly, but through a [`EntityMethods`] instance.
1267///
1268/// # Example
1269///
1270/// Instantiate a resource method builder
1271///
1272/// ```test_harness,no_run
1273/// # extern crate hyper;
1274/// # extern crate hyper_rustls;
1275/// # extern crate google_domainsrdap1 as domainsrdap1;
1276/// # async fn dox() {
1277/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1278///
1279/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1280/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1281/// #     .with_native_roots()
1282/// #     .unwrap()
1283/// #     .https_only()
1284/// #     .enable_http2()
1285/// #     .build();
1286///
1287/// # let executor = hyper_util::rt::TokioExecutor::new();
1288/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1289/// #     secret,
1290/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1291/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
1292/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
1293/// #     ),
1294/// # ).build().await.unwrap();
1295///
1296/// # let client = hyper_util::client::legacy::Client::builder(
1297/// #     hyper_util::rt::TokioExecutor::new()
1298/// # )
1299/// # .build(
1300/// #     hyper_rustls::HttpsConnectorBuilder::new()
1301/// #         .with_native_roots()
1302/// #         .unwrap()
1303/// #         .https_or_http()
1304/// #         .enable_http2()
1305/// #         .build()
1306/// # );
1307/// # let mut hub = DomainsRDAP::new(client, auth);
1308/// // You can configure optional parameters by calling the respective setters at will, and
1309/// // execute the final call using `doit()`.
1310/// // Values shown here are possibly random and not representative !
1311/// let result = hub.entity().get("entityId")
1312///              .doit().await;
1313/// # }
1314/// ```
1315pub struct EntityGetCall<'a, C>
1316where
1317    C: 'a,
1318{
1319    hub: &'a DomainsRDAP<C>,
1320    _entity_id: String,
1321    _delegate: Option<&'a mut dyn common::Delegate>,
1322    _additional_params: HashMap<String, String>,
1323}
1324
1325impl<'a, C> common::CallBuilder for EntityGetCall<'a, C> {}
1326
1327impl<'a, C> EntityGetCall<'a, C>
1328where
1329    C: common::Connector,
1330{
1331    /// Perform the operation you have build so far.
1332    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
1333        use std::borrow::Cow;
1334        use std::io::{Read, Seek};
1335
1336        use common::{url::Params, ToParts};
1337        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1338
1339        let mut dd = common::DefaultDelegate;
1340        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1341        dlg.begin(common::MethodInfo {
1342            id: "domainsrdap.entity.get",
1343            http_method: hyper::Method::GET,
1344        });
1345
1346        for &field in ["alt", "entityId"].iter() {
1347            if self._additional_params.contains_key(field) {
1348                dlg.finished(false);
1349                return Err(common::Error::FieldClash(field));
1350            }
1351        }
1352
1353        let mut params = Params::with_capacity(3 + self._additional_params.len());
1354        params.push("entityId", self._entity_id);
1355
1356        params.extend(self._additional_params.iter());
1357
1358        params.push("alt", "json");
1359        let mut url = self.hub._base_url.clone() + "v1/entity/{entityId}";
1360
1361        match dlg.api_key() {
1362            Some(value) => params.push("key", value),
1363            None => {
1364                dlg.finished(false);
1365                return Err(common::Error::MissingAPIKey);
1366            }
1367        }
1368
1369        #[allow(clippy::single_element_loop)]
1370        for &(find_this, param_name) in [("{entityId}", "entityId")].iter() {
1371            url = params.uri_replacement(url, param_name, find_this, false);
1372        }
1373        {
1374            let to_remove = ["entityId"];
1375            params.remove_params(&to_remove);
1376        }
1377
1378        let url = params.parse_with_url(&url);
1379
1380        loop {
1381            let mut req_result = {
1382                let client = &self.hub.client;
1383                dlg.pre_request();
1384                let mut req_builder = hyper::Request::builder()
1385                    .method(hyper::Method::GET)
1386                    .uri(url.as_str())
1387                    .header(USER_AGENT, self.hub._user_agent.clone());
1388
1389                let request = req_builder
1390                    .header(CONTENT_LENGTH, 0_u64)
1391                    .body(common::to_body::<String>(None));
1392
1393                client.request(request.unwrap()).await
1394            };
1395
1396            match req_result {
1397                Err(err) => {
1398                    if let common::Retry::After(d) = dlg.http_error(&err) {
1399                        sleep(d).await;
1400                        continue;
1401                    }
1402                    dlg.finished(false);
1403                    return Err(common::Error::HttpError(err));
1404                }
1405                Ok(res) => {
1406                    let (mut parts, body) = res.into_parts();
1407                    let mut body = common::Body::new(body);
1408                    if !parts.status.is_success() {
1409                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1410                        let error = serde_json::from_str(&common::to_string(&bytes));
1411                        let response = common::to_response(parts, bytes.into());
1412
1413                        if let common::Retry::After(d) =
1414                            dlg.http_failure(&response, error.as_ref().ok())
1415                        {
1416                            sleep(d).await;
1417                            continue;
1418                        }
1419
1420                        dlg.finished(false);
1421
1422                        return Err(match error {
1423                            Ok(value) => common::Error::BadRequest(value),
1424                            _ => common::Error::Failure(response),
1425                        });
1426                    }
1427                    let response = {
1428                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1429                        let encoded = common::to_string(&bytes);
1430                        match serde_json::from_str(&encoded) {
1431                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1432                            Err(error) => {
1433                                dlg.response_json_decode_error(&encoded, &error);
1434                                return Err(common::Error::JsonDecodeError(
1435                                    encoded.to_string(),
1436                                    error,
1437                                ));
1438                            }
1439                        }
1440                    };
1441
1442                    dlg.finished(true);
1443                    return Ok(response);
1444                }
1445            }
1446        }
1447    }
1448
1449    ///
1450    /// Sets the *entity id* path property to the given value.
1451    ///
1452    /// Even though the property as already been set when instantiating this call,
1453    /// we provide this method for API completeness.
1454    pub fn entity_id(mut self, new_value: &str) -> EntityGetCall<'a, C> {
1455        self._entity_id = new_value.to_string();
1456        self
1457    }
1458    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1459    /// while executing the actual API request.
1460    ///
1461    /// ````text
1462    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
1463    /// ````
1464    ///
1465    /// Sets the *delegate* property to the given value.
1466    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> EntityGetCall<'a, C> {
1467        self._delegate = Some(new_value);
1468        self
1469    }
1470
1471    /// Set any additional parameter of the query string used in the request.
1472    /// It should be used to set parameters which are not yet available through their own
1473    /// setters.
1474    ///
1475    /// Please note that this method must not be used to set any of the known parameters
1476    /// which have their own setter method. If done anyway, the request will fail.
1477    ///
1478    /// # Additional Parameters
1479    ///
1480    /// * *$.xgafv* (query-string) - V1 error format.
1481    /// * *access_token* (query-string) - OAuth access token.
1482    /// * *alt* (query-string) - Data format for response.
1483    /// * *callback* (query-string) - JSONP
1484    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1485    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1486    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1487    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1488    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1489    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1490    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1491    pub fn param<T>(mut self, name: T, value: T) -> EntityGetCall<'a, C>
1492    where
1493        T: AsRef<str>,
1494    {
1495        self._additional_params
1496            .insert(name.as_ref().to_string(), value.as_ref().to_string());
1497        self
1498    }
1499}
1500
1501/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
1502///
1503/// A builder for the *get* method supported by a *ip* resource.
1504/// It is not used directly, but through a [`IpMethods`] instance.
1505///
1506/// # Example
1507///
1508/// Instantiate a resource method builder
1509///
1510/// ```test_harness,no_run
1511/// # extern crate hyper;
1512/// # extern crate hyper_rustls;
1513/// # extern crate google_domainsrdap1 as domainsrdap1;
1514/// # async fn dox() {
1515/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1516///
1517/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1518/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1519/// #     .with_native_roots()
1520/// #     .unwrap()
1521/// #     .https_only()
1522/// #     .enable_http2()
1523/// #     .build();
1524///
1525/// # let executor = hyper_util::rt::TokioExecutor::new();
1526/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1527/// #     secret,
1528/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1529/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
1530/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
1531/// #     ),
1532/// # ).build().await.unwrap();
1533///
1534/// # let client = hyper_util::client::legacy::Client::builder(
1535/// #     hyper_util::rt::TokioExecutor::new()
1536/// # )
1537/// # .build(
1538/// #     hyper_rustls::HttpsConnectorBuilder::new()
1539/// #         .with_native_roots()
1540/// #         .unwrap()
1541/// #         .https_or_http()
1542/// #         .enable_http2()
1543/// #         .build()
1544/// # );
1545/// # let mut hub = DomainsRDAP::new(client, auth);
1546/// // You can configure optional parameters by calling the respective setters at will, and
1547/// // execute the final call using `doit()`.
1548/// // Values shown here are possibly random and not representative !
1549/// let result = hub.ip().get("ipId", "ipId1")
1550///              .doit().await;
1551/// # }
1552/// ```
1553pub struct IpGetCall<'a, C>
1554where
1555    C: 'a,
1556{
1557    hub: &'a DomainsRDAP<C>,
1558    _ip_id: String,
1559    _ip_id1: String,
1560    _delegate: Option<&'a mut dyn common::Delegate>,
1561    _additional_params: HashMap<String, String>,
1562}
1563
1564impl<'a, C> common::CallBuilder for IpGetCall<'a, C> {}
1565
1566impl<'a, C> IpGetCall<'a, C>
1567where
1568    C: common::Connector,
1569{
1570    /// Perform the operation you have build so far.
1571    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
1572        use std::borrow::Cow;
1573        use std::io::{Read, Seek};
1574
1575        use common::{url::Params, ToParts};
1576        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1577
1578        let mut dd = common::DefaultDelegate;
1579        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1580        dlg.begin(common::MethodInfo {
1581            id: "domainsrdap.ip.get",
1582            http_method: hyper::Method::GET,
1583        });
1584
1585        for &field in ["alt", "ipId", "ipId1"].iter() {
1586            if self._additional_params.contains_key(field) {
1587                dlg.finished(false);
1588                return Err(common::Error::FieldClash(field));
1589            }
1590        }
1591
1592        let mut params = Params::with_capacity(4 + self._additional_params.len());
1593        params.push("ipId", self._ip_id);
1594        params.push("ipId1", self._ip_id1);
1595
1596        params.extend(self._additional_params.iter());
1597
1598        params.push("alt", "json");
1599        let mut url = self.hub._base_url.clone() + "v1/ip/{ipId}/{ipId1}";
1600
1601        match dlg.api_key() {
1602            Some(value) => params.push("key", value),
1603            None => {
1604                dlg.finished(false);
1605                return Err(common::Error::MissingAPIKey);
1606            }
1607        }
1608
1609        #[allow(clippy::single_element_loop)]
1610        for &(find_this, param_name) in [("{ipId}", "ipId"), ("{ipId1}", "ipId1")].iter() {
1611            url = params.uri_replacement(url, param_name, find_this, false);
1612        }
1613        {
1614            let to_remove = ["ipId1", "ipId"];
1615            params.remove_params(&to_remove);
1616        }
1617
1618        let url = params.parse_with_url(&url);
1619
1620        loop {
1621            let mut req_result = {
1622                let client = &self.hub.client;
1623                dlg.pre_request();
1624                let mut req_builder = hyper::Request::builder()
1625                    .method(hyper::Method::GET)
1626                    .uri(url.as_str())
1627                    .header(USER_AGENT, self.hub._user_agent.clone());
1628
1629                let request = req_builder
1630                    .header(CONTENT_LENGTH, 0_u64)
1631                    .body(common::to_body::<String>(None));
1632
1633                client.request(request.unwrap()).await
1634            };
1635
1636            match req_result {
1637                Err(err) => {
1638                    if let common::Retry::After(d) = dlg.http_error(&err) {
1639                        sleep(d).await;
1640                        continue;
1641                    }
1642                    dlg.finished(false);
1643                    return Err(common::Error::HttpError(err));
1644                }
1645                Ok(res) => {
1646                    let (mut parts, body) = res.into_parts();
1647                    let mut body = common::Body::new(body);
1648                    if !parts.status.is_success() {
1649                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1650                        let error = serde_json::from_str(&common::to_string(&bytes));
1651                        let response = common::to_response(parts, bytes.into());
1652
1653                        if let common::Retry::After(d) =
1654                            dlg.http_failure(&response, error.as_ref().ok())
1655                        {
1656                            sleep(d).await;
1657                            continue;
1658                        }
1659
1660                        dlg.finished(false);
1661
1662                        return Err(match error {
1663                            Ok(value) => common::Error::BadRequest(value),
1664                            _ => common::Error::Failure(response),
1665                        });
1666                    }
1667                    let response = {
1668                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1669                        let encoded = common::to_string(&bytes);
1670                        match serde_json::from_str(&encoded) {
1671                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1672                            Err(error) => {
1673                                dlg.response_json_decode_error(&encoded, &error);
1674                                return Err(common::Error::JsonDecodeError(
1675                                    encoded.to_string(),
1676                                    error,
1677                                ));
1678                            }
1679                        }
1680                    };
1681
1682                    dlg.finished(true);
1683                    return Ok(response);
1684                }
1685            }
1686        }
1687    }
1688
1689    ///
1690    /// Sets the *ip id* path property to the given value.
1691    ///
1692    /// Even though the property as already been set when instantiating this call,
1693    /// we provide this method for API completeness.
1694    pub fn ip_id(mut self, new_value: &str) -> IpGetCall<'a, C> {
1695        self._ip_id = new_value.to_string();
1696        self
1697    }
1698    ///
1699    /// Sets the *ip id1* path property to the given value.
1700    ///
1701    /// Even though the property as already been set when instantiating this call,
1702    /// we provide this method for API completeness.
1703    pub fn ip_id1(mut self, new_value: &str) -> IpGetCall<'a, C> {
1704        self._ip_id1 = new_value.to_string();
1705        self
1706    }
1707    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1708    /// while executing the actual API request.
1709    ///
1710    /// ````text
1711    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
1712    /// ````
1713    ///
1714    /// Sets the *delegate* property to the given value.
1715    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> IpGetCall<'a, C> {
1716        self._delegate = Some(new_value);
1717        self
1718    }
1719
1720    /// Set any additional parameter of the query string used in the request.
1721    /// It should be used to set parameters which are not yet available through their own
1722    /// setters.
1723    ///
1724    /// Please note that this method must not be used to set any of the known parameters
1725    /// which have their own setter method. If done anyway, the request will fail.
1726    ///
1727    /// # Additional Parameters
1728    ///
1729    /// * *$.xgafv* (query-string) - V1 error format.
1730    /// * *access_token* (query-string) - OAuth access token.
1731    /// * *alt* (query-string) - Data format for response.
1732    /// * *callback* (query-string) - JSONP
1733    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1734    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1735    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1736    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1737    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1738    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1739    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1740    pub fn param<T>(mut self, name: T, value: T) -> IpGetCall<'a, C>
1741    where
1742        T: AsRef<str>,
1743    {
1744        self._additional_params
1745            .insert(name.as_ref().to_string(), value.as_ref().to_string());
1746        self
1747    }
1748}
1749
1750/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
1751///
1752/// A builder for the *get* method supported by a *nameserver* resource.
1753/// It is not used directly, but through a [`NameserverMethods`] instance.
1754///
1755/// # Example
1756///
1757/// Instantiate a resource method builder
1758///
1759/// ```test_harness,no_run
1760/// # extern crate hyper;
1761/// # extern crate hyper_rustls;
1762/// # extern crate google_domainsrdap1 as domainsrdap1;
1763/// # async fn dox() {
1764/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1765///
1766/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1767/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1768/// #     .with_native_roots()
1769/// #     .unwrap()
1770/// #     .https_only()
1771/// #     .enable_http2()
1772/// #     .build();
1773///
1774/// # let executor = hyper_util::rt::TokioExecutor::new();
1775/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1776/// #     secret,
1777/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1778/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
1779/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
1780/// #     ),
1781/// # ).build().await.unwrap();
1782///
1783/// # let client = hyper_util::client::legacy::Client::builder(
1784/// #     hyper_util::rt::TokioExecutor::new()
1785/// # )
1786/// # .build(
1787/// #     hyper_rustls::HttpsConnectorBuilder::new()
1788/// #         .with_native_roots()
1789/// #         .unwrap()
1790/// #         .https_or_http()
1791/// #         .enable_http2()
1792/// #         .build()
1793/// # );
1794/// # let mut hub = DomainsRDAP::new(client, auth);
1795/// // You can configure optional parameters by calling the respective setters at will, and
1796/// // execute the final call using `doit()`.
1797/// // Values shown here are possibly random and not representative !
1798/// let result = hub.nameserver().get("nameserverId")
1799///              .doit().await;
1800/// # }
1801/// ```
1802pub struct NameserverGetCall<'a, C>
1803where
1804    C: 'a,
1805{
1806    hub: &'a DomainsRDAP<C>,
1807    _nameserver_id: String,
1808    _delegate: Option<&'a mut dyn common::Delegate>,
1809    _additional_params: HashMap<String, String>,
1810}
1811
1812impl<'a, C> common::CallBuilder for NameserverGetCall<'a, C> {}
1813
1814impl<'a, C> NameserverGetCall<'a, C>
1815where
1816    C: common::Connector,
1817{
1818    /// Perform the operation you have build so far.
1819    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
1820        use std::borrow::Cow;
1821        use std::io::{Read, Seek};
1822
1823        use common::{url::Params, ToParts};
1824        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1825
1826        let mut dd = common::DefaultDelegate;
1827        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1828        dlg.begin(common::MethodInfo {
1829            id: "domainsrdap.nameserver.get",
1830            http_method: hyper::Method::GET,
1831        });
1832
1833        for &field in ["alt", "nameserverId"].iter() {
1834            if self._additional_params.contains_key(field) {
1835                dlg.finished(false);
1836                return Err(common::Error::FieldClash(field));
1837            }
1838        }
1839
1840        let mut params = Params::with_capacity(3 + self._additional_params.len());
1841        params.push("nameserverId", self._nameserver_id);
1842
1843        params.extend(self._additional_params.iter());
1844
1845        params.push("alt", "json");
1846        let mut url = self.hub._base_url.clone() + "v1/nameserver/{nameserverId}";
1847
1848        match dlg.api_key() {
1849            Some(value) => params.push("key", value),
1850            None => {
1851                dlg.finished(false);
1852                return Err(common::Error::MissingAPIKey);
1853            }
1854        }
1855
1856        #[allow(clippy::single_element_loop)]
1857        for &(find_this, param_name) in [("{nameserverId}", "nameserverId")].iter() {
1858            url = params.uri_replacement(url, param_name, find_this, false);
1859        }
1860        {
1861            let to_remove = ["nameserverId"];
1862            params.remove_params(&to_remove);
1863        }
1864
1865        let url = params.parse_with_url(&url);
1866
1867        loop {
1868            let mut req_result = {
1869                let client = &self.hub.client;
1870                dlg.pre_request();
1871                let mut req_builder = hyper::Request::builder()
1872                    .method(hyper::Method::GET)
1873                    .uri(url.as_str())
1874                    .header(USER_AGENT, self.hub._user_agent.clone());
1875
1876                let request = req_builder
1877                    .header(CONTENT_LENGTH, 0_u64)
1878                    .body(common::to_body::<String>(None));
1879
1880                client.request(request.unwrap()).await
1881            };
1882
1883            match req_result {
1884                Err(err) => {
1885                    if let common::Retry::After(d) = dlg.http_error(&err) {
1886                        sleep(d).await;
1887                        continue;
1888                    }
1889                    dlg.finished(false);
1890                    return Err(common::Error::HttpError(err));
1891                }
1892                Ok(res) => {
1893                    let (mut parts, body) = res.into_parts();
1894                    let mut body = common::Body::new(body);
1895                    if !parts.status.is_success() {
1896                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1897                        let error = serde_json::from_str(&common::to_string(&bytes));
1898                        let response = common::to_response(parts, bytes.into());
1899
1900                        if let common::Retry::After(d) =
1901                            dlg.http_failure(&response, error.as_ref().ok())
1902                        {
1903                            sleep(d).await;
1904                            continue;
1905                        }
1906
1907                        dlg.finished(false);
1908
1909                        return Err(match error {
1910                            Ok(value) => common::Error::BadRequest(value),
1911                            _ => common::Error::Failure(response),
1912                        });
1913                    }
1914                    let response = {
1915                        let bytes = common::to_bytes(body).await.unwrap_or_default();
1916                        let encoded = common::to_string(&bytes);
1917                        match serde_json::from_str(&encoded) {
1918                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1919                            Err(error) => {
1920                                dlg.response_json_decode_error(&encoded, &error);
1921                                return Err(common::Error::JsonDecodeError(
1922                                    encoded.to_string(),
1923                                    error,
1924                                ));
1925                            }
1926                        }
1927                    };
1928
1929                    dlg.finished(true);
1930                    return Ok(response);
1931                }
1932            }
1933        }
1934    }
1935
1936    ///
1937    /// Sets the *nameserver id* path property to the given value.
1938    ///
1939    /// Even though the property as already been set when instantiating this call,
1940    /// we provide this method for API completeness.
1941    pub fn nameserver_id(mut self, new_value: &str) -> NameserverGetCall<'a, C> {
1942        self._nameserver_id = new_value.to_string();
1943        self
1944    }
1945    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1946    /// while executing the actual API request.
1947    ///
1948    /// ````text
1949    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
1950    /// ````
1951    ///
1952    /// Sets the *delegate* property to the given value.
1953    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> NameserverGetCall<'a, C> {
1954        self._delegate = Some(new_value);
1955        self
1956    }
1957
1958    /// Set any additional parameter of the query string used in the request.
1959    /// It should be used to set parameters which are not yet available through their own
1960    /// setters.
1961    ///
1962    /// Please note that this method must not be used to set any of the known parameters
1963    /// which have their own setter method. If done anyway, the request will fail.
1964    ///
1965    /// # Additional Parameters
1966    ///
1967    /// * *$.xgafv* (query-string) - V1 error format.
1968    /// * *access_token* (query-string) - OAuth access token.
1969    /// * *alt* (query-string) - Data format for response.
1970    /// * *callback* (query-string) - JSONP
1971    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1972    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1973    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1974    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1975    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1976    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1977    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1978    pub fn param<T>(mut self, name: T, value: T) -> NameserverGetCall<'a, C>
1979    where
1980        T: AsRef<str>,
1981    {
1982        self._additional_params
1983            .insert(name.as_ref().to_string(), value.as_ref().to_string());
1984        self
1985    }
1986}
1987
1988/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
1989///
1990/// A builder for the *getDomains* method.
1991/// It is not used directly, but through a [`MethodMethods`] instance.
1992///
1993/// # Example
1994///
1995/// Instantiate a resource method builder
1996///
1997/// ```test_harness,no_run
1998/// # extern crate hyper;
1999/// # extern crate hyper_rustls;
2000/// # extern crate google_domainsrdap1 as domainsrdap1;
2001/// # async fn dox() {
2002/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2003///
2004/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2005/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2006/// #     .with_native_roots()
2007/// #     .unwrap()
2008/// #     .https_only()
2009/// #     .enable_http2()
2010/// #     .build();
2011///
2012/// # let executor = hyper_util::rt::TokioExecutor::new();
2013/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2014/// #     secret,
2015/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2016/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
2017/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
2018/// #     ),
2019/// # ).build().await.unwrap();
2020///
2021/// # let client = hyper_util::client::legacy::Client::builder(
2022/// #     hyper_util::rt::TokioExecutor::new()
2023/// # )
2024/// # .build(
2025/// #     hyper_rustls::HttpsConnectorBuilder::new()
2026/// #         .with_native_roots()
2027/// #         .unwrap()
2028/// #         .https_or_http()
2029/// #         .enable_http2()
2030/// #         .build()
2031/// # );
2032/// # let mut hub = DomainsRDAP::new(client, auth);
2033/// // You can configure optional parameters by calling the respective setters at will, and
2034/// // execute the final call using `doit()`.
2035/// // Values shown here are possibly random and not representative !
2036/// let result = hub.methods().get_domains()
2037///              .doit().await;
2038/// # }
2039/// ```
2040pub struct MethodGetDomainCall<'a, C>
2041where
2042    C: 'a,
2043{
2044    hub: &'a DomainsRDAP<C>,
2045    _delegate: Option<&'a mut dyn common::Delegate>,
2046    _additional_params: HashMap<String, String>,
2047}
2048
2049impl<'a, C> common::CallBuilder for MethodGetDomainCall<'a, C> {}
2050
2051impl<'a, C> MethodGetDomainCall<'a, C>
2052where
2053    C: common::Connector,
2054{
2055    /// Perform the operation you have build so far.
2056    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
2057        use std::borrow::Cow;
2058        use std::io::{Read, Seek};
2059
2060        use common::{url::Params, ToParts};
2061        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2062
2063        let mut dd = common::DefaultDelegate;
2064        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2065        dlg.begin(common::MethodInfo {
2066            id: "domainsrdap.getDomains",
2067            http_method: hyper::Method::GET,
2068        });
2069
2070        for &field in ["alt"].iter() {
2071            if self._additional_params.contains_key(field) {
2072                dlg.finished(false);
2073                return Err(common::Error::FieldClash(field));
2074            }
2075        }
2076
2077        let mut params = Params::with_capacity(2 + self._additional_params.len());
2078
2079        params.extend(self._additional_params.iter());
2080
2081        params.push("alt", "json");
2082        let mut url = self.hub._base_url.clone() + "v1/domains";
2083
2084        match dlg.api_key() {
2085            Some(value) => params.push("key", value),
2086            None => {
2087                dlg.finished(false);
2088                return Err(common::Error::MissingAPIKey);
2089            }
2090        }
2091
2092        let url = params.parse_with_url(&url);
2093
2094        loop {
2095            let mut req_result = {
2096                let client = &self.hub.client;
2097                dlg.pre_request();
2098                let mut req_builder = hyper::Request::builder()
2099                    .method(hyper::Method::GET)
2100                    .uri(url.as_str())
2101                    .header(USER_AGENT, self.hub._user_agent.clone());
2102
2103                let request = req_builder
2104                    .header(CONTENT_LENGTH, 0_u64)
2105                    .body(common::to_body::<String>(None));
2106
2107                client.request(request.unwrap()).await
2108            };
2109
2110            match req_result {
2111                Err(err) => {
2112                    if let common::Retry::After(d) = dlg.http_error(&err) {
2113                        sleep(d).await;
2114                        continue;
2115                    }
2116                    dlg.finished(false);
2117                    return Err(common::Error::HttpError(err));
2118                }
2119                Ok(res) => {
2120                    let (mut parts, body) = res.into_parts();
2121                    let mut body = common::Body::new(body);
2122                    if !parts.status.is_success() {
2123                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2124                        let error = serde_json::from_str(&common::to_string(&bytes));
2125                        let response = common::to_response(parts, bytes.into());
2126
2127                        if let common::Retry::After(d) =
2128                            dlg.http_failure(&response, error.as_ref().ok())
2129                        {
2130                            sleep(d).await;
2131                            continue;
2132                        }
2133
2134                        dlg.finished(false);
2135
2136                        return Err(match error {
2137                            Ok(value) => common::Error::BadRequest(value),
2138                            _ => common::Error::Failure(response),
2139                        });
2140                    }
2141                    let response = {
2142                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2143                        let encoded = common::to_string(&bytes);
2144                        match serde_json::from_str(&encoded) {
2145                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2146                            Err(error) => {
2147                                dlg.response_json_decode_error(&encoded, &error);
2148                                return Err(common::Error::JsonDecodeError(
2149                                    encoded.to_string(),
2150                                    error,
2151                                ));
2152                            }
2153                        }
2154                    };
2155
2156                    dlg.finished(true);
2157                    return Ok(response);
2158                }
2159            }
2160        }
2161    }
2162
2163    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2164    /// while executing the actual API request.
2165    ///
2166    /// ````text
2167    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2168    /// ````
2169    ///
2170    /// Sets the *delegate* property to the given value.
2171    pub fn delegate(
2172        mut self,
2173        new_value: &'a mut dyn common::Delegate,
2174    ) -> MethodGetDomainCall<'a, C> {
2175        self._delegate = Some(new_value);
2176        self
2177    }
2178
2179    /// Set any additional parameter of the query string used in the request.
2180    /// It should be used to set parameters which are not yet available through their own
2181    /// setters.
2182    ///
2183    /// Please note that this method must not be used to set any of the known parameters
2184    /// which have their own setter method. If done anyway, the request will fail.
2185    ///
2186    /// # Additional Parameters
2187    ///
2188    /// * *$.xgafv* (query-string) - V1 error format.
2189    /// * *access_token* (query-string) - OAuth access token.
2190    /// * *alt* (query-string) - Data format for response.
2191    /// * *callback* (query-string) - JSONP
2192    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2193    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2194    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2195    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2196    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2197    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2198    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2199    pub fn param<T>(mut self, name: T, value: T) -> MethodGetDomainCall<'a, C>
2200    where
2201        T: AsRef<str>,
2202    {
2203        self._additional_params
2204            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2205        self
2206    }
2207}
2208
2209/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
2210///
2211/// A builder for the *getEntities* method.
2212/// It is not used directly, but through a [`MethodMethods`] instance.
2213///
2214/// # Example
2215///
2216/// Instantiate a resource method builder
2217///
2218/// ```test_harness,no_run
2219/// # extern crate hyper;
2220/// # extern crate hyper_rustls;
2221/// # extern crate google_domainsrdap1 as domainsrdap1;
2222/// # async fn dox() {
2223/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2224///
2225/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2226/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2227/// #     .with_native_roots()
2228/// #     .unwrap()
2229/// #     .https_only()
2230/// #     .enable_http2()
2231/// #     .build();
2232///
2233/// # let executor = hyper_util::rt::TokioExecutor::new();
2234/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2235/// #     secret,
2236/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2237/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
2238/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
2239/// #     ),
2240/// # ).build().await.unwrap();
2241///
2242/// # let client = hyper_util::client::legacy::Client::builder(
2243/// #     hyper_util::rt::TokioExecutor::new()
2244/// # )
2245/// # .build(
2246/// #     hyper_rustls::HttpsConnectorBuilder::new()
2247/// #         .with_native_roots()
2248/// #         .unwrap()
2249/// #         .https_or_http()
2250/// #         .enable_http2()
2251/// #         .build()
2252/// # );
2253/// # let mut hub = DomainsRDAP::new(client, auth);
2254/// // You can configure optional parameters by calling the respective setters at will, and
2255/// // execute the final call using `doit()`.
2256/// // Values shown here are possibly random and not representative !
2257/// let result = hub.methods().get_entities()
2258///              .doit().await;
2259/// # }
2260/// ```
2261pub struct MethodGetEntityCall<'a, C>
2262where
2263    C: 'a,
2264{
2265    hub: &'a DomainsRDAP<C>,
2266    _delegate: Option<&'a mut dyn common::Delegate>,
2267    _additional_params: HashMap<String, String>,
2268}
2269
2270impl<'a, C> common::CallBuilder for MethodGetEntityCall<'a, C> {}
2271
2272impl<'a, C> MethodGetEntityCall<'a, C>
2273where
2274    C: common::Connector,
2275{
2276    /// Perform the operation you have build so far.
2277    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
2278        use std::borrow::Cow;
2279        use std::io::{Read, Seek};
2280
2281        use common::{url::Params, ToParts};
2282        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2283
2284        let mut dd = common::DefaultDelegate;
2285        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2286        dlg.begin(common::MethodInfo {
2287            id: "domainsrdap.getEntities",
2288            http_method: hyper::Method::GET,
2289        });
2290
2291        for &field in ["alt"].iter() {
2292            if self._additional_params.contains_key(field) {
2293                dlg.finished(false);
2294                return Err(common::Error::FieldClash(field));
2295            }
2296        }
2297
2298        let mut params = Params::with_capacity(2 + self._additional_params.len());
2299
2300        params.extend(self._additional_params.iter());
2301
2302        params.push("alt", "json");
2303        let mut url = self.hub._base_url.clone() + "v1/entities";
2304
2305        match dlg.api_key() {
2306            Some(value) => params.push("key", value),
2307            None => {
2308                dlg.finished(false);
2309                return Err(common::Error::MissingAPIKey);
2310            }
2311        }
2312
2313        let url = params.parse_with_url(&url);
2314
2315        loop {
2316            let mut req_result = {
2317                let client = &self.hub.client;
2318                dlg.pre_request();
2319                let mut req_builder = hyper::Request::builder()
2320                    .method(hyper::Method::GET)
2321                    .uri(url.as_str())
2322                    .header(USER_AGENT, self.hub._user_agent.clone());
2323
2324                let request = req_builder
2325                    .header(CONTENT_LENGTH, 0_u64)
2326                    .body(common::to_body::<String>(None));
2327
2328                client.request(request.unwrap()).await
2329            };
2330
2331            match req_result {
2332                Err(err) => {
2333                    if let common::Retry::After(d) = dlg.http_error(&err) {
2334                        sleep(d).await;
2335                        continue;
2336                    }
2337                    dlg.finished(false);
2338                    return Err(common::Error::HttpError(err));
2339                }
2340                Ok(res) => {
2341                    let (mut parts, body) = res.into_parts();
2342                    let mut body = common::Body::new(body);
2343                    if !parts.status.is_success() {
2344                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2345                        let error = serde_json::from_str(&common::to_string(&bytes));
2346                        let response = common::to_response(parts, bytes.into());
2347
2348                        if let common::Retry::After(d) =
2349                            dlg.http_failure(&response, error.as_ref().ok())
2350                        {
2351                            sleep(d).await;
2352                            continue;
2353                        }
2354
2355                        dlg.finished(false);
2356
2357                        return Err(match error {
2358                            Ok(value) => common::Error::BadRequest(value),
2359                            _ => common::Error::Failure(response),
2360                        });
2361                    }
2362                    let response = {
2363                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2364                        let encoded = common::to_string(&bytes);
2365                        match serde_json::from_str(&encoded) {
2366                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2367                            Err(error) => {
2368                                dlg.response_json_decode_error(&encoded, &error);
2369                                return Err(common::Error::JsonDecodeError(
2370                                    encoded.to_string(),
2371                                    error,
2372                                ));
2373                            }
2374                        }
2375                    };
2376
2377                    dlg.finished(true);
2378                    return Ok(response);
2379                }
2380            }
2381        }
2382    }
2383
2384    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2385    /// while executing the actual API request.
2386    ///
2387    /// ````text
2388    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2389    /// ````
2390    ///
2391    /// Sets the *delegate* property to the given value.
2392    pub fn delegate(
2393        mut self,
2394        new_value: &'a mut dyn common::Delegate,
2395    ) -> MethodGetEntityCall<'a, C> {
2396        self._delegate = Some(new_value);
2397        self
2398    }
2399
2400    /// Set any additional parameter of the query string used in the request.
2401    /// It should be used to set parameters which are not yet available through their own
2402    /// setters.
2403    ///
2404    /// Please note that this method must not be used to set any of the known parameters
2405    /// which have their own setter method. If done anyway, the request will fail.
2406    ///
2407    /// # Additional Parameters
2408    ///
2409    /// * *$.xgafv* (query-string) - V1 error format.
2410    /// * *access_token* (query-string) - OAuth access token.
2411    /// * *alt* (query-string) - Data format for response.
2412    /// * *callback* (query-string) - JSONP
2413    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2414    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2415    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2416    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2417    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2418    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2419    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2420    pub fn param<T>(mut self, name: T, value: T) -> MethodGetEntityCall<'a, C>
2421    where
2422        T: AsRef<str>,
2423    {
2424        self._additional_params
2425            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2426        self
2427    }
2428}
2429
2430/// Get help information for the RDAP API, including links to documentation.
2431///
2432/// A builder for the *getHelp* method.
2433/// It is not used directly, but through a [`MethodMethods`] instance.
2434///
2435/// # Example
2436///
2437/// Instantiate a resource method builder
2438///
2439/// ```test_harness,no_run
2440/// # extern crate hyper;
2441/// # extern crate hyper_rustls;
2442/// # extern crate google_domainsrdap1 as domainsrdap1;
2443/// # async fn dox() {
2444/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2445///
2446/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2447/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2448/// #     .with_native_roots()
2449/// #     .unwrap()
2450/// #     .https_only()
2451/// #     .enable_http2()
2452/// #     .build();
2453///
2454/// # let executor = hyper_util::rt::TokioExecutor::new();
2455/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2456/// #     secret,
2457/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2458/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
2459/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
2460/// #     ),
2461/// # ).build().await.unwrap();
2462///
2463/// # let client = hyper_util::client::legacy::Client::builder(
2464/// #     hyper_util::rt::TokioExecutor::new()
2465/// # )
2466/// # .build(
2467/// #     hyper_rustls::HttpsConnectorBuilder::new()
2468/// #         .with_native_roots()
2469/// #         .unwrap()
2470/// #         .https_or_http()
2471/// #         .enable_http2()
2472/// #         .build()
2473/// # );
2474/// # let mut hub = DomainsRDAP::new(client, auth);
2475/// // You can configure optional parameters by calling the respective setters at will, and
2476/// // execute the final call using `doit()`.
2477/// // Values shown here are possibly random and not representative !
2478/// let result = hub.methods().get_help()
2479///              .doit().await;
2480/// # }
2481/// ```
2482pub struct MethodGetHelpCall<'a, C>
2483where
2484    C: 'a,
2485{
2486    hub: &'a DomainsRDAP<C>,
2487    _delegate: Option<&'a mut dyn common::Delegate>,
2488    _additional_params: HashMap<String, String>,
2489}
2490
2491impl<'a, C> common::CallBuilder for MethodGetHelpCall<'a, C> {}
2492
2493impl<'a, C> MethodGetHelpCall<'a, C>
2494where
2495    C: common::Connector,
2496{
2497    /// Perform the operation you have build so far.
2498    pub async fn doit(mut self) -> common::Result<(common::Response, HttpBody)> {
2499        use std::borrow::Cow;
2500        use std::io::{Read, Seek};
2501
2502        use common::{url::Params, ToParts};
2503        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2504
2505        let mut dd = common::DefaultDelegate;
2506        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2507        dlg.begin(common::MethodInfo {
2508            id: "domainsrdap.getHelp",
2509            http_method: hyper::Method::GET,
2510        });
2511
2512        for &field in ["alt"].iter() {
2513            if self._additional_params.contains_key(field) {
2514                dlg.finished(false);
2515                return Err(common::Error::FieldClash(field));
2516            }
2517        }
2518
2519        let mut params = Params::with_capacity(2 + self._additional_params.len());
2520
2521        params.extend(self._additional_params.iter());
2522
2523        params.push("alt", "json");
2524        let mut url = self.hub._base_url.clone() + "v1/help";
2525
2526        match dlg.api_key() {
2527            Some(value) => params.push("key", value),
2528            None => {
2529                dlg.finished(false);
2530                return Err(common::Error::MissingAPIKey);
2531            }
2532        }
2533
2534        let url = params.parse_with_url(&url);
2535
2536        loop {
2537            let mut req_result = {
2538                let client = &self.hub.client;
2539                dlg.pre_request();
2540                let mut req_builder = hyper::Request::builder()
2541                    .method(hyper::Method::GET)
2542                    .uri(url.as_str())
2543                    .header(USER_AGENT, self.hub._user_agent.clone());
2544
2545                let request = req_builder
2546                    .header(CONTENT_LENGTH, 0_u64)
2547                    .body(common::to_body::<String>(None));
2548
2549                client.request(request.unwrap()).await
2550            };
2551
2552            match req_result {
2553                Err(err) => {
2554                    if let common::Retry::After(d) = dlg.http_error(&err) {
2555                        sleep(d).await;
2556                        continue;
2557                    }
2558                    dlg.finished(false);
2559                    return Err(common::Error::HttpError(err));
2560                }
2561                Ok(res) => {
2562                    let (mut parts, body) = res.into_parts();
2563                    let mut body = common::Body::new(body);
2564                    if !parts.status.is_success() {
2565                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2566                        let error = serde_json::from_str(&common::to_string(&bytes));
2567                        let response = common::to_response(parts, bytes.into());
2568
2569                        if let common::Retry::After(d) =
2570                            dlg.http_failure(&response, error.as_ref().ok())
2571                        {
2572                            sleep(d).await;
2573                            continue;
2574                        }
2575
2576                        dlg.finished(false);
2577
2578                        return Err(match error {
2579                            Ok(value) => common::Error::BadRequest(value),
2580                            _ => common::Error::Failure(response),
2581                        });
2582                    }
2583                    let response = {
2584                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2585                        let encoded = common::to_string(&bytes);
2586                        match serde_json::from_str(&encoded) {
2587                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2588                            Err(error) => {
2589                                dlg.response_json_decode_error(&encoded, &error);
2590                                return Err(common::Error::JsonDecodeError(
2591                                    encoded.to_string(),
2592                                    error,
2593                                ));
2594                            }
2595                        }
2596                    };
2597
2598                    dlg.finished(true);
2599                    return Ok(response);
2600                }
2601            }
2602        }
2603    }
2604
2605    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2606    /// while executing the actual API request.
2607    ///
2608    /// ````text
2609    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2610    /// ````
2611    ///
2612    /// Sets the *delegate* property to the given value.
2613    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> MethodGetHelpCall<'a, C> {
2614        self._delegate = Some(new_value);
2615        self
2616    }
2617
2618    /// Set any additional parameter of the query string used in the request.
2619    /// It should be used to set parameters which are not yet available through their own
2620    /// setters.
2621    ///
2622    /// Please note that this method must not be used to set any of the known parameters
2623    /// which have their own setter method. If done anyway, the request will fail.
2624    ///
2625    /// # Additional Parameters
2626    ///
2627    /// * *$.xgafv* (query-string) - V1 error format.
2628    /// * *access_token* (query-string) - OAuth access token.
2629    /// * *alt* (query-string) - Data format for response.
2630    /// * *callback* (query-string) - JSONP
2631    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2632    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2633    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2634    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2635    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2636    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2637    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2638    pub fn param<T>(mut self, name: T, value: T) -> MethodGetHelpCall<'a, C>
2639    where
2640        T: AsRef<str>,
2641    {
2642        self._additional_params
2643            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2644        self
2645    }
2646}
2647
2648/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
2649///
2650/// A builder for the *getIp* method.
2651/// It is not used directly, but through a [`MethodMethods`] instance.
2652///
2653/// # Example
2654///
2655/// Instantiate a resource method builder
2656///
2657/// ```test_harness,no_run
2658/// # extern crate hyper;
2659/// # extern crate hyper_rustls;
2660/// # extern crate google_domainsrdap1 as domainsrdap1;
2661/// # async fn dox() {
2662/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2663///
2664/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2665/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2666/// #     .with_native_roots()
2667/// #     .unwrap()
2668/// #     .https_only()
2669/// #     .enable_http2()
2670/// #     .build();
2671///
2672/// # let executor = hyper_util::rt::TokioExecutor::new();
2673/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2674/// #     secret,
2675/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2676/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
2677/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
2678/// #     ),
2679/// # ).build().await.unwrap();
2680///
2681/// # let client = hyper_util::client::legacy::Client::builder(
2682/// #     hyper_util::rt::TokioExecutor::new()
2683/// # )
2684/// # .build(
2685/// #     hyper_rustls::HttpsConnectorBuilder::new()
2686/// #         .with_native_roots()
2687/// #         .unwrap()
2688/// #         .https_or_http()
2689/// #         .enable_http2()
2690/// #         .build()
2691/// # );
2692/// # let mut hub = DomainsRDAP::new(client, auth);
2693/// // You can configure optional parameters by calling the respective setters at will, and
2694/// // execute the final call using `doit()`.
2695/// // Values shown here are possibly random and not representative !
2696/// let result = hub.methods().get_ip()
2697///              .doit().await;
2698/// # }
2699/// ```
2700pub struct MethodGetIpCall<'a, C>
2701where
2702    C: 'a,
2703{
2704    hub: &'a DomainsRDAP<C>,
2705    _delegate: Option<&'a mut dyn common::Delegate>,
2706    _additional_params: HashMap<String, String>,
2707}
2708
2709impl<'a, C> common::CallBuilder for MethodGetIpCall<'a, C> {}
2710
2711impl<'a, C> MethodGetIpCall<'a, C>
2712where
2713    C: common::Connector,
2714{
2715    /// Perform the operation you have build so far.
2716    pub async fn doit(mut self) -> common::Result<(common::Response, HttpBody)> {
2717        use std::borrow::Cow;
2718        use std::io::{Read, Seek};
2719
2720        use common::{url::Params, ToParts};
2721        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2722
2723        let mut dd = common::DefaultDelegate;
2724        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2725        dlg.begin(common::MethodInfo {
2726            id: "domainsrdap.getIp",
2727            http_method: hyper::Method::GET,
2728        });
2729
2730        for &field in ["alt"].iter() {
2731            if self._additional_params.contains_key(field) {
2732                dlg.finished(false);
2733                return Err(common::Error::FieldClash(field));
2734            }
2735        }
2736
2737        let mut params = Params::with_capacity(2 + self._additional_params.len());
2738
2739        params.extend(self._additional_params.iter());
2740
2741        params.push("alt", "json");
2742        let mut url = self.hub._base_url.clone() + "v1/ip";
2743
2744        match dlg.api_key() {
2745            Some(value) => params.push("key", value),
2746            None => {
2747                dlg.finished(false);
2748                return Err(common::Error::MissingAPIKey);
2749            }
2750        }
2751
2752        let url = params.parse_with_url(&url);
2753
2754        loop {
2755            let mut req_result = {
2756                let client = &self.hub.client;
2757                dlg.pre_request();
2758                let mut req_builder = hyper::Request::builder()
2759                    .method(hyper::Method::GET)
2760                    .uri(url.as_str())
2761                    .header(USER_AGENT, self.hub._user_agent.clone());
2762
2763                let request = req_builder
2764                    .header(CONTENT_LENGTH, 0_u64)
2765                    .body(common::to_body::<String>(None));
2766
2767                client.request(request.unwrap()).await
2768            };
2769
2770            match req_result {
2771                Err(err) => {
2772                    if let common::Retry::After(d) = dlg.http_error(&err) {
2773                        sleep(d).await;
2774                        continue;
2775                    }
2776                    dlg.finished(false);
2777                    return Err(common::Error::HttpError(err));
2778                }
2779                Ok(res) => {
2780                    let (mut parts, body) = res.into_parts();
2781                    let mut body = common::Body::new(body);
2782                    if !parts.status.is_success() {
2783                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2784                        let error = serde_json::from_str(&common::to_string(&bytes));
2785                        let response = common::to_response(parts, bytes.into());
2786
2787                        if let common::Retry::After(d) =
2788                            dlg.http_failure(&response, error.as_ref().ok())
2789                        {
2790                            sleep(d).await;
2791                            continue;
2792                        }
2793
2794                        dlg.finished(false);
2795
2796                        return Err(match error {
2797                            Ok(value) => common::Error::BadRequest(value),
2798                            _ => common::Error::Failure(response),
2799                        });
2800                    }
2801                    let response = {
2802                        let bytes = common::to_bytes(body).await.unwrap_or_default();
2803                        let encoded = common::to_string(&bytes);
2804                        match serde_json::from_str(&encoded) {
2805                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2806                            Err(error) => {
2807                                dlg.response_json_decode_error(&encoded, &error);
2808                                return Err(common::Error::JsonDecodeError(
2809                                    encoded.to_string(),
2810                                    error,
2811                                ));
2812                            }
2813                        }
2814                    };
2815
2816                    dlg.finished(true);
2817                    return Ok(response);
2818                }
2819            }
2820        }
2821    }
2822
2823    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2824    /// while executing the actual API request.
2825    ///
2826    /// ````text
2827    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
2828    /// ````
2829    ///
2830    /// Sets the *delegate* property to the given value.
2831    pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> MethodGetIpCall<'a, C> {
2832        self._delegate = Some(new_value);
2833        self
2834    }
2835
2836    /// Set any additional parameter of the query string used in the request.
2837    /// It should be used to set parameters which are not yet available through their own
2838    /// setters.
2839    ///
2840    /// Please note that this method must not be used to set any of the known parameters
2841    /// which have their own setter method. If done anyway, the request will fail.
2842    ///
2843    /// # Additional Parameters
2844    ///
2845    /// * *$.xgafv* (query-string) - V1 error format.
2846    /// * *access_token* (query-string) - OAuth access token.
2847    /// * *alt* (query-string) - Data format for response.
2848    /// * *callback* (query-string) - JSONP
2849    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2850    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
2851    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2852    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2853    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
2854    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
2855    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
2856    pub fn param<T>(mut self, name: T, value: T) -> MethodGetIpCall<'a, C>
2857    where
2858        T: AsRef<str>,
2859    {
2860        self._additional_params
2861            .insert(name.as_ref().to_string(), value.as_ref().to_string());
2862        self
2863    }
2864}
2865
2866/// The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.
2867///
2868/// A builder for the *getNameservers* method.
2869/// It is not used directly, but through a [`MethodMethods`] instance.
2870///
2871/// # Example
2872///
2873/// Instantiate a resource method builder
2874///
2875/// ```test_harness,no_run
2876/// # extern crate hyper;
2877/// # extern crate hyper_rustls;
2878/// # extern crate google_domainsrdap1 as domainsrdap1;
2879/// # async fn dox() {
2880/// # use domainsrdap1::{DomainsRDAP, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2881///
2882/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2883/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
2884/// #     .with_native_roots()
2885/// #     .unwrap()
2886/// #     .https_only()
2887/// #     .enable_http2()
2888/// #     .build();
2889///
2890/// # let executor = hyper_util::rt::TokioExecutor::new();
2891/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
2892/// #     secret,
2893/// #     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2894/// #     yup_oauth2::client::CustomHyperClientBuilder::from(
2895/// #         hyper_util::client::legacy::Client::builder(executor).build(connector),
2896/// #     ),
2897/// # ).build().await.unwrap();
2898///
2899/// # let client = hyper_util::client::legacy::Client::builder(
2900/// #     hyper_util::rt::TokioExecutor::new()
2901/// # )
2902/// # .build(
2903/// #     hyper_rustls::HttpsConnectorBuilder::new()
2904/// #         .with_native_roots()
2905/// #         .unwrap()
2906/// #         .https_or_http()
2907/// #         .enable_http2()
2908/// #         .build()
2909/// # );
2910/// # let mut hub = DomainsRDAP::new(client, auth);
2911/// // You can configure optional parameters by calling the respective setters at will, and
2912/// // execute the final call using `doit()`.
2913/// // Values shown here are possibly random and not representative !
2914/// let result = hub.methods().get_nameservers()
2915///              .doit().await;
2916/// # }
2917/// ```
2918pub struct MethodGetNameserverCall<'a, C>
2919where
2920    C: 'a,
2921{
2922    hub: &'a DomainsRDAP<C>,
2923    _delegate: Option<&'a mut dyn common::Delegate>,
2924    _additional_params: HashMap<String, String>,
2925}
2926
2927impl<'a, C> common::CallBuilder for MethodGetNameserverCall<'a, C> {}
2928
2929impl<'a, C> MethodGetNameserverCall<'a, C>
2930where
2931    C: common::Connector,
2932{
2933    /// Perform the operation you have build so far.
2934    pub async fn doit(mut self) -> common::Result<(common::Response, RdapResponse)> {
2935        use std::borrow::Cow;
2936        use std::io::{Read, Seek};
2937
2938        use common::{url::Params, ToParts};
2939        use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2940
2941        let mut dd = common::DefaultDelegate;
2942        let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2943        dlg.begin(common::MethodInfo {
2944            id: "domainsrdap.getNameservers",
2945            http_method: hyper::Method::GET,
2946        });
2947
2948        for &field in ["alt"].iter() {
2949            if self._additional_params.contains_key(field) {
2950                dlg.finished(false);
2951                return Err(common::Error::FieldClash(field));
2952            }
2953        }
2954
2955        let mut params = Params::with_capacity(2 + self._additional_params.len());
2956
2957        params.extend(self._additional_params.iter());
2958
2959        params.push("alt", "json");
2960        let mut url = self.hub._base_url.clone() + "v1/nameservers";
2961
2962        match dlg.api_key() {
2963            Some(value) => params.push("key", value),
2964            None => {
2965                dlg.finished(false);
2966                return Err(common::Error::MissingAPIKey);
2967            }
2968        }
2969
2970        let url = params.parse_with_url(&url);
2971
2972        loop {
2973            let mut req_result = {
2974                let client = &self.hub.client;
2975                dlg.pre_request();
2976                let mut req_builder = hyper::Request::builder()
2977                    .method(hyper::Method::GET)
2978                    .uri(url.as_str())
2979                    .header(USER_AGENT, self.hub._user_agent.clone());
2980
2981                let request = req_builder
2982                    .header(CONTENT_LENGTH, 0_u64)
2983                    .body(common::to_body::<String>(None));
2984
2985                client.request(request.unwrap()).await
2986            };
2987
2988            match req_result {
2989                Err(err) => {
2990                    if let common::Retry::After(d) = dlg.http_error(&err) {
2991                        sleep(d).await;
2992                        continue;
2993                    }
2994                    dlg.finished(false);
2995                    return Err(common::Error::HttpError(err));
2996                }
2997                Ok(res) => {
2998                    let (mut parts, body) = res.into_parts();
2999                    let mut body = common::Body::new(body);
3000                    if !parts.status.is_success() {
3001                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3002                        let error = serde_json::from_str(&common::to_string(&bytes));
3003                        let response = common::to_response(parts, bytes.into());
3004
3005                        if let common::Retry::After(d) =
3006                            dlg.http_failure(&response, error.as_ref().ok())
3007                        {
3008                            sleep(d).await;
3009                            continue;
3010                        }
3011
3012                        dlg.finished(false);
3013
3014                        return Err(match error {
3015                            Ok(value) => common::Error::BadRequest(value),
3016                            _ => common::Error::Failure(response),
3017                        });
3018                    }
3019                    let response = {
3020                        let bytes = common::to_bytes(body).await.unwrap_or_default();
3021                        let encoded = common::to_string(&bytes);
3022                        match serde_json::from_str(&encoded) {
3023                            Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3024                            Err(error) => {
3025                                dlg.response_json_decode_error(&encoded, &error);
3026                                return Err(common::Error::JsonDecodeError(
3027                                    encoded.to_string(),
3028                                    error,
3029                                ));
3030                            }
3031                        }
3032                    };
3033
3034                    dlg.finished(true);
3035                    return Ok(response);
3036                }
3037            }
3038        }
3039    }
3040
3041    /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3042    /// while executing the actual API request.
3043    ///
3044    /// ````text
3045    ///                   It should be used to handle progress information, and to implement a certain level of resilience.
3046    /// ````
3047    ///
3048    /// Sets the *delegate* property to the given value.
3049    pub fn delegate(
3050        mut self,
3051        new_value: &'a mut dyn common::Delegate,
3052    ) -> MethodGetNameserverCall<'a, C> {
3053        self._delegate = Some(new_value);
3054        self
3055    }
3056
3057    /// Set any additional parameter of the query string used in the request.
3058    /// It should be used to set parameters which are not yet available through their own
3059    /// setters.
3060    ///
3061    /// Please note that this method must not be used to set any of the known parameters
3062    /// which have their own setter method. If done anyway, the request will fail.
3063    ///
3064    /// # Additional Parameters
3065    ///
3066    /// * *$.xgafv* (query-string) - V1 error format.
3067    /// * *access_token* (query-string) - OAuth access token.
3068    /// * *alt* (query-string) - Data format for response.
3069    /// * *callback* (query-string) - JSONP
3070    /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3071    /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
3072    /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3073    /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3074    /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
3075    /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
3076    /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
3077    pub fn param<T>(mut self, name: T, value: T) -> MethodGetNameserverCall<'a, C>
3078    where
3079        T: AsRef<str>,
3080    {
3081        self._additional_params
3082            .insert(name.as_ref().to_string(), value.as_ref().to_string());
3083        self
3084    }
3085}