• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.cloud.domains.v1beta1;
18 
19 import com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.core.BetaApi;
22 import com.google.api.gax.core.BackgroundResource;
23 import com.google.api.gax.httpjson.longrunning.OperationsClient;
24 import com.google.api.gax.longrunning.OperationFuture;
25 import com.google.api.gax.paging.AbstractFixedSizeCollection;
26 import com.google.api.gax.paging.AbstractPage;
27 import com.google.api.gax.paging.AbstractPagedListResponse;
28 import com.google.api.gax.rpc.OperationCallable;
29 import com.google.api.gax.rpc.PageContext;
30 import com.google.api.gax.rpc.UnaryCallable;
31 import com.google.cloud.domains.v1beta1.stub.DomainsStub;
32 import com.google.cloud.domains.v1beta1.stub.DomainsStubSettings;
33 import com.google.common.util.concurrent.MoreExecutors;
34 import com.google.longrunning.Operation;
35 import com.google.protobuf.Empty;
36 import com.google.protobuf.FieldMask;
37 import com.google.type.Money;
38 import java.io.IOException;
39 import java.util.List;
40 import java.util.concurrent.TimeUnit;
41 import javax.annotation.Generated;
42 
43 // AUTO-GENERATED DOCUMENTATION AND CLASS.
44 /**
45  * Service Description: The Cloud Domains API enables management and configuration of domain names.
46  *
47  * <p>This class provides the ability to make remote calls to the backing service through method
48  * calls that map to API methods. Sample code to get started:
49  *
50  * <pre>{@code
51  * // This snippet has been automatically generated and should be regarded as a code template only.
52  * // It will require modifications to work:
53  * // - It may require correct/in-range values for request initialization.
54  * // - It may require specifying regional endpoints when creating the service client as shown in
55  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
56  * try (DomainsClient domainsClient = DomainsClient.create()) {
57  *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
58  *   String query = "query107944136";
59  *   SearchDomainsResponse response = domainsClient.searchDomains(location, query);
60  * }
61  * }</pre>
62  *
63  * <p>Note: close() needs to be called on the DomainsClient object to clean up resources such as
64  * threads. In the example above, try-with-resources is used, which automatically calls close().
65  *
66  * <p>The surface of this class includes several types of Java methods for each of the API's
67  * methods:
68  *
69  * <ol>
70  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
71  *       converted into function parameters. It may be the case that not all fields are available as
72  *       parameters, and not every API method will have a flattened method entry point.
73  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
74  *       which must be constructed before the call. Not every API method will have a request object
75  *       method.
76  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
77  *       callable object, which can be used to initiate calls to the service.
78  * </ol>
79  *
80  * <p>See the individual methods for example code.
81  *
82  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
83  * these names, this class includes a format method for each type of name, and additionally a parse
84  * method to extract the individual identifiers contained within names that are returned.
85  *
86  * <p>This class can be customized by passing in a custom instance of DomainsSettings to create().
87  * For example:
88  *
89  * <p>To customize credentials:
90  *
91  * <pre>{@code
92  * // This snippet has been automatically generated and should be regarded as a code template only.
93  * // It will require modifications to work:
94  * // - It may require correct/in-range values for request initialization.
95  * // - It may require specifying regional endpoints when creating the service client as shown in
96  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
97  * DomainsSettings domainsSettings =
98  *     DomainsSettings.newBuilder()
99  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
100  *         .build();
101  * DomainsClient domainsClient = DomainsClient.create(domainsSettings);
102  * }</pre>
103  *
104  * <p>To customize the endpoint:
105  *
106  * <pre>{@code
107  * // This snippet has been automatically generated and should be regarded as a code template only.
108  * // It will require modifications to work:
109  * // - It may require correct/in-range values for request initialization.
110  * // - It may require specifying regional endpoints when creating the service client as shown in
111  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
112  * DomainsSettings domainsSettings = DomainsSettings.newBuilder().setEndpoint(myEndpoint).build();
113  * DomainsClient domainsClient = DomainsClient.create(domainsSettings);
114  * }</pre>
115  *
116  * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
117  * the wire:
118  *
119  * <pre>{@code
120  * // This snippet has been automatically generated and should be regarded as a code template only.
121  * // It will require modifications to work:
122  * // - It may require correct/in-range values for request initialization.
123  * // - It may require specifying regional endpoints when creating the service client as shown in
124  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
125  * DomainsSettings domainsSettings = DomainsSettings.newHttpJsonBuilder().build();
126  * DomainsClient domainsClient = DomainsClient.create(domainsSettings);
127  * }</pre>
128  *
129  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
130  */
131 @BetaApi
132 @Generated("by gapic-generator-java")
133 public class DomainsClient implements BackgroundResource {
134   private final DomainsSettings settings;
135   private final DomainsStub stub;
136   private final OperationsClient httpJsonOperationsClient;
137   private final com.google.longrunning.OperationsClient operationsClient;
138 
139   /** Constructs an instance of DomainsClient with default settings. */
create()140   public static final DomainsClient create() throws IOException {
141     return create(DomainsSettings.newBuilder().build());
142   }
143 
144   /**
145    * Constructs an instance of DomainsClient, using the given settings. The channels are created
146    * based on the settings passed in, or defaults for any settings that are not set.
147    */
create(DomainsSettings settings)148   public static final DomainsClient create(DomainsSettings settings) throws IOException {
149     return new DomainsClient(settings);
150   }
151 
152   /**
153    * Constructs an instance of DomainsClient, using the given stub for making calls. This is for
154    * advanced usage - prefer using create(DomainsSettings).
155    */
create(DomainsStub stub)156   public static final DomainsClient create(DomainsStub stub) {
157     return new DomainsClient(stub);
158   }
159 
160   /**
161    * Constructs an instance of DomainsClient, using the given settings. This is protected so that it
162    * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
163    */
DomainsClient(DomainsSettings settings)164   protected DomainsClient(DomainsSettings settings) throws IOException {
165     this.settings = settings;
166     this.stub = ((DomainsStubSettings) settings.getStubSettings()).createStub();
167     this.operationsClient =
168         com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
169     this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
170   }
171 
DomainsClient(DomainsStub stub)172   protected DomainsClient(DomainsStub stub) {
173     this.settings = null;
174     this.stub = stub;
175     this.operationsClient =
176         com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
177     this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
178   }
179 
getSettings()180   public final DomainsSettings getSettings() {
181     return settings;
182   }
183 
getStub()184   public DomainsStub getStub() {
185     return stub;
186   }
187 
188   /**
189    * Returns the OperationsClient that can be used to query the status of a long-running operation
190    * returned by another API method call.
191    */
getOperationsClient()192   public final com.google.longrunning.OperationsClient getOperationsClient() {
193     return operationsClient;
194   }
195 
196   /**
197    * Returns the OperationsClient that can be used to query the status of a long-running operation
198    * returned by another API method call.
199    */
200   @BetaApi
getHttpJsonOperationsClient()201   public final OperationsClient getHttpJsonOperationsClient() {
202     return httpJsonOperationsClient;
203   }
204 
205   // AUTO-GENERATED DOCUMENTATION AND METHOD.
206   /**
207    * Searches for available domain names similar to the provided query.
208    *
209    * <p>Availability results from this method are approximate; call `RetrieveRegisterParameters` on
210    * a domain before registering to confirm availability.
211    *
212    * <p>Sample code:
213    *
214    * <pre>{@code
215    * // This snippet has been automatically generated and should be regarded as a code template only.
216    * // It will require modifications to work:
217    * // - It may require correct/in-range values for request initialization.
218    * // - It may require specifying regional endpoints when creating the service client as shown in
219    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
220    * try (DomainsClient domainsClient = DomainsClient.create()) {
221    *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
222    *   String query = "query107944136";
223    *   SearchDomainsResponse response = domainsClient.searchDomains(location, query);
224    * }
225    * }</pre>
226    *
227    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
228    * @param query Required. String used to search for available domain names.
229    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
230    */
searchDomains(LocationName location, String query)231   public final SearchDomainsResponse searchDomains(LocationName location, String query) {
232     SearchDomainsRequest request =
233         SearchDomainsRequest.newBuilder()
234             .setLocation(location == null ? null : location.toString())
235             .setQuery(query)
236             .build();
237     return searchDomains(request);
238   }
239 
240   // AUTO-GENERATED DOCUMENTATION AND METHOD.
241   /**
242    * Searches for available domain names similar to the provided query.
243    *
244    * <p>Availability results from this method are approximate; call `RetrieveRegisterParameters` on
245    * a domain before registering to confirm availability.
246    *
247    * <p>Sample code:
248    *
249    * <pre>{@code
250    * // This snippet has been automatically generated and should be regarded as a code template only.
251    * // It will require modifications to work:
252    * // - It may require correct/in-range values for request initialization.
253    * // - It may require specifying regional endpoints when creating the service client as shown in
254    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
255    * try (DomainsClient domainsClient = DomainsClient.create()) {
256    *   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
257    *   String query = "query107944136";
258    *   SearchDomainsResponse response = domainsClient.searchDomains(location, query);
259    * }
260    * }</pre>
261    *
262    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
263    * @param query Required. String used to search for available domain names.
264    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
265    */
searchDomains(String location, String query)266   public final SearchDomainsResponse searchDomains(String location, String query) {
267     SearchDomainsRequest request =
268         SearchDomainsRequest.newBuilder().setLocation(location).setQuery(query).build();
269     return searchDomains(request);
270   }
271 
272   // AUTO-GENERATED DOCUMENTATION AND METHOD.
273   /**
274    * Searches for available domain names similar to the provided query.
275    *
276    * <p>Availability results from this method are approximate; call `RetrieveRegisterParameters` on
277    * a domain before registering to confirm availability.
278    *
279    * <p>Sample code:
280    *
281    * <pre>{@code
282    * // This snippet has been automatically generated and should be regarded as a code template only.
283    * // It will require modifications to work:
284    * // - It may require correct/in-range values for request initialization.
285    * // - It may require specifying regional endpoints when creating the service client as shown in
286    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
287    * try (DomainsClient domainsClient = DomainsClient.create()) {
288    *   SearchDomainsRequest request =
289    *       SearchDomainsRequest.newBuilder()
290    *           .setQuery("query107944136")
291    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
292    *           .build();
293    *   SearchDomainsResponse response = domainsClient.searchDomains(request);
294    * }
295    * }</pre>
296    *
297    * @param request The request object containing all of the parameters for the API call.
298    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
299    */
searchDomains(SearchDomainsRequest request)300   public final SearchDomainsResponse searchDomains(SearchDomainsRequest request) {
301     return searchDomainsCallable().call(request);
302   }
303 
304   // AUTO-GENERATED DOCUMENTATION AND METHOD.
305   /**
306    * Searches for available domain names similar to the provided query.
307    *
308    * <p>Availability results from this method are approximate; call `RetrieveRegisterParameters` on
309    * a domain before registering to confirm availability.
310    *
311    * <p>Sample code:
312    *
313    * <pre>{@code
314    * // This snippet has been automatically generated and should be regarded as a code template only.
315    * // It will require modifications to work:
316    * // - It may require correct/in-range values for request initialization.
317    * // - It may require specifying regional endpoints when creating the service client as shown in
318    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
319    * try (DomainsClient domainsClient = DomainsClient.create()) {
320    *   SearchDomainsRequest request =
321    *       SearchDomainsRequest.newBuilder()
322    *           .setQuery("query107944136")
323    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
324    *           .build();
325    *   ApiFuture<SearchDomainsResponse> future =
326    *       domainsClient.searchDomainsCallable().futureCall(request);
327    *   // Do something.
328    *   SearchDomainsResponse response = future.get();
329    * }
330    * }</pre>
331    */
searchDomainsCallable()332   public final UnaryCallable<SearchDomainsRequest, SearchDomainsResponse> searchDomainsCallable() {
333     return stub.searchDomainsCallable();
334   }
335 
336   // AUTO-GENERATED DOCUMENTATION AND METHOD.
337   /**
338    * Gets parameters needed to register a new domain name, including price and up-to-date
339    * availability. Use the returned values to call `RegisterDomain`.
340    *
341    * <p>Sample code:
342    *
343    * <pre>{@code
344    * // This snippet has been automatically generated and should be regarded as a code template only.
345    * // It will require modifications to work:
346    * // - It may require correct/in-range values for request initialization.
347    * // - It may require specifying regional endpoints when creating the service client as shown in
348    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
349    * try (DomainsClient domainsClient = DomainsClient.create()) {
350    *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
351    *   String domainName = "domainName-1244085905";
352    *   RetrieveRegisterParametersResponse response =
353    *       domainsClient.retrieveRegisterParameters(location, domainName);
354    * }
355    * }</pre>
356    *
357    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
358    * @param domainName Required. The domain name. Unicode domain names must be expressed in Punycode
359    *     format.
360    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
361    */
retrieveRegisterParameters( LocationName location, String domainName)362   public final RetrieveRegisterParametersResponse retrieveRegisterParameters(
363       LocationName location, String domainName) {
364     RetrieveRegisterParametersRequest request =
365         RetrieveRegisterParametersRequest.newBuilder()
366             .setLocation(location == null ? null : location.toString())
367             .setDomainName(domainName)
368             .build();
369     return retrieveRegisterParameters(request);
370   }
371 
372   // AUTO-GENERATED DOCUMENTATION AND METHOD.
373   /**
374    * Gets parameters needed to register a new domain name, including price and up-to-date
375    * availability. Use the returned values to call `RegisterDomain`.
376    *
377    * <p>Sample code:
378    *
379    * <pre>{@code
380    * // This snippet has been automatically generated and should be regarded as a code template only.
381    * // It will require modifications to work:
382    * // - It may require correct/in-range values for request initialization.
383    * // - It may require specifying regional endpoints when creating the service client as shown in
384    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
385    * try (DomainsClient domainsClient = DomainsClient.create()) {
386    *   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
387    *   String domainName = "domainName-1244085905";
388    *   RetrieveRegisterParametersResponse response =
389    *       domainsClient.retrieveRegisterParameters(location, domainName);
390    * }
391    * }</pre>
392    *
393    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
394    * @param domainName Required. The domain name. Unicode domain names must be expressed in Punycode
395    *     format.
396    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
397    */
retrieveRegisterParameters( String location, String domainName)398   public final RetrieveRegisterParametersResponse retrieveRegisterParameters(
399       String location, String domainName) {
400     RetrieveRegisterParametersRequest request =
401         RetrieveRegisterParametersRequest.newBuilder()
402             .setLocation(location)
403             .setDomainName(domainName)
404             .build();
405     return retrieveRegisterParameters(request);
406   }
407 
408   // AUTO-GENERATED DOCUMENTATION AND METHOD.
409   /**
410    * Gets parameters needed to register a new domain name, including price and up-to-date
411    * availability. Use the returned values to call `RegisterDomain`.
412    *
413    * <p>Sample code:
414    *
415    * <pre>{@code
416    * // This snippet has been automatically generated and should be regarded as a code template only.
417    * // It will require modifications to work:
418    * // - It may require correct/in-range values for request initialization.
419    * // - It may require specifying regional endpoints when creating the service client as shown in
420    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
421    * try (DomainsClient domainsClient = DomainsClient.create()) {
422    *   RetrieveRegisterParametersRequest request =
423    *       RetrieveRegisterParametersRequest.newBuilder()
424    *           .setDomainName("domainName-1244085905")
425    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
426    *           .build();
427    *   RetrieveRegisterParametersResponse response =
428    *       domainsClient.retrieveRegisterParameters(request);
429    * }
430    * }</pre>
431    *
432    * @param request The request object containing all of the parameters for the API call.
433    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
434    */
retrieveRegisterParameters( RetrieveRegisterParametersRequest request)435   public final RetrieveRegisterParametersResponse retrieveRegisterParameters(
436       RetrieveRegisterParametersRequest request) {
437     return retrieveRegisterParametersCallable().call(request);
438   }
439 
440   // AUTO-GENERATED DOCUMENTATION AND METHOD.
441   /**
442    * Gets parameters needed to register a new domain name, including price and up-to-date
443    * availability. Use the returned values to call `RegisterDomain`.
444    *
445    * <p>Sample code:
446    *
447    * <pre>{@code
448    * // This snippet has been automatically generated and should be regarded as a code template only.
449    * // It will require modifications to work:
450    * // - It may require correct/in-range values for request initialization.
451    * // - It may require specifying regional endpoints when creating the service client as shown in
452    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
453    * try (DomainsClient domainsClient = DomainsClient.create()) {
454    *   RetrieveRegisterParametersRequest request =
455    *       RetrieveRegisterParametersRequest.newBuilder()
456    *           .setDomainName("domainName-1244085905")
457    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
458    *           .build();
459    *   ApiFuture<RetrieveRegisterParametersResponse> future =
460    *       domainsClient.retrieveRegisterParametersCallable().futureCall(request);
461    *   // Do something.
462    *   RetrieveRegisterParametersResponse response = future.get();
463    * }
464    * }</pre>
465    */
466   public final UnaryCallable<RetrieveRegisterParametersRequest, RetrieveRegisterParametersResponse>
retrieveRegisterParametersCallable()467       retrieveRegisterParametersCallable() {
468     return stub.retrieveRegisterParametersCallable();
469   }
470 
471   // AUTO-GENERATED DOCUMENTATION AND METHOD.
472   /**
473    * Registers a new domain name and creates a corresponding `Registration` resource.
474    *
475    * <p>Call `RetrieveRegisterParameters` first to check availability of the domain name and
476    * determine parameters like price that are needed to build a call to this method.
477    *
478    * <p>A successful call creates a `Registration` resource in state `REGISTRATION_PENDING`, which
479    * resolves to `ACTIVE` within 1-2 minutes, indicating that the domain was successfully
480    * registered. If the resource ends up in state `REGISTRATION_FAILED`, it indicates that the
481    * domain was not registered successfully, and you can safely delete the resource and retry
482    * registration.
483    *
484    * <p>Sample code:
485    *
486    * <pre>{@code
487    * // This snippet has been automatically generated and should be regarded as a code template only.
488    * // It will require modifications to work:
489    * // - It may require correct/in-range values for request initialization.
490    * // - It may require specifying regional endpoints when creating the service client as shown in
491    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
492    * try (DomainsClient domainsClient = DomainsClient.create()) {
493    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
494    *   Registration registration = Registration.newBuilder().build();
495    *   Money yearlyPrice = Money.newBuilder().build();
496    *   Registration response =
497    *       domainsClient.registerDomainAsync(parent, registration, yearlyPrice).get();
498    * }
499    * }</pre>
500    *
501    * @param parent Required. The parent resource of the `Registration`. Must be in the format
502    *     `projects/&#42;/locations/&#42;`.
503    * @param registration Required. The complete `Registration` resource to be created.
504    * @param yearlyPrice Required. Yearly price to register or renew the domain. The value that
505    *     should be put here can be obtained from RetrieveRegisterParameters or SearchDomains calls.
506    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
507    */
registerDomainAsync( LocationName parent, Registration registration, Money yearlyPrice)508   public final OperationFuture<Registration, OperationMetadata> registerDomainAsync(
509       LocationName parent, Registration registration, Money yearlyPrice) {
510     RegisterDomainRequest request =
511         RegisterDomainRequest.newBuilder()
512             .setParent(parent == null ? null : parent.toString())
513             .setRegistration(registration)
514             .setYearlyPrice(yearlyPrice)
515             .build();
516     return registerDomainAsync(request);
517   }
518 
519   // AUTO-GENERATED DOCUMENTATION AND METHOD.
520   /**
521    * Registers a new domain name and creates a corresponding `Registration` resource.
522    *
523    * <p>Call `RetrieveRegisterParameters` first to check availability of the domain name and
524    * determine parameters like price that are needed to build a call to this method.
525    *
526    * <p>A successful call creates a `Registration` resource in state `REGISTRATION_PENDING`, which
527    * resolves to `ACTIVE` within 1-2 minutes, indicating that the domain was successfully
528    * registered. If the resource ends up in state `REGISTRATION_FAILED`, it indicates that the
529    * domain was not registered successfully, and you can safely delete the resource and retry
530    * registration.
531    *
532    * <p>Sample code:
533    *
534    * <pre>{@code
535    * // This snippet has been automatically generated and should be regarded as a code template only.
536    * // It will require modifications to work:
537    * // - It may require correct/in-range values for request initialization.
538    * // - It may require specifying regional endpoints when creating the service client as shown in
539    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
540    * try (DomainsClient domainsClient = DomainsClient.create()) {
541    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
542    *   Registration registration = Registration.newBuilder().build();
543    *   Money yearlyPrice = Money.newBuilder().build();
544    *   Registration response =
545    *       domainsClient.registerDomainAsync(parent, registration, yearlyPrice).get();
546    * }
547    * }</pre>
548    *
549    * @param parent Required. The parent resource of the `Registration`. Must be in the format
550    *     `projects/&#42;/locations/&#42;`.
551    * @param registration Required. The complete `Registration` resource to be created.
552    * @param yearlyPrice Required. Yearly price to register or renew the domain. The value that
553    *     should be put here can be obtained from RetrieveRegisterParameters or SearchDomains calls.
554    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
555    */
registerDomainAsync( String parent, Registration registration, Money yearlyPrice)556   public final OperationFuture<Registration, OperationMetadata> registerDomainAsync(
557       String parent, Registration registration, Money yearlyPrice) {
558     RegisterDomainRequest request =
559         RegisterDomainRequest.newBuilder()
560             .setParent(parent)
561             .setRegistration(registration)
562             .setYearlyPrice(yearlyPrice)
563             .build();
564     return registerDomainAsync(request);
565   }
566 
567   // AUTO-GENERATED DOCUMENTATION AND METHOD.
568   /**
569    * Registers a new domain name and creates a corresponding `Registration` resource.
570    *
571    * <p>Call `RetrieveRegisterParameters` first to check availability of the domain name and
572    * determine parameters like price that are needed to build a call to this method.
573    *
574    * <p>A successful call creates a `Registration` resource in state `REGISTRATION_PENDING`, which
575    * resolves to `ACTIVE` within 1-2 minutes, indicating that the domain was successfully
576    * registered. If the resource ends up in state `REGISTRATION_FAILED`, it indicates that the
577    * domain was not registered successfully, and you can safely delete the resource and retry
578    * registration.
579    *
580    * <p>Sample code:
581    *
582    * <pre>{@code
583    * // This snippet has been automatically generated and should be regarded as a code template only.
584    * // It will require modifications to work:
585    * // - It may require correct/in-range values for request initialization.
586    * // - It may require specifying regional endpoints when creating the service client as shown in
587    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
588    * try (DomainsClient domainsClient = DomainsClient.create()) {
589    *   RegisterDomainRequest request =
590    *       RegisterDomainRequest.newBuilder()
591    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
592    *           .setRegistration(Registration.newBuilder().build())
593    *           .addAllDomainNotices(new ArrayList<DomainNotice>())
594    *           .addAllContactNotices(new ArrayList<ContactNotice>())
595    *           .setYearlyPrice(Money.newBuilder().build())
596    *           .setValidateOnly(true)
597    *           .build();
598    *   Registration response = domainsClient.registerDomainAsync(request).get();
599    * }
600    * }</pre>
601    *
602    * @param request The request object containing all of the parameters for the API call.
603    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
604    */
registerDomainAsync( RegisterDomainRequest request)605   public final OperationFuture<Registration, OperationMetadata> registerDomainAsync(
606       RegisterDomainRequest request) {
607     return registerDomainOperationCallable().futureCall(request);
608   }
609 
610   // AUTO-GENERATED DOCUMENTATION AND METHOD.
611   /**
612    * Registers a new domain name and creates a corresponding `Registration` resource.
613    *
614    * <p>Call `RetrieveRegisterParameters` first to check availability of the domain name and
615    * determine parameters like price that are needed to build a call to this method.
616    *
617    * <p>A successful call creates a `Registration` resource in state `REGISTRATION_PENDING`, which
618    * resolves to `ACTIVE` within 1-2 minutes, indicating that the domain was successfully
619    * registered. If the resource ends up in state `REGISTRATION_FAILED`, it indicates that the
620    * domain was not registered successfully, and you can safely delete the resource and retry
621    * registration.
622    *
623    * <p>Sample code:
624    *
625    * <pre>{@code
626    * // This snippet has been automatically generated and should be regarded as a code template only.
627    * // It will require modifications to work:
628    * // - It may require correct/in-range values for request initialization.
629    * // - It may require specifying regional endpoints when creating the service client as shown in
630    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
631    * try (DomainsClient domainsClient = DomainsClient.create()) {
632    *   RegisterDomainRequest request =
633    *       RegisterDomainRequest.newBuilder()
634    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
635    *           .setRegistration(Registration.newBuilder().build())
636    *           .addAllDomainNotices(new ArrayList<DomainNotice>())
637    *           .addAllContactNotices(new ArrayList<ContactNotice>())
638    *           .setYearlyPrice(Money.newBuilder().build())
639    *           .setValidateOnly(true)
640    *           .build();
641    *   OperationFuture<Registration, OperationMetadata> future =
642    *       domainsClient.registerDomainOperationCallable().futureCall(request);
643    *   // Do something.
644    *   Registration response = future.get();
645    * }
646    * }</pre>
647    */
648   public final OperationCallable<RegisterDomainRequest, Registration, OperationMetadata>
registerDomainOperationCallable()649       registerDomainOperationCallable() {
650     return stub.registerDomainOperationCallable();
651   }
652 
653   // AUTO-GENERATED DOCUMENTATION AND METHOD.
654   /**
655    * Registers a new domain name and creates a corresponding `Registration` resource.
656    *
657    * <p>Call `RetrieveRegisterParameters` first to check availability of the domain name and
658    * determine parameters like price that are needed to build a call to this method.
659    *
660    * <p>A successful call creates a `Registration` resource in state `REGISTRATION_PENDING`, which
661    * resolves to `ACTIVE` within 1-2 minutes, indicating that the domain was successfully
662    * registered. If the resource ends up in state `REGISTRATION_FAILED`, it indicates that the
663    * domain was not registered successfully, and you can safely delete the resource and retry
664    * registration.
665    *
666    * <p>Sample code:
667    *
668    * <pre>{@code
669    * // This snippet has been automatically generated and should be regarded as a code template only.
670    * // It will require modifications to work:
671    * // - It may require correct/in-range values for request initialization.
672    * // - It may require specifying regional endpoints when creating the service client as shown in
673    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
674    * try (DomainsClient domainsClient = DomainsClient.create()) {
675    *   RegisterDomainRequest request =
676    *       RegisterDomainRequest.newBuilder()
677    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
678    *           .setRegistration(Registration.newBuilder().build())
679    *           .addAllDomainNotices(new ArrayList<DomainNotice>())
680    *           .addAllContactNotices(new ArrayList<ContactNotice>())
681    *           .setYearlyPrice(Money.newBuilder().build())
682    *           .setValidateOnly(true)
683    *           .build();
684    *   ApiFuture<Operation> future = domainsClient.registerDomainCallable().futureCall(request);
685    *   // Do something.
686    *   Operation response = future.get();
687    * }
688    * }</pre>
689    */
registerDomainCallable()690   public final UnaryCallable<RegisterDomainRequest, Operation> registerDomainCallable() {
691     return stub.registerDomainCallable();
692   }
693 
694   // AUTO-GENERATED DOCUMENTATION AND METHOD.
695   /**
696    * Gets parameters needed to transfer a domain name from another registrar to Cloud Domains. For
697    * domains managed by Google Domains, transferring to Cloud Domains is not supported.
698    *
699    * <p>Use the returned values to call `TransferDomain`.
700    *
701    * <p>Sample code:
702    *
703    * <pre>{@code
704    * // This snippet has been automatically generated and should be regarded as a code template only.
705    * // It will require modifications to work:
706    * // - It may require correct/in-range values for request initialization.
707    * // - It may require specifying regional endpoints when creating the service client as shown in
708    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
709    * try (DomainsClient domainsClient = DomainsClient.create()) {
710    *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
711    *   String domainName = "domainName-1244085905";
712    *   RetrieveTransferParametersResponse response =
713    *       domainsClient.retrieveTransferParameters(location, domainName);
714    * }
715    * }</pre>
716    *
717    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
718    * @param domainName Required. The domain name. Unicode domain names must be expressed in Punycode
719    *     format.
720    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
721    */
retrieveTransferParameters( LocationName location, String domainName)722   public final RetrieveTransferParametersResponse retrieveTransferParameters(
723       LocationName location, String domainName) {
724     RetrieveTransferParametersRequest request =
725         RetrieveTransferParametersRequest.newBuilder()
726             .setLocation(location == null ? null : location.toString())
727             .setDomainName(domainName)
728             .build();
729     return retrieveTransferParameters(request);
730   }
731 
732   // AUTO-GENERATED DOCUMENTATION AND METHOD.
733   /**
734    * Gets parameters needed to transfer a domain name from another registrar to Cloud Domains. For
735    * domains managed by Google Domains, transferring to Cloud Domains is not supported.
736    *
737    * <p>Use the returned values to call `TransferDomain`.
738    *
739    * <p>Sample code:
740    *
741    * <pre>{@code
742    * // This snippet has been automatically generated and should be regarded as a code template only.
743    * // It will require modifications to work:
744    * // - It may require correct/in-range values for request initialization.
745    * // - It may require specifying regional endpoints when creating the service client as shown in
746    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
747    * try (DomainsClient domainsClient = DomainsClient.create()) {
748    *   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
749    *   String domainName = "domainName-1244085905";
750    *   RetrieveTransferParametersResponse response =
751    *       domainsClient.retrieveTransferParameters(location, domainName);
752    * }
753    * }</pre>
754    *
755    * @param location Required. The location. Must be in the format `projects/&#42;/locations/&#42;`.
756    * @param domainName Required. The domain name. Unicode domain names must be expressed in Punycode
757    *     format.
758    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
759    */
retrieveTransferParameters( String location, String domainName)760   public final RetrieveTransferParametersResponse retrieveTransferParameters(
761       String location, String domainName) {
762     RetrieveTransferParametersRequest request =
763         RetrieveTransferParametersRequest.newBuilder()
764             .setLocation(location)
765             .setDomainName(domainName)
766             .build();
767     return retrieveTransferParameters(request);
768   }
769 
770   // AUTO-GENERATED DOCUMENTATION AND METHOD.
771   /**
772    * Gets parameters needed to transfer a domain name from another registrar to Cloud Domains. For
773    * domains managed by Google Domains, transferring to Cloud Domains is not supported.
774    *
775    * <p>Use the returned values to call `TransferDomain`.
776    *
777    * <p>Sample code:
778    *
779    * <pre>{@code
780    * // This snippet has been automatically generated and should be regarded as a code template only.
781    * // It will require modifications to work:
782    * // - It may require correct/in-range values for request initialization.
783    * // - It may require specifying regional endpoints when creating the service client as shown in
784    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
785    * try (DomainsClient domainsClient = DomainsClient.create()) {
786    *   RetrieveTransferParametersRequest request =
787    *       RetrieveTransferParametersRequest.newBuilder()
788    *           .setDomainName("domainName-1244085905")
789    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
790    *           .build();
791    *   RetrieveTransferParametersResponse response =
792    *       domainsClient.retrieveTransferParameters(request);
793    * }
794    * }</pre>
795    *
796    * @param request The request object containing all of the parameters for the API call.
797    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
798    */
retrieveTransferParameters( RetrieveTransferParametersRequest request)799   public final RetrieveTransferParametersResponse retrieveTransferParameters(
800       RetrieveTransferParametersRequest request) {
801     return retrieveTransferParametersCallable().call(request);
802   }
803 
804   // AUTO-GENERATED DOCUMENTATION AND METHOD.
805   /**
806    * Gets parameters needed to transfer a domain name from another registrar to Cloud Domains. For
807    * domains managed by Google Domains, transferring to Cloud Domains is not supported.
808    *
809    * <p>Use the returned values to call `TransferDomain`.
810    *
811    * <p>Sample code:
812    *
813    * <pre>{@code
814    * // This snippet has been automatically generated and should be regarded as a code template only.
815    * // It will require modifications to work:
816    * // - It may require correct/in-range values for request initialization.
817    * // - It may require specifying regional endpoints when creating the service client as shown in
818    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
819    * try (DomainsClient domainsClient = DomainsClient.create()) {
820    *   RetrieveTransferParametersRequest request =
821    *       RetrieveTransferParametersRequest.newBuilder()
822    *           .setDomainName("domainName-1244085905")
823    *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
824    *           .build();
825    *   ApiFuture<RetrieveTransferParametersResponse> future =
826    *       domainsClient.retrieveTransferParametersCallable().futureCall(request);
827    *   // Do something.
828    *   RetrieveTransferParametersResponse response = future.get();
829    * }
830    * }</pre>
831    */
832   public final UnaryCallable<RetrieveTransferParametersRequest, RetrieveTransferParametersResponse>
retrieveTransferParametersCallable()833       retrieveTransferParametersCallable() {
834     return stub.retrieveTransferParametersCallable();
835   }
836 
837   // AUTO-GENERATED DOCUMENTATION AND METHOD.
838   /**
839    * Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google
840    * Domains, transferring to Cloud Domains is not supported.
841    *
842    * <p>Before calling this method, go to the domain's current registrar to unlock the domain for
843    * transfer and retrieve the domain's transfer authorization code. Then call
844    * `RetrieveTransferParameters` to confirm that the domain is unlocked and to get values needed to
845    * build a call to this method.
846    *
847    * <p>A successful call creates a `Registration` resource in state `TRANSFER_PENDING`. It can take
848    * several days to complete the transfer process. The registrant can often speed up this process
849    * by approving the transfer through the current registrar, either by clicking a link in an email
850    * from the registrar or by visiting the registrar's website.
851    *
852    * <p>A few minutes after transfer approval, the resource transitions to state `ACTIVE`,
853    * indicating that the transfer was successful. If the transfer is rejected or the request expires
854    * without being approved, the resource can end up in state `TRANSFER_FAILED`. If transfer fails,
855    * you can safely delete the resource and retry the transfer.
856    *
857    * <p>Sample code:
858    *
859    * <pre>{@code
860    * // This snippet has been automatically generated and should be regarded as a code template only.
861    * // It will require modifications to work:
862    * // - It may require correct/in-range values for request initialization.
863    * // - It may require specifying regional endpoints when creating the service client as shown in
864    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
865    * try (DomainsClient domainsClient = DomainsClient.create()) {
866    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
867    *   Registration registration = Registration.newBuilder().build();
868    *   Money yearlyPrice = Money.newBuilder().build();
869    *   AuthorizationCode authorizationCode = AuthorizationCode.newBuilder().build();
870    *   Registration response =
871    *       domainsClient
872    *           .transferDomainAsync(parent, registration, yearlyPrice, authorizationCode)
873    *           .get();
874    * }
875    * }</pre>
876    *
877    * @param parent Required. The parent resource of the `Registration`. Must be in the format
878    *     `projects/&#42;/locations/&#42;`.
879    * @param registration Required. The complete `Registration` resource to be created.
880    *     <p>You can leave `registration.dns_settings` unset to import the domain's current DNS
881    *     configuration from its current registrar. Use this option only if you are sure that the
882    *     domain's current DNS service does not cease upon transfer, as is often the case for DNS
883    *     services provided for free by the registrar.
884    * @param yearlyPrice Required. Acknowledgement of the price to transfer or renew the domain for
885    *     one year. Call `RetrieveTransferParameters` to obtain the price, which you must
886    *     acknowledge.
887    * @param authorizationCode The domain's transfer authorization code. You can obtain this from the
888    *     domain's current registrar.
889    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
890    */
transferDomainAsync( LocationName parent, Registration registration, Money yearlyPrice, AuthorizationCode authorizationCode)891   public final OperationFuture<Registration, OperationMetadata> transferDomainAsync(
892       LocationName parent,
893       Registration registration,
894       Money yearlyPrice,
895       AuthorizationCode authorizationCode) {
896     TransferDomainRequest request =
897         TransferDomainRequest.newBuilder()
898             .setParent(parent == null ? null : parent.toString())
899             .setRegistration(registration)
900             .setYearlyPrice(yearlyPrice)
901             .setAuthorizationCode(authorizationCode)
902             .build();
903     return transferDomainAsync(request);
904   }
905 
906   // AUTO-GENERATED DOCUMENTATION AND METHOD.
907   /**
908    * Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google
909    * Domains, transferring to Cloud Domains is not supported.
910    *
911    * <p>Before calling this method, go to the domain's current registrar to unlock the domain for
912    * transfer and retrieve the domain's transfer authorization code. Then call
913    * `RetrieveTransferParameters` to confirm that the domain is unlocked and to get values needed to
914    * build a call to this method.
915    *
916    * <p>A successful call creates a `Registration` resource in state `TRANSFER_PENDING`. It can take
917    * several days to complete the transfer process. The registrant can often speed up this process
918    * by approving the transfer through the current registrar, either by clicking a link in an email
919    * from the registrar or by visiting the registrar's website.
920    *
921    * <p>A few minutes after transfer approval, the resource transitions to state `ACTIVE`,
922    * indicating that the transfer was successful. If the transfer is rejected or the request expires
923    * without being approved, the resource can end up in state `TRANSFER_FAILED`. If transfer fails,
924    * you can safely delete the resource and retry the transfer.
925    *
926    * <p>Sample code:
927    *
928    * <pre>{@code
929    * // This snippet has been automatically generated and should be regarded as a code template only.
930    * // It will require modifications to work:
931    * // - It may require correct/in-range values for request initialization.
932    * // - It may require specifying regional endpoints when creating the service client as shown in
933    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
934    * try (DomainsClient domainsClient = DomainsClient.create()) {
935    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
936    *   Registration registration = Registration.newBuilder().build();
937    *   Money yearlyPrice = Money.newBuilder().build();
938    *   AuthorizationCode authorizationCode = AuthorizationCode.newBuilder().build();
939    *   Registration response =
940    *       domainsClient
941    *           .transferDomainAsync(parent, registration, yearlyPrice, authorizationCode)
942    *           .get();
943    * }
944    * }</pre>
945    *
946    * @param parent Required. The parent resource of the `Registration`. Must be in the format
947    *     `projects/&#42;/locations/&#42;`.
948    * @param registration Required. The complete `Registration` resource to be created.
949    *     <p>You can leave `registration.dns_settings` unset to import the domain's current DNS
950    *     configuration from its current registrar. Use this option only if you are sure that the
951    *     domain's current DNS service does not cease upon transfer, as is often the case for DNS
952    *     services provided for free by the registrar.
953    * @param yearlyPrice Required. Acknowledgement of the price to transfer or renew the domain for
954    *     one year. Call `RetrieveTransferParameters` to obtain the price, which you must
955    *     acknowledge.
956    * @param authorizationCode The domain's transfer authorization code. You can obtain this from the
957    *     domain's current registrar.
958    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
959    */
transferDomainAsync( String parent, Registration registration, Money yearlyPrice, AuthorizationCode authorizationCode)960   public final OperationFuture<Registration, OperationMetadata> transferDomainAsync(
961       String parent,
962       Registration registration,
963       Money yearlyPrice,
964       AuthorizationCode authorizationCode) {
965     TransferDomainRequest request =
966         TransferDomainRequest.newBuilder()
967             .setParent(parent)
968             .setRegistration(registration)
969             .setYearlyPrice(yearlyPrice)
970             .setAuthorizationCode(authorizationCode)
971             .build();
972     return transferDomainAsync(request);
973   }
974 
975   // AUTO-GENERATED DOCUMENTATION AND METHOD.
976   /**
977    * Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google
978    * Domains, transferring to Cloud Domains is not supported.
979    *
980    * <p>Before calling this method, go to the domain's current registrar to unlock the domain for
981    * transfer and retrieve the domain's transfer authorization code. Then call
982    * `RetrieveTransferParameters` to confirm that the domain is unlocked and to get values needed to
983    * build a call to this method.
984    *
985    * <p>A successful call creates a `Registration` resource in state `TRANSFER_PENDING`. It can take
986    * several days to complete the transfer process. The registrant can often speed up this process
987    * by approving the transfer through the current registrar, either by clicking a link in an email
988    * from the registrar or by visiting the registrar's website.
989    *
990    * <p>A few minutes after transfer approval, the resource transitions to state `ACTIVE`,
991    * indicating that the transfer was successful. If the transfer is rejected or the request expires
992    * without being approved, the resource can end up in state `TRANSFER_FAILED`. If transfer fails,
993    * you can safely delete the resource and retry the transfer.
994    *
995    * <p>Sample code:
996    *
997    * <pre>{@code
998    * // This snippet has been automatically generated and should be regarded as a code template only.
999    * // It will require modifications to work:
1000    * // - It may require correct/in-range values for request initialization.
1001    * // - It may require specifying regional endpoints when creating the service client as shown in
1002    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1003    * try (DomainsClient domainsClient = DomainsClient.create()) {
1004    *   TransferDomainRequest request =
1005    *       TransferDomainRequest.newBuilder()
1006    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1007    *           .setRegistration(Registration.newBuilder().build())
1008    *           .addAllContactNotices(new ArrayList<ContactNotice>())
1009    *           .setYearlyPrice(Money.newBuilder().build())
1010    *           .setAuthorizationCode(AuthorizationCode.newBuilder().build())
1011    *           .setValidateOnly(true)
1012    *           .build();
1013    *   Registration response = domainsClient.transferDomainAsync(request).get();
1014    * }
1015    * }</pre>
1016    *
1017    * @param request The request object containing all of the parameters for the API call.
1018    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1019    */
transferDomainAsync( TransferDomainRequest request)1020   public final OperationFuture<Registration, OperationMetadata> transferDomainAsync(
1021       TransferDomainRequest request) {
1022     return transferDomainOperationCallable().futureCall(request);
1023   }
1024 
1025   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1026   /**
1027    * Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google
1028    * Domains, transferring to Cloud Domains is not supported.
1029    *
1030    * <p>Before calling this method, go to the domain's current registrar to unlock the domain for
1031    * transfer and retrieve the domain's transfer authorization code. Then call
1032    * `RetrieveTransferParameters` to confirm that the domain is unlocked and to get values needed to
1033    * build a call to this method.
1034    *
1035    * <p>A successful call creates a `Registration` resource in state `TRANSFER_PENDING`. It can take
1036    * several days to complete the transfer process. The registrant can often speed up this process
1037    * by approving the transfer through the current registrar, either by clicking a link in an email
1038    * from the registrar or by visiting the registrar's website.
1039    *
1040    * <p>A few minutes after transfer approval, the resource transitions to state `ACTIVE`,
1041    * indicating that the transfer was successful. If the transfer is rejected or the request expires
1042    * without being approved, the resource can end up in state `TRANSFER_FAILED`. If transfer fails,
1043    * you can safely delete the resource and retry the transfer.
1044    *
1045    * <p>Sample code:
1046    *
1047    * <pre>{@code
1048    * // This snippet has been automatically generated and should be regarded as a code template only.
1049    * // It will require modifications to work:
1050    * // - It may require correct/in-range values for request initialization.
1051    * // - It may require specifying regional endpoints when creating the service client as shown in
1052    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1053    * try (DomainsClient domainsClient = DomainsClient.create()) {
1054    *   TransferDomainRequest request =
1055    *       TransferDomainRequest.newBuilder()
1056    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1057    *           .setRegistration(Registration.newBuilder().build())
1058    *           .addAllContactNotices(new ArrayList<ContactNotice>())
1059    *           .setYearlyPrice(Money.newBuilder().build())
1060    *           .setAuthorizationCode(AuthorizationCode.newBuilder().build())
1061    *           .setValidateOnly(true)
1062    *           .build();
1063    *   OperationFuture<Registration, OperationMetadata> future =
1064    *       domainsClient.transferDomainOperationCallable().futureCall(request);
1065    *   // Do something.
1066    *   Registration response = future.get();
1067    * }
1068    * }</pre>
1069    */
1070   public final OperationCallable<TransferDomainRequest, Registration, OperationMetadata>
transferDomainOperationCallable()1071       transferDomainOperationCallable() {
1072     return stub.transferDomainOperationCallable();
1073   }
1074 
1075   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1076   /**
1077    * Transfers a domain name from another registrar to Cloud Domains. For domains managed by Google
1078    * Domains, transferring to Cloud Domains is not supported.
1079    *
1080    * <p>Before calling this method, go to the domain's current registrar to unlock the domain for
1081    * transfer and retrieve the domain's transfer authorization code. Then call
1082    * `RetrieveTransferParameters` to confirm that the domain is unlocked and to get values needed to
1083    * build a call to this method.
1084    *
1085    * <p>A successful call creates a `Registration` resource in state `TRANSFER_PENDING`. It can take
1086    * several days to complete the transfer process. The registrant can often speed up this process
1087    * by approving the transfer through the current registrar, either by clicking a link in an email
1088    * from the registrar or by visiting the registrar's website.
1089    *
1090    * <p>A few minutes after transfer approval, the resource transitions to state `ACTIVE`,
1091    * indicating that the transfer was successful. If the transfer is rejected or the request expires
1092    * without being approved, the resource can end up in state `TRANSFER_FAILED`. If transfer fails,
1093    * you can safely delete the resource and retry the transfer.
1094    *
1095    * <p>Sample code:
1096    *
1097    * <pre>{@code
1098    * // This snippet has been automatically generated and should be regarded as a code template only.
1099    * // It will require modifications to work:
1100    * // - It may require correct/in-range values for request initialization.
1101    * // - It may require specifying regional endpoints when creating the service client as shown in
1102    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1103    * try (DomainsClient domainsClient = DomainsClient.create()) {
1104    *   TransferDomainRequest request =
1105    *       TransferDomainRequest.newBuilder()
1106    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1107    *           .setRegistration(Registration.newBuilder().build())
1108    *           .addAllContactNotices(new ArrayList<ContactNotice>())
1109    *           .setYearlyPrice(Money.newBuilder().build())
1110    *           .setAuthorizationCode(AuthorizationCode.newBuilder().build())
1111    *           .setValidateOnly(true)
1112    *           .build();
1113    *   ApiFuture<Operation> future = domainsClient.transferDomainCallable().futureCall(request);
1114    *   // Do something.
1115    *   Operation response = future.get();
1116    * }
1117    * }</pre>
1118    */
transferDomainCallable()1119   public final UnaryCallable<TransferDomainRequest, Operation> transferDomainCallable() {
1120     return stub.transferDomainCallable();
1121   }
1122 
1123   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1124   /**
1125    * Lists the `Registration` resources in a project.
1126    *
1127    * <p>Sample code:
1128    *
1129    * <pre>{@code
1130    * // This snippet has been automatically generated and should be regarded as a code template only.
1131    * // It will require modifications to work:
1132    * // - It may require correct/in-range values for request initialization.
1133    * // - It may require specifying regional endpoints when creating the service client as shown in
1134    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1135    * try (DomainsClient domainsClient = DomainsClient.create()) {
1136    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
1137    *   for (Registration element : domainsClient.listRegistrations(parent).iterateAll()) {
1138    *     // doThingsWith(element);
1139    *   }
1140    * }
1141    * }</pre>
1142    *
1143    * @param parent Required. The project and location from which to list `Registration`s, specified
1144    *     in the format `projects/&#42;/locations/&#42;`.
1145    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1146    */
listRegistrations(LocationName parent)1147   public final ListRegistrationsPagedResponse listRegistrations(LocationName parent) {
1148     ListRegistrationsRequest request =
1149         ListRegistrationsRequest.newBuilder()
1150             .setParent(parent == null ? null : parent.toString())
1151             .build();
1152     return listRegistrations(request);
1153   }
1154 
1155   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1156   /**
1157    * Lists the `Registration` resources in a project.
1158    *
1159    * <p>Sample code:
1160    *
1161    * <pre>{@code
1162    * // This snippet has been automatically generated and should be regarded as a code template only.
1163    * // It will require modifications to work:
1164    * // - It may require correct/in-range values for request initialization.
1165    * // - It may require specifying regional endpoints when creating the service client as shown in
1166    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1167    * try (DomainsClient domainsClient = DomainsClient.create()) {
1168    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
1169    *   for (Registration element : domainsClient.listRegistrations(parent).iterateAll()) {
1170    *     // doThingsWith(element);
1171    *   }
1172    * }
1173    * }</pre>
1174    *
1175    * @param parent Required. The project and location from which to list `Registration`s, specified
1176    *     in the format `projects/&#42;/locations/&#42;`.
1177    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1178    */
listRegistrations(String parent)1179   public final ListRegistrationsPagedResponse listRegistrations(String parent) {
1180     ListRegistrationsRequest request =
1181         ListRegistrationsRequest.newBuilder().setParent(parent).build();
1182     return listRegistrations(request);
1183   }
1184 
1185   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1186   /**
1187    * Lists the `Registration` resources in a project.
1188    *
1189    * <p>Sample code:
1190    *
1191    * <pre>{@code
1192    * // This snippet has been automatically generated and should be regarded as a code template only.
1193    * // It will require modifications to work:
1194    * // - It may require correct/in-range values for request initialization.
1195    * // - It may require specifying regional endpoints when creating the service client as shown in
1196    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1197    * try (DomainsClient domainsClient = DomainsClient.create()) {
1198    *   ListRegistrationsRequest request =
1199    *       ListRegistrationsRequest.newBuilder()
1200    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1201    *           .setPageSize(883849137)
1202    *           .setPageToken("pageToken873572522")
1203    *           .setFilter("filter-1274492040")
1204    *           .build();
1205    *   for (Registration element : domainsClient.listRegistrations(request).iterateAll()) {
1206    *     // doThingsWith(element);
1207    *   }
1208    * }
1209    * }</pre>
1210    *
1211    * @param request The request object containing all of the parameters for the API call.
1212    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1213    */
listRegistrations(ListRegistrationsRequest request)1214   public final ListRegistrationsPagedResponse listRegistrations(ListRegistrationsRequest request) {
1215     return listRegistrationsPagedCallable().call(request);
1216   }
1217 
1218   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1219   /**
1220    * Lists the `Registration` resources in a project.
1221    *
1222    * <p>Sample code:
1223    *
1224    * <pre>{@code
1225    * // This snippet has been automatically generated and should be regarded as a code template only.
1226    * // It will require modifications to work:
1227    * // - It may require correct/in-range values for request initialization.
1228    * // - It may require specifying regional endpoints when creating the service client as shown in
1229    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1230    * try (DomainsClient domainsClient = DomainsClient.create()) {
1231    *   ListRegistrationsRequest request =
1232    *       ListRegistrationsRequest.newBuilder()
1233    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1234    *           .setPageSize(883849137)
1235    *           .setPageToken("pageToken873572522")
1236    *           .setFilter("filter-1274492040")
1237    *           .build();
1238    *   ApiFuture<Registration> future =
1239    *       domainsClient.listRegistrationsPagedCallable().futureCall(request);
1240    *   // Do something.
1241    *   for (Registration element : future.get().iterateAll()) {
1242    *     // doThingsWith(element);
1243    *   }
1244    * }
1245    * }</pre>
1246    */
1247   public final UnaryCallable<ListRegistrationsRequest, ListRegistrationsPagedResponse>
listRegistrationsPagedCallable()1248       listRegistrationsPagedCallable() {
1249     return stub.listRegistrationsPagedCallable();
1250   }
1251 
1252   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1253   /**
1254    * Lists the `Registration` resources in a project.
1255    *
1256    * <p>Sample code:
1257    *
1258    * <pre>{@code
1259    * // This snippet has been automatically generated and should be regarded as a code template only.
1260    * // It will require modifications to work:
1261    * // - It may require correct/in-range values for request initialization.
1262    * // - It may require specifying regional endpoints when creating the service client as shown in
1263    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1264    * try (DomainsClient domainsClient = DomainsClient.create()) {
1265    *   ListRegistrationsRequest request =
1266    *       ListRegistrationsRequest.newBuilder()
1267    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1268    *           .setPageSize(883849137)
1269    *           .setPageToken("pageToken873572522")
1270    *           .setFilter("filter-1274492040")
1271    *           .build();
1272    *   while (true) {
1273    *     ListRegistrationsResponse response =
1274    *         domainsClient.listRegistrationsCallable().call(request);
1275    *     for (Registration element : response.getRegistrationsList()) {
1276    *       // doThingsWith(element);
1277    *     }
1278    *     String nextPageToken = response.getNextPageToken();
1279    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1280    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1281    *     } else {
1282    *       break;
1283    *     }
1284    *   }
1285    * }
1286    * }</pre>
1287    */
1288   public final UnaryCallable<ListRegistrationsRequest, ListRegistrationsResponse>
listRegistrationsCallable()1289       listRegistrationsCallable() {
1290     return stub.listRegistrationsCallable();
1291   }
1292 
1293   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1294   /**
1295    * Gets the details of a `Registration` resource.
1296    *
1297    * <p>Sample code:
1298    *
1299    * <pre>{@code
1300    * // This snippet has been automatically generated and should be regarded as a code template only.
1301    * // It will require modifications to work:
1302    * // - It may require correct/in-range values for request initialization.
1303    * // - It may require specifying regional endpoints when creating the service client as shown in
1304    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1305    * try (DomainsClient domainsClient = DomainsClient.create()) {
1306    *   RegistrationName name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
1307    *   Registration response = domainsClient.getRegistration(name);
1308    * }
1309    * }</pre>
1310    *
1311    * @param name Required. The name of the `Registration` to get, in the format
1312    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
1313    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1314    */
getRegistration(RegistrationName name)1315   public final Registration getRegistration(RegistrationName name) {
1316     GetRegistrationRequest request =
1317         GetRegistrationRequest.newBuilder().setName(name == null ? null : name.toString()).build();
1318     return getRegistration(request);
1319   }
1320 
1321   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1322   /**
1323    * Gets the details of a `Registration` resource.
1324    *
1325    * <p>Sample code:
1326    *
1327    * <pre>{@code
1328    * // This snippet has been automatically generated and should be regarded as a code template only.
1329    * // It will require modifications to work:
1330    * // - It may require correct/in-range values for request initialization.
1331    * // - It may require specifying regional endpoints when creating the service client as shown in
1332    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1333    * try (DomainsClient domainsClient = DomainsClient.create()) {
1334    *   String name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
1335    *   Registration response = domainsClient.getRegistration(name);
1336    * }
1337    * }</pre>
1338    *
1339    * @param name Required. The name of the `Registration` to get, in the format
1340    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
1341    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1342    */
getRegistration(String name)1343   public final Registration getRegistration(String name) {
1344     GetRegistrationRequest request = GetRegistrationRequest.newBuilder().setName(name).build();
1345     return getRegistration(request);
1346   }
1347 
1348   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1349   /**
1350    * Gets the details of a `Registration` resource.
1351    *
1352    * <p>Sample code:
1353    *
1354    * <pre>{@code
1355    * // This snippet has been automatically generated and should be regarded as a code template only.
1356    * // It will require modifications to work:
1357    * // - It may require correct/in-range values for request initialization.
1358    * // - It may require specifying regional endpoints when creating the service client as shown in
1359    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1360    * try (DomainsClient domainsClient = DomainsClient.create()) {
1361    *   GetRegistrationRequest request =
1362    *       GetRegistrationRequest.newBuilder()
1363    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1364    *           .build();
1365    *   Registration response = domainsClient.getRegistration(request);
1366    * }
1367    * }</pre>
1368    *
1369    * @param request The request object containing all of the parameters for the API call.
1370    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1371    */
getRegistration(GetRegistrationRequest request)1372   public final Registration getRegistration(GetRegistrationRequest request) {
1373     return getRegistrationCallable().call(request);
1374   }
1375 
1376   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1377   /**
1378    * Gets the details of a `Registration` resource.
1379    *
1380    * <p>Sample code:
1381    *
1382    * <pre>{@code
1383    * // This snippet has been automatically generated and should be regarded as a code template only.
1384    * // It will require modifications to work:
1385    * // - It may require correct/in-range values for request initialization.
1386    * // - It may require specifying regional endpoints when creating the service client as shown in
1387    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1388    * try (DomainsClient domainsClient = DomainsClient.create()) {
1389    *   GetRegistrationRequest request =
1390    *       GetRegistrationRequest.newBuilder()
1391    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1392    *           .build();
1393    *   ApiFuture<Registration> future = domainsClient.getRegistrationCallable().futureCall(request);
1394    *   // Do something.
1395    *   Registration response = future.get();
1396    * }
1397    * }</pre>
1398    */
getRegistrationCallable()1399   public final UnaryCallable<GetRegistrationRequest, Registration> getRegistrationCallable() {
1400     return stub.getRegistrationCallable();
1401   }
1402 
1403   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1404   /**
1405    * Updates select fields of a `Registration` resource, notably `labels`. To update other fields,
1406    * use the appropriate custom update method:
1407    *
1408    * <ul>
1409    *   <li>To update management settings, see `ConfigureManagementSettings`
1410    *   <li>To update DNS configuration, see `ConfigureDnsSettings`
1411    *   <li>To update contact information, see `ConfigureContactSettings`
1412    * </ul>
1413    *
1414    * <p>Sample code:
1415    *
1416    * <pre>{@code
1417    * // This snippet has been automatically generated and should be regarded as a code template only.
1418    * // It will require modifications to work:
1419    * // - It may require correct/in-range values for request initialization.
1420    * // - It may require specifying regional endpoints when creating the service client as shown in
1421    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1422    * try (DomainsClient domainsClient = DomainsClient.create()) {
1423    *   Registration registration = Registration.newBuilder().build();
1424    *   FieldMask updateMask = FieldMask.newBuilder().build();
1425    *   Registration response = domainsClient.updateRegistrationAsync(registration, updateMask).get();
1426    * }
1427    * }</pre>
1428    *
1429    * @param registration Fields of the `Registration` to update.
1430    * @param updateMask Required. The field mask describing which fields to update as a
1431    *     comma-separated list. For example, if only the labels are being updated, the `update_mask`
1432    *     is `"labels"`.
1433    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1434    */
updateRegistrationAsync( Registration registration, FieldMask updateMask)1435   public final OperationFuture<Registration, OperationMetadata> updateRegistrationAsync(
1436       Registration registration, FieldMask updateMask) {
1437     UpdateRegistrationRequest request =
1438         UpdateRegistrationRequest.newBuilder()
1439             .setRegistration(registration)
1440             .setUpdateMask(updateMask)
1441             .build();
1442     return updateRegistrationAsync(request);
1443   }
1444 
1445   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1446   /**
1447    * Updates select fields of a `Registration` resource, notably `labels`. To update other fields,
1448    * use the appropriate custom update method:
1449    *
1450    * <ul>
1451    *   <li>To update management settings, see `ConfigureManagementSettings`
1452    *   <li>To update DNS configuration, see `ConfigureDnsSettings`
1453    *   <li>To update contact information, see `ConfigureContactSettings`
1454    * </ul>
1455    *
1456    * <p>Sample code:
1457    *
1458    * <pre>{@code
1459    * // This snippet has been automatically generated and should be regarded as a code template only.
1460    * // It will require modifications to work:
1461    * // - It may require correct/in-range values for request initialization.
1462    * // - It may require specifying regional endpoints when creating the service client as shown in
1463    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1464    * try (DomainsClient domainsClient = DomainsClient.create()) {
1465    *   UpdateRegistrationRequest request =
1466    *       UpdateRegistrationRequest.newBuilder()
1467    *           .setRegistration(Registration.newBuilder().build())
1468    *           .setUpdateMask(FieldMask.newBuilder().build())
1469    *           .build();
1470    *   Registration response = domainsClient.updateRegistrationAsync(request).get();
1471    * }
1472    * }</pre>
1473    *
1474    * @param request The request object containing all of the parameters for the API call.
1475    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1476    */
updateRegistrationAsync( UpdateRegistrationRequest request)1477   public final OperationFuture<Registration, OperationMetadata> updateRegistrationAsync(
1478       UpdateRegistrationRequest request) {
1479     return updateRegistrationOperationCallable().futureCall(request);
1480   }
1481 
1482   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1483   /**
1484    * Updates select fields of a `Registration` resource, notably `labels`. To update other fields,
1485    * use the appropriate custom update method:
1486    *
1487    * <ul>
1488    *   <li>To update management settings, see `ConfigureManagementSettings`
1489    *   <li>To update DNS configuration, see `ConfigureDnsSettings`
1490    *   <li>To update contact information, see `ConfigureContactSettings`
1491    * </ul>
1492    *
1493    * <p>Sample code:
1494    *
1495    * <pre>{@code
1496    * // This snippet has been automatically generated and should be regarded as a code template only.
1497    * // It will require modifications to work:
1498    * // - It may require correct/in-range values for request initialization.
1499    * // - It may require specifying regional endpoints when creating the service client as shown in
1500    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1501    * try (DomainsClient domainsClient = DomainsClient.create()) {
1502    *   UpdateRegistrationRequest request =
1503    *       UpdateRegistrationRequest.newBuilder()
1504    *           .setRegistration(Registration.newBuilder().build())
1505    *           .setUpdateMask(FieldMask.newBuilder().build())
1506    *           .build();
1507    *   OperationFuture<Registration, OperationMetadata> future =
1508    *       domainsClient.updateRegistrationOperationCallable().futureCall(request);
1509    *   // Do something.
1510    *   Registration response = future.get();
1511    * }
1512    * }</pre>
1513    */
1514   public final OperationCallable<UpdateRegistrationRequest, Registration, OperationMetadata>
updateRegistrationOperationCallable()1515       updateRegistrationOperationCallable() {
1516     return stub.updateRegistrationOperationCallable();
1517   }
1518 
1519   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1520   /**
1521    * Updates select fields of a `Registration` resource, notably `labels`. To update other fields,
1522    * use the appropriate custom update method:
1523    *
1524    * <ul>
1525    *   <li>To update management settings, see `ConfigureManagementSettings`
1526    *   <li>To update DNS configuration, see `ConfigureDnsSettings`
1527    *   <li>To update contact information, see `ConfigureContactSettings`
1528    * </ul>
1529    *
1530    * <p>Sample code:
1531    *
1532    * <pre>{@code
1533    * // This snippet has been automatically generated and should be regarded as a code template only.
1534    * // It will require modifications to work:
1535    * // - It may require correct/in-range values for request initialization.
1536    * // - It may require specifying regional endpoints when creating the service client as shown in
1537    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1538    * try (DomainsClient domainsClient = DomainsClient.create()) {
1539    *   UpdateRegistrationRequest request =
1540    *       UpdateRegistrationRequest.newBuilder()
1541    *           .setRegistration(Registration.newBuilder().build())
1542    *           .setUpdateMask(FieldMask.newBuilder().build())
1543    *           .build();
1544    *   ApiFuture<Operation> future = domainsClient.updateRegistrationCallable().futureCall(request);
1545    *   // Do something.
1546    *   Operation response = future.get();
1547    * }
1548    * }</pre>
1549    */
updateRegistrationCallable()1550   public final UnaryCallable<UpdateRegistrationRequest, Operation> updateRegistrationCallable() {
1551     return stub.updateRegistrationCallable();
1552   }
1553 
1554   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1555   /**
1556    * Updates a `Registration`'s management settings.
1557    *
1558    * <p>Sample code:
1559    *
1560    * <pre>{@code
1561    * // This snippet has been automatically generated and should be regarded as a code template only.
1562    * // It will require modifications to work:
1563    * // - It may require correct/in-range values for request initialization.
1564    * // - It may require specifying regional endpoints when creating the service client as shown in
1565    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1566    * try (DomainsClient domainsClient = DomainsClient.create()) {
1567    *   RegistrationName registration =
1568    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
1569    *   ManagementSettings managementSettings = ManagementSettings.newBuilder().build();
1570    *   FieldMask updateMask = FieldMask.newBuilder().build();
1571    *   Registration response =
1572    *       domainsClient
1573    *           .configureManagementSettingsAsync(registration, managementSettings, updateMask)
1574    *           .get();
1575    * }
1576    * }</pre>
1577    *
1578    * @param registration Required. The name of the `Registration` whose management settings are
1579    *     being updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1580    * @param managementSettings Fields of the `ManagementSettings` to update.
1581    * @param updateMask Required. The field mask describing which fields to update as a
1582    *     comma-separated list. For example, if only the transfer lock is being updated, the
1583    *     `update_mask` is `"transfer_lock_state"`.
1584    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1585    */
configureManagementSettingsAsync( RegistrationName registration, ManagementSettings managementSettings, FieldMask updateMask)1586   public final OperationFuture<Registration, OperationMetadata> configureManagementSettingsAsync(
1587       RegistrationName registration, ManagementSettings managementSettings, FieldMask updateMask) {
1588     ConfigureManagementSettingsRequest request =
1589         ConfigureManagementSettingsRequest.newBuilder()
1590             .setRegistration(registration == null ? null : registration.toString())
1591             .setManagementSettings(managementSettings)
1592             .setUpdateMask(updateMask)
1593             .build();
1594     return configureManagementSettingsAsync(request);
1595   }
1596 
1597   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1598   /**
1599    * Updates a `Registration`'s management settings.
1600    *
1601    * <p>Sample code:
1602    *
1603    * <pre>{@code
1604    * // This snippet has been automatically generated and should be regarded as a code template only.
1605    * // It will require modifications to work:
1606    * // - It may require correct/in-range values for request initialization.
1607    * // - It may require specifying regional endpoints when creating the service client as shown in
1608    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1609    * try (DomainsClient domainsClient = DomainsClient.create()) {
1610    *   String registration =
1611    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
1612    *   ManagementSettings managementSettings = ManagementSettings.newBuilder().build();
1613    *   FieldMask updateMask = FieldMask.newBuilder().build();
1614    *   Registration response =
1615    *       domainsClient
1616    *           .configureManagementSettingsAsync(registration, managementSettings, updateMask)
1617    *           .get();
1618    * }
1619    * }</pre>
1620    *
1621    * @param registration Required. The name of the `Registration` whose management settings are
1622    *     being updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1623    * @param managementSettings Fields of the `ManagementSettings` to update.
1624    * @param updateMask Required. The field mask describing which fields to update as a
1625    *     comma-separated list. For example, if only the transfer lock is being updated, the
1626    *     `update_mask` is `"transfer_lock_state"`.
1627    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1628    */
configureManagementSettingsAsync( String registration, ManagementSettings managementSettings, FieldMask updateMask)1629   public final OperationFuture<Registration, OperationMetadata> configureManagementSettingsAsync(
1630       String registration, ManagementSettings managementSettings, FieldMask updateMask) {
1631     ConfigureManagementSettingsRequest request =
1632         ConfigureManagementSettingsRequest.newBuilder()
1633             .setRegistration(registration)
1634             .setManagementSettings(managementSettings)
1635             .setUpdateMask(updateMask)
1636             .build();
1637     return configureManagementSettingsAsync(request);
1638   }
1639 
1640   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1641   /**
1642    * Updates a `Registration`'s management settings.
1643    *
1644    * <p>Sample code:
1645    *
1646    * <pre>{@code
1647    * // This snippet has been automatically generated and should be regarded as a code template only.
1648    * // It will require modifications to work:
1649    * // - It may require correct/in-range values for request initialization.
1650    * // - It may require specifying regional endpoints when creating the service client as shown in
1651    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1652    * try (DomainsClient domainsClient = DomainsClient.create()) {
1653    *   ConfigureManagementSettingsRequest request =
1654    *       ConfigureManagementSettingsRequest.newBuilder()
1655    *           .setRegistration(
1656    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1657    *           .setManagementSettings(ManagementSettings.newBuilder().build())
1658    *           .setUpdateMask(FieldMask.newBuilder().build())
1659    *           .build();
1660    *   Registration response = domainsClient.configureManagementSettingsAsync(request).get();
1661    * }
1662    * }</pre>
1663    *
1664    * @param request The request object containing all of the parameters for the API call.
1665    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1666    */
configureManagementSettingsAsync( ConfigureManagementSettingsRequest request)1667   public final OperationFuture<Registration, OperationMetadata> configureManagementSettingsAsync(
1668       ConfigureManagementSettingsRequest request) {
1669     return configureManagementSettingsOperationCallable().futureCall(request);
1670   }
1671 
1672   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1673   /**
1674    * Updates a `Registration`'s management settings.
1675    *
1676    * <p>Sample code:
1677    *
1678    * <pre>{@code
1679    * // This snippet has been automatically generated and should be regarded as a code template only.
1680    * // It will require modifications to work:
1681    * // - It may require correct/in-range values for request initialization.
1682    * // - It may require specifying regional endpoints when creating the service client as shown in
1683    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1684    * try (DomainsClient domainsClient = DomainsClient.create()) {
1685    *   ConfigureManagementSettingsRequest request =
1686    *       ConfigureManagementSettingsRequest.newBuilder()
1687    *           .setRegistration(
1688    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1689    *           .setManagementSettings(ManagementSettings.newBuilder().build())
1690    *           .setUpdateMask(FieldMask.newBuilder().build())
1691    *           .build();
1692    *   OperationFuture<Registration, OperationMetadata> future =
1693    *       domainsClient.configureManagementSettingsOperationCallable().futureCall(request);
1694    *   // Do something.
1695    *   Registration response = future.get();
1696    * }
1697    * }</pre>
1698    */
1699   public final OperationCallable<
1700           ConfigureManagementSettingsRequest, Registration, OperationMetadata>
configureManagementSettingsOperationCallable()1701       configureManagementSettingsOperationCallable() {
1702     return stub.configureManagementSettingsOperationCallable();
1703   }
1704 
1705   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1706   /**
1707    * Updates a `Registration`'s management settings.
1708    *
1709    * <p>Sample code:
1710    *
1711    * <pre>{@code
1712    * // This snippet has been automatically generated and should be regarded as a code template only.
1713    * // It will require modifications to work:
1714    * // - It may require correct/in-range values for request initialization.
1715    * // - It may require specifying regional endpoints when creating the service client as shown in
1716    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1717    * try (DomainsClient domainsClient = DomainsClient.create()) {
1718    *   ConfigureManagementSettingsRequest request =
1719    *       ConfigureManagementSettingsRequest.newBuilder()
1720    *           .setRegistration(
1721    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1722    *           .setManagementSettings(ManagementSettings.newBuilder().build())
1723    *           .setUpdateMask(FieldMask.newBuilder().build())
1724    *           .build();
1725    *   ApiFuture<Operation> future =
1726    *       domainsClient.configureManagementSettingsCallable().futureCall(request);
1727    *   // Do something.
1728    *   Operation response = future.get();
1729    * }
1730    * }</pre>
1731    */
1732   public final UnaryCallable<ConfigureManagementSettingsRequest, Operation>
configureManagementSettingsCallable()1733       configureManagementSettingsCallable() {
1734     return stub.configureManagementSettingsCallable();
1735   }
1736 
1737   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1738   /**
1739    * Updates a `Registration`'s DNS settings.
1740    *
1741    * <p>Sample code:
1742    *
1743    * <pre>{@code
1744    * // This snippet has been automatically generated and should be regarded as a code template only.
1745    * // It will require modifications to work:
1746    * // - It may require correct/in-range values for request initialization.
1747    * // - It may require specifying regional endpoints when creating the service client as shown in
1748    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1749    * try (DomainsClient domainsClient = DomainsClient.create()) {
1750    *   RegistrationName registration =
1751    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
1752    *   DnsSettings dnsSettings = DnsSettings.newBuilder().build();
1753    *   FieldMask updateMask = FieldMask.newBuilder().build();
1754    *   Registration response =
1755    *       domainsClient.configureDnsSettingsAsync(registration, dnsSettings, updateMask).get();
1756    * }
1757    * }</pre>
1758    *
1759    * @param registration Required. The name of the `Registration` whose DNS settings are being
1760    *     updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1761    * @param dnsSettings Fields of the `DnsSettings` to update.
1762    * @param updateMask Required. The field mask describing which fields to update as a
1763    *     comma-separated list. For example, if only the name servers are being updated for an
1764    *     existing Custom DNS configuration, the `update_mask` is `"custom_dns.name_servers"`.
1765    *     <p>When changing the DNS provider from one type to another, pass the new provider's field
1766    *     name as part of the field mask. For example, when changing from a Google Domains DNS
1767    *     configuration to a Custom DNS configuration, the `update_mask` is `"custom_dns"`. //
1768    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1769    */
configureDnsSettingsAsync( RegistrationName registration, DnsSettings dnsSettings, FieldMask updateMask)1770   public final OperationFuture<Registration, OperationMetadata> configureDnsSettingsAsync(
1771       RegistrationName registration, DnsSettings dnsSettings, FieldMask updateMask) {
1772     ConfigureDnsSettingsRequest request =
1773         ConfigureDnsSettingsRequest.newBuilder()
1774             .setRegistration(registration == null ? null : registration.toString())
1775             .setDnsSettings(dnsSettings)
1776             .setUpdateMask(updateMask)
1777             .build();
1778     return configureDnsSettingsAsync(request);
1779   }
1780 
1781   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1782   /**
1783    * Updates a `Registration`'s DNS settings.
1784    *
1785    * <p>Sample code:
1786    *
1787    * <pre>{@code
1788    * // This snippet has been automatically generated and should be regarded as a code template only.
1789    * // It will require modifications to work:
1790    * // - It may require correct/in-range values for request initialization.
1791    * // - It may require specifying regional endpoints when creating the service client as shown in
1792    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1793    * try (DomainsClient domainsClient = DomainsClient.create()) {
1794    *   String registration =
1795    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
1796    *   DnsSettings dnsSettings = DnsSettings.newBuilder().build();
1797    *   FieldMask updateMask = FieldMask.newBuilder().build();
1798    *   Registration response =
1799    *       domainsClient.configureDnsSettingsAsync(registration, dnsSettings, updateMask).get();
1800    * }
1801    * }</pre>
1802    *
1803    * @param registration Required. The name of the `Registration` whose DNS settings are being
1804    *     updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1805    * @param dnsSettings Fields of the `DnsSettings` to update.
1806    * @param updateMask Required. The field mask describing which fields to update as a
1807    *     comma-separated list. For example, if only the name servers are being updated for an
1808    *     existing Custom DNS configuration, the `update_mask` is `"custom_dns.name_servers"`.
1809    *     <p>When changing the DNS provider from one type to another, pass the new provider's field
1810    *     name as part of the field mask. For example, when changing from a Google Domains DNS
1811    *     configuration to a Custom DNS configuration, the `update_mask` is `"custom_dns"`. //
1812    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1813    */
configureDnsSettingsAsync( String registration, DnsSettings dnsSettings, FieldMask updateMask)1814   public final OperationFuture<Registration, OperationMetadata> configureDnsSettingsAsync(
1815       String registration, DnsSettings dnsSettings, FieldMask updateMask) {
1816     ConfigureDnsSettingsRequest request =
1817         ConfigureDnsSettingsRequest.newBuilder()
1818             .setRegistration(registration)
1819             .setDnsSettings(dnsSettings)
1820             .setUpdateMask(updateMask)
1821             .build();
1822     return configureDnsSettingsAsync(request);
1823   }
1824 
1825   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1826   /**
1827    * Updates a `Registration`'s DNS settings.
1828    *
1829    * <p>Sample code:
1830    *
1831    * <pre>{@code
1832    * // This snippet has been automatically generated and should be regarded as a code template only.
1833    * // It will require modifications to work:
1834    * // - It may require correct/in-range values for request initialization.
1835    * // - It may require specifying regional endpoints when creating the service client as shown in
1836    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1837    * try (DomainsClient domainsClient = DomainsClient.create()) {
1838    *   ConfigureDnsSettingsRequest request =
1839    *       ConfigureDnsSettingsRequest.newBuilder()
1840    *           .setRegistration(
1841    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1842    *           .setDnsSettings(DnsSettings.newBuilder().build())
1843    *           .setUpdateMask(FieldMask.newBuilder().build())
1844    *           .setValidateOnly(true)
1845    *           .build();
1846    *   Registration response = domainsClient.configureDnsSettingsAsync(request).get();
1847    * }
1848    * }</pre>
1849    *
1850    * @param request The request object containing all of the parameters for the API call.
1851    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1852    */
configureDnsSettingsAsync( ConfigureDnsSettingsRequest request)1853   public final OperationFuture<Registration, OperationMetadata> configureDnsSettingsAsync(
1854       ConfigureDnsSettingsRequest request) {
1855     return configureDnsSettingsOperationCallable().futureCall(request);
1856   }
1857 
1858   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1859   /**
1860    * Updates a `Registration`'s DNS settings.
1861    *
1862    * <p>Sample code:
1863    *
1864    * <pre>{@code
1865    * // This snippet has been automatically generated and should be regarded as a code template only.
1866    * // It will require modifications to work:
1867    * // - It may require correct/in-range values for request initialization.
1868    * // - It may require specifying regional endpoints when creating the service client as shown in
1869    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1870    * try (DomainsClient domainsClient = DomainsClient.create()) {
1871    *   ConfigureDnsSettingsRequest request =
1872    *       ConfigureDnsSettingsRequest.newBuilder()
1873    *           .setRegistration(
1874    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1875    *           .setDnsSettings(DnsSettings.newBuilder().build())
1876    *           .setUpdateMask(FieldMask.newBuilder().build())
1877    *           .setValidateOnly(true)
1878    *           .build();
1879    *   OperationFuture<Registration, OperationMetadata> future =
1880    *       domainsClient.configureDnsSettingsOperationCallable().futureCall(request);
1881    *   // Do something.
1882    *   Registration response = future.get();
1883    * }
1884    * }</pre>
1885    */
1886   public final OperationCallable<ConfigureDnsSettingsRequest, Registration, OperationMetadata>
configureDnsSettingsOperationCallable()1887       configureDnsSettingsOperationCallable() {
1888     return stub.configureDnsSettingsOperationCallable();
1889   }
1890 
1891   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1892   /**
1893    * Updates a `Registration`'s DNS settings.
1894    *
1895    * <p>Sample code:
1896    *
1897    * <pre>{@code
1898    * // This snippet has been automatically generated and should be regarded as a code template only.
1899    * // It will require modifications to work:
1900    * // - It may require correct/in-range values for request initialization.
1901    * // - It may require specifying regional endpoints when creating the service client as shown in
1902    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1903    * try (DomainsClient domainsClient = DomainsClient.create()) {
1904    *   ConfigureDnsSettingsRequest request =
1905    *       ConfigureDnsSettingsRequest.newBuilder()
1906    *           .setRegistration(
1907    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
1908    *           .setDnsSettings(DnsSettings.newBuilder().build())
1909    *           .setUpdateMask(FieldMask.newBuilder().build())
1910    *           .setValidateOnly(true)
1911    *           .build();
1912    *   ApiFuture<Operation> future =
1913    *       domainsClient.configureDnsSettingsCallable().futureCall(request);
1914    *   // Do something.
1915    *   Operation response = future.get();
1916    * }
1917    * }</pre>
1918    */
1919   public final UnaryCallable<ConfigureDnsSettingsRequest, Operation>
configureDnsSettingsCallable()1920       configureDnsSettingsCallable() {
1921     return stub.configureDnsSettingsCallable();
1922   }
1923 
1924   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1925   /**
1926    * Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's
1927    * registrant contact .
1928    *
1929    * <p>Sample code:
1930    *
1931    * <pre>{@code
1932    * // This snippet has been automatically generated and should be regarded as a code template only.
1933    * // It will require modifications to work:
1934    * // - It may require correct/in-range values for request initialization.
1935    * // - It may require specifying regional endpoints when creating the service client as shown in
1936    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1937    * try (DomainsClient domainsClient = DomainsClient.create()) {
1938    *   RegistrationName registration =
1939    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
1940    *   ContactSettings contactSettings = ContactSettings.newBuilder().build();
1941    *   FieldMask updateMask = FieldMask.newBuilder().build();
1942    *   Registration response =
1943    *       domainsClient
1944    *           .configureContactSettingsAsync(registration, contactSettings, updateMask)
1945    *           .get();
1946    * }
1947    * }</pre>
1948    *
1949    * @param registration Required. The name of the `Registration` whose contact settings are being
1950    *     updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1951    * @param contactSettings Fields of the `ContactSettings` to update.
1952    * @param updateMask Required. The field mask describing which fields to update as a
1953    *     comma-separated list. For example, if only the registrant contact is being updated, the
1954    *     `update_mask` is `"registrant_contact"`.
1955    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1956    */
configureContactSettingsAsync( RegistrationName registration, ContactSettings contactSettings, FieldMask updateMask)1957   public final OperationFuture<Registration, OperationMetadata> configureContactSettingsAsync(
1958       RegistrationName registration, ContactSettings contactSettings, FieldMask updateMask) {
1959     ConfigureContactSettingsRequest request =
1960         ConfigureContactSettingsRequest.newBuilder()
1961             .setRegistration(registration == null ? null : registration.toString())
1962             .setContactSettings(contactSettings)
1963             .setUpdateMask(updateMask)
1964             .build();
1965     return configureContactSettingsAsync(request);
1966   }
1967 
1968   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1969   /**
1970    * Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's
1971    * registrant contact .
1972    *
1973    * <p>Sample code:
1974    *
1975    * <pre>{@code
1976    * // This snippet has been automatically generated and should be regarded as a code template only.
1977    * // It will require modifications to work:
1978    * // - It may require correct/in-range values for request initialization.
1979    * // - It may require specifying regional endpoints when creating the service client as shown in
1980    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1981    * try (DomainsClient domainsClient = DomainsClient.create()) {
1982    *   String registration =
1983    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
1984    *   ContactSettings contactSettings = ContactSettings.newBuilder().build();
1985    *   FieldMask updateMask = FieldMask.newBuilder().build();
1986    *   Registration response =
1987    *       domainsClient
1988    *           .configureContactSettingsAsync(registration, contactSettings, updateMask)
1989    *           .get();
1990    * }
1991    * }</pre>
1992    *
1993    * @param registration Required. The name of the `Registration` whose contact settings are being
1994    *     updated, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
1995    * @param contactSettings Fields of the `ContactSettings` to update.
1996    * @param updateMask Required. The field mask describing which fields to update as a
1997    *     comma-separated list. For example, if only the registrant contact is being updated, the
1998    *     `update_mask` is `"registrant_contact"`.
1999    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2000    */
configureContactSettingsAsync( String registration, ContactSettings contactSettings, FieldMask updateMask)2001   public final OperationFuture<Registration, OperationMetadata> configureContactSettingsAsync(
2002       String registration, ContactSettings contactSettings, FieldMask updateMask) {
2003     ConfigureContactSettingsRequest request =
2004         ConfigureContactSettingsRequest.newBuilder()
2005             .setRegistration(registration)
2006             .setContactSettings(contactSettings)
2007             .setUpdateMask(updateMask)
2008             .build();
2009     return configureContactSettingsAsync(request);
2010   }
2011 
2012   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2013   /**
2014    * Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's
2015    * registrant contact .
2016    *
2017    * <p>Sample code:
2018    *
2019    * <pre>{@code
2020    * // This snippet has been automatically generated and should be regarded as a code template only.
2021    * // It will require modifications to work:
2022    * // - It may require correct/in-range values for request initialization.
2023    * // - It may require specifying regional endpoints when creating the service client as shown in
2024    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2025    * try (DomainsClient domainsClient = DomainsClient.create()) {
2026    *   ConfigureContactSettingsRequest request =
2027    *       ConfigureContactSettingsRequest.newBuilder()
2028    *           .setRegistration(
2029    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2030    *           .setContactSettings(ContactSettings.newBuilder().build())
2031    *           .setUpdateMask(FieldMask.newBuilder().build())
2032    *           .addAllContactNotices(new ArrayList<ContactNotice>())
2033    *           .setValidateOnly(true)
2034    *           .build();
2035    *   Registration response = domainsClient.configureContactSettingsAsync(request).get();
2036    * }
2037    * }</pre>
2038    *
2039    * @param request The request object containing all of the parameters for the API call.
2040    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2041    */
configureContactSettingsAsync( ConfigureContactSettingsRequest request)2042   public final OperationFuture<Registration, OperationMetadata> configureContactSettingsAsync(
2043       ConfigureContactSettingsRequest request) {
2044     return configureContactSettingsOperationCallable().futureCall(request);
2045   }
2046 
2047   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2048   /**
2049    * Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's
2050    * registrant contact .
2051    *
2052    * <p>Sample code:
2053    *
2054    * <pre>{@code
2055    * // This snippet has been automatically generated and should be regarded as a code template only.
2056    * // It will require modifications to work:
2057    * // - It may require correct/in-range values for request initialization.
2058    * // - It may require specifying regional endpoints when creating the service client as shown in
2059    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2060    * try (DomainsClient domainsClient = DomainsClient.create()) {
2061    *   ConfigureContactSettingsRequest request =
2062    *       ConfigureContactSettingsRequest.newBuilder()
2063    *           .setRegistration(
2064    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2065    *           .setContactSettings(ContactSettings.newBuilder().build())
2066    *           .setUpdateMask(FieldMask.newBuilder().build())
2067    *           .addAllContactNotices(new ArrayList<ContactNotice>())
2068    *           .setValidateOnly(true)
2069    *           .build();
2070    *   OperationFuture<Registration, OperationMetadata> future =
2071    *       domainsClient.configureContactSettingsOperationCallable().futureCall(request);
2072    *   // Do something.
2073    *   Registration response = future.get();
2074    * }
2075    * }</pre>
2076    */
2077   public final OperationCallable<ConfigureContactSettingsRequest, Registration, OperationMetadata>
configureContactSettingsOperationCallable()2078       configureContactSettingsOperationCallable() {
2079     return stub.configureContactSettingsOperationCallable();
2080   }
2081 
2082   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2083   /**
2084    * Updates a `Registration`'s contact settings. Some changes require confirmation by the domain's
2085    * registrant contact .
2086    *
2087    * <p>Sample code:
2088    *
2089    * <pre>{@code
2090    * // This snippet has been automatically generated and should be regarded as a code template only.
2091    * // It will require modifications to work:
2092    * // - It may require correct/in-range values for request initialization.
2093    * // - It may require specifying regional endpoints when creating the service client as shown in
2094    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2095    * try (DomainsClient domainsClient = DomainsClient.create()) {
2096    *   ConfigureContactSettingsRequest request =
2097    *       ConfigureContactSettingsRequest.newBuilder()
2098    *           .setRegistration(
2099    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2100    *           .setContactSettings(ContactSettings.newBuilder().build())
2101    *           .setUpdateMask(FieldMask.newBuilder().build())
2102    *           .addAllContactNotices(new ArrayList<ContactNotice>())
2103    *           .setValidateOnly(true)
2104    *           .build();
2105    *   ApiFuture<Operation> future =
2106    *       domainsClient.configureContactSettingsCallable().futureCall(request);
2107    *   // Do something.
2108    *   Operation response = future.get();
2109    * }
2110    * }</pre>
2111    */
2112   public final UnaryCallable<ConfigureContactSettingsRequest, Operation>
configureContactSettingsCallable()2113       configureContactSettingsCallable() {
2114     return stub.configureContactSettingsCallable();
2115   }
2116 
2117   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2118   /**
2119    * Exports a `Registration` resource, such that it is no longer managed by Cloud Domains.
2120    *
2121    * <p>When an active domain is successfully exported, you can continue to use the domain in
2122    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2123    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2124    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2125    * Domains.
2126    *
2127    * <p>Sample code:
2128    *
2129    * <pre>{@code
2130    * // This snippet has been automatically generated and should be regarded as a code template only.
2131    * // It will require modifications to work:
2132    * // - It may require correct/in-range values for request initialization.
2133    * // - It may require specifying regional endpoints when creating the service client as shown in
2134    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2135    * try (DomainsClient domainsClient = DomainsClient.create()) {
2136    *   RegistrationName name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
2137    *   Registration response = domainsClient.exportRegistrationAsync(name).get();
2138    * }
2139    * }</pre>
2140    *
2141    * @param name Required. The name of the `Registration` to export, in the format
2142    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
2143    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2144    */
exportRegistrationAsync( RegistrationName name)2145   public final OperationFuture<Registration, OperationMetadata> exportRegistrationAsync(
2146       RegistrationName name) {
2147     ExportRegistrationRequest request =
2148         ExportRegistrationRequest.newBuilder()
2149             .setName(name == null ? null : name.toString())
2150             .build();
2151     return exportRegistrationAsync(request);
2152   }
2153 
2154   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2155   /**
2156    * Exports a `Registration` resource, such that it is no longer managed by Cloud Domains.
2157    *
2158    * <p>When an active domain is successfully exported, you can continue to use the domain in
2159    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2160    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2161    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2162    * Domains.
2163    *
2164    * <p>Sample code:
2165    *
2166    * <pre>{@code
2167    * // This snippet has been automatically generated and should be regarded as a code template only.
2168    * // It will require modifications to work:
2169    * // - It may require correct/in-range values for request initialization.
2170    * // - It may require specifying regional endpoints when creating the service client as shown in
2171    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2172    * try (DomainsClient domainsClient = DomainsClient.create()) {
2173    *   String name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
2174    *   Registration response = domainsClient.exportRegistrationAsync(name).get();
2175    * }
2176    * }</pre>
2177    *
2178    * @param name Required. The name of the `Registration` to export, in the format
2179    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
2180    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2181    */
exportRegistrationAsync( String name)2182   public final OperationFuture<Registration, OperationMetadata> exportRegistrationAsync(
2183       String name) {
2184     ExportRegistrationRequest request =
2185         ExportRegistrationRequest.newBuilder().setName(name).build();
2186     return exportRegistrationAsync(request);
2187   }
2188 
2189   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2190   /**
2191    * Exports a `Registration` resource, such that it is no longer managed by Cloud Domains.
2192    *
2193    * <p>When an active domain is successfully exported, you can continue to use the domain in
2194    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2195    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2196    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2197    * Domains.
2198    *
2199    * <p>Sample code:
2200    *
2201    * <pre>{@code
2202    * // This snippet has been automatically generated and should be regarded as a code template only.
2203    * // It will require modifications to work:
2204    * // - It may require correct/in-range values for request initialization.
2205    * // - It may require specifying regional endpoints when creating the service client as shown in
2206    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2207    * try (DomainsClient domainsClient = DomainsClient.create()) {
2208    *   ExportRegistrationRequest request =
2209    *       ExportRegistrationRequest.newBuilder()
2210    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2211    *           .build();
2212    *   Registration response = domainsClient.exportRegistrationAsync(request).get();
2213    * }
2214    * }</pre>
2215    *
2216    * @param request The request object containing all of the parameters for the API call.
2217    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2218    */
exportRegistrationAsync( ExportRegistrationRequest request)2219   public final OperationFuture<Registration, OperationMetadata> exportRegistrationAsync(
2220       ExportRegistrationRequest request) {
2221     return exportRegistrationOperationCallable().futureCall(request);
2222   }
2223 
2224   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2225   /**
2226    * Exports a `Registration` resource, such that it is no longer managed by Cloud Domains.
2227    *
2228    * <p>When an active domain is successfully exported, you can continue to use the domain in
2229    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2230    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2231    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2232    * Domains.
2233    *
2234    * <p>Sample code:
2235    *
2236    * <pre>{@code
2237    * // This snippet has been automatically generated and should be regarded as a code template only.
2238    * // It will require modifications to work:
2239    * // - It may require correct/in-range values for request initialization.
2240    * // - It may require specifying regional endpoints when creating the service client as shown in
2241    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2242    * try (DomainsClient domainsClient = DomainsClient.create()) {
2243    *   ExportRegistrationRequest request =
2244    *       ExportRegistrationRequest.newBuilder()
2245    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2246    *           .build();
2247    *   OperationFuture<Registration, OperationMetadata> future =
2248    *       domainsClient.exportRegistrationOperationCallable().futureCall(request);
2249    *   // Do something.
2250    *   Registration response = future.get();
2251    * }
2252    * }</pre>
2253    */
2254   public final OperationCallable<ExportRegistrationRequest, Registration, OperationMetadata>
exportRegistrationOperationCallable()2255       exportRegistrationOperationCallable() {
2256     return stub.exportRegistrationOperationCallable();
2257   }
2258 
2259   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2260   /**
2261    * Exports a `Registration` resource, such that it is no longer managed by Cloud Domains.
2262    *
2263    * <p>When an active domain is successfully exported, you can continue to use the domain in
2264    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2265    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2266    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2267    * Domains.
2268    *
2269    * <p>Sample code:
2270    *
2271    * <pre>{@code
2272    * // This snippet has been automatically generated and should be regarded as a code template only.
2273    * // It will require modifications to work:
2274    * // - It may require correct/in-range values for request initialization.
2275    * // - It may require specifying regional endpoints when creating the service client as shown in
2276    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2277    * try (DomainsClient domainsClient = DomainsClient.create()) {
2278    *   ExportRegistrationRequest request =
2279    *       ExportRegistrationRequest.newBuilder()
2280    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2281    *           .build();
2282    *   ApiFuture<Operation> future = domainsClient.exportRegistrationCallable().futureCall(request);
2283    *   // Do something.
2284    *   Operation response = future.get();
2285    * }
2286    * }</pre>
2287    */
exportRegistrationCallable()2288   public final UnaryCallable<ExportRegistrationRequest, Operation> exportRegistrationCallable() {
2289     return stub.exportRegistrationCallable();
2290   }
2291 
2292   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2293   /**
2294    * Deletes a `Registration` resource.
2295    *
2296    * <p>This method works on any `Registration` resource using [Subscription or Commitment
2297    * billing](/domains/pricing#billing-models), provided that the resource was created at least 1
2298    * day in the past.
2299    *
2300    * <p>For `Registration` resources using [Monthly billing](/domains/pricing#billing-models), this
2301    * method works if:
2302    *
2303    * <ul>
2304    *   <li>`state` is `EXPORTED` with `expire_time` in the past
2305    *   <li>`state` is `REGISTRATION_FAILED`
2306    *   <li>`state` is `TRANSFER_FAILED`
2307    * </ul>
2308    *
2309    * <p>When an active registration is successfully deleted, you can continue to use the domain in
2310    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2311    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2312    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2313    * Domains.
2314    *
2315    * <p>Sample code:
2316    *
2317    * <pre>{@code
2318    * // This snippet has been automatically generated and should be regarded as a code template only.
2319    * // It will require modifications to work:
2320    * // - It may require correct/in-range values for request initialization.
2321    * // - It may require specifying regional endpoints when creating the service client as shown in
2322    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2323    * try (DomainsClient domainsClient = DomainsClient.create()) {
2324    *   RegistrationName name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
2325    *   domainsClient.deleteRegistrationAsync(name).get();
2326    * }
2327    * }</pre>
2328    *
2329    * @param name Required. The name of the `Registration` to delete, in the format
2330    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
2331    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2332    */
deleteRegistrationAsync( RegistrationName name)2333   public final OperationFuture<Empty, OperationMetadata> deleteRegistrationAsync(
2334       RegistrationName name) {
2335     DeleteRegistrationRequest request =
2336         DeleteRegistrationRequest.newBuilder()
2337             .setName(name == null ? null : name.toString())
2338             .build();
2339     return deleteRegistrationAsync(request);
2340   }
2341 
2342   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2343   /**
2344    * Deletes a `Registration` resource.
2345    *
2346    * <p>This method works on any `Registration` resource using [Subscription or Commitment
2347    * billing](/domains/pricing#billing-models), provided that the resource was created at least 1
2348    * day in the past.
2349    *
2350    * <p>For `Registration` resources using [Monthly billing](/domains/pricing#billing-models), this
2351    * method works if:
2352    *
2353    * <ul>
2354    *   <li>`state` is `EXPORTED` with `expire_time` in the past
2355    *   <li>`state` is `REGISTRATION_FAILED`
2356    *   <li>`state` is `TRANSFER_FAILED`
2357    * </ul>
2358    *
2359    * <p>When an active registration is successfully deleted, you can continue to use the domain in
2360    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2361    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2362    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2363    * Domains.
2364    *
2365    * <p>Sample code:
2366    *
2367    * <pre>{@code
2368    * // This snippet has been automatically generated and should be regarded as a code template only.
2369    * // It will require modifications to work:
2370    * // - It may require correct/in-range values for request initialization.
2371    * // - It may require specifying regional endpoints when creating the service client as shown in
2372    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2373    * try (DomainsClient domainsClient = DomainsClient.create()) {
2374    *   String name = RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
2375    *   domainsClient.deleteRegistrationAsync(name).get();
2376    * }
2377    * }</pre>
2378    *
2379    * @param name Required. The name of the `Registration` to delete, in the format
2380    *     `projects/&#42;/locations/&#42;/registrations/&#42;`.
2381    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2382    */
deleteRegistrationAsync(String name)2383   public final OperationFuture<Empty, OperationMetadata> deleteRegistrationAsync(String name) {
2384     DeleteRegistrationRequest request =
2385         DeleteRegistrationRequest.newBuilder().setName(name).build();
2386     return deleteRegistrationAsync(request);
2387   }
2388 
2389   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2390   /**
2391    * Deletes a `Registration` resource.
2392    *
2393    * <p>This method works on any `Registration` resource using [Subscription or Commitment
2394    * billing](/domains/pricing#billing-models), provided that the resource was created at least 1
2395    * day in the past.
2396    *
2397    * <p>For `Registration` resources using [Monthly billing](/domains/pricing#billing-models), this
2398    * method works if:
2399    *
2400    * <ul>
2401    *   <li>`state` is `EXPORTED` with `expire_time` in the past
2402    *   <li>`state` is `REGISTRATION_FAILED`
2403    *   <li>`state` is `TRANSFER_FAILED`
2404    * </ul>
2405    *
2406    * <p>When an active registration is successfully deleted, you can continue to use the domain in
2407    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2408    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2409    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2410    * Domains.
2411    *
2412    * <p>Sample code:
2413    *
2414    * <pre>{@code
2415    * // This snippet has been automatically generated and should be regarded as a code template only.
2416    * // It will require modifications to work:
2417    * // - It may require correct/in-range values for request initialization.
2418    * // - It may require specifying regional endpoints when creating the service client as shown in
2419    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2420    * try (DomainsClient domainsClient = DomainsClient.create()) {
2421    *   DeleteRegistrationRequest request =
2422    *       DeleteRegistrationRequest.newBuilder()
2423    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2424    *           .build();
2425    *   domainsClient.deleteRegistrationAsync(request).get();
2426    * }
2427    * }</pre>
2428    *
2429    * @param request The request object containing all of the parameters for the API call.
2430    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2431    */
deleteRegistrationAsync( DeleteRegistrationRequest request)2432   public final OperationFuture<Empty, OperationMetadata> deleteRegistrationAsync(
2433       DeleteRegistrationRequest request) {
2434     return deleteRegistrationOperationCallable().futureCall(request);
2435   }
2436 
2437   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2438   /**
2439    * Deletes a `Registration` resource.
2440    *
2441    * <p>This method works on any `Registration` resource using [Subscription or Commitment
2442    * billing](/domains/pricing#billing-models), provided that the resource was created at least 1
2443    * day in the past.
2444    *
2445    * <p>For `Registration` resources using [Monthly billing](/domains/pricing#billing-models), this
2446    * method works if:
2447    *
2448    * <ul>
2449    *   <li>`state` is `EXPORTED` with `expire_time` in the past
2450    *   <li>`state` is `REGISTRATION_FAILED`
2451    *   <li>`state` is `TRANSFER_FAILED`
2452    * </ul>
2453    *
2454    * <p>When an active registration is successfully deleted, you can continue to use the domain in
2455    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2456    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2457    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2458    * Domains.
2459    *
2460    * <p>Sample code:
2461    *
2462    * <pre>{@code
2463    * // This snippet has been automatically generated and should be regarded as a code template only.
2464    * // It will require modifications to work:
2465    * // - It may require correct/in-range values for request initialization.
2466    * // - It may require specifying regional endpoints when creating the service client as shown in
2467    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2468    * try (DomainsClient domainsClient = DomainsClient.create()) {
2469    *   DeleteRegistrationRequest request =
2470    *       DeleteRegistrationRequest.newBuilder()
2471    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2472    *           .build();
2473    *   OperationFuture<Empty, OperationMetadata> future =
2474    *       domainsClient.deleteRegistrationOperationCallable().futureCall(request);
2475    *   // Do something.
2476    *   future.get();
2477    * }
2478    * }</pre>
2479    */
2480   public final OperationCallable<DeleteRegistrationRequest, Empty, OperationMetadata>
deleteRegistrationOperationCallable()2481       deleteRegistrationOperationCallable() {
2482     return stub.deleteRegistrationOperationCallable();
2483   }
2484 
2485   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2486   /**
2487    * Deletes a `Registration` resource.
2488    *
2489    * <p>This method works on any `Registration` resource using [Subscription or Commitment
2490    * billing](/domains/pricing#billing-models), provided that the resource was created at least 1
2491    * day in the past.
2492    *
2493    * <p>For `Registration` resources using [Monthly billing](/domains/pricing#billing-models), this
2494    * method works if:
2495    *
2496    * <ul>
2497    *   <li>`state` is `EXPORTED` with `expire_time` in the past
2498    *   <li>`state` is `REGISTRATION_FAILED`
2499    *   <li>`state` is `TRANSFER_FAILED`
2500    * </ul>
2501    *
2502    * <p>When an active registration is successfully deleted, you can continue to use the domain in
2503    * [Google Domains](https://domains.google/) until it expires. The calling user becomes the
2504    * domain's sole owner in Google Domains, and permissions for the domain are subsequently managed
2505    * there. The domain does not renew automatically unless the new owner sets up billing in Google
2506    * Domains.
2507    *
2508    * <p>Sample code:
2509    *
2510    * <pre>{@code
2511    * // This snippet has been automatically generated and should be regarded as a code template only.
2512    * // It will require modifications to work:
2513    * // - It may require correct/in-range values for request initialization.
2514    * // - It may require specifying regional endpoints when creating the service client as shown in
2515    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2516    * try (DomainsClient domainsClient = DomainsClient.create()) {
2517    *   DeleteRegistrationRequest request =
2518    *       DeleteRegistrationRequest.newBuilder()
2519    *           .setName(RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2520    *           .build();
2521    *   ApiFuture<Operation> future = domainsClient.deleteRegistrationCallable().futureCall(request);
2522    *   // Do something.
2523    *   future.get();
2524    * }
2525    * }</pre>
2526    */
deleteRegistrationCallable()2527   public final UnaryCallable<DeleteRegistrationRequest, Operation> deleteRegistrationCallable() {
2528     return stub.deleteRegistrationCallable();
2529   }
2530 
2531   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2532   /**
2533    * Gets the authorization code of the `Registration` for the purpose of transferring the domain to
2534    * another registrar.
2535    *
2536    * <p>You can call this method only after 60 days have elapsed since the initial domain
2537    * registration.
2538    *
2539    * <p>Sample code:
2540    *
2541    * <pre>{@code
2542    * // This snippet has been automatically generated and should be regarded as a code template only.
2543    * // It will require modifications to work:
2544    * // - It may require correct/in-range values for request initialization.
2545    * // - It may require specifying regional endpoints when creating the service client as shown in
2546    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2547    * try (DomainsClient domainsClient = DomainsClient.create()) {
2548    *   RegistrationName registration =
2549    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
2550    *   AuthorizationCode response = domainsClient.retrieveAuthorizationCode(registration);
2551    * }
2552    * }</pre>
2553    *
2554    * @param registration Required. The name of the `Registration` whose authorization code is being
2555    *     retrieved, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
2556    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2557    */
retrieveAuthorizationCode(RegistrationName registration)2558   public final AuthorizationCode retrieveAuthorizationCode(RegistrationName registration) {
2559     RetrieveAuthorizationCodeRequest request =
2560         RetrieveAuthorizationCodeRequest.newBuilder()
2561             .setRegistration(registration == null ? null : registration.toString())
2562             .build();
2563     return retrieveAuthorizationCode(request);
2564   }
2565 
2566   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2567   /**
2568    * Gets the authorization code of the `Registration` for the purpose of transferring the domain to
2569    * another registrar.
2570    *
2571    * <p>You can call this method only after 60 days have elapsed since the initial domain
2572    * registration.
2573    *
2574    * <p>Sample code:
2575    *
2576    * <pre>{@code
2577    * // This snippet has been automatically generated and should be regarded as a code template only.
2578    * // It will require modifications to work:
2579    * // - It may require correct/in-range values for request initialization.
2580    * // - It may require specifying regional endpoints when creating the service client as shown in
2581    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2582    * try (DomainsClient domainsClient = DomainsClient.create()) {
2583    *   String registration =
2584    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
2585    *   AuthorizationCode response = domainsClient.retrieveAuthorizationCode(registration);
2586    * }
2587    * }</pre>
2588    *
2589    * @param registration Required. The name of the `Registration` whose authorization code is being
2590    *     retrieved, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
2591    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2592    */
retrieveAuthorizationCode(String registration)2593   public final AuthorizationCode retrieveAuthorizationCode(String registration) {
2594     RetrieveAuthorizationCodeRequest request =
2595         RetrieveAuthorizationCodeRequest.newBuilder().setRegistration(registration).build();
2596     return retrieveAuthorizationCode(request);
2597   }
2598 
2599   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2600   /**
2601    * Gets the authorization code of the `Registration` for the purpose of transferring the domain to
2602    * another registrar.
2603    *
2604    * <p>You can call this method only after 60 days have elapsed since the initial domain
2605    * registration.
2606    *
2607    * <p>Sample code:
2608    *
2609    * <pre>{@code
2610    * // This snippet has been automatically generated and should be regarded as a code template only.
2611    * // It will require modifications to work:
2612    * // - It may require correct/in-range values for request initialization.
2613    * // - It may require specifying regional endpoints when creating the service client as shown in
2614    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2615    * try (DomainsClient domainsClient = DomainsClient.create()) {
2616    *   RetrieveAuthorizationCodeRequest request =
2617    *       RetrieveAuthorizationCodeRequest.newBuilder()
2618    *           .setRegistration(
2619    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2620    *           .build();
2621    *   AuthorizationCode response = domainsClient.retrieveAuthorizationCode(request);
2622    * }
2623    * }</pre>
2624    *
2625    * @param request The request object containing all of the parameters for the API call.
2626    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2627    */
retrieveAuthorizationCode( RetrieveAuthorizationCodeRequest request)2628   public final AuthorizationCode retrieveAuthorizationCode(
2629       RetrieveAuthorizationCodeRequest request) {
2630     return retrieveAuthorizationCodeCallable().call(request);
2631   }
2632 
2633   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2634   /**
2635    * Gets the authorization code of the `Registration` for the purpose of transferring the domain to
2636    * another registrar.
2637    *
2638    * <p>You can call this method only after 60 days have elapsed since the initial domain
2639    * registration.
2640    *
2641    * <p>Sample code:
2642    *
2643    * <pre>{@code
2644    * // This snippet has been automatically generated and should be regarded as a code template only.
2645    * // It will require modifications to work:
2646    * // - It may require correct/in-range values for request initialization.
2647    * // - It may require specifying regional endpoints when creating the service client as shown in
2648    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2649    * try (DomainsClient domainsClient = DomainsClient.create()) {
2650    *   RetrieveAuthorizationCodeRequest request =
2651    *       RetrieveAuthorizationCodeRequest.newBuilder()
2652    *           .setRegistration(
2653    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2654    *           .build();
2655    *   ApiFuture<AuthorizationCode> future =
2656    *       domainsClient.retrieveAuthorizationCodeCallable().futureCall(request);
2657    *   // Do something.
2658    *   AuthorizationCode response = future.get();
2659    * }
2660    * }</pre>
2661    */
2662   public final UnaryCallable<RetrieveAuthorizationCodeRequest, AuthorizationCode>
retrieveAuthorizationCodeCallable()2663       retrieveAuthorizationCodeCallable() {
2664     return stub.retrieveAuthorizationCodeCallable();
2665   }
2666 
2667   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2668   /**
2669    * Resets the authorization code of the `Registration` to a new random string.
2670    *
2671    * <p>You can call this method only after 60 days have elapsed since the initial domain
2672    * registration.
2673    *
2674    * <p>Sample code:
2675    *
2676    * <pre>{@code
2677    * // This snippet has been automatically generated and should be regarded as a code template only.
2678    * // It will require modifications to work:
2679    * // - It may require correct/in-range values for request initialization.
2680    * // - It may require specifying regional endpoints when creating the service client as shown in
2681    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2682    * try (DomainsClient domainsClient = DomainsClient.create()) {
2683    *   RegistrationName registration =
2684    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]");
2685    *   AuthorizationCode response = domainsClient.resetAuthorizationCode(registration);
2686    * }
2687    * }</pre>
2688    *
2689    * @param registration Required. The name of the `Registration` whose authorization code is being
2690    *     reset, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
2691    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2692    */
resetAuthorizationCode(RegistrationName registration)2693   public final AuthorizationCode resetAuthorizationCode(RegistrationName registration) {
2694     ResetAuthorizationCodeRequest request =
2695         ResetAuthorizationCodeRequest.newBuilder()
2696             .setRegistration(registration == null ? null : registration.toString())
2697             .build();
2698     return resetAuthorizationCode(request);
2699   }
2700 
2701   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2702   /**
2703    * Resets the authorization code of the `Registration` to a new random string.
2704    *
2705    * <p>You can call this method only after 60 days have elapsed since the initial domain
2706    * registration.
2707    *
2708    * <p>Sample code:
2709    *
2710    * <pre>{@code
2711    * // This snippet has been automatically generated and should be regarded as a code template only.
2712    * // It will require modifications to work:
2713    * // - It may require correct/in-range values for request initialization.
2714    * // - It may require specifying regional endpoints when creating the service client as shown in
2715    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2716    * try (DomainsClient domainsClient = DomainsClient.create()) {
2717    *   String registration =
2718    *       RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString();
2719    *   AuthorizationCode response = domainsClient.resetAuthorizationCode(registration);
2720    * }
2721    * }</pre>
2722    *
2723    * @param registration Required. The name of the `Registration` whose authorization code is being
2724    *     reset, in the format `projects/&#42;/locations/&#42;/registrations/&#42;`.
2725    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2726    */
resetAuthorizationCode(String registration)2727   public final AuthorizationCode resetAuthorizationCode(String registration) {
2728     ResetAuthorizationCodeRequest request =
2729         ResetAuthorizationCodeRequest.newBuilder().setRegistration(registration).build();
2730     return resetAuthorizationCode(request);
2731   }
2732 
2733   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2734   /**
2735    * Resets the authorization code of the `Registration` to a new random string.
2736    *
2737    * <p>You can call this method only after 60 days have elapsed since the initial domain
2738    * registration.
2739    *
2740    * <p>Sample code:
2741    *
2742    * <pre>{@code
2743    * // This snippet has been automatically generated and should be regarded as a code template only.
2744    * // It will require modifications to work:
2745    * // - It may require correct/in-range values for request initialization.
2746    * // - It may require specifying regional endpoints when creating the service client as shown in
2747    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2748    * try (DomainsClient domainsClient = DomainsClient.create()) {
2749    *   ResetAuthorizationCodeRequest request =
2750    *       ResetAuthorizationCodeRequest.newBuilder()
2751    *           .setRegistration(
2752    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2753    *           .build();
2754    *   AuthorizationCode response = domainsClient.resetAuthorizationCode(request);
2755    * }
2756    * }</pre>
2757    *
2758    * @param request The request object containing all of the parameters for the API call.
2759    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2760    */
resetAuthorizationCode(ResetAuthorizationCodeRequest request)2761   public final AuthorizationCode resetAuthorizationCode(ResetAuthorizationCodeRequest request) {
2762     return resetAuthorizationCodeCallable().call(request);
2763   }
2764 
2765   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2766   /**
2767    * Resets the authorization code of the `Registration` to a new random string.
2768    *
2769    * <p>You can call this method only after 60 days have elapsed since the initial domain
2770    * registration.
2771    *
2772    * <p>Sample code:
2773    *
2774    * <pre>{@code
2775    * // This snippet has been automatically generated and should be regarded as a code template only.
2776    * // It will require modifications to work:
2777    * // - It may require correct/in-range values for request initialization.
2778    * // - It may require specifying regional endpoints when creating the service client as shown in
2779    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2780    * try (DomainsClient domainsClient = DomainsClient.create()) {
2781    *   ResetAuthorizationCodeRequest request =
2782    *       ResetAuthorizationCodeRequest.newBuilder()
2783    *           .setRegistration(
2784    *               RegistrationName.of("[PROJECT]", "[LOCATION]", "[REGISTRATION]").toString())
2785    *           .build();
2786    *   ApiFuture<AuthorizationCode> future =
2787    *       domainsClient.resetAuthorizationCodeCallable().futureCall(request);
2788    *   // Do something.
2789    *   AuthorizationCode response = future.get();
2790    * }
2791    * }</pre>
2792    */
2793   public final UnaryCallable<ResetAuthorizationCodeRequest, AuthorizationCode>
resetAuthorizationCodeCallable()2794       resetAuthorizationCodeCallable() {
2795     return stub.resetAuthorizationCodeCallable();
2796   }
2797 
2798   @Override
close()2799   public final void close() {
2800     stub.close();
2801   }
2802 
2803   @Override
shutdown()2804   public void shutdown() {
2805     stub.shutdown();
2806   }
2807 
2808   @Override
isShutdown()2809   public boolean isShutdown() {
2810     return stub.isShutdown();
2811   }
2812 
2813   @Override
isTerminated()2814   public boolean isTerminated() {
2815     return stub.isTerminated();
2816   }
2817 
2818   @Override
shutdownNow()2819   public void shutdownNow() {
2820     stub.shutdownNow();
2821   }
2822 
2823   @Override
awaitTermination(long duration, TimeUnit unit)2824   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
2825     return stub.awaitTermination(duration, unit);
2826   }
2827 
2828   public static class ListRegistrationsPagedResponse
2829       extends AbstractPagedListResponse<
2830           ListRegistrationsRequest,
2831           ListRegistrationsResponse,
2832           Registration,
2833           ListRegistrationsPage,
2834           ListRegistrationsFixedSizeCollection> {
2835 
createAsync( PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context, ApiFuture<ListRegistrationsResponse> futureResponse)2836     public static ApiFuture<ListRegistrationsPagedResponse> createAsync(
2837         PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context,
2838         ApiFuture<ListRegistrationsResponse> futureResponse) {
2839       ApiFuture<ListRegistrationsPage> futurePage =
2840           ListRegistrationsPage.createEmptyPage().createPageAsync(context, futureResponse);
2841       return ApiFutures.transform(
2842           futurePage,
2843           input -> new ListRegistrationsPagedResponse(input),
2844           MoreExecutors.directExecutor());
2845     }
2846 
ListRegistrationsPagedResponse(ListRegistrationsPage page)2847     private ListRegistrationsPagedResponse(ListRegistrationsPage page) {
2848       super(page, ListRegistrationsFixedSizeCollection.createEmptyCollection());
2849     }
2850   }
2851 
2852   public static class ListRegistrationsPage
2853       extends AbstractPage<
2854           ListRegistrationsRequest,
2855           ListRegistrationsResponse,
2856           Registration,
2857           ListRegistrationsPage> {
2858 
ListRegistrationsPage( PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context, ListRegistrationsResponse response)2859     private ListRegistrationsPage(
2860         PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context,
2861         ListRegistrationsResponse response) {
2862       super(context, response);
2863     }
2864 
createEmptyPage()2865     private static ListRegistrationsPage createEmptyPage() {
2866       return new ListRegistrationsPage(null, null);
2867     }
2868 
2869     @Override
createPage( PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context, ListRegistrationsResponse response)2870     protected ListRegistrationsPage createPage(
2871         PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context,
2872         ListRegistrationsResponse response) {
2873       return new ListRegistrationsPage(context, response);
2874     }
2875 
2876     @Override
createPageAsync( PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context, ApiFuture<ListRegistrationsResponse> futureResponse)2877     public ApiFuture<ListRegistrationsPage> createPageAsync(
2878         PageContext<ListRegistrationsRequest, ListRegistrationsResponse, Registration> context,
2879         ApiFuture<ListRegistrationsResponse> futureResponse) {
2880       return super.createPageAsync(context, futureResponse);
2881     }
2882   }
2883 
2884   public static class ListRegistrationsFixedSizeCollection
2885       extends AbstractFixedSizeCollection<
2886           ListRegistrationsRequest,
2887           ListRegistrationsResponse,
2888           Registration,
2889           ListRegistrationsPage,
2890           ListRegistrationsFixedSizeCollection> {
2891 
ListRegistrationsFixedSizeCollection( List<ListRegistrationsPage> pages, int collectionSize)2892     private ListRegistrationsFixedSizeCollection(
2893         List<ListRegistrationsPage> pages, int collectionSize) {
2894       super(pages, collectionSize);
2895     }
2896 
createEmptyCollection()2897     private static ListRegistrationsFixedSizeCollection createEmptyCollection() {
2898       return new ListRegistrationsFixedSizeCollection(null, 0);
2899     }
2900 
2901     @Override
createCollection( List<ListRegistrationsPage> pages, int collectionSize)2902     protected ListRegistrationsFixedSizeCollection createCollection(
2903         List<ListRegistrationsPage> pages, int collectionSize) {
2904       return new ListRegistrationsFixedSizeCollection(pages, collectionSize);
2905     }
2906   }
2907 }
2908