diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsClient.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsClient.java
index f984f6bf78b2..a697fd4d6f5b 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsClient.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsClient.java
@@ -19,6 +19,7 @@
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -30,7 +31,6 @@
import com.google.cloud.domains.v1.stub.DomainsStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import com.google.type.Money;
@@ -103,13 +103,28 @@
* DomainsClient domainsClient = DomainsClient.create(domainsSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * DomainsSettings domainsSettings =
+ * DomainsSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * DomainsSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * DomainsClient domainsClient = DomainsClient.create(domainsSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class DomainsClient implements BackgroundResource {
private final DomainsSettings settings;
private final DomainsStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of DomainsClient with default settings. */
public static final DomainsClient create() throws IOException {
@@ -139,13 +154,17 @@ public static final DomainsClient create(DomainsStub stub) {
protected DomainsClient(DomainsSettings settings) throws IOException {
this.settings = settings;
this.stub = ((DomainsStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected DomainsClient(DomainsStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final DomainsSettings getSettings() {
@@ -160,10 +179,18 @@ public DomainsStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches for available domain names similar to the provided query.
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsSettings.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsSettings.java
index 7a6ade9c8902..e1b7cc49f1eb 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsSettings.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/DomainsSettings.java
@@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -228,11 +229,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return DomainsStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return DomainsStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return DomainsStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return DomainsStubSettings.defaultTransportChannelProvider();
}
@@ -242,11 +250,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return DomainsStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -284,6 +298,11 @@ private static Builder createDefault() {
return new Builder(DomainsStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(DomainsStubSettings.newHttpJsonBuilder());
+ }
+
public DomainsStubSettings.Builder getStubSettingsBuilder() {
return ((DomainsStubSettings.Builder) getStubSettings());
}
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStub.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStub.java
index 87c1dc6132ca..bda9889c07b7 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStub.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStub.java
@@ -58,7 +58,11 @@
public abstract class DomainsStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable searchDomainsCallable() {
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStubSettings.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStubSettings.java
index bd2900634651..77bd965e51f0 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStubSettings.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/DomainsStubSettings.java
@@ -28,6 +28,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -360,6 +363,11 @@ public DomainsStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcDomainsStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonDomainsStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -392,29 +400,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DomainsStubSettings.class))
.setTransportToken(
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DomainsStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return DomainsStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -658,6 +691,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.searchDomainsSettings()
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsCallableFactory.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsCallableFactory.java
new file mode 100644
index 000000000000..270f0dc698d5
--- /dev/null
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.domains.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the Domains service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonDomainsCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsStub.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsStub.java
new file mode 100644
index 000000000000..ff46eff7a9ff
--- /dev/null
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1/stub/HttpJsonDomainsStub.java
@@ -0,0 +1,1137 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.domains.v1.stub;
+
+import static com.google.cloud.domains.v1.DomainsClient.ListRegistrationsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.domains.v1.AuthorizationCode;
+import com.google.cloud.domains.v1.ConfigureContactSettingsRequest;
+import com.google.cloud.domains.v1.ConfigureDnsSettingsRequest;
+import com.google.cloud.domains.v1.ConfigureManagementSettingsRequest;
+import com.google.cloud.domains.v1.DeleteRegistrationRequest;
+import com.google.cloud.domains.v1.ExportRegistrationRequest;
+import com.google.cloud.domains.v1.GetRegistrationRequest;
+import com.google.cloud.domains.v1.ListRegistrationsRequest;
+import com.google.cloud.domains.v1.ListRegistrationsResponse;
+import com.google.cloud.domains.v1.OperationMetadata;
+import com.google.cloud.domains.v1.RegisterDomainRequest;
+import com.google.cloud.domains.v1.Registration;
+import com.google.cloud.domains.v1.ResetAuthorizationCodeRequest;
+import com.google.cloud.domains.v1.RetrieveAuthorizationCodeRequest;
+import com.google.cloud.domains.v1.RetrieveRegisterParametersRequest;
+import com.google.cloud.domains.v1.RetrieveRegisterParametersResponse;
+import com.google.cloud.domains.v1.RetrieveTransferParametersRequest;
+import com.google.cloud.domains.v1.RetrieveTransferParametersResponse;
+import com.google.cloud.domains.v1.SearchDomainsRequest;
+import com.google.cloud.domains.v1.SearchDomainsResponse;
+import com.google.cloud.domains.v1.TransferDomainRequest;
+import com.google.cloud.domains.v1.UpdateRegistrationRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the Domains service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonDomainsStub extends DomainsStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(OperationMetadata.getDescriptor())
+ .add(Empty.getDescriptor())
+ .add(Registration.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ searchDomainsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/SearchDomains")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{location=projects/*/locations/*}/registrations:searchDomains",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "location", request.getLocation());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "query", request.getQuery());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(SearchDomainsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ RetrieveRegisterParametersRequest, RetrieveRegisterParametersResponse>
+ retrieveRegisterParametersMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/RetrieveRegisterParameters")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{location=projects/*/locations/*}/registrations:retrieveRegisterParameters",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "location", request.getLocation());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "domainName", request.getDomainName());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(RetrieveRegisterParametersResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ registerDomainMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/RegisterDomain")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/registrations:register",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (RegisterDomainRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor<
+ RetrieveTransferParametersRequest, RetrieveTransferParametersResponse>
+ retrieveTransferParametersMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/RetrieveTransferParameters")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{location=projects/*/locations/*}/registrations:retrieveTransferParameters",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "location", request.getLocation());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "domainName", request.getDomainName());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(RetrieveTransferParametersResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ transferDomainMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/TransferDomain")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/registrations:transfer",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (TransferDomainRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listRegistrationsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ListRegistrations")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/registrations",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListRegistrationsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getRegistrationMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/GetRegistration")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/registrations/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Registration.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateRegistrationMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/UpdateRegistration")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration.name=projects/*/locations/*/registrations/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration.name", request.getRegistration().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("registration", request.getRegistration()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateRegistrationRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ configureManagementSettingsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ConfigureManagementSettings")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration=projects/*/locations/*/registrations/*}:configureManagementSettings",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration", request.getRegistration());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearRegistration().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ConfigureManagementSettingsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ configureDnsSettingsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ConfigureDnsSettings")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration=projects/*/locations/*/registrations/*}:configureDnsSettings",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration", request.getRegistration());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearRegistration().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ConfigureDnsSettingsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ configureContactSettingsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ConfigureContactSettings")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration=projects/*/locations/*/registrations/*}:configureContactSettings",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration", request.getRegistration());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearRegistration().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ConfigureContactSettingsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ exportRegistrationMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ExportRegistration")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/registrations/*}:export",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ExportRegistrationRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteRegistrationMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/DeleteRegistration")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/registrations/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteRegistrationRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ retrieveAuthorizationCodeMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/RetrieveAuthorizationCode")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration=projects/*/locations/*/registrations/*}:retrieveAuthorizationCode",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration", request.getRegistration());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(AuthorizationCode.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ resetAuthorizationCodeMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.domains.v1.Domains/ResetAuthorizationCode")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{registration=projects/*/locations/*/registrations/*}:resetAuthorizationCode",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "registration", request.getRegistration());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearRegistration().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(AuthorizationCode.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable searchDomainsCallable;
+ private final UnaryCallable
+ retrieveRegisterParametersCallable;
+ private final UnaryCallable registerDomainCallable;
+ private final OperationCallable
+ registerDomainOperationCallable;
+ private final UnaryCallable
+ retrieveTransferParametersCallable;
+ private final UnaryCallable transferDomainCallable;
+ private final OperationCallable
+ transferDomainOperationCallable;
+ private final UnaryCallable
+ listRegistrationsCallable;
+ private final UnaryCallable
+ listRegistrationsPagedCallable;
+ private final UnaryCallable getRegistrationCallable;
+ private final UnaryCallable updateRegistrationCallable;
+ private final OperationCallable
+ updateRegistrationOperationCallable;
+ private final UnaryCallable
+ configureManagementSettingsCallable;
+ private final OperationCallable<
+ ConfigureManagementSettingsRequest, Registration, OperationMetadata>
+ configureManagementSettingsOperationCallable;
+ private final UnaryCallable configureDnsSettingsCallable;
+ private final OperationCallable
+ configureDnsSettingsOperationCallable;
+ private final UnaryCallable
+ configureContactSettingsCallable;
+ private final OperationCallable
+ configureContactSettingsOperationCallable;
+ private final UnaryCallable exportRegistrationCallable;
+ private final OperationCallable
+ exportRegistrationOperationCallable;
+ private final UnaryCallable deleteRegistrationCallable;
+ private final OperationCallable
+ deleteRegistrationOperationCallable;
+ private final UnaryCallable
+ retrieveAuthorizationCodeCallable;
+ private final UnaryCallable
+ resetAuthorizationCodeCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonOperationsStub httpJsonOperationsStub;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonDomainsStub create(DomainsStubSettings settings) throws IOException {
+ return new HttpJsonDomainsStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonDomainsStub create(ClientContext clientContext) throws IOException {
+ return new HttpJsonDomainsStub(DomainsStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonDomainsStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonDomainsStub(
+ DomainsStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonDomainsStub, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected HttpJsonDomainsStub(DomainsStubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new HttpJsonDomainsCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonDomainsStub, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected HttpJsonDomainsStub(
+ DomainsStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.httpJsonOperationsStub =
+ HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry);
+
+ HttpJsonCallSettings
+ searchDomainsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(searchDomainsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ retrieveRegisterParametersTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(retrieveRegisterParametersMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings registerDomainTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(registerDomainMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ retrieveTransferParametersTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(retrieveTransferParametersMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings transferDomainTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(transferDomainMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listRegistrationsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listRegistrationsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getRegistrationTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateRegistrationTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ configureManagementSettingsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(configureManagementSettingsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ configureDnsSettingsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(configureDnsSettingsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ configureContactSettingsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(configureContactSettingsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings exportRegistrationTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(exportRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteRegistrationTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ retrieveAuthorizationCodeTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(retrieveAuthorizationCodeMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ resetAuthorizationCodeTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(resetAuthorizationCodeMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.searchDomainsCallable =
+ callableFactory.createUnaryCallable(
+ searchDomainsTransportSettings, settings.searchDomainsSettings(), clientContext);
+ this.retrieveRegisterParametersCallable =
+ callableFactory.createUnaryCallable(
+ retrieveRegisterParametersTransportSettings,
+ settings.retrieveRegisterParametersSettings(),
+ clientContext);
+ this.registerDomainCallable =
+ callableFactory.createUnaryCallable(
+ registerDomainTransportSettings, settings.registerDomainSettings(), clientContext);
+ this.registerDomainOperationCallable =
+ callableFactory.createOperationCallable(
+ registerDomainTransportSettings,
+ settings.registerDomainOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.retrieveTransferParametersCallable =
+ callableFactory.createUnaryCallable(
+ retrieveTransferParametersTransportSettings,
+ settings.retrieveTransferParametersSettings(),
+ clientContext);
+ this.transferDomainCallable =
+ callableFactory.createUnaryCallable(
+ transferDomainTransportSettings, settings.transferDomainSettings(), clientContext);
+ this.transferDomainOperationCallable =
+ callableFactory.createOperationCallable(
+ transferDomainTransportSettings,
+ settings.transferDomainOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.listRegistrationsCallable =
+ callableFactory.createUnaryCallable(
+ listRegistrationsTransportSettings,
+ settings.listRegistrationsSettings(),
+ clientContext);
+ this.listRegistrationsPagedCallable =
+ callableFactory.createPagedCallable(
+ listRegistrationsTransportSettings,
+ settings.listRegistrationsSettings(),
+ clientContext);
+ this.getRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ getRegistrationTransportSettings, settings.getRegistrationSettings(), clientContext);
+ this.updateRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ updateRegistrationTransportSettings,
+ settings.updateRegistrationSettings(),
+ clientContext);
+ this.updateRegistrationOperationCallable =
+ callableFactory.createOperationCallable(
+ updateRegistrationTransportSettings,
+ settings.updateRegistrationOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.configureManagementSettingsCallable =
+ callableFactory.createUnaryCallable(
+ configureManagementSettingsTransportSettings,
+ settings.configureManagementSettingsSettings(),
+ clientContext);
+ this.configureManagementSettingsOperationCallable =
+ callableFactory.createOperationCallable(
+ configureManagementSettingsTransportSettings,
+ settings.configureManagementSettingsOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.configureDnsSettingsCallable =
+ callableFactory.createUnaryCallable(
+ configureDnsSettingsTransportSettings,
+ settings.configureDnsSettingsSettings(),
+ clientContext);
+ this.configureDnsSettingsOperationCallable =
+ callableFactory.createOperationCallable(
+ configureDnsSettingsTransportSettings,
+ settings.configureDnsSettingsOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.configureContactSettingsCallable =
+ callableFactory.createUnaryCallable(
+ configureContactSettingsTransportSettings,
+ settings.configureContactSettingsSettings(),
+ clientContext);
+ this.configureContactSettingsOperationCallable =
+ callableFactory.createOperationCallable(
+ configureContactSettingsTransportSettings,
+ settings.configureContactSettingsOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.exportRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ exportRegistrationTransportSettings,
+ settings.exportRegistrationSettings(),
+ clientContext);
+ this.exportRegistrationOperationCallable =
+ callableFactory.createOperationCallable(
+ exportRegistrationTransportSettings,
+ settings.exportRegistrationOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.deleteRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ deleteRegistrationTransportSettings,
+ settings.deleteRegistrationSettings(),
+ clientContext);
+ this.deleteRegistrationOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteRegistrationTransportSettings,
+ settings.deleteRegistrationOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.retrieveAuthorizationCodeCallable =
+ callableFactory.createUnaryCallable(
+ retrieveAuthorizationCodeTransportSettings,
+ settings.retrieveAuthorizationCodeSettings(),
+ clientContext);
+ this.resetAuthorizationCodeCallable =
+ callableFactory.createUnaryCallable(
+ resetAuthorizationCodeTransportSettings,
+ settings.resetAuthorizationCodeSettings(),
+ clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(searchDomainsMethodDescriptor);
+ methodDescriptors.add(retrieveRegisterParametersMethodDescriptor);
+ methodDescriptors.add(registerDomainMethodDescriptor);
+ methodDescriptors.add(retrieveTransferParametersMethodDescriptor);
+ methodDescriptors.add(transferDomainMethodDescriptor);
+ methodDescriptors.add(listRegistrationsMethodDescriptor);
+ methodDescriptors.add(getRegistrationMethodDescriptor);
+ methodDescriptors.add(updateRegistrationMethodDescriptor);
+ methodDescriptors.add(configureManagementSettingsMethodDescriptor);
+ methodDescriptors.add(configureDnsSettingsMethodDescriptor);
+ methodDescriptors.add(configureContactSettingsMethodDescriptor);
+ methodDescriptors.add(exportRegistrationMethodDescriptor);
+ methodDescriptors.add(deleteRegistrationMethodDescriptor);
+ methodDescriptors.add(retrieveAuthorizationCodeMethodDescriptor);
+ methodDescriptors.add(resetAuthorizationCodeMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ public HttpJsonOperationsStub getHttpJsonOperationsStub() {
+ return httpJsonOperationsStub;
+ }
+
+ @Override
+ public UnaryCallable searchDomainsCallable() {
+ return searchDomainsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ retrieveRegisterParametersCallable() {
+ return retrieveRegisterParametersCallable;
+ }
+
+ @Override
+ public UnaryCallable registerDomainCallable() {
+ return registerDomainCallable;
+ }
+
+ @Override
+ public OperationCallable
+ registerDomainOperationCallable() {
+ return registerDomainOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ retrieveTransferParametersCallable() {
+ return retrieveTransferParametersCallable;
+ }
+
+ @Override
+ public UnaryCallable transferDomainCallable() {
+ return transferDomainCallable;
+ }
+
+ @Override
+ public OperationCallable
+ transferDomainOperationCallable() {
+ return transferDomainOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listRegistrationsCallable() {
+ return listRegistrationsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listRegistrationsPagedCallable() {
+ return listRegistrationsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getRegistrationCallable() {
+ return getRegistrationCallable;
+ }
+
+ @Override
+ public UnaryCallable updateRegistrationCallable() {
+ return updateRegistrationCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateRegistrationOperationCallable() {
+ return updateRegistrationOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ configureManagementSettingsCallable() {
+ return configureManagementSettingsCallable;
+ }
+
+ @Override
+ public OperationCallable
+ configureManagementSettingsOperationCallable() {
+ return configureManagementSettingsOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable configureDnsSettingsCallable() {
+ return configureDnsSettingsCallable;
+ }
+
+ @Override
+ public OperationCallable
+ configureDnsSettingsOperationCallable() {
+ return configureDnsSettingsOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ configureContactSettingsCallable() {
+ return configureContactSettingsCallable;
+ }
+
+ @Override
+ public OperationCallable
+ configureContactSettingsOperationCallable() {
+ return configureContactSettingsOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable exportRegistrationCallable() {
+ return exportRegistrationCallable;
+ }
+
+ @Override
+ public OperationCallable
+ exportRegistrationOperationCallable() {
+ return exportRegistrationOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteRegistrationCallable() {
+ return deleteRegistrationCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteRegistrationOperationCallable() {
+ return deleteRegistrationOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ retrieveAuthorizationCodeCallable() {
+ return retrieveAuthorizationCodeCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ resetAuthorizationCodeCallable() {
+ return resetAuthorizationCodeCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsClient.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsClient.java
index ed9a6d18af1a..5af5aff9a9cd 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsClient.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsClient.java
@@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
import com.google.cloud.domains.v1alpha2.stub.DomainsStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import com.google.type.Money;
@@ -104,6 +104,20 @@
* DomainsClient domainsClient = DomainsClient.create(domainsSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * DomainsSettings domainsSettings =
+ * DomainsSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * DomainsSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * DomainsClient domainsClient = DomainsClient.create(domainsSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@@ -111,7 +125,8 @@
public class DomainsClient implements BackgroundResource {
private final DomainsSettings settings;
private final DomainsStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of DomainsClient with default settings. */
public static final DomainsClient create() throws IOException {
@@ -141,13 +156,17 @@ public static final DomainsClient create(DomainsStub stub) {
protected DomainsClient(DomainsSettings settings) throws IOException {
this.settings = settings;
this.stub = ((DomainsStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected DomainsClient(DomainsStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final DomainsSettings getSettings() {
@@ -162,10 +181,18 @@ public DomainsStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches for available domain names similar to the provided query.
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsSettings.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsSettings.java
index 1229fd77583f..f7ff28d3a079 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsSettings.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/DomainsSettings.java
@@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -229,11 +230,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return DomainsStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return DomainsStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return DomainsStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return DomainsStubSettings.defaultTransportChannelProvider();
}
@@ -243,11 +251,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return DomainsStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -285,6 +299,11 @@ private static Builder createDefault() {
return new Builder(DomainsStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(DomainsStubSettings.newHttpJsonBuilder());
+ }
+
public DomainsStubSettings.Builder getStubSettingsBuilder() {
return ((DomainsStubSettings.Builder) getStubSettings());
}
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStub.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStub.java
index 676a64cb6827..5465e5ab5a2d 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStub.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStub.java
@@ -60,7 +60,11 @@
public abstract class DomainsStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable searchDomainsCallable() {
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStubSettings.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStubSettings.java
index 3e6227b62494..3ffa9c4856cd 100644
--- a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStubSettings.java
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/DomainsStubSettings.java
@@ -28,6 +28,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -361,6 +364,11 @@ public DomainsStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcDomainsStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonDomainsStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -393,29 +401,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DomainsStubSettings.class))
.setTransportToken(
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(DomainsStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return DomainsStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -659,6 +692,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.searchDomainsSettings()
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsCallableFactory.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsCallableFactory.java
new file mode 100644
index 000000000000..4b9cb1996e76
--- /dev/null
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.domains.v1alpha2.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the Domains service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonDomainsCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsStub.java b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsStub.java
new file mode 100644
index 000000000000..7c7efb05e014
--- /dev/null
+++ b/java-domains/google-cloud-domains/src/main/java/com/google/cloud/domains/v1alpha2/stub/HttpJsonDomainsStub.java
@@ -0,0 +1,1138 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.domains.v1alpha2.stub;
+
+import static com.google.cloud.domains.v1alpha2.DomainsClient.ListRegistrationsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.domains.v1alpha2.AuthorizationCode;
+import com.google.cloud.domains.v1alpha2.ConfigureContactSettingsRequest;
+import com.google.cloud.domains.v1alpha2.ConfigureDnsSettingsRequest;
+import com.google.cloud.domains.v1alpha2.ConfigureManagementSettingsRequest;
+import com.google.cloud.domains.v1alpha2.DeleteRegistrationRequest;
+import com.google.cloud.domains.v1alpha2.ExportRegistrationRequest;
+import com.google.cloud.domains.v1alpha2.GetRegistrationRequest;
+import com.google.cloud.domains.v1alpha2.ListRegistrationsRequest;
+import com.google.cloud.domains.v1alpha2.ListRegistrationsResponse;
+import com.google.cloud.domains.v1alpha2.OperationMetadata;
+import com.google.cloud.domains.v1alpha2.RegisterDomainRequest;
+import com.google.cloud.domains.v1alpha2.Registration;
+import com.google.cloud.domains.v1alpha2.ResetAuthorizationCodeRequest;
+import com.google.cloud.domains.v1alpha2.RetrieveAuthorizationCodeRequest;
+import com.google.cloud.domains.v1alpha2.RetrieveRegisterParametersRequest;
+import com.google.cloud.domains.v1alpha2.RetrieveRegisterParametersResponse;
+import com.google.cloud.domains.v1alpha2.RetrieveTransferParametersRequest;
+import com.google.cloud.domains.v1alpha2.RetrieveTransferParametersResponse;
+import com.google.cloud.domains.v1alpha2.SearchDomainsRequest;
+import com.google.cloud.domains.v1alpha2.SearchDomainsResponse;
+import com.google.cloud.domains.v1alpha2.TransferDomainRequest;
+import com.google.cloud.domains.v1alpha2.UpdateRegistrationRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the Domains service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonDomainsStub extends DomainsStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(Registration.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor