diff --git a/.kokoro/continuous/gameservices-it.cfg b/.kokoro/continuous/gameservices-it.cfg new file mode 100644 index 000000000000..3abb415e9432 --- /dev/null +++ b/.kokoro/continuous/gameservices-it.cfg @@ -0,0 +1,27 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "google-cloud-clients/google-cloud-gameservices" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} diff --git a/.kokoro/nightly/gameservices-it.cfg b/.kokoro/nightly/gameservices-it.cfg new file mode 100644 index 000000000000..3abb415e9432 --- /dev/null +++ b/.kokoro/nightly/gameservices-it.cfg @@ -0,0 +1,27 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "google-cloud-clients/google-cloud-gameservices" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} diff --git a/.kokoro/presubmit/ebsecurityscanner-it.cfg b/.kokoro/presubmit/ebsecurityscanner-it.cfg deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/.kokoro/presubmit/gameservices-it.cfg b/.kokoro/presubmit/gameservices-it.cfg new file mode 100644 index 000000000000..3abb415e9432 --- /dev/null +++ b/.kokoro/presubmit/gameservices-it.cfg @@ -0,0 +1,27 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "google-cloud-clients/google-cloud-gameservices" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/pom.xml b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/pom.xml new file mode 100644 index 000000000000..20221c539be5 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + grpc-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + grpc-google-cloud-gameservices-v1alpha + GRPC library for grpc-google-cloud-gameservices-v1alpha + + com.google.api.grpc + google-api-grpc + 0.64.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-gameservices-v1alpha + compile + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../proto-google-cloud-gameservices-v1alpha/target/site/apidocs/ + + + + + + + diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceGrpc.java b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceGrpc.java new file mode 100644 index 000000000000..b1d122837952 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceGrpc.java @@ -0,0 +1,930 @@ +package com.google.cloud.gaming.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The cloud gaming allocation policy is used as the controller's recipe for the
+ * allocating game servers from clusters. The policy has three modes:
+ *   1. Default mode which is not limited to time.
+ *   2. Time based mode which is temporary and overrides the default mode when
+ *   effective.
+ *   3. Periodic mode which follows the time base mode, but happens
+ *   periodically using local time, identified by cron specs.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/gaming/v1alpha/allocation_policies.proto") +public final class AllocationPoliciesServiceGrpc { + + private AllocationPoliciesServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.gaming.v1alpha.AllocationPoliciesService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListAllocationPoliciesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + METHOD_LIST_ALLOCATION_POLICIES = getListAllocationPoliciesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + getListAllocationPoliciesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + getListAllocationPoliciesMethod() { + return getListAllocationPoliciesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + getListAllocationPoliciesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + getListAllocationPoliciesMethod; + if ((getListAllocationPoliciesMethod = + AllocationPoliciesServiceGrpc.getListAllocationPoliciesMethod) + == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + if ((getListAllocationPoliciesMethod = + AllocationPoliciesServiceGrpc.getListAllocationPoliciesMethod) + == null) { + AllocationPoliciesServiceGrpc.getListAllocationPoliciesMethod = + getListAllocationPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService", + "ListAllocationPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AllocationPoliciesServiceMethodDescriptorSupplier( + "ListAllocationPolicies")) + .build(); + } + } + } + return getListAllocationPoliciesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetAllocationPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy> + METHOD_GET_ALLOCATION_POLICY = getGetAllocationPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy> + getGetAllocationPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy> + getGetAllocationPolicyMethod() { + return getGetAllocationPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy> + getGetAllocationPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy> + getGetAllocationPolicyMethod; + if ((getGetAllocationPolicyMethod = AllocationPoliciesServiceGrpc.getGetAllocationPolicyMethod) + == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + if ((getGetAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getGetAllocationPolicyMethod) + == null) { + AllocationPoliciesServiceGrpc.getGetAllocationPolicyMethod = + getGetAllocationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService", + "GetAllocationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.AllocationPolicy + .getDefaultInstance())) + .setSchemaDescriptor( + new AllocationPoliciesServiceMethodDescriptorSupplier( + "GetAllocationPolicy")) + .build(); + } + } + } + return getGetAllocationPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateAllocationPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation> + METHOD_CREATE_ALLOCATION_POLICY = getCreateAllocationPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation> + getCreateAllocationPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation> + getCreateAllocationPolicyMethod() { + return getCreateAllocationPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation> + getCreateAllocationPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation> + getCreateAllocationPolicyMethod; + if ((getCreateAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getCreateAllocationPolicyMethod) + == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + if ((getCreateAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getCreateAllocationPolicyMethod) + == null) { + AllocationPoliciesServiceGrpc.getCreateAllocationPolicyMethod = + getCreateAllocationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService", + "CreateAllocationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AllocationPoliciesServiceMethodDescriptorSupplier( + "CreateAllocationPolicy")) + .build(); + } + } + } + return getCreateAllocationPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteAllocationPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation> + METHOD_DELETE_ALLOCATION_POLICY = getDeleteAllocationPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAllocationPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAllocationPolicyMethod() { + return getDeleteAllocationPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAllocationPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation> + getDeleteAllocationPolicyMethod; + if ((getDeleteAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getDeleteAllocationPolicyMethod) + == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + if ((getDeleteAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getDeleteAllocationPolicyMethod) + == null) { + AllocationPoliciesServiceGrpc.getDeleteAllocationPolicyMethod = + getDeleteAllocationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService", + "DeleteAllocationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AllocationPoliciesServiceMethodDescriptorSupplier( + "DeleteAllocationPolicy")) + .build(); + } + } + } + return getDeleteAllocationPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateAllocationPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation> + METHOD_UPDATE_ALLOCATION_POLICY = getUpdateAllocationPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAllocationPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAllocationPolicyMethod() { + return getUpdateAllocationPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAllocationPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation> + getUpdateAllocationPolicyMethod; + if ((getUpdateAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getUpdateAllocationPolicyMethod) + == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + if ((getUpdateAllocationPolicyMethod = + AllocationPoliciesServiceGrpc.getUpdateAllocationPolicyMethod) + == null) { + AllocationPoliciesServiceGrpc.getUpdateAllocationPolicyMethod = + getUpdateAllocationPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService", + "UpdateAllocationPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AllocationPoliciesServiceMethodDescriptorSupplier( + "UpdateAllocationPolicy")) + .build(); + } + } + } + return getUpdateAllocationPolicyMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AllocationPoliciesServiceStub newStub(io.grpc.Channel channel) { + return new AllocationPoliciesServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AllocationPoliciesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new AllocationPoliciesServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AllocationPoliciesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new AllocationPoliciesServiceFutureStub(channel); + } + + /** + * + * + *
+   * The cloud gaming allocation policy is used as the controller's recipe for the
+   * allocating game servers from clusters. The policy has three modes:
+   *   1. Default mode which is not limited to time.
+   *   2. Time based mode which is temporary and overrides the default mode when
+   *   effective.
+   *   3. Periodic mode which follows the time base mode, but happens
+   *   periodically using local time, identified by cron specs.
+   * 
+ */ + public abstract static class AllocationPoliciesServiceImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * List allocation policies in a given project and location.
+     * 
+ */ + public void listAllocationPolicies( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListAllocationPoliciesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single allocation policy.
+     * 
+ */ + public void getAllocationPolicy( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetAllocationPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new allocation policy in a given project and location.
+     * 
+ */ + public void createAllocationPolicy( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateAllocationPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single allocation policy.
+     * 
+ */ + public void deleteAllocationPolicy( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteAllocationPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Patches a single allocation policy.
+     * 
+ */ + public void updateAllocationPolicy( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateAllocationPolicyMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAllocationPoliciesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse>( + this, METHODID_LIST_ALLOCATION_POLICIES))) + .addMethod( + getGetAllocationPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest, + com.google.cloud.gaming.v1alpha.AllocationPolicy>( + this, METHODID_GET_ALLOCATION_POLICY))) + .addMethod( + getCreateAllocationPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_ALLOCATION_POLICY))) + .addMethod( + getDeleteAllocationPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_ALLOCATION_POLICY))) + .addMethod( + getUpdateAllocationPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_ALLOCATION_POLICY))) + .build(); + } + } + + /** + * + * + *
+   * The cloud gaming allocation policy is used as the controller's recipe for the
+   * allocating game servers from clusters. The policy has three modes:
+   *   1. Default mode which is not limited to time.
+   *   2. Time based mode which is temporary and overrides the default mode when
+   *   effective.
+   *   3. Periodic mode which follows the time base mode, but happens
+   *   periodically using local time, identified by cron specs.
+   * 
+ */ + public static final class AllocationPoliciesServiceStub + extends io.grpc.stub.AbstractStub { + private AllocationPoliciesServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private AllocationPoliciesServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AllocationPoliciesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AllocationPoliciesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * List allocation policies in a given project and location.
+     * 
+ */ + public void listAllocationPolicies( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAllocationPoliciesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single allocation policy.
+     * 
+ */ + public void getAllocationPolicy( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetAllocationPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new allocation policy in a given project and location.
+     * 
+ */ + public void createAllocationPolicy( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateAllocationPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single allocation policy.
+     * 
+ */ + public void deleteAllocationPolicy( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteAllocationPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Patches a single allocation policy.
+     * 
+ */ + public void updateAllocationPolicy( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateAllocationPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The cloud gaming allocation policy is used as the controller's recipe for the
+   * allocating game servers from clusters. The policy has three modes:
+   *   1. Default mode which is not limited to time.
+   *   2. Time based mode which is temporary and overrides the default mode when
+   *   effective.
+   *   3. Periodic mode which follows the time base mode, but happens
+   *   periodically using local time, identified by cron specs.
+   * 
+ */ + public static final class AllocationPoliciesServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private AllocationPoliciesServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private AllocationPoliciesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AllocationPoliciesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AllocationPoliciesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * List allocation policies in a given project and location.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse listAllocationPolicies( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest request) { + return blockingUnaryCall( + getChannel(), getListAllocationPoliciesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single allocation policy.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getGetAllocationPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new allocation policy in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createAllocationPolicy( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getCreateAllocationPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single allocation policy.
+     * 
+ */ + public com.google.longrunning.Operation deleteAllocationPolicy( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteAllocationPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Patches a single allocation policy.
+     * 
+ */ + public com.google.longrunning.Operation updateAllocationPolicy( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateAllocationPolicyMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The cloud gaming allocation policy is used as the controller's recipe for the
+   * allocating game servers from clusters. The policy has three modes:
+   *   1. Default mode which is not limited to time.
+   *   2. Time based mode which is temporary and overrides the default mode when
+   *   effective.
+   *   3. Periodic mode which follows the time base mode, but happens
+   *   periodically using local time, identified by cron specs.
+   * 
+ */ + public static final class AllocationPoliciesServiceFutureStub + extends io.grpc.stub.AbstractStub { + private AllocationPoliciesServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private AllocationPoliciesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AllocationPoliciesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AllocationPoliciesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * List allocation policies in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse> + listAllocationPolicies( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAllocationPoliciesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single allocation policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.AllocationPolicy> + getAllocationPolicy(com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetAllocationPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new allocation policy in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAllocationPolicy( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateAllocationPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single allocation policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAllocationPolicy( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteAllocationPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Patches a single allocation policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateAllocationPolicy( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateAllocationPolicyMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_ALLOCATION_POLICIES = 0; + private static final int METHODID_GET_ALLOCATION_POLICY = 1; + private static final int METHODID_CREATE_ALLOCATION_POLICY = 2; + private static final int METHODID_DELETE_ALLOCATION_POLICY = 3; + private static final int METHODID_UPDATE_ALLOCATION_POLICY = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AllocationPoliciesServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AllocationPoliciesServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_ALLOCATION_POLICIES: + serviceImpl.listAllocationPolicies( + (com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse>) + responseObserver); + break; + case METHODID_GET_ALLOCATION_POLICY: + serviceImpl.getAllocationPolicy( + (com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_ALLOCATION_POLICY: + serviceImpl.createAllocationPolicy( + (com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ALLOCATION_POLICY: + serviceImpl.deleteAllocationPolicy( + (com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ALLOCATION_POLICY: + serviceImpl.updateAllocationPolicy( + (com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class AllocationPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AllocationPoliciesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AllocationPoliciesService"); + } + } + + private static final class AllocationPoliciesServiceFileDescriptorSupplier + extends AllocationPoliciesServiceBaseDescriptorSupplier { + AllocationPoliciesServiceFileDescriptorSupplier() {} + } + + private static final class AllocationPoliciesServiceMethodDescriptorSupplier + extends AllocationPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AllocationPoliciesServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AllocationPoliciesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AllocationPoliciesServiceFileDescriptorSupplier()) + .addMethod(getListAllocationPoliciesMethodHelper()) + .addMethod(getGetAllocationPolicyMethodHelper()) + .addMethod(getCreateAllocationPolicyMethodHelper()) + .addMethod(getDeleteAllocationPolicyMethodHelper()) + .addMethod(getUpdateAllocationPolicyMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceGrpc.java b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceGrpc.java new file mode 100644 index 000000000000..39001e18800b --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceGrpc.java @@ -0,0 +1,909 @@ +package com.google.cloud.gaming.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The game server cluster is used to capture the game server cluster's settings
+ * which are used to manage game server clusters.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/gaming/v1alpha/game_server_clusters.proto") +public final class GameServerClustersServiceGrpc { + + private GameServerClustersServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.gaming.v1alpha.GameServerClustersService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListGameServerClustersMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + METHOD_LIST_GAME_SERVER_CLUSTERS = getListGameServerClustersMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + getListGameServerClustersMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + getListGameServerClustersMethod() { + return getListGameServerClustersMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + getListGameServerClustersMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + getListGameServerClustersMethod; + if ((getListGameServerClustersMethod = + GameServerClustersServiceGrpc.getListGameServerClustersMethod) + == null) { + synchronized (GameServerClustersServiceGrpc.class) { + if ((getListGameServerClustersMethod = + GameServerClustersServiceGrpc.getListGameServerClustersMethod) + == null) { + GameServerClustersServiceGrpc.getListGameServerClustersMethod = + getListGameServerClustersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService", + "ListGameServerClusters")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new GameServerClustersServiceMethodDescriptorSupplier( + "ListGameServerClusters")) + .build(); + } + } + } + return getListGameServerClustersMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetGameServerClusterMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster> + METHOD_GET_GAME_SERVER_CLUSTER = getGetGameServerClusterMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster> + getGetGameServerClusterMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster> + getGetGameServerClusterMethod() { + return getGetGameServerClusterMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster> + getGetGameServerClusterMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster> + getGetGameServerClusterMethod; + if ((getGetGameServerClusterMethod = + GameServerClustersServiceGrpc.getGetGameServerClusterMethod) + == null) { + synchronized (GameServerClustersServiceGrpc.class) { + if ((getGetGameServerClusterMethod = + GameServerClustersServiceGrpc.getGetGameServerClusterMethod) + == null) { + GameServerClustersServiceGrpc.getGetGameServerClusterMethod = + getGetGameServerClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService", + "GetGameServerCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GameServerCluster + .getDefaultInstance())) + .setSchemaDescriptor( + new GameServerClustersServiceMethodDescriptorSupplier( + "GetGameServerCluster")) + .build(); + } + } + } + return getGetGameServerClusterMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateGameServerClusterMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation> + METHOD_CREATE_GAME_SERVER_CLUSTER = getCreateGameServerClusterMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation> + getCreateGameServerClusterMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation> + getCreateGameServerClusterMethod() { + return getCreateGameServerClusterMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation> + getCreateGameServerClusterMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation> + getCreateGameServerClusterMethod; + if ((getCreateGameServerClusterMethod = + GameServerClustersServiceGrpc.getCreateGameServerClusterMethod) + == null) { + synchronized (GameServerClustersServiceGrpc.class) { + if ((getCreateGameServerClusterMethod = + GameServerClustersServiceGrpc.getCreateGameServerClusterMethod) + == null) { + GameServerClustersServiceGrpc.getCreateGameServerClusterMethod = + getCreateGameServerClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService", + "CreateGameServerCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerClustersServiceMethodDescriptorSupplier( + "CreateGameServerCluster")) + .build(); + } + } + } + return getCreateGameServerClusterMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteGameServerClusterMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation> + METHOD_DELETE_GAME_SERVER_CLUSTER = getDeleteGameServerClusterMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation> + getDeleteGameServerClusterMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation> + getDeleteGameServerClusterMethod() { + return getDeleteGameServerClusterMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation> + getDeleteGameServerClusterMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation> + getDeleteGameServerClusterMethod; + if ((getDeleteGameServerClusterMethod = + GameServerClustersServiceGrpc.getDeleteGameServerClusterMethod) + == null) { + synchronized (GameServerClustersServiceGrpc.class) { + if ((getDeleteGameServerClusterMethod = + GameServerClustersServiceGrpc.getDeleteGameServerClusterMethod) + == null) { + GameServerClustersServiceGrpc.getDeleteGameServerClusterMethod = + getDeleteGameServerClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService", + "DeleteGameServerCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerClustersServiceMethodDescriptorSupplier( + "DeleteGameServerCluster")) + .build(); + } + } + } + return getDeleteGameServerClusterMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateGameServerClusterMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation> + METHOD_UPDATE_GAME_SERVER_CLUSTER = getUpdateGameServerClusterMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation> + getUpdateGameServerClusterMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation> + getUpdateGameServerClusterMethod() { + return getUpdateGameServerClusterMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation> + getUpdateGameServerClusterMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation> + getUpdateGameServerClusterMethod; + if ((getUpdateGameServerClusterMethod = + GameServerClustersServiceGrpc.getUpdateGameServerClusterMethod) + == null) { + synchronized (GameServerClustersServiceGrpc.class) { + if ((getUpdateGameServerClusterMethod = + GameServerClustersServiceGrpc.getUpdateGameServerClusterMethod) + == null) { + GameServerClustersServiceGrpc.getUpdateGameServerClusterMethod = + getUpdateGameServerClusterMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService", + "UpdateGameServerCluster")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerClustersServiceMethodDescriptorSupplier( + "UpdateGameServerCluster")) + .build(); + } + } + } + return getUpdateGameServerClusterMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static GameServerClustersServiceStub newStub(io.grpc.Channel channel) { + return new GameServerClustersServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static GameServerClustersServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new GameServerClustersServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static GameServerClustersServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new GameServerClustersServiceFutureStub(channel); + } + + /** + * + * + *
+   * The game server cluster is used to capture the game server cluster's settings
+   * which are used to manage game server clusters.
+   * 
+ */ + public abstract static class GameServerClustersServiceImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists game server clusters in a given project and location.
+     * 
+ */ + public void listGameServerClusters( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListGameServerClustersMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single game server cluster.
+     * 
+ */ + public void getGameServerCluster( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetGameServerClusterMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new game server cluster in a given project and location.
+     * 
+ */ + public void createGameServerCluster( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateGameServerClusterMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single game server cluster.
+     * 
+ */ + public void deleteGameServerCluster( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteGameServerClusterMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Patches a single game server cluster.
+     * 
+ */ + public void updateGameServerCluster( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateGameServerClusterMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListGameServerClustersMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse>( + this, METHODID_LIST_GAME_SERVER_CLUSTERS))) + .addMethod( + getGetGameServerClusterMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest, + com.google.cloud.gaming.v1alpha.GameServerCluster>( + this, METHODID_GET_GAME_SERVER_CLUSTER))) + .addMethod( + getCreateGameServerClusterMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_GAME_SERVER_CLUSTER))) + .addMethod( + getDeleteGameServerClusterMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_GAME_SERVER_CLUSTER))) + .addMethod( + getUpdateGameServerClusterMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_GAME_SERVER_CLUSTER))) + .build(); + } + } + + /** + * + * + *
+   * The game server cluster is used to capture the game server cluster's settings
+   * which are used to manage game server clusters.
+   * 
+ */ + public static final class GameServerClustersServiceStub + extends io.grpc.stub.AbstractStub { + private GameServerClustersServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerClustersServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerClustersServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerClustersServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server clusters in a given project and location.
+     * 
+ */ + public void listGameServerClusters( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListGameServerClustersMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single game server cluster.
+     * 
+ */ + public void getGameServerCluster( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetGameServerClusterMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new game server cluster in a given project and location.
+     * 
+ */ + public void createGameServerCluster( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateGameServerClusterMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single game server cluster.
+     * 
+ */ + public void deleteGameServerCluster( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteGameServerClusterMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Patches a single game server cluster.
+     * 
+ */ + public void updateGameServerCluster( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateGameServerClusterMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The game server cluster is used to capture the game server cluster's settings
+   * which are used to manage game server clusters.
+   * 
+ */ + public static final class GameServerClustersServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private GameServerClustersServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerClustersServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerClustersServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerClustersServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server clusters in a given project and location.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse listGameServerClusters( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest request) { + return blockingUnaryCall( + getChannel(), getListGameServerClustersMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single game server cluster.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest request) { + return blockingUnaryCall( + getChannel(), getGetGameServerClusterMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new game server cluster in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createGameServerCluster( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest request) { + return blockingUnaryCall( + getChannel(), getCreateGameServerClusterMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single game server cluster.
+     * 
+ */ + public com.google.longrunning.Operation deleteGameServerCluster( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteGameServerClusterMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Patches a single game server cluster.
+     * 
+ */ + public com.google.longrunning.Operation updateGameServerCluster( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateGameServerClusterMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The game server cluster is used to capture the game server cluster's settings
+   * which are used to manage game server clusters.
+   * 
+ */ + public static final class GameServerClustersServiceFutureStub + extends io.grpc.stub.AbstractStub { + private GameServerClustersServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerClustersServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerClustersServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerClustersServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server clusters in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse> + listGameServerClusters( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest request) { + return futureUnaryCall( + getChannel().newCall(getListGameServerClustersMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single game server cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.GameServerCluster> + getGameServerCluster(com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetGameServerClusterMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new game server cluster in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createGameServerCluster( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateGameServerClusterMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Deletes a single game server cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteGameServerCluster( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteGameServerClusterMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Patches a single game server cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateGameServerCluster( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateGameServerClusterMethodHelper(), getCallOptions()), + request); + } + } + + private static final int METHODID_LIST_GAME_SERVER_CLUSTERS = 0; + private static final int METHODID_GET_GAME_SERVER_CLUSTER = 1; + private static final int METHODID_CREATE_GAME_SERVER_CLUSTER = 2; + private static final int METHODID_DELETE_GAME_SERVER_CLUSTER = 3; + private static final int METHODID_UPDATE_GAME_SERVER_CLUSTER = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final GameServerClustersServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(GameServerClustersServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_GAME_SERVER_CLUSTERS: + serviceImpl.listGameServerClusters( + (com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse>) + responseObserver); + break; + case METHODID_GET_GAME_SERVER_CLUSTER: + serviceImpl.getGameServerCluster( + (com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_GAME_SERVER_CLUSTER: + serviceImpl.createGameServerCluster( + (com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_GAME_SERVER_CLUSTER: + serviceImpl.deleteGameServerCluster( + (com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_GAME_SERVER_CLUSTER: + serviceImpl.updateGameServerCluster( + (com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class GameServerClustersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + GameServerClustersServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("GameServerClustersService"); + } + } + + private static final class GameServerClustersServiceFileDescriptorSupplier + extends GameServerClustersServiceBaseDescriptorSupplier { + GameServerClustersServiceFileDescriptorSupplier() {} + } + + private static final class GameServerClustersServiceMethodDescriptorSupplier + extends GameServerClustersServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + GameServerClustersServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (GameServerClustersServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new GameServerClustersServiceFileDescriptorSupplier()) + .addMethod(getListGameServerClustersMethodHelper()) + .addMethod(getGetGameServerClusterMethodHelper()) + .addMethod(getCreateGameServerClusterMethodHelper()) + .addMethod(getDeleteGameServerClusterMethodHelper()) + .addMethod(getUpdateGameServerClusterMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceGrpc.java b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceGrpc.java new file mode 100644 index 000000000000..8b126025e658 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceGrpc.java @@ -0,0 +1,1586 @@ +package com.google.cloud.gaming.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The game server deployment is used to configure the deployment of game server
+ * software to Agones Fleets in game server clusters.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/gaming/v1alpha/game_server_deployments.proto") +public final class GameServerDeploymentsServiceGrpc { + + private GameServerDeploymentsServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.gaming.v1alpha.GameServerDeploymentsService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListGameServerDeploymentsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + METHOD_LIST_GAME_SERVER_DEPLOYMENTS = getListGameServerDeploymentsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + getListGameServerDeploymentsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + getListGameServerDeploymentsMethod() { + return getListGameServerDeploymentsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + getListGameServerDeploymentsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + getListGameServerDeploymentsMethod; + if ((getListGameServerDeploymentsMethod = + GameServerDeploymentsServiceGrpc.getListGameServerDeploymentsMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getListGameServerDeploymentsMethod = + GameServerDeploymentsServiceGrpc.getListGameServerDeploymentsMethod) + == null) { + GameServerDeploymentsServiceGrpc.getListGameServerDeploymentsMethod = + getListGameServerDeploymentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "ListGameServerDeployments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "ListGameServerDeployments")) + .build(); + } + } + } + return getListGameServerDeploymentsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetGameServerDeploymentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment> + METHOD_GET_GAME_SERVER_DEPLOYMENT = getGetGameServerDeploymentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment> + getGetGameServerDeploymentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment> + getGetGameServerDeploymentMethod() { + return getGetGameServerDeploymentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment> + getGetGameServerDeploymentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment> + getGetGameServerDeploymentMethod; + if ((getGetGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getGetGameServerDeploymentMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getGetGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getGetGameServerDeploymentMethod) + == null) { + GameServerDeploymentsServiceGrpc.getGetGameServerDeploymentMethod = + getGetGameServerDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "GetGameServerDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GameServerDeployment + .getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "GetGameServerDeployment")) + .build(); + } + } + } + return getGetGameServerDeploymentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateGameServerDeploymentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation> + METHOD_CREATE_GAME_SERVER_DEPLOYMENT = getCreateGameServerDeploymentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getCreateGameServerDeploymentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getCreateGameServerDeploymentMethod() { + return getCreateGameServerDeploymentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getCreateGameServerDeploymentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getCreateGameServerDeploymentMethod; + if ((getCreateGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getCreateGameServerDeploymentMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getCreateGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getCreateGameServerDeploymentMethod) + == null) { + GameServerDeploymentsServiceGrpc.getCreateGameServerDeploymentMethod = + getCreateGameServerDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "CreateGameServerDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "CreateGameServerDeployment")) + .build(); + } + } + } + return getCreateGameServerDeploymentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteGameServerDeploymentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation> + METHOD_DELETE_GAME_SERVER_DEPLOYMENT = getDeleteGameServerDeploymentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation> + getDeleteGameServerDeploymentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation> + getDeleteGameServerDeploymentMethod() { + return getDeleteGameServerDeploymentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation> + getDeleteGameServerDeploymentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation> + getDeleteGameServerDeploymentMethod; + if ((getDeleteGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getDeleteGameServerDeploymentMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getDeleteGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getDeleteGameServerDeploymentMethod) + == null) { + GameServerDeploymentsServiceGrpc.getDeleteGameServerDeploymentMethod = + getDeleteGameServerDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "DeleteGameServerDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "DeleteGameServerDeployment")) + .build(); + } + } + } + return getDeleteGameServerDeploymentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateGameServerDeploymentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation> + METHOD_UPDATE_GAME_SERVER_DEPLOYMENT = getUpdateGameServerDeploymentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getUpdateGameServerDeploymentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getUpdateGameServerDeploymentMethod() { + return getUpdateGameServerDeploymentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getUpdateGameServerDeploymentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation> + getUpdateGameServerDeploymentMethod; + if ((getUpdateGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getUpdateGameServerDeploymentMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getUpdateGameServerDeploymentMethod = + GameServerDeploymentsServiceGrpc.getUpdateGameServerDeploymentMethod) + == null) { + GameServerDeploymentsServiceGrpc.getUpdateGameServerDeploymentMethod = + getUpdateGameServerDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "UpdateGameServerDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "UpdateGameServerDeployment")) + .build(); + } + } + } + return getUpdateGameServerDeploymentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getStartRolloutMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, com.google.longrunning.Operation> + METHOD_START_ROLLOUT = getStartRolloutMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, com.google.longrunning.Operation> + getStartRolloutMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, com.google.longrunning.Operation> + getStartRolloutMethod() { + return getStartRolloutMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, com.google.longrunning.Operation> + getStartRolloutMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, com.google.longrunning.Operation> + getStartRolloutMethod; + if ((getStartRolloutMethod = GameServerDeploymentsServiceGrpc.getStartRolloutMethod) == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getStartRolloutMethod = GameServerDeploymentsServiceGrpc.getStartRolloutMethod) + == null) { + GameServerDeploymentsServiceGrpc.getStartRolloutMethod = + getStartRolloutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "StartRollout")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.StartRolloutRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier("StartRollout")) + .build(); + } + } + } + return getStartRolloutMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetRolloutTargetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, com.google.longrunning.Operation> + METHOD_SET_ROLLOUT_TARGET = getSetRolloutTargetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, com.google.longrunning.Operation> + getSetRolloutTargetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, com.google.longrunning.Operation> + getSetRolloutTargetMethod() { + return getSetRolloutTargetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, com.google.longrunning.Operation> + getSetRolloutTargetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, + com.google.longrunning.Operation> + getSetRolloutTargetMethod; + if ((getSetRolloutTargetMethod = GameServerDeploymentsServiceGrpc.getSetRolloutTargetMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getSetRolloutTargetMethod = GameServerDeploymentsServiceGrpc.getSetRolloutTargetMethod) + == null) { + GameServerDeploymentsServiceGrpc.getSetRolloutTargetMethod = + getSetRolloutTargetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "SetRolloutTarget")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "SetRolloutTarget")) + .build(); + } + } + } + return getSetRolloutTargetMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCommitRolloutMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, com.google.longrunning.Operation> + METHOD_COMMIT_ROLLOUT = getCommitRolloutMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, com.google.longrunning.Operation> + getCommitRolloutMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, com.google.longrunning.Operation> + getCommitRolloutMethod() { + return getCommitRolloutMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, com.google.longrunning.Operation> + getCommitRolloutMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, com.google.longrunning.Operation> + getCommitRolloutMethod; + if ((getCommitRolloutMethod = GameServerDeploymentsServiceGrpc.getCommitRolloutMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getCommitRolloutMethod = GameServerDeploymentsServiceGrpc.getCommitRolloutMethod) + == null) { + GameServerDeploymentsServiceGrpc.getCommitRolloutMethod = + getCommitRolloutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "CommitRollout")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier("CommitRollout")) + .build(); + } + } + } + return getCommitRolloutMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRevertRolloutMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, com.google.longrunning.Operation> + METHOD_REVERT_ROLLOUT = getRevertRolloutMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, com.google.longrunning.Operation> + getRevertRolloutMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, com.google.longrunning.Operation> + getRevertRolloutMethod() { + return getRevertRolloutMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, com.google.longrunning.Operation> + getRevertRolloutMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, com.google.longrunning.Operation> + getRevertRolloutMethod; + if ((getRevertRolloutMethod = GameServerDeploymentsServiceGrpc.getRevertRolloutMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getRevertRolloutMethod = GameServerDeploymentsServiceGrpc.getRevertRolloutMethod) + == null) { + GameServerDeploymentsServiceGrpc.getRevertRolloutMethod = + getRevertRolloutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "RevertRollout")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier("RevertRollout")) + .build(); + } + } + } + return getRevertRolloutMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetDeploymentTargetMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget> + METHOD_GET_DEPLOYMENT_TARGET = getGetDeploymentTargetMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget> + getGetDeploymentTargetMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget> + getGetDeploymentTargetMethod() { + return getGetDeploymentTargetMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget> + getGetDeploymentTargetMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget> + getGetDeploymentTargetMethod; + if ((getGetDeploymentTargetMethod = + GameServerDeploymentsServiceGrpc.getGetDeploymentTargetMethod) + == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + if ((getGetDeploymentTargetMethod = + GameServerDeploymentsServiceGrpc.getGetDeploymentTargetMethod) + == null) { + GameServerDeploymentsServiceGrpc.getGetDeploymentTargetMethod = + getGetDeploymentTargetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService", + "GetDeploymentTarget")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeploymentTarget + .getDefaultInstance())) + .setSchemaDescriptor( + new GameServerDeploymentsServiceMethodDescriptorSupplier( + "GetDeploymentTarget")) + .build(); + } + } + } + return getGetDeploymentTargetMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static GameServerDeploymentsServiceStub newStub(io.grpc.Channel channel) { + return new GameServerDeploymentsServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static GameServerDeploymentsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new GameServerDeploymentsServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static GameServerDeploymentsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new GameServerDeploymentsServiceFutureStub(channel); + } + + /** + * + * + *
+   * The game server deployment is used to configure the deployment of game server
+   * software to Agones Fleets in game server clusters.
+   * 
+ */ + public abstract static class GameServerDeploymentsServiceImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists game server deployments in a given project and location.
+     * 
+ */ + public void listGameServerDeployments( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListGameServerDeploymentsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single game server deployment.
+     * 
+ */ + public void getGameServerDeployment( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetGameServerDeploymentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new game server deployment in a given project and location.
+     * 
+ */ + public void createGameServerDeployment( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateGameServerDeploymentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single game server deployment.
+     * 
+ */ + public void deleteGameServerDeployment( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteGameServerDeploymentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Patches a game server deployment.
+     * 
+ */ + public void updateGameServerDeployment( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateGameServerDeploymentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Starts rollout of this game server deployment based on the given game
+     * server template.
+     * 
+ */ + public void startRollout( + com.google.cloud.gaming.v1alpha.StartRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getStartRolloutMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Sets rollout target for the ongoing game server deployment rollout in the
+     * specified clusters and based on the given rollout percentage. Default is 0.
+     * 
+ */ + public void setRolloutTarget( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetRolloutTargetMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Commits the ongoing game server deployment rollout by setting the rollout
+     * percentage to 100 in all clusters whose labels match labels in the game
+     * server template.
+     * 
+ */ + public void commitRollout( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCommitRolloutMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Rolls back the ongoing game server deployment rollout by setting the
+     * rollout percentage to 0 in all clusters whose labels match labels in the
+     * game server template.
+     * 
+ */ + public void revertRollout( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRevertRolloutMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Retrieves information on the rollout target of the deployment, e.g. the
+     * target percentage of game servers running stable_game_server_template and
+     * new_game_server_template in clusters.
+     * 
+ */ + public void getDeploymentTarget( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetDeploymentTargetMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListGameServerDeploymentsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse>( + this, METHODID_LIST_GAME_SERVER_DEPLOYMENTS))) + .addMethod( + getGetGameServerDeploymentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest, + com.google.cloud.gaming.v1alpha.GameServerDeployment>( + this, METHODID_GET_GAME_SERVER_DEPLOYMENT))) + .addMethod( + getCreateGameServerDeploymentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest, + com.google.longrunning.Operation>( + this, METHODID_CREATE_GAME_SERVER_DEPLOYMENT))) + .addMethod( + getDeleteGameServerDeploymentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_GAME_SERVER_DEPLOYMENT))) + .addMethod( + getUpdateGameServerDeploymentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest, + com.google.longrunning.Operation>( + this, METHODID_UPDATE_GAME_SERVER_DEPLOYMENT))) + .addMethod( + getStartRolloutMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.StartRolloutRequest, + com.google.longrunning.Operation>(this, METHODID_START_ROLLOUT))) + .addMethod( + getSetRolloutTargetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest, + com.google.longrunning.Operation>(this, METHODID_SET_ROLLOUT_TARGET))) + .addMethod( + getCommitRolloutMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CommitRolloutRequest, + com.google.longrunning.Operation>(this, METHODID_COMMIT_ROLLOUT))) + .addMethod( + getRevertRolloutMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.RevertRolloutRequest, + com.google.longrunning.Operation>(this, METHODID_REVERT_ROLLOUT))) + .addMethod( + getGetDeploymentTargetMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest, + com.google.cloud.gaming.v1alpha.DeploymentTarget>( + this, METHODID_GET_DEPLOYMENT_TARGET))) + .build(); + } + } + + /** + * + * + *
+   * The game server deployment is used to configure the deployment of game server
+   * software to Agones Fleets in game server clusters.
+   * 
+ */ + public static final class GameServerDeploymentsServiceStub + extends io.grpc.stub.AbstractStub { + private GameServerDeploymentsServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerDeploymentsServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerDeploymentsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerDeploymentsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server deployments in a given project and location.
+     * 
+ */ + public void listGameServerDeployments( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListGameServerDeploymentsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single game server deployment.
+     * 
+ */ + public void getGameServerDeployment( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetGameServerDeploymentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new game server deployment in a given project and location.
+     * 
+ */ + public void createGameServerDeployment( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateGameServerDeploymentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single game server deployment.
+     * 
+ */ + public void deleteGameServerDeployment( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteGameServerDeploymentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Patches a game server deployment.
+     * 
+ */ + public void updateGameServerDeployment( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateGameServerDeploymentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Starts rollout of this game server deployment based on the given game
+     * server template.
+     * 
+ */ + public void startRollout( + com.google.cloud.gaming.v1alpha.StartRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getStartRolloutMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets rollout target for the ongoing game server deployment rollout in the
+     * specified clusters and based on the given rollout percentage. Default is 0.
+     * 
+ */ + public void setRolloutTarget( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetRolloutTargetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Commits the ongoing game server deployment rollout by setting the rollout
+     * percentage to 100 in all clusters whose labels match labels in the game
+     * server template.
+     * 
+ */ + public void commitRollout( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCommitRolloutMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Rolls back the ongoing game server deployment rollout by setting the
+     * rollout percentage to 0 in all clusters whose labels match labels in the
+     * game server template.
+     * 
+ */ + public void revertRollout( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRevertRolloutMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves information on the rollout target of the deployment, e.g. the
+     * target percentage of game servers running stable_game_server_template and
+     * new_game_server_template in clusters.
+     * 
+ */ + public void getDeploymentTarget( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDeploymentTargetMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The game server deployment is used to configure the deployment of game server
+   * software to Agones Fleets in game server clusters.
+   * 
+ */ + public static final class GameServerDeploymentsServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private GameServerDeploymentsServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerDeploymentsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerDeploymentsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerDeploymentsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server deployments in a given project and location.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + listGameServerDeployments( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest request) { + return blockingUnaryCall( + getChannel(), getListGameServerDeploymentsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single game server deployment.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest request) { + return blockingUnaryCall( + getChannel(), getGetGameServerDeploymentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new game server deployment in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createGameServerDeployment( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest request) { + return blockingUnaryCall( + getChannel(), getCreateGameServerDeploymentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single game server deployment.
+     * 
+ */ + public com.google.longrunning.Operation deleteGameServerDeployment( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteGameServerDeploymentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Patches a game server deployment.
+     * 
+ */ + public com.google.longrunning.Operation updateGameServerDeployment( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateGameServerDeploymentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Starts rollout of this game server deployment based on the given game
+     * server template.
+     * 
+ */ + public com.google.longrunning.Operation startRollout( + com.google.cloud.gaming.v1alpha.StartRolloutRequest request) { + return blockingUnaryCall( + getChannel(), getStartRolloutMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets rollout target for the ongoing game server deployment rollout in the
+     * specified clusters and based on the given rollout percentage. Default is 0.
+     * 
+ */ + public com.google.longrunning.Operation setRolloutTarget( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest request) { + return blockingUnaryCall( + getChannel(), getSetRolloutTargetMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Commits the ongoing game server deployment rollout by setting the rollout
+     * percentage to 100 in all clusters whose labels match labels in the game
+     * server template.
+     * 
+ */ + public com.google.longrunning.Operation commitRollout( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest request) { + return blockingUnaryCall( + getChannel(), getCommitRolloutMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Rolls back the ongoing game server deployment rollout by setting the
+     * rollout percentage to 0 in all clusters whose labels match labels in the
+     * game server template.
+     * 
+ */ + public com.google.longrunning.Operation revertRollout( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest request) { + return blockingUnaryCall( + getChannel(), getRevertRolloutMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves information on the rollout target of the deployment, e.g. the
+     * target percentage of game servers running stable_game_server_template and
+     * new_game_server_template in clusters.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget getDeploymentTarget( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest request) { + return blockingUnaryCall( + getChannel(), getGetDeploymentTargetMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The game server deployment is used to configure the deployment of game server
+   * software to Agones Fleets in game server clusters.
+   * 
+ */ + public static final class GameServerDeploymentsServiceFutureStub + extends io.grpc.stub.AbstractStub { + private GameServerDeploymentsServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private GameServerDeploymentsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GameServerDeploymentsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new GameServerDeploymentsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists game server deployments in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse> + listGameServerDeployments( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListGameServerDeploymentsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets details of a single game server deployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.GameServerDeployment> + getGameServerDeployment( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetGameServerDeploymentMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Creates a new game server deployment in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createGameServerDeployment( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateGameServerDeploymentMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Deletes a single game server deployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteGameServerDeployment( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteGameServerDeploymentMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Patches a game server deployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateGameServerDeployment( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateGameServerDeploymentMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Starts rollout of this game server deployment based on the given game
+     * server template.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + startRollout(com.google.cloud.gaming.v1alpha.StartRolloutRequest request) { + return futureUnaryCall( + getChannel().newCall(getStartRolloutMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets rollout target for the ongoing game server deployment rollout in the
+     * specified clusters and based on the given rollout percentage. Default is 0.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setRolloutTarget(com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetRolloutTargetMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Commits the ongoing game server deployment rollout by setting the rollout
+     * percentage to 100 in all clusters whose labels match labels in the game
+     * server template.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + commitRollout(com.google.cloud.gaming.v1alpha.CommitRolloutRequest request) { + return futureUnaryCall( + getChannel().newCall(getCommitRolloutMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Rolls back the ongoing game server deployment rollout by setting the
+     * rollout percentage to 0 in all clusters whose labels match labels in the
+     * game server template.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + revertRollout(com.google.cloud.gaming.v1alpha.RevertRolloutRequest request) { + return futureUnaryCall( + getChannel().newCall(getRevertRolloutMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves information on the rollout target of the deployment, e.g. the
+     * target percentage of game servers running stable_game_server_template and
+     * new_game_server_template in clusters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.DeploymentTarget> + getDeploymentTarget(com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetDeploymentTargetMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_GAME_SERVER_DEPLOYMENTS = 0; + private static final int METHODID_GET_GAME_SERVER_DEPLOYMENT = 1; + private static final int METHODID_CREATE_GAME_SERVER_DEPLOYMENT = 2; + private static final int METHODID_DELETE_GAME_SERVER_DEPLOYMENT = 3; + private static final int METHODID_UPDATE_GAME_SERVER_DEPLOYMENT = 4; + private static final int METHODID_START_ROLLOUT = 5; + private static final int METHODID_SET_ROLLOUT_TARGET = 6; + private static final int METHODID_COMMIT_ROLLOUT = 7; + private static final int METHODID_REVERT_ROLLOUT = 8; + private static final int METHODID_GET_DEPLOYMENT_TARGET = 9; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final GameServerDeploymentsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(GameServerDeploymentsServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_GAME_SERVER_DEPLOYMENTS: + serviceImpl.listGameServerDeployments( + (com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse>) + responseObserver); + break; + case METHODID_GET_GAME_SERVER_DEPLOYMENT: + serviceImpl.getGameServerDeployment( + (com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_GAME_SERVER_DEPLOYMENT: + serviceImpl.createGameServerDeployment( + (com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_GAME_SERVER_DEPLOYMENT: + serviceImpl.deleteGameServerDeployment( + (com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_GAME_SERVER_DEPLOYMENT: + serviceImpl.updateGameServerDeployment( + (com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_START_ROLLOUT: + serviceImpl.startRollout( + (com.google.cloud.gaming.v1alpha.StartRolloutRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_ROLLOUT_TARGET: + serviceImpl.setRolloutTarget( + (com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COMMIT_ROLLOUT: + serviceImpl.commitRollout( + (com.google.cloud.gaming.v1alpha.CommitRolloutRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REVERT_ROLLOUT: + serviceImpl.revertRollout( + (com.google.cloud.gaming.v1alpha.RevertRolloutRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_DEPLOYMENT_TARGET: + serviceImpl.getDeploymentTarget( + (com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class GameServerDeploymentsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + GameServerDeploymentsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("GameServerDeploymentsService"); + } + } + + private static final class GameServerDeploymentsServiceFileDescriptorSupplier + extends GameServerDeploymentsServiceBaseDescriptorSupplier { + GameServerDeploymentsServiceFileDescriptorSupplier() {} + } + + private static final class GameServerDeploymentsServiceMethodDescriptorSupplier + extends GameServerDeploymentsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + GameServerDeploymentsServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (GameServerDeploymentsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new GameServerDeploymentsServiceFileDescriptorSupplier()) + .addMethod(getListGameServerDeploymentsMethodHelper()) + .addMethod(getGetGameServerDeploymentMethodHelper()) + .addMethod(getCreateGameServerDeploymentMethodHelper()) + .addMethod(getDeleteGameServerDeploymentMethodHelper()) + .addMethod(getUpdateGameServerDeploymentMethodHelper()) + .addMethod(getStartRolloutMethodHelper()) + .addMethod(getSetRolloutTargetMethodHelper()) + .addMethod(getCommitRolloutMethodHelper()) + .addMethod(getRevertRolloutMethodHelper()) + .addMethod(getGetDeploymentTargetMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceGrpc.java b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceGrpc.java new file mode 100644 index 000000000000..5589999b9e53 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceGrpc.java @@ -0,0 +1,833 @@ +package com.google.cloud.gaming.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Realm provides grouping of game server clusters that are serving particular
+ * gamer population.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/gaming/v1alpha/realms.proto") +public final class RealmsServiceGrpc { + + private RealmsServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.gaming.v1alpha.RealmsService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListRealmsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + METHOD_LIST_REALMS = getListRealmsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + getListRealmsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + getListRealmsMethod() { + return getListRealmsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + getListRealmsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + getListRealmsMethod; + if ((getListRealmsMethod = RealmsServiceGrpc.getListRealmsMethod) == null) { + synchronized (RealmsServiceGrpc.class) { + if ((getListRealmsMethod = RealmsServiceGrpc.getListRealmsMethod) == null) { + RealmsServiceGrpc.getListRealmsMethod = + getListRealmsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.RealmsService", "ListRealms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListRealmsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListRealmsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new RealmsServiceMethodDescriptorSupplier("ListRealms")) + .build(); + } + } + } + return getListRealmsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetRealmMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetRealmRequest, com.google.cloud.gaming.v1alpha.Realm> + METHOD_GET_REALM = getGetRealmMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetRealmRequest, com.google.cloud.gaming.v1alpha.Realm> + getGetRealmMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetRealmRequest, com.google.cloud.gaming.v1alpha.Realm> + getGetRealmMethod() { + return getGetRealmMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetRealmRequest, com.google.cloud.gaming.v1alpha.Realm> + getGetRealmMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetRealmRequest, com.google.cloud.gaming.v1alpha.Realm> + getGetRealmMethod; + if ((getGetRealmMethod = RealmsServiceGrpc.getGetRealmMethod) == null) { + synchronized (RealmsServiceGrpc.class) { + if ((getGetRealmMethod = RealmsServiceGrpc.getGetRealmMethod) == null) { + RealmsServiceGrpc.getGetRealmMethod = + getGetRealmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.RealmsService", "GetRealm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetRealmRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance())) + .setSchemaDescriptor(new RealmsServiceMethodDescriptorSupplier("GetRealm")) + .build(); + } + } + } + return getGetRealmMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateRealmMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, com.google.longrunning.Operation> + METHOD_CREATE_REALM = getCreateRealmMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, com.google.longrunning.Operation> + getCreateRealmMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, com.google.longrunning.Operation> + getCreateRealmMethod() { + return getCreateRealmMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, com.google.longrunning.Operation> + getCreateRealmMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, com.google.longrunning.Operation> + getCreateRealmMethod; + if ((getCreateRealmMethod = RealmsServiceGrpc.getCreateRealmMethod) == null) { + synchronized (RealmsServiceGrpc.class) { + if ((getCreateRealmMethod = RealmsServiceGrpc.getCreateRealmMethod) == null) { + RealmsServiceGrpc.getCreateRealmMethod = + getCreateRealmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.RealmsService", "CreateRealm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CreateRealmRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new RealmsServiceMethodDescriptorSupplier("CreateRealm")) + .build(); + } + } + } + return getCreateRealmMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteRealmMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, com.google.longrunning.Operation> + METHOD_DELETE_REALM = getDeleteRealmMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, com.google.longrunning.Operation> + getDeleteRealmMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, com.google.longrunning.Operation> + getDeleteRealmMethod() { + return getDeleteRealmMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, com.google.longrunning.Operation> + getDeleteRealmMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, com.google.longrunning.Operation> + getDeleteRealmMethod; + if ((getDeleteRealmMethod = RealmsServiceGrpc.getDeleteRealmMethod) == null) { + synchronized (RealmsServiceGrpc.class) { + if ((getDeleteRealmMethod = RealmsServiceGrpc.getDeleteRealmMethod) == null) { + RealmsServiceGrpc.getDeleteRealmMethod = + getDeleteRealmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.RealmsService", "DeleteRealm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new RealmsServiceMethodDescriptorSupplier("DeleteRealm")) + .build(); + } + } + } + return getDeleteRealmMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateRealmMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, com.google.longrunning.Operation> + METHOD_UPDATE_REALM = getUpdateRealmMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, com.google.longrunning.Operation> + getUpdateRealmMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, com.google.longrunning.Operation> + getUpdateRealmMethod() { + return getUpdateRealmMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, com.google.longrunning.Operation> + getUpdateRealmMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, com.google.longrunning.Operation> + getUpdateRealmMethod; + if ((getUpdateRealmMethod = RealmsServiceGrpc.getUpdateRealmMethod) == null) { + synchronized (RealmsServiceGrpc.class) { + if ((getUpdateRealmMethod = RealmsServiceGrpc.getUpdateRealmMethod) == null) { + RealmsServiceGrpc.getUpdateRealmMethod = + getUpdateRealmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.RealmsService", "UpdateRealm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new RealmsServiceMethodDescriptorSupplier("UpdateRealm")) + .build(); + } + } + } + return getUpdateRealmMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RealmsServiceStub newStub(io.grpc.Channel channel) { + return new RealmsServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RealmsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new RealmsServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RealmsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new RealmsServiceFutureStub(channel); + } + + /** + * + * + *
+   * Realm provides grouping of game server clusters that are serving particular
+   * gamer population.
+   * 
+ */ + public abstract static class RealmsServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists realms in a given project and location.
+     * 
+ */ + public void listRealms( + com.google.cloud.gaming.v1alpha.ListRealmsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListRealmsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single realm.
+     * 
+ */ + public void getRealm( + com.google.cloud.gaming.v1alpha.GetRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetRealmMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Realm in a given project and location.
+     * 
+ */ + public void createRealm( + com.google.cloud.gaming.v1alpha.CreateRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateRealmMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single realm.
+     * 
+ */ + public void deleteRealm( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteRealmMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Patches a single Realm.
+     * 
+ */ + public void updateRealm( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateRealmMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListRealmsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.ListRealmsRequest, + com.google.cloud.gaming.v1alpha.ListRealmsResponse>( + this, METHODID_LIST_REALMS))) + .addMethod( + getGetRealmMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetRealmRequest, + com.google.cloud.gaming.v1alpha.Realm>(this, METHODID_GET_REALM))) + .addMethod( + getCreateRealmMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CreateRealmRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_REALM))) + .addMethod( + getDeleteRealmMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.DeleteRealmRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_REALM))) + .addMethod( + getUpdateRealmMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.UpdateRealmRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_REALM))) + .build(); + } + } + + /** + * + * + *
+   * Realm provides grouping of game server clusters that are serving particular
+   * gamer population.
+   * 
+ */ + public static final class RealmsServiceStub extends io.grpc.stub.AbstractStub { + private RealmsServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private RealmsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RealmsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RealmsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists realms in a given project and location.
+     * 
+ */ + public void listRealms( + com.google.cloud.gaming.v1alpha.ListRealmsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListRealmsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single realm.
+     * 
+ */ + public void getRealm( + com.google.cloud.gaming.v1alpha.GetRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetRealmMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new Realm in a given project and location.
+     * 
+ */ + public void createRealm( + com.google.cloud.gaming.v1alpha.CreateRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateRealmMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single realm.
+     * 
+ */ + public void deleteRealm( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteRealmMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Patches a single Realm.
+     * 
+ */ + public void updateRealm( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateRealmMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Realm provides grouping of game server clusters that are serving particular
+   * gamer population.
+   * 
+ */ + public static final class RealmsServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private RealmsServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private RealmsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RealmsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RealmsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists realms in a given project and location.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ListRealmsResponse listRealms( + com.google.cloud.gaming.v1alpha.ListRealmsRequest request) { + return blockingUnaryCall( + getChannel(), getListRealmsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single realm.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.Realm getRealm( + com.google.cloud.gaming.v1alpha.GetRealmRequest request) { + return blockingUnaryCall(getChannel(), getGetRealmMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Realm in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createRealm( + com.google.cloud.gaming.v1alpha.CreateRealmRequest request) { + return blockingUnaryCall( + getChannel(), getCreateRealmMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single realm.
+     * 
+ */ + public com.google.longrunning.Operation deleteRealm( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteRealmMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Patches a single Realm.
+     * 
+ */ + public com.google.longrunning.Operation updateRealm( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateRealmMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Realm provides grouping of game server clusters that are serving particular
+   * gamer population.
+   * 
+ */ + public static final class RealmsServiceFutureStub + extends io.grpc.stub.AbstractStub { + private RealmsServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private RealmsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RealmsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RealmsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists realms in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ListRealmsResponse> + listRealms(com.google.cloud.gaming.v1alpha.ListRealmsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListRealmsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single realm.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getRealm(com.google.cloud.gaming.v1alpha.GetRealmRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetRealmMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Realm in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createRealm(com.google.cloud.gaming.v1alpha.CreateRealmRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateRealmMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single realm.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteRealm(com.google.cloud.gaming.v1alpha.DeleteRealmRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteRealmMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Patches a single Realm.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateRealm(com.google.cloud.gaming.v1alpha.UpdateRealmRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateRealmMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_REALMS = 0; + private static final int METHODID_GET_REALM = 1; + private static final int METHODID_CREATE_REALM = 2; + private static final int METHODID_DELETE_REALM = 3; + private static final int METHODID_UPDATE_REALM = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final RealmsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RealmsServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_REALMS: + serviceImpl.listRealms( + (com.google.cloud.gaming.v1alpha.ListRealmsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_REALM: + serviceImpl.getRealm( + (com.google.cloud.gaming.v1alpha.GetRealmRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_REALM: + serviceImpl.createRealm( + (com.google.cloud.gaming.v1alpha.CreateRealmRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_REALM: + serviceImpl.deleteRealm( + (com.google.cloud.gaming.v1alpha.DeleteRealmRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_REALM: + serviceImpl.updateRealm( + (com.google.cloud.gaming.v1alpha.UpdateRealmRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class RealmsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RealmsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RealmsService"); + } + } + + private static final class RealmsServiceFileDescriptorSupplier + extends RealmsServiceBaseDescriptorSupplier { + RealmsServiceFileDescriptorSupplier() {} + } + + private static final class RealmsServiceMethodDescriptorSupplier + extends RealmsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RealmsServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RealmsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RealmsServiceFileDescriptorSupplier()) + .addMethod(getListRealmsMethodHelper()) + .addMethod(getGetRealmMethodHelper()) + .addMethod(getCreateRealmMethodHelper()) + .addMethod(getDeleteRealmMethodHelper()) + .addMethod(getUpdateRealmMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceGrpc.java b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceGrpc.java new file mode 100644 index 000000000000..559bf6c13efb --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceGrpc.java @@ -0,0 +1,884 @@ +package com.google.cloud.gaming.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * The cloud gaming scaling policy is used to configure scaling parameters for
+ * each fleet.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/gaming/v1alpha/scaling_policies.proto") +public final class ScalingPoliciesServiceGrpc { + + private ScalingPoliciesServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.gaming.v1alpha.ScalingPoliciesService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListScalingPoliciesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + METHOD_LIST_SCALING_POLICIES = getListScalingPoliciesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + getListScalingPoliciesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + getListScalingPoliciesMethod() { + return getListScalingPoliciesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + getListScalingPoliciesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + getListScalingPoliciesMethod; + if ((getListScalingPoliciesMethod = ScalingPoliciesServiceGrpc.getListScalingPoliciesMethod) + == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + if ((getListScalingPoliciesMethod = ScalingPoliciesServiceGrpc.getListScalingPoliciesMethod) + == null) { + ScalingPoliciesServiceGrpc.getListScalingPoliciesMethod = + getListScalingPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService", + "ListScalingPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ScalingPoliciesServiceMethodDescriptorSupplier("ListScalingPolicies")) + .build(); + } + } + } + return getListScalingPoliciesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetScalingPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy> + METHOD_GET_SCALING_POLICY = getGetScalingPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy> + getGetScalingPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy> + getGetScalingPolicyMethod() { + return getGetScalingPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy> + getGetScalingPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy> + getGetScalingPolicyMethod; + if ((getGetScalingPolicyMethod = ScalingPoliciesServiceGrpc.getGetScalingPolicyMethod) + == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + if ((getGetScalingPolicyMethod = ScalingPoliciesServiceGrpc.getGetScalingPolicyMethod) + == null) { + ScalingPoliciesServiceGrpc.getGetScalingPolicyMethod = + getGetScalingPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService", + "GetScalingPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance())) + .setSchemaDescriptor( + new ScalingPoliciesServiceMethodDescriptorSupplier("GetScalingPolicy")) + .build(); + } + } + } + return getGetScalingPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateScalingPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation> + METHOD_CREATE_SCALING_POLICY = getCreateScalingPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation> + getCreateScalingPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation> + getCreateScalingPolicyMethod() { + return getCreateScalingPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation> + getCreateScalingPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation> + getCreateScalingPolicyMethod; + if ((getCreateScalingPolicyMethod = ScalingPoliciesServiceGrpc.getCreateScalingPolicyMethod) + == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + if ((getCreateScalingPolicyMethod = ScalingPoliciesServiceGrpc.getCreateScalingPolicyMethod) + == null) { + ScalingPoliciesServiceGrpc.getCreateScalingPolicyMethod = + getCreateScalingPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService", + "CreateScalingPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ScalingPoliciesServiceMethodDescriptorSupplier("CreateScalingPolicy")) + .build(); + } + } + } + return getCreateScalingPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteScalingPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation> + METHOD_DELETE_SCALING_POLICY = getDeleteScalingPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation> + getDeleteScalingPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation> + getDeleteScalingPolicyMethod() { + return getDeleteScalingPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation> + getDeleteScalingPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation> + getDeleteScalingPolicyMethod; + if ((getDeleteScalingPolicyMethod = ScalingPoliciesServiceGrpc.getDeleteScalingPolicyMethod) + == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + if ((getDeleteScalingPolicyMethod = ScalingPoliciesServiceGrpc.getDeleteScalingPolicyMethod) + == null) { + ScalingPoliciesServiceGrpc.getDeleteScalingPolicyMethod = + getDeleteScalingPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService", + "DeleteScalingPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ScalingPoliciesServiceMethodDescriptorSupplier("DeleteScalingPolicy")) + .build(); + } + } + } + return getDeleteScalingPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateScalingPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation> + METHOD_UPDATE_SCALING_POLICY = getUpdateScalingPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation> + getUpdateScalingPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation> + getUpdateScalingPolicyMethod() { + return getUpdateScalingPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation> + getUpdateScalingPolicyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation> + getUpdateScalingPolicyMethod; + if ((getUpdateScalingPolicyMethod = ScalingPoliciesServiceGrpc.getUpdateScalingPolicyMethod) + == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + if ((getUpdateScalingPolicyMethod = ScalingPoliciesServiceGrpc.getUpdateScalingPolicyMethod) + == null) { + ScalingPoliciesServiceGrpc.getUpdateScalingPolicyMethod = + getUpdateScalingPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService", + "UpdateScalingPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ScalingPoliciesServiceMethodDescriptorSupplier("UpdateScalingPolicy")) + .build(); + } + } + } + return getUpdateScalingPolicyMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ScalingPoliciesServiceStub newStub(io.grpc.Channel channel) { + return new ScalingPoliciesServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ScalingPoliciesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new ScalingPoliciesServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ScalingPoliciesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new ScalingPoliciesServiceFutureStub(channel); + } + + /** + * + * + *
+   * The cloud gaming scaling policy is used to configure scaling parameters for
+   * each fleet.
+   * 
+ */ + public abstract static class ScalingPoliciesServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists ScalingPolicies in a given project and location.
+     * 
+ */ + public void listScalingPolicies( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListScalingPoliciesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single scaling policy.
+     * 
+ */ + public void getScalingPolicy( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetScalingPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a new scaling policy in a given project and location.
+     * 
+ */ + public void createScalingPolicy( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateScalingPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single scaling policy.
+     * 
+ */ + public void deleteScalingPolicy( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteScalingPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Patches a single scaling policy.
+     * 
+ */ + public void updateScalingPolicy( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateScalingPolicyMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListScalingPoliciesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse>( + this, METHODID_LIST_SCALING_POLICIES))) + .addMethod( + getGetScalingPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest, + com.google.cloud.gaming.v1alpha.ScalingPolicy>( + this, METHODID_GET_SCALING_POLICY))) + .addMethod( + getCreateScalingPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_SCALING_POLICY))) + .addMethod( + getDeleteScalingPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_SCALING_POLICY))) + .addMethod( + getUpdateScalingPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_SCALING_POLICY))) + .build(); + } + } + + /** + * + * + *
+   * The cloud gaming scaling policy is used to configure scaling parameters for
+   * each fleet.
+   * 
+ */ + public static final class ScalingPoliciesServiceStub + extends io.grpc.stub.AbstractStub { + private ScalingPoliciesServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private ScalingPoliciesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ScalingPoliciesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ScalingPoliciesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ScalingPolicies in a given project and location.
+     * 
+ */ + public void listScalingPolicies( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListScalingPoliciesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single scaling policy.
+     * 
+ */ + public void getScalingPolicy( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetScalingPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new scaling policy in a given project and location.
+     * 
+ */ + public void createScalingPolicy( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateScalingPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single scaling policy.
+     * 
+ */ + public void deleteScalingPolicy( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteScalingPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Patches a single scaling policy.
+     * 
+ */ + public void updateScalingPolicy( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateScalingPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The cloud gaming scaling policy is used to configure scaling parameters for
+   * each fleet.
+   * 
+ */ + public static final class ScalingPoliciesServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private ScalingPoliciesServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ScalingPoliciesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ScalingPoliciesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ScalingPoliciesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ScalingPolicies in a given project and location.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse listScalingPolicies( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest request) { + return blockingUnaryCall( + getChannel(), getListScalingPoliciesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single scaling policy.
+     * 
+ */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getGetScalingPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new scaling policy in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createScalingPolicy( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getCreateScalingPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single scaling policy.
+     * 
+ */ + public com.google.longrunning.Operation deleteScalingPolicy( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteScalingPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Patches a single scaling policy.
+     * 
+ */ + public com.google.longrunning.Operation updateScalingPolicy( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateScalingPolicyMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The cloud gaming scaling policy is used to configure scaling parameters for
+   * each fleet.
+   * 
+ */ + public static final class ScalingPoliciesServiceFutureStub + extends io.grpc.stub.AbstractStub { + private ScalingPoliciesServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ScalingPoliciesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ScalingPoliciesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ScalingPoliciesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ScalingPolicies in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse> + listScalingPolicies(com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListScalingPoliciesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single scaling policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.gaming.v1alpha.ScalingPolicy> + getScalingPolicy(com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetScalingPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new scaling policy in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createScalingPolicy(com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateScalingPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single scaling policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteScalingPolicy(com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteScalingPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Patches a single scaling policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateScalingPolicy(com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateScalingPolicyMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_SCALING_POLICIES = 0; + private static final int METHODID_GET_SCALING_POLICY = 1; + private static final int METHODID_CREATE_SCALING_POLICY = 2; + private static final int METHODID_DELETE_SCALING_POLICY = 3; + private static final int METHODID_UPDATE_SCALING_POLICY = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ScalingPoliciesServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ScalingPoliciesServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_SCALING_POLICIES: + serviceImpl.listScalingPolicies( + (com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse>) + responseObserver); + break; + case METHODID_GET_SCALING_POLICY: + serviceImpl.getScalingPolicy( + (com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_SCALING_POLICY: + serviceImpl.createScalingPolicy( + (com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SCALING_POLICY: + serviceImpl.deleteScalingPolicy( + (com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SCALING_POLICY: + serviceImpl.updateScalingPolicy( + (com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ScalingPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ScalingPoliciesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ScalingPoliciesService"); + } + } + + private static final class ScalingPoliciesServiceFileDescriptorSupplier + extends ScalingPoliciesServiceBaseDescriptorSupplier { + ScalingPoliciesServiceFileDescriptorSupplier() {} + } + + private static final class ScalingPoliciesServiceMethodDescriptorSupplier + extends ScalingPoliciesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ScalingPoliciesServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ScalingPoliciesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ScalingPoliciesServiceFileDescriptorSupplier()) + .addMethod(getListScalingPoliciesMethodHelper()) + .addMethod(getGetScalingPolicyMethodHelper()) + .addMethod(getCreateScalingPolicyMethodHelper()) + .addMethod(getDeleteScalingPolicyMethodHelper()) + .addMethod(getUpdateScalingPolicyMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 472d580b156e..eb845b2f45fb 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -815,6 +815,16 @@ grpc-google-cloud-recaptchaenterprise-v1beta1 0.10.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + @@ -840,6 +850,7 @@ grpc-google-cloud-firestore-admin-v1 grpc-google-cloud-firestore-v1 grpc-google-cloud-firestore-v1beta1 + grpc-google-cloud-gameservices-v1alpha grpc-google-cloud-iamcredentials-v1 grpc-google-cloud-iot-v1 grpc-google-cloud-kms-v1 @@ -909,6 +920,7 @@ proto-google-cloud-firestore-admin-v1 proto-google-cloud-firestore-v1 proto-google-cloud-firestore-v1beta1 + proto-google-cloud-gameservices-v1alpha proto-google-cloud-iamcredentials-v1 proto-google-cloud-iot-v1 proto-google-cloud-kms-v1 diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/pom.xml b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/pom.xml new file mode 100644 index 000000000000..374aea6c329b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + proto-google-cloud-gameservices-v1alpha + PROTO library for proto-google-cloud-gameservices-v1alpha + + com.google.api.grpc + google-api-grpc + 0.64.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + com.google.api.grpc + proto-google-iam-v1 + compile + + + diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicies.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicies.java new file mode 100644 index 000000000000..abe339b2b308 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicies.java @@ -0,0 +1,235 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public final class AllocationPolicies { + private AllocationPolicies() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/gaming/v1alpha/allocation" + + "_policies.proto\022\033google.cloud.gaming.v1a" + + "lpha\032\034google/api/annotations.proto\032(goog" + + "le/cloud/gaming/v1alpha/common.proto\032#go" + + "ogle/longrunning/operations.proto\032\036googl" + + "e/protobuf/duration.proto\032 google/protob" + + "uf/field_mask.proto\032\037google/protobuf/tim" + + "estamp.proto\032\036google/protobuf/wrappers.p" + + "roto\032\027google/api/client.proto\"x\n\035ListAll" + + "ocationPoliciesRequest\022\016\n\006parent\030\001 \001(\t\022\021" + + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n" + + "\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\205\001\n\036List" + + "AllocationPoliciesResponse\022J\n\023allocation" + + "_policies\030\001 \003(\0132-.google.cloud.gaming.v1" + + "alpha.AllocationPolicy\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"*\n\032GetAllocationPolicyRequest\022\014\n" + + "\004name\030\001 \001(\t\"\227\001\n\035CreateAllocationPolicyRe" + + "quest\022\016\n\006parent\030\001 \001(\t\022\034\n\024allocation_poli" + + "cy_id\030\002 \001(\t\022H\n\021allocation_policy\030\003 \001(\0132-" + + ".google.cloud.gaming.v1alpha.AllocationP" + + "olicy\"-\n\035DeleteAllocationPolicyRequest\022\014" + + "\n\004name\030\001 \001(\t\"\232\001\n\035UpdateAllocationPolicyR" + + "equest\022H\n\021allocation_policy\030\001 \001(\0132-.goog" + + "le.cloud.gaming.v1alpha.AllocationPolicy" + + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMask\"\274\003\n\020AllocationPolicy\022\014\n\004name\030\001" + + " \001(\t\022/\n\013create_time\030\002 \001(\0132\032.google.proto" + + "buf.Timestamp\022/\n\013update_time\030\003 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022I\n\006labels\030\004 \003(\01329" + + ".google.cloud.gaming.v1alpha.AllocationP" + + "olicy.LabelsEntry\022-\n\010priority\030\010 \001(\0132\033.go" + + "ogle.protobuf.Int32Value\022\016\n\006weight\030\t \001(\005" + + "\022E\n\021cluster_selectors\030\n \003(\0132*.google.clo" + + "ud.gaming.v1alpha.LabelSelector\0228\n\tsched" + + "ules\030\013 \003(\0132%.google.cloud.gaming.v1alpha" + + ".Schedule\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\0012\302\010\n\031AllocationPoliciesS" + + "ervice\022\326\001\n\026ListAllocationPolicies\022:.goog" + + "le.cloud.gaming.v1alpha.ListAllocationPo" + + "liciesRequest\032;.google.cloud.gaming.v1al" + + "pha.ListAllocationPoliciesResponse\"C\202\323\344\223" + + "\002=\022;/v1alpha/{parent=projects/*/location" + + "s/*}/allocationPolicies\022\302\001\n\023GetAllocatio" + + "nPolicy\0227.google.cloud.gaming.v1alpha.Ge" + + "tAllocationPolicyRequest\032-.google.cloud." + + "gaming.v1alpha.AllocationPolicy\"C\202\323\344\223\002=\022" + + ";/v1alpha/{name=projects/*/locations/*/a" + + "llocationPolicies/*}\022\313\001\n\026CreateAllocatio" + + "nPolicy\022:.google.cloud.gaming.v1alpha.Cr" + + "eateAllocationPolicyRequest\032\035.google.lon" + + "grunning.Operation\"V\202\323\344\223\002P\";/v1alpha/{pa" + + "rent=projects/*/locations/*}/allocationP" + + "olicies:\021allocation_policy\022\270\001\n\026DeleteAll" + + "ocationPolicy\022:.google.cloud.gaming.v1al" + + "pha.DeleteAllocationPolicyRequest\032\035.goog" + + "le.longrunning.Operation\"C\202\323\344\223\002=*;/v1alp" + + "ha/{name=projects/*/locations/*/allocati" + + "onPolicies/*}\022\335\001\n\026UpdateAllocationPolicy" + + "\022:.google.cloud.gaming.v1alpha.UpdateAll" + + "ocationPolicyRequest\032\035.google.longrunnin" + + "g.Operation\"h\202\323\344\223\002b2M/v1alpha/{allocatio" + + "n_policy.name=projects/*/locations/*/all" + + "ocationPolicies/*}:\021allocation_policy\032\036\312" + + "A\033gameservices.googleapis.comBf\n\037com.goo" + + "gle.cloud.gaming.v1alphaP\001ZAgoogle.golan" + + "g.org/genproto/googleapis/cloud/gaming/v" + + "1alpha;gamingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.gaming.v1alpha.Common.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor, + new java.lang.String[] { + "AllocationPolicies", "NextPageToken", + }); + internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "AllocationPolicyId", "AllocationPolicy", + }); + internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor, + new java.lang.String[] { + "AllocationPolicy", "UpdateMask", + }); + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "Priority", + "Weight", + "ClusterSelectors", + "Schedules", + }); + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.gaming.v1alpha.Common.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicy.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicy.java new file mode 100644 index 000000000000..c0b558d9c508 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicy.java @@ -0,0 +1,2848 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * An allocation policy resource.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.AllocationPolicy} + */ +public final class AllocationPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.AllocationPolicy) + AllocationPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AllocationPolicy.newBuilder() to construct. + private AllocationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AllocationPolicy() { + name_ = ""; + clusterSelectors_ = java.util.Collections.emptyList(); + schedules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AllocationPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 66: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (priority_ != null) { + subBuilder = priority_.toBuilder(); + } + priority_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priority_); + priority_ = subBuilder.buildPartial(); + } + + break; + } + case 72: + { + weight_ = input.readInt32(); + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + clusterSelectors_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.LabelSelector.parser(), extensionRegistry)); + break; + } + case 90: + { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + schedules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + schedules_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.Schedule.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = java.util.Collections.unmodifiableList(clusterSelectors_); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + schedules_ = java.util.Collections.unmodifiableList(schedules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.AllocationPolicy.class, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the allocation policy, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the allocation policy, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PRIORITY_FIELD_NUMBER = 8; + private com.google.protobuf.Int32Value priority_; + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public boolean hasPriority() { + return priority_ != null; + } + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public com.google.protobuf.Int32Value getPriority() { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder() { + return getPriority(); + } + + public static final int WEIGHT_FIELD_NUMBER = 9; + private int weight_; + /** + * + * + *
+   * The relative weight of the policy based on its priority - If there are
+   * multiple policies with the same priority, the probability of using a policy
+   * is based on its weight.
+   * 
+ * + * int32 weight = 9; + */ + public int getWeight() { + return weight_; + } + + public static final int CLUSTER_SELECTORS_FIELD_NUMBER = 10; + private java.util.List clusterSelectors_; + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public java.util.List getClusterSelectorsList() { + return clusterSelectors_; + } + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public java.util.List + getClusterSelectorsOrBuilderList() { + return clusterSelectors_; + } + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public int getClusterSelectorsCount() { + return clusterSelectors_.size(); + } + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index) { + return clusterSelectors_.get(index); + } + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder( + int index) { + return clusterSelectors_.get(index); + } + + public static final int SCHEDULES_FIELD_NUMBER = 11; + private java.util.List schedules_; + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public java.util.List getSchedulesList() { + return schedules_; + } + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public java.util.List + getSchedulesOrBuilderList() { + return schedules_; + } + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public int getSchedulesCount() { + return schedules_.size(); + } + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index) { + return schedules_.get(index); + } + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index) { + return schedules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (priority_ != null) { + output.writeMessage(8, getPriority()); + } + if (weight_ != 0) { + output.writeInt32(9, weight_); + } + for (int i = 0; i < clusterSelectors_.size(); i++) { + output.writeMessage(10, clusterSelectors_.get(i)); + } + for (int i = 0; i < schedules_.size(); i++) { + output.writeMessage(11, schedules_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (priority_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getPriority()); + } + if (weight_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, weight_); + } + for (int i = 0; i < clusterSelectors_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(10, clusterSelectors_.get(i)); + } + for (int i = 0; i < schedules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, schedules_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.AllocationPolicy)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.AllocationPolicy other = + (com.google.cloud.gaming.v1alpha.AllocationPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasPriority() != other.hasPriority()) return false; + if (hasPriority()) { + if (!getPriority().equals(other.getPriority())) return false; + } + if (getWeight() != other.getWeight()) return false; + if (!getClusterSelectorsList().equals(other.getClusterSelectorsList())) return false; + if (!getSchedulesList().equals(other.getSchedulesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasPriority()) { + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority().hashCode(); + } + hash = (37 * hash) + WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getWeight(); + if (getClusterSelectorsCount() > 0) { + hash = (37 * hash) + CLUSTER_SELECTORS_FIELD_NUMBER; + hash = (53 * hash) + getClusterSelectorsList().hashCode(); + } + if (getSchedulesCount() > 0) { + hash = (37 * hash) + SCHEDULES_FIELD_NUMBER; + hash = (53 * hash) + getSchedulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.AllocationPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An allocation policy resource.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.AllocationPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.AllocationPolicy) + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.AllocationPolicy.class, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.AllocationPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterSelectorsFieldBuilder(); + getSchedulesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (priorityBuilder_ == null) { + priority_ = null; + } else { + priority_ = null; + priorityBuilder_ = null; + } + weight_ = 0; + + if (clusterSelectorsBuilder_ == null) { + clusterSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + clusterSelectorsBuilder_.clear(); + } + if (schedulesBuilder_ == null) { + schedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + schedulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_AllocationPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.AllocationPolicy getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.AllocationPolicy build() { + com.google.cloud.gaming.v1alpha.AllocationPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.AllocationPolicy buildPartial() { + com.google.cloud.gaming.v1alpha.AllocationPolicy result = + new com.google.cloud.gaming.v1alpha.AllocationPolicy(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (priorityBuilder_ == null) { + result.priority_ = priority_; + } else { + result.priority_ = priorityBuilder_.build(); + } + result.weight_ = weight_; + if (clusterSelectorsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = java.util.Collections.unmodifiableList(clusterSelectors_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.clusterSelectors_ = clusterSelectors_; + } else { + result.clusterSelectors_ = clusterSelectorsBuilder_.build(); + } + if (schedulesBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + schedules_ = java.util.Collections.unmodifiableList(schedules_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.schedules_ = schedules_; + } else { + result.schedules_ = schedulesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.AllocationPolicy) { + return mergeFrom((com.google.cloud.gaming.v1alpha.AllocationPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.AllocationPolicy other) { + if (other == com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasPriority()) { + mergePriority(other.getPriority()); + } + if (other.getWeight() != 0) { + setWeight(other.getWeight()); + } + if (clusterSelectorsBuilder_ == null) { + if (!other.clusterSelectors_.isEmpty()) { + if (clusterSelectors_.isEmpty()) { + clusterSelectors_ = other.clusterSelectors_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.addAll(other.clusterSelectors_); + } + onChanged(); + } + } else { + if (!other.clusterSelectors_.isEmpty()) { + if (clusterSelectorsBuilder_.isEmpty()) { + clusterSelectorsBuilder_.dispose(); + clusterSelectorsBuilder_ = null; + clusterSelectors_ = other.clusterSelectors_; + bitField0_ = (bitField0_ & ~0x00000040); + clusterSelectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClusterSelectorsFieldBuilder() + : null; + } else { + clusterSelectorsBuilder_.addAllMessages(other.clusterSelectors_); + } + } + } + if (schedulesBuilder_ == null) { + if (!other.schedules_.isEmpty()) { + if (schedules_.isEmpty()) { + schedules_ = other.schedules_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureSchedulesIsMutable(); + schedules_.addAll(other.schedules_); + } + onChanged(); + } + } else { + if (!other.schedules_.isEmpty()) { + if (schedulesBuilder_.isEmpty()) { + schedulesBuilder_.dispose(); + schedulesBuilder_ = null; + schedules_ = other.schedules_; + bitField0_ = (bitField0_ & ~0x00000080); + schedulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSchedulesFieldBuilder() + : null; + } else { + schedulesBuilder_.addAllMessages(other.schedules_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.AllocationPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.AllocationPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the allocation policy, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the allocation policy, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the allocation policy, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the allocation policy, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the allocation policy, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels associated with the allocation policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Int32Value priority_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + priorityBuilder_; + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public boolean hasPriority() { + return priorityBuilder_ != null || priority_ != null; + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public com.google.protobuf.Int32Value getPriority() { + if (priorityBuilder_ == null) { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } else { + return priorityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public Builder setPriority(com.google.protobuf.Int32Value value) { + if (priorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priority_ = value; + onChanged(); + } else { + priorityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public Builder setPriority(com.google.protobuf.Int32Value.Builder builderForValue) { + if (priorityBuilder_ == null) { + priority_ = builderForValue.build(); + onChanged(); + } else { + priorityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public Builder mergePriority(com.google.protobuf.Int32Value value) { + if (priorityBuilder_ == null) { + if (priority_ != null) { + priority_ = + com.google.protobuf.Int32Value.newBuilder(priority_).mergeFrom(value).buildPartial(); + } else { + priority_ = value; + } + onChanged(); + } else { + priorityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public Builder clearPriority() { + if (priorityBuilder_ == null) { + priority_ = null; + onChanged(); + } else { + priority_ = null; + priorityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public com.google.protobuf.Int32Value.Builder getPriorityBuilder() { + + onChanged(); + return getPriorityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + public com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder() { + if (priorityBuilder_ != null) { + return priorityBuilder_.getMessageOrBuilder(); + } else { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } + } + /** + * + * + *
+     * Required. The priority of the policy for allocation. A smaller value
+     * indicates a higher priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getPriorityFieldBuilder() { + if (priorityBuilder_ == null) { + priorityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getPriority(), getParentForChildren(), isClean()); + priority_ = null; + } + return priorityBuilder_; + } + + private int weight_; + /** + * + * + *
+     * The relative weight of the policy based on its priority - If there are
+     * multiple policies with the same priority, the probability of using a policy
+     * is based on its weight.
+     * 
+ * + * int32 weight = 9; + */ + public int getWeight() { + return weight_; + } + /** + * + * + *
+     * The relative weight of the policy based on its priority - If there are
+     * multiple policies with the same priority, the probability of using a policy
+     * is based on its weight.
+     * 
+ * + * int32 weight = 9; + */ + public Builder setWeight(int value) { + + weight_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative weight of the policy based on its priority - If there are
+     * multiple policies with the same priority, the probability of using a policy
+     * is based on its weight.
+     * 
+ * + * int32 weight = 9; + */ + public Builder clearWeight() { + + weight_ = 0; + onChanged(); + return this; + } + + private java.util.List clusterSelectors_ = + java.util.Collections.emptyList(); + + private void ensureClusterSelectorsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = + new java.util.ArrayList( + clusterSelectors_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + clusterSelectorsBuilder_; + + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public java.util.List getClusterSelectorsList() { + if (clusterSelectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusterSelectors_); + } else { + return clusterSelectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public int getClusterSelectorsCount() { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.size(); + } else { + return clusterSelectorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index) { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.get(index); + } else { + return clusterSelectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder setClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.set(index, value); + onChanged(); + } else { + clusterSelectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder setClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.set(index, builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder addClusterSelectors(com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(value); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder addClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(index, value); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder addClusterSelectors( + com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder addClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(index, builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder addAllClusterSelectors( + java.lang.Iterable values) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterSelectors_); + onChanged(); + } else { + clusterSelectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder clearClusterSelectors() { + if (clusterSelectorsBuilder_ == null) { + clusterSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + clusterSelectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public Builder removeClusterSelectors(int index) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.remove(index); + onChanged(); + } else { + clusterSelectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder getClusterSelectorsBuilder( + int index) { + return getClusterSelectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder( + int index) { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.get(index); + } else { + return clusterSelectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public java.util.List + getClusterSelectorsOrBuilderList() { + if (clusterSelectorsBuilder_ != null) { + return clusterSelectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusterSelectors_); + } + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder addClusterSelectorsBuilder() { + return getClusterSelectorsFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance()); + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder addClusterSelectorsBuilder( + int index) { + return getClusterSelectorsFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance()); + } + /** + * + * + *
+     * The cluster labels are used to identify the clusters that a policy is
+     * applied to.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + public java.util.List + getClusterSelectorsBuilderList() { + return getClusterSelectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + getClusterSelectorsFieldBuilder() { + if (clusterSelectorsBuilder_ == null) { + clusterSelectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder>( + clusterSelectors_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + clusterSelectors_ = null; + } + return clusterSelectorsBuilder_; + } + + private java.util.List schedules_ = + java.util.Collections.emptyList(); + + private void ensureSchedulesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + schedules_ = new java.util.ArrayList(schedules_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder> + schedulesBuilder_; + + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public java.util.List getSchedulesList() { + if (schedulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(schedules_); + } else { + return schedulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public int getSchedulesCount() { + if (schedulesBuilder_ == null) { + return schedules_.size(); + } else { + return schedulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index) { + if (schedulesBuilder_ == null) { + return schedules_.get(index); + } else { + return schedulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder setSchedules(int index, com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.set(index, value); + onChanged(); + } else { + schedulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder setSchedules( + int index, com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.set(index, builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder addSchedules(com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.add(value); + onChanged(); + } else { + schedulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder addSchedules(int index, com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.add(index, value); + onChanged(); + } else { + schedulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder addSchedules(com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.add(builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder addSchedules( + int index, com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.add(index, builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder addAllSchedules( + java.lang.Iterable values) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, schedules_); + onChanged(); + } else { + schedulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder clearSchedules() { + if (schedulesBuilder_ == null) { + schedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + schedulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public Builder removeSchedules(int index) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.remove(index); + onChanged(); + } else { + schedulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder getSchedulesBuilder(int index) { + return getSchedulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index) { + if (schedulesBuilder_ == null) { + return schedules_.get(index); + } else { + return schedulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public java.util.List + getSchedulesOrBuilderList() { + if (schedulesBuilder_ != null) { + return schedulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(schedules_); + } + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder addSchedulesBuilder() { + return getSchedulesFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance()); + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder addSchedulesBuilder(int index) { + return getSchedulesFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance()); + } + /** + * + * + *
+     * The event schedules - If specified, the policy is time based and when the
+     * schedule is effective overrides the default policy.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + public java.util.List + getSchedulesBuilderList() { + return getSchedulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder> + getSchedulesFieldBuilder() { + if (schedulesBuilder_ == null) { + schedulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder>( + schedules_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); + schedules_ = null; + } + return schedulesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.AllocationPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.AllocationPolicy) + private static final com.google.cloud.gaming.v1alpha.AllocationPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.AllocationPolicy(); + } + + public static com.google.cloud.gaming.v1alpha.AllocationPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocationPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllocationPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.AllocationPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyName.java new file mode 100644 index 000000000000..f4da02b9ad86 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyName.java @@ -0,0 +1,213 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AllocationPolicyName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/allocationPolicies/{allocation_policy}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String allocationPolicy; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAllocationPolicy() { + return allocationPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AllocationPolicyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + allocationPolicy = Preconditions.checkNotNull(builder.getAllocationPolicy()); + } + + public static AllocationPolicyName of(String project, String location, String allocationPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAllocationPolicy(allocationPolicy) + .build(); + } + + public static String format(String project, String location, String allocationPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAllocationPolicy(allocationPolicy) + .build() + .toString(); + } + + public static AllocationPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AllocationPolicyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("allocation_policy")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (AllocationPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("allocationPolicy", allocationPolicy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "allocation_policy", allocationPolicy); + } + + /** Builder for AllocationPolicyName. */ + public static class Builder { + + private String project; + private String location; + private String allocationPolicy; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAllocationPolicy() { + return allocationPolicy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAllocationPolicy(String allocationPolicy) { + this.allocationPolicy = allocationPolicy; + return this; + } + + private Builder() {} + + private Builder(AllocationPolicyName allocationPolicyName) { + project = allocationPolicyName.project; + location = allocationPolicyName.location; + allocationPolicy = allocationPolicyName.allocationPolicy; + } + + public AllocationPolicyName build() { + return new AllocationPolicyName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AllocationPolicyName) { + AllocationPolicyName that = (AllocationPolicyName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.allocationPolicy.equals(that.allocationPolicy)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= allocationPolicy.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyOrBuilder.java new file mode 100644 index 000000000000..c184b000d354 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPolicyOrBuilder.java @@ -0,0 +1,319 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface AllocationPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.AllocationPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the allocation policy, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the allocation policy, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/allocationPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels associated with the allocation policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + boolean hasPriority(); + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + com.google.protobuf.Int32Value getPriority(); + /** + * + * + *
+   * Required. The priority of the policy for allocation. A smaller value
+   * indicates a higher priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 8; + */ + com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder(); + + /** + * + * + *
+   * The relative weight of the policy based on its priority - If there are
+   * multiple policies with the same priority, the probability of using a policy
+   * is based on its weight.
+   * 
+ * + * int32 weight = 9; + */ + int getWeight(); + + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + java.util.List getClusterSelectorsList(); + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index); + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + int getClusterSelectorsCount(); + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + java.util.List + getClusterSelectorsOrBuilderList(); + /** + * + * + *
+   * The cluster labels are used to identify the clusters that a policy is
+   * applied to.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 10; + */ + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder(int index); + + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + java.util.List getSchedulesList(); + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index); + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + int getSchedulesCount(); + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + java.util.List + getSchedulesOrBuilderList(); + /** + * + * + *
+   * The event schedules - If specified, the policy is time based and when the
+   * schedule is effective overrides the default policy.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 11; + */ + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelector.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelector.java new file mode 100644 index 000000000000..89a648d60bc7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelector.java @@ -0,0 +1,805 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * The percentage of game servers running this game server template in the
+ * selected clusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ClusterPercentageSelector} + */ +public final class ClusterPercentageSelector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ClusterPercentageSelector) + ClusterPercentageSelectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClusterPercentageSelector.newBuilder() to construct. + private ClusterPercentageSelector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClusterPercentageSelector() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClusterPercentageSelector( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.LabelSelector.Builder subBuilder = null; + if (clusterSelector_ != null) { + subBuilder = clusterSelector_.toBuilder(); + } + clusterSelector_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.LabelSelector.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clusterSelector_); + clusterSelector_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + percent_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.class, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder.class); + } + + public static final int CLUSTER_SELECTOR_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.LabelSelector clusterSelector_; + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public boolean hasClusterSelector() { + return clusterSelector_ != null; + } + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelector() { + return clusterSelector_ == null + ? com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance() + : clusterSelector_; + } + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorOrBuilder() { + return getClusterSelector(); + } + + public static final int PERCENT_FIELD_NUMBER = 2; + private int percent_; + /** + * + * + *
+   * The percentage of game servers running this game server depolyment. The
+   * percentage is applied to game server clusters which contain all of the
+   * labels in the cluster selector field.
+   * 
+ * + * int32 percent = 2; + */ + public int getPercent() { + return percent_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (clusterSelector_ != null) { + output.writeMessage(1, getClusterSelector()); + } + if (percent_ != 0) { + output.writeInt32(2, percent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (clusterSelector_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getClusterSelector()); + } + if (percent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, percent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ClusterPercentageSelector)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector other = + (com.google.cloud.gaming.v1alpha.ClusterPercentageSelector) obj; + + if (hasClusterSelector() != other.hasClusterSelector()) return false; + if (hasClusterSelector()) { + if (!getClusterSelector().equals(other.getClusterSelector())) return false; + } + if (getPercent() != other.getPercent()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasClusterSelector()) { + hash = (37 * hash) + CLUSTER_SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getClusterSelector().hashCode(); + } + hash = (37 * hash) + PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getPercent(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The percentage of game servers running this game server template in the
+   * selected clusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ClusterPercentageSelector} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ClusterPercentageSelector) + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.class, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (clusterSelectorBuilder_ == null) { + clusterSelector_ = null; + } else { + clusterSelector_ = null; + clusterSelectorBuilder_ = null; + } + percent_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector build() { + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector buildPartial() { + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector result = + new com.google.cloud.gaming.v1alpha.ClusterPercentageSelector(this); + if (clusterSelectorBuilder_ == null) { + result.clusterSelector_ = clusterSelector_; + } else { + result.clusterSelector_ = clusterSelectorBuilder_.build(); + } + result.percent_ = percent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ClusterPercentageSelector) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ClusterPercentageSelector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ClusterPercentageSelector other) { + if (other == com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance()) + return this; + if (other.hasClusterSelector()) { + mergeClusterSelector(other.getClusterSelector()); + } + if (other.getPercent() != 0) { + setPercent(other.getPercent()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ClusterPercentageSelector) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.LabelSelector clusterSelector_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + clusterSelectorBuilder_; + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public boolean hasClusterSelector() { + return clusterSelectorBuilder_ != null || clusterSelector_ != null; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelector() { + if (clusterSelectorBuilder_ == null) { + return clusterSelector_ == null + ? com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance() + : clusterSelector_; + } else { + return clusterSelectorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public Builder setClusterSelector(com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterSelector_ = value; + onChanged(); + } else { + clusterSelectorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public Builder setClusterSelector( + com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorBuilder_ == null) { + clusterSelector_ = builderForValue.build(); + onChanged(); + } else { + clusterSelectorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public Builder mergeClusterSelector(com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorBuilder_ == null) { + if (clusterSelector_ != null) { + clusterSelector_ = + com.google.cloud.gaming.v1alpha.LabelSelector.newBuilder(clusterSelector_) + .mergeFrom(value) + .buildPartial(); + } else { + clusterSelector_ = value; + } + onChanged(); + } else { + clusterSelectorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public Builder clearClusterSelector() { + if (clusterSelectorBuilder_ == null) { + clusterSelector_ = null; + onChanged(); + } else { + clusterSelector_ = null; + clusterSelectorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder getClusterSelectorBuilder() { + + onChanged(); + return getClusterSelectorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorOrBuilder() { + if (clusterSelectorBuilder_ != null) { + return clusterSelectorBuilder_.getMessageOrBuilder(); + } else { + return clusterSelector_ == null + ? com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance() + : clusterSelector_; + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this game server template
+     * applies.
+     * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + getClusterSelectorFieldBuilder() { + if (clusterSelectorBuilder_ == null) { + clusterSelectorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder>( + getClusterSelector(), getParentForChildren(), isClean()); + clusterSelector_ = null; + } + return clusterSelectorBuilder_; + } + + private int percent_; + /** + * + * + *
+     * The percentage of game servers running this game server depolyment. The
+     * percentage is applied to game server clusters which contain all of the
+     * labels in the cluster selector field.
+     * 
+ * + * int32 percent = 2; + */ + public int getPercent() { + return percent_; + } + /** + * + * + *
+     * The percentage of game servers running this game server depolyment. The
+     * percentage is applied to game server clusters which contain all of the
+     * labels in the cluster selector field.
+     * 
+ * + * int32 percent = 2; + */ + public Builder setPercent(int value) { + + percent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The percentage of game servers running this game server depolyment. The
+     * percentage is applied to game server clusters which contain all of the
+     * labels in the cluster selector field.
+     * 
+ * + * int32 percent = 2; + */ + public Builder clearPercent() { + + percent_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ClusterPercentageSelector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ClusterPercentageSelector) + private static final com.google.cloud.gaming.v1alpha.ClusterPercentageSelector DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ClusterPercentageSelector(); + } + + public static com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterPercentageSelector parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClusterPercentageSelector(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelectorOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelectorOrBuilder.java new file mode 100644 index 000000000000..94242326604c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ClusterPercentageSelectorOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ClusterPercentageSelectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ClusterPercentageSelector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + boolean hasClusterSelector(); + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelector(); + /** + * + * + *
+   * Labels used to identify the clusters to which this game server template
+   * applies.
+   * 
+ * + * .google.cloud.gaming.v1alpha.LabelSelector cluster_selector = 1; + */ + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorOrBuilder(); + + /** + * + * + *
+   * The percentage of game servers running this game server depolyment. The
+   * percentage is applied to game server clusters which contain all of the
+   * labels in the cluster selector field.
+   * 
+ * + * int32 percent = 2; + */ + int getPercent(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequest.java new file mode 100644 index 000000000000..97a212442852 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequest.java @@ -0,0 +1,612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.CommitRollout.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CommitRolloutRequest} + */ +public final class CommitRolloutRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CommitRolloutRequest) + CommitRolloutRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommitRolloutRequest.newBuilder() to construct. + private CommitRolloutRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommitRolloutRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommitRolloutRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest.class, + com.google.cloud.gaming.v1alpha.CommitRolloutRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CommitRolloutRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CommitRolloutRequest other = + (com.google.cloud.gaming.v1alpha.CommitRolloutRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.CommitRolloutRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.CommitRollout.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CommitRolloutRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CommitRolloutRequest) + com.google.cloud.gaming.v1alpha.CommitRolloutRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CommitRolloutRequest.class, + com.google.cloud.gaming.v1alpha.CommitRolloutRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.CommitRolloutRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CommitRolloutRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CommitRolloutRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CommitRolloutRequest build() { + com.google.cloud.gaming.v1alpha.CommitRolloutRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CommitRolloutRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CommitRolloutRequest result = + new com.google.cloud.gaming.v1alpha.CommitRolloutRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CommitRolloutRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CommitRolloutRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.CommitRolloutRequest other) { + if (other == com.google.cloud.gaming.v1alpha.CommitRolloutRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CommitRolloutRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CommitRolloutRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CommitRolloutRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CommitRolloutRequest) + private static final com.google.cloud.gaming.v1alpha.CommitRolloutRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CommitRolloutRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CommitRolloutRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommitRolloutRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitRolloutRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CommitRolloutRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequestOrBuilder.java new file mode 100644 index 000000000000..954be2fab91d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CommitRolloutRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CommitRolloutRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CommitRolloutRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Common.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Common.java new file mode 100644 index 000000000000..64a160004305 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Common.java @@ -0,0 +1,127 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +public final class Common { + private Common() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_LabelSelector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_Schedule_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/gaming/v1alpha/common.pro" + + "to\022\033google.cloud.gaming.v1alpha\032\034google/" + + "api/annotations.proto\032#google/longrunnin" + + "g/operations.proto\032\036google/protobuf/dura" + + "tion.proto\032\037google/protobuf/timestamp.pr" + + "oto\"\335\001\n\021OperationMetadata\022/\n\013create_time" + + "\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n\010en" + + "d_time\030\002 \001(\0132\032.google.protobuf.Timestamp" + + "\022\016\n\006target\030\003 \001(\t\022\014\n\004verb\030\004 \001(\t\022\026\n\016status" + + "_message\030\005 \001(\t\022\036\n\026requested_cancellation" + + "\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\"\206\001\n\rLabelSel" + + "ector\022F\n\006labels\030\001 \003(\01326.google.cloud.gam" + + "ing.v1alpha.LabelSelector.LabelsEntry\032-\n" + + "\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001\"\261\001\n\010Schedule\022.\n\nstart_time\030\001 \001(\0132\032." + + "google.protobuf.Timestamp\022,\n\010end_time\030\002 " + + "\001(\0132\032.google.protobuf.Timestamp\0224\n\021cron_" + + "job_duration\030\003 \001(\0132\031.google.protobuf.Dur" + + "ation\022\021\n\tcron_spec\030\004 \001(\tBf\n\037com.google.c" + + "loud.gaming.v1alphaP\001ZAgoogle.golang.org" + + "/genproto/googleapis/cloud/gaming/v1alph" + + "a;gamingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_LabelSelector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor, + new java.lang.String[] { + "Labels", + }); + internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_Schedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", "CronJobDuration", "CronSpec", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequest.java new file mode 100644 index 000000000000..c3d820fe3530 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequest.java @@ -0,0 +1,1039 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for AllocationPoliciesService.CreateAllocationPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest} + */ +public final class CreateAllocationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + CreateAllocationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAllocationPolicyRequest.newBuilder() to construct. + private CreateAllocationPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAllocationPolicyRequest() { + parent_ = ""; + allocationPolicyId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAllocationPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + allocationPolicyId_ = s; + break; + } + case 26: + { + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder subBuilder = null; + if (allocationPolicy_ != null) { + subBuilder = allocationPolicy_.toBuilder(); + } + allocationPolicy_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.AllocationPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allocationPolicy_); + allocationPolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATION_POLICY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object allocationPolicyId_; + /** + * + * + *
+   * Required. The ID of the allocation policy resource to be created.
+   * 
+ * + * string allocation_policy_id = 2; + */ + public java.lang.String getAllocationPolicyId() { + java.lang.Object ref = allocationPolicyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocationPolicyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the allocation policy resource to be created.
+   * 
+ * + * string allocation_policy_id = 2; + */ + public com.google.protobuf.ByteString getAllocationPolicyIdBytes() { + java.lang.Object ref = allocationPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocationPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATION_POLICY_FIELD_NUMBER = 3; + private com.google.cloud.gaming.v1alpha.AllocationPolicy allocationPolicy_; + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public boolean hasAllocationPolicy() { + return allocationPolicy_ != null; + } + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy() { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder() { + return getAllocationPolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getAllocationPolicyIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allocationPolicyId_); + } + if (allocationPolicy_ != null) { + output.writeMessage(3, getAllocationPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getAllocationPolicyIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, allocationPolicyId_); + } + if (allocationPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAllocationPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest other = + (com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getAllocationPolicyId().equals(other.getAllocationPolicyId())) return false; + if (hasAllocationPolicy() != other.hasAllocationPolicy()) return false; + if (hasAllocationPolicy()) { + if (!getAllocationPolicy().equals(other.getAllocationPolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + ALLOCATION_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getAllocationPolicyId().hashCode(); + if (hasAllocationPolicy()) { + hash = (37 * hash) + ALLOCATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAllocationPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for AllocationPoliciesService.CreateAllocationPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + allocationPolicyId_ = ""; + + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest build() { + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest result = + new com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest(this); + result.parent_ = parent_; + result.allocationPolicyId_ = allocationPolicyId_; + if (allocationPolicyBuilder_ == null) { + result.allocationPolicy_ = allocationPolicy_; + } else { + result.allocationPolicy_ = allocationPolicyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getAllocationPolicyId().isEmpty()) { + allocationPolicyId_ = other.allocationPolicyId_; + onChanged(); + } + if (other.hasAllocationPolicy()) { + mergeAllocationPolicy(other.getAllocationPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object allocationPolicyId_ = ""; + /** + * + * + *
+     * Required. The ID of the allocation policy resource to be created.
+     * 
+ * + * string allocation_policy_id = 2; + */ + public java.lang.String getAllocationPolicyId() { + java.lang.Object ref = allocationPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocationPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the allocation policy resource to be created.
+     * 
+ * + * string allocation_policy_id = 2; + */ + public com.google.protobuf.ByteString getAllocationPolicyIdBytes() { + java.lang.Object ref = allocationPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + allocationPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the allocation policy resource to be created.
+     * 
+ * + * string allocation_policy_id = 2; + */ + public Builder setAllocationPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + allocationPolicyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the allocation policy resource to be created.
+     * 
+ * + * string allocation_policy_id = 2; + */ + public Builder clearAllocationPolicyId() { + + allocationPolicyId_ = getDefaultInstance().getAllocationPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the allocation policy resource to be created.
+     * 
+ * + * string allocation_policy_id = 2; + */ + public Builder setAllocationPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + allocationPolicyId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.AllocationPolicy allocationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + allocationPolicyBuilder_; + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public boolean hasAllocationPolicy() { + return allocationPolicyBuilder_ != null || allocationPolicy_ != null; + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } else { + return allocationPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public Builder setAllocationPolicy(com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocationPolicy_ = value; + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public Builder setAllocationPolicy( + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = builderForValue.build(); + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public Builder mergeAllocationPolicy(com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (allocationPolicy_ != null) { + allocationPolicy_ = + com.google.cloud.gaming.v1alpha.AllocationPolicy.newBuilder(allocationPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + allocationPolicy_ = value; + } + onChanged(); + } else { + allocationPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public Builder clearAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + onChanged(); + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder getAllocationPolicyBuilder() { + + onChanged(); + return getAllocationPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder + getAllocationPolicyOrBuilder() { + if (allocationPolicyBuilder_ != null) { + return allocationPolicyBuilder_.getMessageOrBuilder(); + } else { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + } + /** + * + * + *
+     * Required. The allocation policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + getAllocationPolicyFieldBuilder() { + if (allocationPolicyBuilder_ == null) { + allocationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder>( + getAllocationPolicy(), getParentForChildren(), isClean()); + allocationPolicy_ = null; + } + return allocationPolicyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAllocationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAllocationPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..2fb278797bd9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateAllocationPolicyRequestOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CreateAllocationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the allocation policy resource to be created.
+   * 
+ * + * string allocation_policy_id = 2; + */ + java.lang.String getAllocationPolicyId(); + /** + * + * + *
+   * Required. The ID of the allocation policy resource to be created.
+   * 
+ * + * string allocation_policy_id = 2; + */ + com.google.protobuf.ByteString getAllocationPolicyIdBytes(); + + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + boolean hasAllocationPolicy(); + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy(); + /** + * + * + *
+   * Required. The allocation policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 3; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequest.java new file mode 100644 index 000000000000..d1e7ab402556 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequest.java @@ -0,0 +1,1044 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerClustersService.CreateGameServerCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateGameServerClusterRequest} + */ +public final class CreateGameServerClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + CreateGameServerClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateGameServerClusterRequest.newBuilder() to construct. + private CreateGameServerClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateGameServerClusterRequest() { + parent_ = ""; + gameServerClusterId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateGameServerClusterRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + gameServerClusterId_ = s; + break; + } + case 26: + { + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder subBuilder = null; + if (gameServerCluster_ != null) { + subBuilder = gameServerCluster_.toBuilder(); + } + gameServerCluster_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerCluster.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gameServerCluster_); + gameServerCluster_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GAME_SERVER_CLUSTER_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object gameServerClusterId_; + /** + * + * + *
+   * Required. The ID of the game server cluster resource to be created.
+   * 
+ * + * string game_server_cluster_id = 2; + */ + public java.lang.String getGameServerClusterId() { + java.lang.Object ref = gameServerClusterId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gameServerClusterId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the game server cluster resource to be created.
+   * 
+ * + * string game_server_cluster_id = 2; + */ + public com.google.protobuf.ByteString getGameServerClusterIdBytes() { + java.lang.Object ref = gameServerClusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gameServerClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GAME_SERVER_CLUSTER_FIELD_NUMBER = 3; + private com.google.cloud.gaming.v1alpha.GameServerCluster gameServerCluster_; + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public boolean hasGameServerCluster() { + return gameServerCluster_ != null; + } + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster() { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder + getGameServerClusterOrBuilder() { + return getGameServerCluster(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getGameServerClusterIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gameServerClusterId_); + } + if (gameServerCluster_ != null) { + output.writeMessage(3, getGameServerCluster()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getGameServerClusterIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gameServerClusterId_); + } + if (gameServerCluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getGameServerCluster()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest other = + (com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getGameServerClusterId().equals(other.getGameServerClusterId())) return false; + if (hasGameServerCluster() != other.hasGameServerCluster()) return false; + if (hasGameServerCluster()) { + if (!getGameServerCluster().equals(other.getGameServerCluster())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + GAME_SERVER_CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getGameServerClusterId().hashCode(); + if (hasGameServerCluster()) { + hash = (37 * hash) + GAME_SERVER_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getGameServerCluster().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerClustersService.CreateGameServerCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateGameServerClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + gameServerClusterId_ = ""; + + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = null; + } else { + gameServerCluster_ = null; + gameServerClusterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest build() { + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest result = + new com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest(this); + result.parent_ = parent_; + result.gameServerClusterId_ = gameServerClusterId_; + if (gameServerClusterBuilder_ == null) { + result.gameServerCluster_ = gameServerCluster_; + } else { + result.gameServerCluster_ = gameServerClusterBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getGameServerClusterId().isEmpty()) { + gameServerClusterId_ = other.gameServerClusterId_; + onChanged(); + } + if (other.hasGameServerCluster()) { + mergeGameServerCluster(other.getGameServerCluster()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object gameServerClusterId_ = ""; + /** + * + * + *
+     * Required. The ID of the game server cluster resource to be created.
+     * 
+ * + * string game_server_cluster_id = 2; + */ + public java.lang.String getGameServerClusterId() { + java.lang.Object ref = gameServerClusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gameServerClusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the game server cluster resource to be created.
+     * 
+ * + * string game_server_cluster_id = 2; + */ + public com.google.protobuf.ByteString getGameServerClusterIdBytes() { + java.lang.Object ref = gameServerClusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gameServerClusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the game server cluster resource to be created.
+     * 
+ * + * string game_server_cluster_id = 2; + */ + public Builder setGameServerClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gameServerClusterId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the game server cluster resource to be created.
+     * 
+ * + * string game_server_cluster_id = 2; + */ + public Builder clearGameServerClusterId() { + + gameServerClusterId_ = getDefaultInstance().getGameServerClusterId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the game server cluster resource to be created.
+     * 
+ * + * string game_server_cluster_id = 2; + */ + public Builder setGameServerClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gameServerClusterId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerCluster gameServerCluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + gameServerClusterBuilder_; + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public boolean hasGameServerCluster() { + return gameServerClusterBuilder_ != null || gameServerCluster_ != null; + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster() { + if (gameServerClusterBuilder_ == null) { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } else { + return gameServerClusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public Builder setGameServerCluster(com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gameServerCluster_ = value; + onChanged(); + } else { + gameServerClusterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public Builder setGameServerCluster( + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder builderForValue) { + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = builderForValue.build(); + onChanged(); + } else { + gameServerClusterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public Builder mergeGameServerCluster(com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClusterBuilder_ == null) { + if (gameServerCluster_ != null) { + gameServerCluster_ = + com.google.cloud.gaming.v1alpha.GameServerCluster.newBuilder(gameServerCluster_) + .mergeFrom(value) + .buildPartial(); + } else { + gameServerCluster_ = value; + } + onChanged(); + } else { + gameServerClusterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public Builder clearGameServerCluster() { + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = null; + onChanged(); + } else { + gameServerCluster_ = null; + gameServerClusterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster.Builder getGameServerClusterBuilder() { + + onChanged(); + return getGameServerClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder + getGameServerClusterOrBuilder() { + if (gameServerClusterBuilder_ != null) { + return gameServerClusterBuilder_.getMessageOrBuilder(); + } else { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } + } + /** + * + * + *
+     * Required. The game server cluster resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + getGameServerClusterFieldBuilder() { + if (gameServerClusterBuilder_ == null) { + gameServerClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder>( + getGameServerCluster(), getParentForChildren(), isClean()); + gameServerCluster_ = null; + } + return gameServerClusterBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + private static final com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateGameServerClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateGameServerClusterRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequestOrBuilder.java new file mode 100644 index 000000000000..08d25925d859 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerClusterRequestOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CreateGameServerClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CreateGameServerClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the game server cluster resource to be created.
+   * 
+ * + * string game_server_cluster_id = 2; + */ + java.lang.String getGameServerClusterId(); + /** + * + * + *
+   * Required. The ID of the game server cluster resource to be created.
+   * 
+ * + * string game_server_cluster_id = 2; + */ + com.google.protobuf.ByteString getGameServerClusterIdBytes(); + + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + boolean hasGameServerCluster(); + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster(); + /** + * + * + *
+   * Required. The game server cluster resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 3; + */ + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder getGameServerClusterOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequest.java new file mode 100644 index 000000000000..2b3096583f5b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequest.java @@ -0,0 +1,1051 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.CreateGameServerDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest} + */ +public final class CreateGameServerDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + CreateGameServerDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateGameServerDeploymentRequest.newBuilder() to construct. + private CreateGameServerDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateGameServerDeploymentRequest() { + parent_ = ""; + deploymentId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateGameServerDeploymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + deploymentId_ = s; + break; + } + case 26: + { + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder subBuilder = null; + if (gameServerDeployment_ != null) { + subBuilder = gameServerDeployment_.toBuilder(); + } + gameServerDeployment_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerDeployment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gameServerDeployment_); + gameServerDeployment_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYMENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object deploymentId_; + /** + * + * + *
+   * Required. The ID of the game server deployment resource to be created.
+   * 
+ * + * string deployment_id = 2; + */ + public java.lang.String getDeploymentId() { + java.lang.Object ref = deploymentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deploymentId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the game server deployment resource to be created.
+   * 
+ * + * string deployment_id = 2; + */ + public com.google.protobuf.ByteString getDeploymentIdBytes() { + java.lang.Object ref = deploymentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GAME_SERVER_DEPLOYMENT_FIELD_NUMBER = 3; + private com.google.cloud.gaming.v1alpha.GameServerDeployment gameServerDeployment_; + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public boolean hasGameServerDeployment() { + return gameServerDeployment_ != null; + } + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment() { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentOrBuilder() { + return getGameServerDeployment(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getDeploymentIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deploymentId_); + } + if (gameServerDeployment_ != null) { + output.writeMessage(3, getGameServerDeployment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getDeploymentIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deploymentId_); + } + if (gameServerDeployment_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getGameServerDeployment()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest other = + (com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getDeploymentId().equals(other.getDeploymentId())) return false; + if (hasGameServerDeployment() != other.hasGameServerDeployment()) return false; + if (hasGameServerDeployment()) { + if (!getGameServerDeployment().equals(other.getGameServerDeployment())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + DEPLOYMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeploymentId().hashCode(); + if (hasGameServerDeployment()) { + hash = (37 * hash) + GAME_SERVER_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getGameServerDeployment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.CreateGameServerDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + deploymentId_ = ""; + + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = null; + } else { + gameServerDeployment_ = null; + gameServerDeploymentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest build() { + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest result = + new com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest(this); + result.parent_ = parent_; + result.deploymentId_ = deploymentId_; + if (gameServerDeploymentBuilder_ == null) { + result.gameServerDeployment_ = gameServerDeployment_; + } else { + result.gameServerDeployment_ = gameServerDeploymentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getDeploymentId().isEmpty()) { + deploymentId_ = other.deploymentId_; + onChanged(); + } + if (other.hasGameServerDeployment()) { + mergeGameServerDeployment(other.getGameServerDeployment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object deploymentId_ = ""; + /** + * + * + *
+     * Required. The ID of the game server deployment resource to be created.
+     * 
+ * + * string deployment_id = 2; + */ + public java.lang.String getDeploymentId() { + java.lang.Object ref = deploymentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deploymentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the game server deployment resource to be created.
+     * 
+ * + * string deployment_id = 2; + */ + public com.google.protobuf.ByteString getDeploymentIdBytes() { + java.lang.Object ref = deploymentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the game server deployment resource to be created.
+     * 
+ * + * string deployment_id = 2; + */ + public Builder setDeploymentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deploymentId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the game server deployment resource to be created.
+     * 
+ * + * string deployment_id = 2; + */ + public Builder clearDeploymentId() { + + deploymentId_ = getDefaultInstance().getDeploymentId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the game server deployment resource to be created.
+     * 
+ * + * string deployment_id = 2; + */ + public Builder setDeploymentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deploymentId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerDeployment gameServerDeployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + gameServerDeploymentBuilder_; + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public boolean hasGameServerDeployment() { + return gameServerDeploymentBuilder_ != null || gameServerDeployment_ != null; + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment() { + if (gameServerDeploymentBuilder_ == null) { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } else { + return gameServerDeploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public Builder setGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gameServerDeployment_ = value; + onChanged(); + } else { + gameServerDeploymentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public Builder setGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder builderForValue) { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = builderForValue.build(); + onChanged(); + } else { + gameServerDeploymentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public Builder mergeGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentBuilder_ == null) { + if (gameServerDeployment_ != null) { + gameServerDeployment_ = + com.google.cloud.gaming.v1alpha.GameServerDeployment.newBuilder(gameServerDeployment_) + .mergeFrom(value) + .buildPartial(); + } else { + gameServerDeployment_ = value; + } + onChanged(); + } else { + gameServerDeploymentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public Builder clearGameServerDeployment() { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = null; + onChanged(); + } else { + gameServerDeployment_ = null; + gameServerDeploymentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder + getGameServerDeploymentBuilder() { + + onChanged(); + return getGameServerDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentOrBuilder() { + if (gameServerDeploymentBuilder_ != null) { + return gameServerDeploymentBuilder_.getMessageOrBuilder(); + } else { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } + } + /** + * + * + *
+     * Required. The game server deployment resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + getGameServerDeploymentFieldBuilder() { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder>( + getGameServerDeployment(), getParentForChildren(), isClean()); + gameServerDeployment_ = null; + } + return gameServerDeploymentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + private static final com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateGameServerDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateGameServerDeploymentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..fec6a2f0dca8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateGameServerDeploymentRequestOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CreateGameServerDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the game server deployment resource to be created.
+   * 
+ * + * string deployment_id = 2; + */ + java.lang.String getDeploymentId(); + /** + * + * + *
+   * Required. The ID of the game server deployment resource to be created.
+   * 
+ * + * string deployment_id = 2; + */ + com.google.protobuf.ByteString getDeploymentIdBytes(); + + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + boolean hasGameServerDeployment(); + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment(); + /** + * + * + *
+   * Required. The game server deployment resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 3; + */ + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder getGameServerDeploymentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequest.java new file mode 100644 index 000000000000..2a48d51e74ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequest.java @@ -0,0 +1,1026 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for RealmsService.CreateRealm.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateRealmRequest} + */ +public final class CreateRealmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CreateRealmRequest) + CreateRealmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateRealmRequest.newBuilder() to construct. + private CreateRealmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRealmRequest() { + parent_ = ""; + realmId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateRealmRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + realmId_ = s; + break; + } + case 26: + { + com.google.cloud.gaming.v1alpha.Realm.Builder subBuilder = null; + if (realm_ != null) { + subBuilder = realm_.toBuilder(); + } + realm_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.Realm.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(realm_); + realm_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateRealmRequest.class, + com.google.cloud.gaming.v1alpha.CreateRealmRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REALM_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object realmId_; + /** + * + * + *
+   * Required. The ID of the realm resource to be created.
+   * 
+ * + * string realm_id = 2; + */ + public java.lang.String getRealmId() { + java.lang.Object ref = realmId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + realmId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the realm resource to be created.
+   * 
+ * + * string realm_id = 2; + */ + public com.google.protobuf.ByteString getRealmIdBytes() { + java.lang.Object ref = realmId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + realmId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REALM_FIELD_NUMBER = 3; + private com.google.cloud.gaming.v1alpha.Realm realm_; + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public boolean hasRealm() { + return realm_ != null; + } + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealm() { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder() { + return getRealm(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getRealmIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, realmId_); + } + if (realm_ != null) { + output.writeMessage(3, getRealm()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getRealmIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, realmId_); + } + if (realm_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRealm()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CreateRealmRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CreateRealmRequest other = + (com.google.cloud.gaming.v1alpha.CreateRealmRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRealmId().equals(other.getRealmId())) return false; + if (hasRealm() != other.hasRealm()) return false; + if (hasRealm()) { + if (!getRealm().equals(other.getRealm())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + REALM_ID_FIELD_NUMBER; + hash = (53 * hash) + getRealmId().hashCode(); + if (hasRealm()) { + hash = (37 * hash) + REALM_FIELD_NUMBER; + hash = (53 * hash) + getRealm().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.CreateRealmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RealmsService.CreateRealm.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateRealmRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CreateRealmRequest) + com.google.cloud.gaming.v1alpha.CreateRealmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateRealmRequest.class, + com.google.cloud.gaming.v1alpha.CreateRealmRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.CreateRealmRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + realmId_ = ""; + + if (realmBuilder_ == null) { + realm_ = null; + } else { + realm_ = null; + realmBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateRealmRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CreateRealmRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateRealmRequest build() { + com.google.cloud.gaming.v1alpha.CreateRealmRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateRealmRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CreateRealmRequest result = + new com.google.cloud.gaming.v1alpha.CreateRealmRequest(this); + result.parent_ = parent_; + result.realmId_ = realmId_; + if (realmBuilder_ == null) { + result.realm_ = realm_; + } else { + result.realm_ = realmBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CreateRealmRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CreateRealmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.CreateRealmRequest other) { + if (other == com.google.cloud.gaming.v1alpha.CreateRealmRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getRealmId().isEmpty()) { + realmId_ = other.realmId_; + onChanged(); + } + if (other.hasRealm()) { + mergeRealm(other.getRealm()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CreateRealmRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CreateRealmRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object realmId_ = ""; + /** + * + * + *
+     * Required. The ID of the realm resource to be created.
+     * 
+ * + * string realm_id = 2; + */ + public java.lang.String getRealmId() { + java.lang.Object ref = realmId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + realmId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the realm resource to be created.
+     * 
+ * + * string realm_id = 2; + */ + public com.google.protobuf.ByteString getRealmIdBytes() { + java.lang.Object ref = realmId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + realmId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the realm resource to be created.
+     * 
+ * + * string realm_id = 2; + */ + public Builder setRealmId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + realmId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the realm resource to be created.
+     * 
+ * + * string realm_id = 2; + */ + public Builder clearRealmId() { + + realmId_ = getDefaultInstance().getRealmId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the realm resource to be created.
+     * 
+ * + * string realm_id = 2; + */ + public Builder setRealmIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + realmId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.Realm realm_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + realmBuilder_; + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public boolean hasRealm() { + return realmBuilder_ != null || realm_ != null; + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealm() { + if (realmBuilder_ == null) { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } else { + return realmBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public Builder setRealm(com.google.cloud.gaming.v1alpha.Realm value) { + if (realmBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + realm_ = value; + onChanged(); + } else { + realmBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public Builder setRealm(com.google.cloud.gaming.v1alpha.Realm.Builder builderForValue) { + if (realmBuilder_ == null) { + realm_ = builderForValue.build(); + onChanged(); + } else { + realmBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public Builder mergeRealm(com.google.cloud.gaming.v1alpha.Realm value) { + if (realmBuilder_ == null) { + if (realm_ != null) { + realm_ = + com.google.cloud.gaming.v1alpha.Realm.newBuilder(realm_) + .mergeFrom(value) + .buildPartial(); + } else { + realm_ = value; + } + onChanged(); + } else { + realmBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public Builder clearRealm() { + if (realmBuilder_ == null) { + realm_ = null; + onChanged(); + } else { + realm_ = null; + realmBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public com.google.cloud.gaming.v1alpha.Realm.Builder getRealmBuilder() { + + onChanged(); + return getRealmFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder() { + if (realmBuilder_ != null) { + return realmBuilder_.getMessageOrBuilder(); + } else { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } + } + /** + * + * + *
+     * Required. The realm resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + getRealmFieldBuilder() { + if (realmBuilder_ == null) { + realmBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder>( + getRealm(), getParentForChildren(), isClean()); + realm_ = null; + } + return realmBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CreateRealmRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CreateRealmRequest) + private static final com.google.cloud.gaming.v1alpha.CreateRealmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CreateRealmRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CreateRealmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRealmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateRealmRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateRealmRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequestOrBuilder.java new file mode 100644 index 000000000000..bc27e7586c47 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateRealmRequestOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CreateRealmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CreateRealmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the realm resource to be created.
+   * 
+ * + * string realm_id = 2; + */ + java.lang.String getRealmId(); + /** + * + * + *
+   * Required. The ID of the realm resource to be created.
+   * 
+ * + * string realm_id = 2; + */ + com.google.protobuf.ByteString getRealmIdBytes(); + + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + boolean hasRealm(); + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + com.google.cloud.gaming.v1alpha.Realm getRealm(); + /** + * + * + *
+   * Required. The realm resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 3; + */ + com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequest.java new file mode 100644 index 000000000000..aaff24d60d77 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequest.java @@ -0,0 +1,1034 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for ScalingPoliciesService.CreateScalingPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateScalingPolicyRequest} + */ +public final class CreateScalingPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) + CreateScalingPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateScalingPolicyRequest.newBuilder() to construct. + private CreateScalingPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateScalingPolicyRequest() { + parent_ = ""; + scalingPolicyId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateScalingPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + scalingPolicyId_ = s; + break; + } + case 26: + { + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder subBuilder = null; + if (scalingPolicy_ != null) { + subBuilder = scalingPolicy_.toBuilder(); + } + scalingPolicy_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.ScalingPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scalingPolicy_); + scalingPolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCALING_POLICY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object scalingPolicyId_; + /** + * + * + *
+   * Required. The ID of the scaling policy resource to be created.
+   * 
+ * + * string scaling_policy_id = 2; + */ + public java.lang.String getScalingPolicyId() { + java.lang.Object ref = scalingPolicyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + scalingPolicyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the scaling policy resource to be created.
+   * 
+ * + * string scaling_policy_id = 2; + */ + public com.google.protobuf.ByteString getScalingPolicyIdBytes() { + java.lang.Object ref = scalingPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + scalingPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCALING_POLICY_FIELD_NUMBER = 3; + private com.google.cloud.gaming.v1alpha.ScalingPolicy scalingPolicy_; + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public boolean hasScalingPolicy() { + return scalingPolicy_ != null; + } + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy() { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder() { + return getScalingPolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getScalingPolicyIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, scalingPolicyId_); + } + if (scalingPolicy_ != null) { + output.writeMessage(3, getScalingPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getScalingPolicyIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, scalingPolicyId_); + } + if (scalingPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getScalingPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest other = + (com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getScalingPolicyId().equals(other.getScalingPolicyId())) return false; + if (hasScalingPolicy() != other.hasScalingPolicy()) return false; + if (hasScalingPolicy()) { + if (!getScalingPolicy().equals(other.getScalingPolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SCALING_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getScalingPolicyId().hashCode(); + if (hasScalingPolicy()) { + hash = (37 * hash) + SCALING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getScalingPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ScalingPoliciesService.CreateScalingPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.CreateScalingPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + scalingPolicyId_ = ""; + + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = null; + } else { + scalingPolicy_ = null; + scalingPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest build() { + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest result = + new com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest(this); + result.parent_ = parent_; + result.scalingPolicyId_ = scalingPolicyId_; + if (scalingPolicyBuilder_ == null) { + result.scalingPolicy_ = scalingPolicy_; + } else { + result.scalingPolicy_ = scalingPolicyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest other) { + if (other == com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getScalingPolicyId().isEmpty()) { + scalingPolicyId_ = other.scalingPolicyId_; + onChanged(); + } + if (other.hasScalingPolicy()) { + mergeScalingPolicy(other.getScalingPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object scalingPolicyId_ = ""; + /** + * + * + *
+     * Required. The ID of the scaling policy resource to be created.
+     * 
+ * + * string scaling_policy_id = 2; + */ + public java.lang.String getScalingPolicyId() { + java.lang.Object ref = scalingPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + scalingPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the scaling policy resource to be created.
+     * 
+ * + * string scaling_policy_id = 2; + */ + public com.google.protobuf.ByteString getScalingPolicyIdBytes() { + java.lang.Object ref = scalingPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + scalingPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the scaling policy resource to be created.
+     * 
+ * + * string scaling_policy_id = 2; + */ + public Builder setScalingPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + scalingPolicyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the scaling policy resource to be created.
+     * 
+ * + * string scaling_policy_id = 2; + */ + public Builder clearScalingPolicyId() { + + scalingPolicyId_ = getDefaultInstance().getScalingPolicyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the scaling policy resource to be created.
+     * 
+ * + * string scaling_policy_id = 2; + */ + public Builder setScalingPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + scalingPolicyId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.ScalingPolicy scalingPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + scalingPolicyBuilder_; + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public boolean hasScalingPolicy() { + return scalingPolicyBuilder_ != null || scalingPolicy_ != null; + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy() { + if (scalingPolicyBuilder_ == null) { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } else { + return scalingPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public Builder setScalingPolicy(com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scalingPolicy_ = value; + onChanged(); + } else { + scalingPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public Builder setScalingPolicy( + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder builderForValue) { + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = builderForValue.build(); + onChanged(); + } else { + scalingPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public Builder mergeScalingPolicy(com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPolicyBuilder_ == null) { + if (scalingPolicy_ != null) { + scalingPolicy_ = + com.google.cloud.gaming.v1alpha.ScalingPolicy.newBuilder(scalingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + scalingPolicy_ = value; + } + onChanged(); + } else { + scalingPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public Builder clearScalingPolicy() { + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = null; + onChanged(); + } else { + scalingPolicy_ = null; + scalingPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder getScalingPolicyBuilder() { + + onChanged(); + return getScalingPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder() { + if (scalingPolicyBuilder_ != null) { + return scalingPolicyBuilder_.getMessageOrBuilder(); + } else { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } + } + /** + * + * + *
+     * Required. The scaling policy resource to be created.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + getScalingPolicyFieldBuilder() { + if (scalingPolicyBuilder_ == null) { + scalingPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder>( + getScalingPolicy(), getParentForChildren(), isClean()); + scalingPolicy_ = null; + } + return scalingPolicyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateScalingPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateScalingPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..bce1b84c9903 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/CreateScalingPolicyRequestOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface CreateScalingPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.CreateScalingPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID of the scaling policy resource to be created.
+   * 
+ * + * string scaling_policy_id = 2; + */ + java.lang.String getScalingPolicyId(); + /** + * + * + *
+   * Required. The ID of the scaling policy resource to be created.
+   * 
+ * + * string scaling_policy_id = 2; + */ + com.google.protobuf.ByteString getScalingPolicyIdBytes(); + + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + boolean hasScalingPolicy(); + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy(); + /** + * + * + *
+   * Required. The scaling policy resource to be created.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 3; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequest.java new file mode 100644 index 000000000000..a1882506c588 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequest.java @@ -0,0 +1,610 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for AllocationPoliciesService.DeleteAllocationPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest} + */ +public final class DeleteAllocationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + DeleteAllocationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAllocationPolicyRequest.newBuilder() to construct. + private DeleteAllocationPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAllocationPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteAllocationPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the allocation policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the allocation policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest other = + (com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for AllocationPoliciesService.DeleteAllocationPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest build() { + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest result = + new com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the allocation policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the allocation policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the allocation policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the allocation policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the allocation policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAllocationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteAllocationPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..36d05e4b3810 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteAllocationPolicyRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeleteAllocationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the allocation policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the allocation policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequest.java new file mode 100644 index 000000000000..464543a1efec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequest.java @@ -0,0 +1,613 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerClustersService.DeleteGameServerCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest} + */ +public final class DeleteGameServerClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + DeleteGameServerClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteGameServerClusterRequest.newBuilder() to construct. + private DeleteGameServerClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteGameServerClusterRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteGameServerClusterRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server cluster to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server cluster to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest other = + (com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerClustersService.DeleteGameServerCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest build() { + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest buildPartial() { + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest result = + new com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server cluster to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server cluster to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server cluster to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server cluster to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server cluster to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + private static final com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest(); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteGameServerClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteGameServerClusterRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequestOrBuilder.java new file mode 100644 index 000000000000..0a3cfb1a4e5b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerClusterRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeleteGameServerClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server cluster to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server cluster to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequest.java new file mode 100644 index 000000000000..93fb3baec857 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequest.java @@ -0,0 +1,616 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.DeleteGameServerDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest} + */ +public final class DeleteGameServerDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + DeleteGameServerDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteGameServerDeploymentRequest.newBuilder() to construct. + private DeleteGameServerDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteGameServerDeploymentRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteGameServerDeploymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest other = + (com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.DeleteGameServerDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest build() { + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest buildPartial() { + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest result = + new com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to delete, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + private static final com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest(); + } + + public static com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteGameServerDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteGameServerDeploymentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..56aee33b0d94 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteGameServerDeploymentRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeleteGameServerDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment to delete, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequest.java new file mode 100644 index 000000000000..0884d6e4db7c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequest.java @@ -0,0 +1,605 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for RealmsService.DeleteRealm.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteRealmRequest} + */ +public final class DeleteRealmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeleteRealmRequest) + DeleteRealmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteRealmRequest.newBuilder() to construct. + private DeleteRealmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRealmRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteRealmRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest.class, + com.google.cloud.gaming.v1alpha.DeleteRealmRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the realm to delete, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the realm to delete, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeleteRealmRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeleteRealmRequest other = + (com.google.cloud.gaming.v1alpha.DeleteRealmRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.DeleteRealmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RealmsService.DeleteRealm.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteRealmRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeleteRealmRequest) + com.google.cloud.gaming.v1alpha.DeleteRealmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteRealmRequest.class, + com.google.cloud.gaming.v1alpha.DeleteRealmRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.DeleteRealmRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteRealmRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeleteRealmRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteRealmRequest build() { + com.google.cloud.gaming.v1alpha.DeleteRealmRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteRealmRequest buildPartial() { + com.google.cloud.gaming.v1alpha.DeleteRealmRequest result = + new com.google.cloud.gaming.v1alpha.DeleteRealmRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeleteRealmRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeleteRealmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.DeleteRealmRequest other) { + if (other == com.google.cloud.gaming.v1alpha.DeleteRealmRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeleteRealmRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeleteRealmRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the realm to delete, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the realm to delete, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the realm to delete, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the realm to delete, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the realm to delete, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeleteRealmRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeleteRealmRequest) + private static final com.google.cloud.gaming.v1alpha.DeleteRealmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeleteRealmRequest(); + } + + public static com.google.cloud.gaming.v1alpha.DeleteRealmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRealmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteRealmRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteRealmRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequestOrBuilder.java new file mode 100644 index 000000000000..5cba356de220 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteRealmRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeleteRealmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeleteRealmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the realm to delete, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the realm to delete, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequest.java new file mode 100644 index 000000000000..237c62a05442 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequest.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for ScalingPoliciesService.DeleteScalingPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest} + */ +public final class DeleteScalingPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) + DeleteScalingPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteScalingPolicyRequest.newBuilder() to construct. + private DeleteScalingPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteScalingPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteScalingPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the scaling policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the scaling policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest other = + (com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ScalingPoliciesService.DeleteScalingPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest build() { + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest result = + new com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest other) { + if (other == com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the scaling policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the scaling policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the scaling policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the scaling policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the scaling policy to delete, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteScalingPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteScalingPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..3726d9b5d380 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeleteScalingPolicyRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeleteScalingPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the scaling policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the scaling policy to delete, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTarget.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTarget.java new file mode 100644 index 000000000000..533b18b09251 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTarget.java @@ -0,0 +1,1875 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * The rollout target of the deployment, e.g. the target percentage of game
+ * servers running stable_game_server_template and new_game_server_template in
+ * clusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeploymentTarget} + */ +public final class DeploymentTarget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeploymentTarget) + DeploymentTargetOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeploymentTarget.newBuilder() to construct. + private DeploymentTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeploymentTarget() { + clusters_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeploymentTarget( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + clusters_ = + new java.util.ArrayList< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget>(); + mutable_bitField0_ |= 0x00000001; + } + clusters_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + .parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeploymentTarget.class, + com.google.cloud.gaming.v1alpha.DeploymentTarget.Builder.class); + } + + public interface ClusterRolloutTargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The realm name.
+     * 
+ * + * string realm = 1; + */ + java.lang.String getRealm(); + /** + * + * + *
+     * The realm name.
+     * 
+ * + * string realm = 1; + */ + com.google.protobuf.ByteString getRealmBytes(); + + /** + * + * + *
+     * The cluster name.
+     * 
+ * + * string cluster = 2; + */ + java.lang.String getCluster(); + /** + * + * + *
+     * The cluster name.
+     * 
+ * + * string cluster = 2; + */ + com.google.protobuf.ByteString getClusterBytes(); + + /** + * + * + *
+     * The desired percentage of game servers that run
+     * stable_game_server_template.
+     * 
+ * + * int32 stable_percent = 3; + */ + int getStablePercent(); + + /** + * + * + *
+     * The desired percentage of game servers that run new_game_server_template.
+     * 
+ * + * int32 new_percent = 4; + */ + int getNewPercent(); + } + /** + * + * + *
+   * The rollout target of a cluster, i.e. the percentage of game servers
+   * running stable_game_server_template and new_game_server_template.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget} + */ + public static final class ClusterRolloutTarget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + ClusterRolloutTargetOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClusterRolloutTarget.newBuilder() to construct. + private ClusterRolloutTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClusterRolloutTarget() { + realm_ = ""; + cluster_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClusterRolloutTarget( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + realm_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + cluster_ = s; + break; + } + case 24: + { + stablePercent_ = input.readInt32(); + break; + } + case 32: + { + newPercent_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.class, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder.class); + } + + public static final int REALM_FIELD_NUMBER = 1; + private volatile java.lang.Object realm_; + /** + * + * + *
+     * The realm name.
+     * 
+ * + * string realm = 1; + */ + public java.lang.String getRealm() { + java.lang.Object ref = realm_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + realm_ = s; + return s; + } + } + /** + * + * + *
+     * The realm name.
+     * 
+ * + * string realm = 1; + */ + public com.google.protobuf.ByteString getRealmBytes() { + java.lang.Object ref = realm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + realm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_FIELD_NUMBER = 2; + private volatile java.lang.Object cluster_; + /** + * + * + *
+     * The cluster name.
+     * 
+ * + * string cluster = 2; + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } + } + /** + * + * + *
+     * The cluster name.
+     * 
+ * + * string cluster = 2; + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STABLE_PERCENT_FIELD_NUMBER = 3; + private int stablePercent_; + /** + * + * + *
+     * The desired percentage of game servers that run
+     * stable_game_server_template.
+     * 
+ * + * int32 stable_percent = 3; + */ + public int getStablePercent() { + return stablePercent_; + } + + public static final int NEW_PERCENT_FIELD_NUMBER = 4; + private int newPercent_; + /** + * + * + *
+     * The desired percentage of game servers that run new_game_server_template.
+     * 
+ * + * int32 new_percent = 4; + */ + public int getNewPercent() { + return newPercent_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getRealmBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, realm_); + } + if (!getClusterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cluster_); + } + if (stablePercent_ != 0) { + output.writeInt32(3, stablePercent_); + } + if (newPercent_ != 0) { + output.writeInt32(4, newPercent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRealmBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, realm_); + } + if (!getClusterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cluster_); + } + if (stablePercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, stablePercent_); + } + if (newPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, newPercent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget other = + (com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) obj; + + if (!getRealm().equals(other.getRealm())) return false; + if (!getCluster().equals(other.getCluster())) return false; + if (getStablePercent() != other.getStablePercent()) return false; + if (getNewPercent() != other.getNewPercent()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REALM_FIELD_NUMBER; + hash = (53 * hash) + getRealm().hashCode(); + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + hash = (37 * hash) + STABLE_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getStablePercent(); + hash = (37 * hash) + NEW_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getNewPercent(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The rollout target of a cluster, i.e. the percentage of game servers
+     * running stable_game_server_template and new_game_server_template.
+     * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.class, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + .class); + } + + // Construct using + // com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + realm_ = ""; + + cluster_ = ""; + + stablePercent_ = 0; + + newPercent_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget build() { + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget buildPartial() { + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget result = + new com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget(this); + result.realm_ = realm_; + result.cluster_ = cluster_; + result.stablePercent_ = stablePercent_; + result.newPercent_ = newPercent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) { + return mergeFrom( + (com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget other) { + if (other + == com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + .getDefaultInstance()) return this; + if (!other.getRealm().isEmpty()) { + realm_ = other.realm_; + onChanged(); + } + if (!other.getCluster().isEmpty()) { + cluster_ = other.cluster_; + onChanged(); + } + if (other.getStablePercent() != 0) { + setStablePercent(other.getStablePercent()); + } + if (other.getNewPercent() != 0) { + setNewPercent(other.getNewPercent()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object realm_ = ""; + /** + * + * + *
+       * The realm name.
+       * 
+ * + * string realm = 1; + */ + public java.lang.String getRealm() { + java.lang.Object ref = realm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + realm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The realm name.
+       * 
+ * + * string realm = 1; + */ + public com.google.protobuf.ByteString getRealmBytes() { + java.lang.Object ref = realm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + realm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The realm name.
+       * 
+ * + * string realm = 1; + */ + public Builder setRealm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + realm_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The realm name.
+       * 
+ * + * string realm = 1; + */ + public Builder clearRealm() { + + realm_ = getDefaultInstance().getRealm(); + onChanged(); + return this; + } + /** + * + * + *
+       * The realm name.
+       * 
+ * + * string realm = 1; + */ + public Builder setRealmBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + realm_ = value; + onChanged(); + return this; + } + + private java.lang.Object cluster_ = ""; + /** + * + * + *
+       * The cluster name.
+       * 
+ * + * string cluster = 2; + */ + public java.lang.String getCluster() { + java.lang.Object ref = cluster_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cluster_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The cluster name.
+       * 
+ * + * string cluster = 2; + */ + public com.google.protobuf.ByteString getClusterBytes() { + java.lang.Object ref = cluster_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cluster_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The cluster name.
+       * 
+ * + * string cluster = 2; + */ + public Builder setCluster(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cluster_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The cluster name.
+       * 
+ * + * string cluster = 2; + */ + public Builder clearCluster() { + + cluster_ = getDefaultInstance().getCluster(); + onChanged(); + return this; + } + /** + * + * + *
+       * The cluster name.
+       * 
+ * + * string cluster = 2; + */ + public Builder setClusterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cluster_ = value; + onChanged(); + return this; + } + + private int stablePercent_; + /** + * + * + *
+       * The desired percentage of game servers that run
+       * stable_game_server_template.
+       * 
+ * + * int32 stable_percent = 3; + */ + public int getStablePercent() { + return stablePercent_; + } + /** + * + * + *
+       * The desired percentage of game servers that run
+       * stable_game_server_template.
+       * 
+ * + * int32 stable_percent = 3; + */ + public Builder setStablePercent(int value) { + + stablePercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The desired percentage of game servers that run
+       * stable_game_server_template.
+       * 
+ * + * int32 stable_percent = 3; + */ + public Builder clearStablePercent() { + + stablePercent_ = 0; + onChanged(); + return this; + } + + private int newPercent_; + /** + * + * + *
+       * The desired percentage of game servers that run new_game_server_template.
+       * 
+ * + * int32 new_percent = 4; + */ + public int getNewPercent() { + return newPercent_; + } + /** + * + * + *
+       * The desired percentage of game servers that run new_game_server_template.
+       * 
+ * + * int32 new_percent = 4; + */ + public Builder setNewPercent(int value) { + + newPercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The desired percentage of game servers that run new_game_server_template.
+       * 
+ * + * int32 new_percent = 4; + */ + public Builder clearNewPercent() { + + newPercent_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget) + private static final com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget(); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterRolloutTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClusterRolloutTarget(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + private java.util.List + clusters_; + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public java.util.List + getClustersList() { + return clusters_; + } + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder> + getClustersOrBuilderList() { + return clusters_; + } + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public int getClustersCount() { + return clusters_.size(); + } + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget getClusters( + int index) { + return clusters_.get(index); + } + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder + getClustersOrBuilder(int index) { + return clusters_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < clusters_.size(); i++) { + output.writeMessage(1, clusters_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < clusters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, clusters_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.DeploymentTarget)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.DeploymentTarget other = + (com.google.cloud.gaming.v1alpha.DeploymentTarget) obj; + + if (!getClustersList().equals(other.getClustersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getClustersCount() > 0) { + hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getClustersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.DeploymentTarget prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The rollout target of the deployment, e.g. the target percentage of game
+   * servers running stable_game_server_template and new_game_server_template in
+   * clusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.DeploymentTarget} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.DeploymentTarget) + com.google.cloud.gaming.v1alpha.DeploymentTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.DeploymentTarget.class, + com.google.cloud.gaming.v1alpha.DeploymentTarget.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.DeploymentTarget.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClustersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + clustersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.DeploymentTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget build() { + com.google.cloud.gaming.v1alpha.DeploymentTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget buildPartial() { + com.google.cloud.gaming.v1alpha.DeploymentTarget result = + new com.google.cloud.gaming.v1alpha.DeploymentTarget(this); + int from_bitField0_ = bitField0_; + if (clustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + clusters_ = java.util.Collections.unmodifiableList(clusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.clusters_ = clusters_; + } else { + result.clusters_ = clustersBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.DeploymentTarget) { + return mergeFrom((com.google.cloud.gaming.v1alpha.DeploymentTarget) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.DeploymentTarget other) { + if (other == com.google.cloud.gaming.v1alpha.DeploymentTarget.getDefaultInstance()) + return this; + if (clustersBuilder_ == null) { + if (!other.clusters_.isEmpty()) { + if (clusters_.isEmpty()) { + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureClustersIsMutable(); + clusters_.addAll(other.clusters_); + } + onChanged(); + } + } else { + if (!other.clusters_.isEmpty()) { + if (clustersBuilder_.isEmpty()) { + clustersBuilder_.dispose(); + clustersBuilder_ = null; + clusters_ = other.clusters_; + bitField0_ = (bitField0_ & ~0x00000001); + clustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClustersFieldBuilder() + : null; + } else { + clustersBuilder_.addAllMessages(other.clusters_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.DeploymentTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.DeploymentTarget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + clusters_ = java.util.Collections.emptyList(); + + private void ensureClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + clusters_ = + new java.util.ArrayList< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget>(clusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder> + clustersBuilder_; + + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public java.util.List + getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget getClusters( + int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder setClusters( + int index, com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder setClusters( + int index, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder addClusters( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder addClusters( + int index, com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder addClusters( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder addClusters( + int index, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder addAllClusters( + java.lang.Iterable< + ? extends com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget> + values) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusters_); + onChanged(); + } else { + clustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder + getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder> + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder( + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + .getDefaultInstance()); + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder + addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder( + index, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget + .getDefaultInstance()); + } + /** + * + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + public java.util.List< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder> + getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget.Builder, + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.DeploymentTarget) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.DeploymentTarget) + private static final com.google.cloud.gaming.v1alpha.DeploymentTarget DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.DeploymentTarget(); + } + + public static com.google.cloud.gaming.v1alpha.DeploymentTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeploymentTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeploymentTarget(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.DeploymentTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTargetOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTargetOrBuilder.java new file mode 100644 index 000000000000..cde01a7f2a0f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/DeploymentTargetOrBuilder.java @@ -0,0 +1,40 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface DeploymentTargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.DeploymentTarget) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + java.util.List + getClustersList(); + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget getClusters(int index); + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + int getClustersCount(); + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + java.util.List< + ? extends com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder> + getClustersOrBuilderList(); + /** + * repeated .google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTarget clusters = 1; + * + */ + com.google.cloud.gaming.v1alpha.DeploymentTarget.ClusterRolloutTargetOrBuilder + getClustersOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettings.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettings.java new file mode 100644 index 000000000000..fd87daec0380 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettings.java @@ -0,0 +1,872 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Fleet autoscaling parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.FleetAutoscalerSettings} + */ +public final class FleetAutoscalerSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.FleetAutoscalerSettings) + FleetAutoscalerSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FleetAutoscalerSettings.newBuilder() to construct. + private FleetAutoscalerSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FleetAutoscalerSettings() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FleetAutoscalerSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + bufferSizeCase_ = 1; + bufferSize_ = input.readInt64(); + break; + } + case 21: + { + bufferSizeCase_ = 2; + bufferSize_ = input.readFloat(); + break; + } + case 24: + { + minReplicas_ = input.readInt64(); + break; + } + case 32: + { + maxReplicas_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.class, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder.class); + } + + private int bufferSizeCase_ = 0; + private java.lang.Object bufferSize_; + + public enum BufferSizeCase implements com.google.protobuf.Internal.EnumLite { + BUFFER_SIZE_ABSOLUTE(1), + BUFFER_SIZE_PERCENTAGE(2), + BUFFERSIZE_NOT_SET(0); + private final int value; + + private BufferSizeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static BufferSizeCase valueOf(int value) { + return forNumber(value); + } + + public static BufferSizeCase forNumber(int value) { + switch (value) { + case 1: + return BUFFER_SIZE_ABSOLUTE; + case 2: + return BUFFER_SIZE_PERCENTAGE; + case 0: + return BUFFERSIZE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public BufferSizeCase getBufferSizeCase() { + return BufferSizeCase.forNumber(bufferSizeCase_); + } + + public static final int BUFFER_SIZE_ABSOLUTE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The size of a buffer of ready game server instances in absolute number.
+   * As game server instances get allocated or terminated, the fleet will be
+   * scaled up and down so that this buffer is maintained.
+   * 
+ * + * int64 buffer_size_absolute = 1; + */ + public long getBufferSizeAbsolute() { + if (bufferSizeCase_ == 1) { + return (java.lang.Long) bufferSize_; + } + return 0L; + } + + public static final int BUFFER_SIZE_PERCENTAGE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The size of a buffer of ready game server instances in percentage.
+   * As game server instances get allocated or terminated, the fleet will be
+   * scaled up and down so that this buffer is maintained.
+   * 
+ * + * float buffer_size_percentage = 2; + */ + public float getBufferSizePercentage() { + if (bufferSizeCase_ == 2) { + return (java.lang.Float) bufferSize_; + } + return 0F; + } + + public static final int MIN_REPLICAS_FIELD_NUMBER = 3; + private long minReplicas_; + /** + * + * + *
+   * The minimum fleet size.
+   * 
+ * + * int64 min_replicas = 3; + */ + public long getMinReplicas() { + return minReplicas_; + } + + public static final int MAX_REPLICAS_FIELD_NUMBER = 4; + private long maxReplicas_; + /** + * + * + *
+   * The maximum fleet size.
+   * 
+ * + * int64 max_replicas = 4; + */ + public long getMaxReplicas() { + return maxReplicas_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (bufferSizeCase_ == 1) { + output.writeInt64(1, (long) ((java.lang.Long) bufferSize_)); + } + if (bufferSizeCase_ == 2) { + output.writeFloat(2, (float) ((java.lang.Float) bufferSize_)); + } + if (minReplicas_ != 0L) { + output.writeInt64(3, minReplicas_); + } + if (maxReplicas_ != 0L) { + output.writeInt64(4, maxReplicas_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (bufferSizeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 1, (long) ((java.lang.Long) bufferSize_)); + } + if (bufferSizeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 2, (float) ((java.lang.Float) bufferSize_)); + } + if (minReplicas_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, minReplicas_); + } + if (maxReplicas_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, maxReplicas_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings other = + (com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings) obj; + + if (getMinReplicas() != other.getMinReplicas()) return false; + if (getMaxReplicas() != other.getMaxReplicas()) return false; + if (!getBufferSizeCase().equals(other.getBufferSizeCase())) return false; + switch (bufferSizeCase_) { + case 1: + if (getBufferSizeAbsolute() != other.getBufferSizeAbsolute()) return false; + break; + case 2: + if (java.lang.Float.floatToIntBits(getBufferSizePercentage()) + != java.lang.Float.floatToIntBits(other.getBufferSizePercentage())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMinReplicas()); + hash = (37 * hash) + MAX_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxReplicas()); + switch (bufferSizeCase_) { + case 1: + hash = (37 * hash) + BUFFER_SIZE_ABSOLUTE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBufferSizeAbsolute()); + break; + case 2: + hash = (37 * hash) + BUFFER_SIZE_PERCENTAGE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBufferSizePercentage()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Fleet autoscaling parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.FleetAutoscalerSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.FleetAutoscalerSettings) + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.class, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + minReplicas_ = 0L; + + maxReplicas_ = 0L; + + bufferSizeCase_ = 0; + bufferSize_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings build() { + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings buildPartial() { + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings result = + new com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings(this); + if (bufferSizeCase_ == 1) { + result.bufferSize_ = bufferSize_; + } + if (bufferSizeCase_ == 2) { + result.bufferSize_ = bufferSize_; + } + result.minReplicas_ = minReplicas_; + result.maxReplicas_ = maxReplicas_; + result.bufferSizeCase_ = bufferSizeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings) { + return mergeFrom((com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings other) { + if (other == com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.getDefaultInstance()) + return this; + if (other.getMinReplicas() != 0L) { + setMinReplicas(other.getMinReplicas()); + } + if (other.getMaxReplicas() != 0L) { + setMaxReplicas(other.getMaxReplicas()); + } + switch (other.getBufferSizeCase()) { + case BUFFER_SIZE_ABSOLUTE: + { + setBufferSizeAbsolute(other.getBufferSizeAbsolute()); + break; + } + case BUFFER_SIZE_PERCENTAGE: + { + setBufferSizePercentage(other.getBufferSizePercentage()); + break; + } + case BUFFERSIZE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bufferSizeCase_ = 0; + private java.lang.Object bufferSize_; + + public BufferSizeCase getBufferSizeCase() { + return BufferSizeCase.forNumber(bufferSizeCase_); + } + + public Builder clearBufferSize() { + bufferSizeCase_ = 0; + bufferSize_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The size of a buffer of ready game server instances in absolute number.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * int64 buffer_size_absolute = 1; + */ + public long getBufferSizeAbsolute() { + if (bufferSizeCase_ == 1) { + return (java.lang.Long) bufferSize_; + } + return 0L; + } + /** + * + * + *
+     * The size of a buffer of ready game server instances in absolute number.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * int64 buffer_size_absolute = 1; + */ + public Builder setBufferSizeAbsolute(long value) { + bufferSizeCase_ = 1; + bufferSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The size of a buffer of ready game server instances in absolute number.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * int64 buffer_size_absolute = 1; + */ + public Builder clearBufferSizeAbsolute() { + if (bufferSizeCase_ == 1) { + bufferSizeCase_ = 0; + bufferSize_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The size of a buffer of ready game server instances in percentage.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * float buffer_size_percentage = 2; + */ + public float getBufferSizePercentage() { + if (bufferSizeCase_ == 2) { + return (java.lang.Float) bufferSize_; + } + return 0F; + } + /** + * + * + *
+     * The size of a buffer of ready game server instances in percentage.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * float buffer_size_percentage = 2; + */ + public Builder setBufferSizePercentage(float value) { + bufferSizeCase_ = 2; + bufferSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The size of a buffer of ready game server instances in percentage.
+     * As game server instances get allocated or terminated, the fleet will be
+     * scaled up and down so that this buffer is maintained.
+     * 
+ * + * float buffer_size_percentage = 2; + */ + public Builder clearBufferSizePercentage() { + if (bufferSizeCase_ == 2) { + bufferSizeCase_ = 0; + bufferSize_ = null; + onChanged(); + } + return this; + } + + private long minReplicas_; + /** + * + * + *
+     * The minimum fleet size.
+     * 
+ * + * int64 min_replicas = 3; + */ + public long getMinReplicas() { + return minReplicas_; + } + /** + * + * + *
+     * The minimum fleet size.
+     * 
+ * + * int64 min_replicas = 3; + */ + public Builder setMinReplicas(long value) { + + minReplicas_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The minimum fleet size.
+     * 
+ * + * int64 min_replicas = 3; + */ + public Builder clearMinReplicas() { + + minReplicas_ = 0L; + onChanged(); + return this; + } + + private long maxReplicas_; + /** + * + * + *
+     * The maximum fleet size.
+     * 
+ * + * int64 max_replicas = 4; + */ + public long getMaxReplicas() { + return maxReplicas_; + } + /** + * + * + *
+     * The maximum fleet size.
+     * 
+ * + * int64 max_replicas = 4; + */ + public Builder setMaxReplicas(long value) { + + maxReplicas_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum fleet size.
+     * 
+ * + * int64 max_replicas = 4; + */ + public Builder clearMaxReplicas() { + + maxReplicas_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.FleetAutoscalerSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.FleetAutoscalerSettings) + private static final com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings(); + } + + public static com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FleetAutoscalerSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FleetAutoscalerSettings(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettingsOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettingsOrBuilder.java new file mode 100644 index 000000000000..b15ddb7e36ce --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/FleetAutoscalerSettingsOrBuilder.java @@ -0,0 +1,60 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface FleetAutoscalerSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.FleetAutoscalerSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The size of a buffer of ready game server instances in absolute number.
+   * As game server instances get allocated or terminated, the fleet will be
+   * scaled up and down so that this buffer is maintained.
+   * 
+ * + * int64 buffer_size_absolute = 1; + */ + long getBufferSizeAbsolute(); + + /** + * + * + *
+   * The size of a buffer of ready game server instances in percentage.
+   * As game server instances get allocated or terminated, the fleet will be
+   * scaled up and down so that this buffer is maintained.
+   * 
+ * + * float buffer_size_percentage = 2; + */ + float getBufferSizePercentage(); + + /** + * + * + *
+   * The minimum fleet size.
+   * 
+ * + * int64 min_replicas = 3; + */ + long getMinReplicas(); + + /** + * + * + *
+   * The maximum fleet size.
+   * 
+ * + * int64 max_replicas = 4; + */ + long getMaxReplicas(); + + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.BufferSizeCase getBufferSizeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerCluster.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerCluster.java new file mode 100644 index 000000000000..9d8ff340030f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerCluster.java @@ -0,0 +1,1764 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * A game server cluster resource.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerCluster} + */ +public final class GameServerCluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GameServerCluster) + GameServerClusterOrBuilder { + private static final long serialVersionUID = 0L; + // Use GameServerCluster.newBuilder() to construct. + private GameServerCluster(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GameServerCluster() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GameServerCluster( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder subBuilder = + null; + if (connectionInfo_ != null) { + subBuilder = connectionInfo_.toBuilder(); + } + connectionInfo_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connectionInfo_); + connectionInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerCluster.class, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the game server cluster, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the game server cluster, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CONNECTION_INFO_FIELD_NUMBER = 5; + private com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connectionInfo_; + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + public boolean hasConnectionInfo() { + return connectionInfo_ != null; + } + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo getConnectionInfo() { + return connectionInfo_ == null + ? com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.getDefaultInstance() + : connectionInfo_; + } + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder + getConnectionInfoOrBuilder() { + return getConnectionInfo(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (connectionInfo_ != null) { + output.writeMessage(5, getConnectionInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (connectionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getConnectionInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GameServerCluster)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GameServerCluster other = + (com.google.cloud.gaming.v1alpha.GameServerCluster) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasConnectionInfo() != other.hasConnectionInfo()) return false; + if (hasConnectionInfo()) { + if (!getConnectionInfo().equals(other.getConnectionInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasConnectionInfo()) { + hash = (37 * hash) + CONNECTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getConnectionInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.GameServerCluster prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A game server cluster resource.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerCluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GameServerCluster) + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerCluster.class, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GameServerCluster.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (connectionInfoBuilder_ == null) { + connectionInfo_ = null; + } else { + connectionInfo_ = null; + connectionInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerCluster getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerCluster build() { + com.google.cloud.gaming.v1alpha.GameServerCluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerCluster buildPartial() { + com.google.cloud.gaming.v1alpha.GameServerCluster result = + new com.google.cloud.gaming.v1alpha.GameServerCluster(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (connectionInfoBuilder_ == null) { + result.connectionInfo_ = connectionInfo_; + } else { + result.connectionInfo_ = connectionInfoBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GameServerCluster) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GameServerCluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GameServerCluster other) { + if (other == com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasConnectionInfo()) { + mergeConnectionInfo(other.getConnectionInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GameServerCluster parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GameServerCluster) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the game server cluster, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the game server cluster, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the game server cluster, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the game server cluster, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the game server cluster, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels associated with this game server cluster. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connectionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder> + connectionInfoBuilder_; + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public boolean hasConnectionInfo() { + return connectionInfoBuilder_ != null || connectionInfo_ != null; + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo getConnectionInfo() { + if (connectionInfoBuilder_ == null) { + return connectionInfo_ == null + ? com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.getDefaultInstance() + : connectionInfo_; + } else { + return connectionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public Builder setConnectionInfo( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo value) { + if (connectionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionInfo_ = value; + onChanged(); + } else { + connectionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public Builder setConnectionInfo( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder builderForValue) { + if (connectionInfoBuilder_ == null) { + connectionInfo_ = builderForValue.build(); + onChanged(); + } else { + connectionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public Builder mergeConnectionInfo( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo value) { + if (connectionInfoBuilder_ == null) { + if (connectionInfo_ != null) { + connectionInfo_ = + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.newBuilder( + connectionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + connectionInfo_ = value; + } + onChanged(); + } else { + connectionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public Builder clearConnectionInfo() { + if (connectionInfoBuilder_ == null) { + connectionInfo_ = null; + onChanged(); + } else { + connectionInfo_ = null; + connectionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder + getConnectionInfoBuilder() { + + onChanged(); + return getConnectionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder + getConnectionInfoOrBuilder() { + if (connectionInfoBuilder_ != null) { + return connectionInfoBuilder_.getMessageOrBuilder(); + } else { + return connectionInfo_ == null + ? com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.getDefaultInstance() + : connectionInfo_; + } + } + /** + * + * + *
+     * Game server cluster connection information. This information is used to
+     * manage game server clusters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder> + getConnectionInfoFieldBuilder() { + if (connectionInfoBuilder_ == null) { + connectionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder>( + getConnectionInfo(), getParentForChildren(), isClean()); + connectionInfo_ = null; + } + return connectionInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GameServerCluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GameServerCluster) + private static final com.google.cloud.gaming.v1alpha.GameServerCluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GameServerCluster(); + } + + public static com.google.cloud.gaming.v1alpha.GameServerCluster getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GameServerCluster parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GameServerCluster(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerCluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfo.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfo.java new file mode 100644 index 000000000000..a31faaf7ac1f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfo.java @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Game server cluster connection information.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo} + */ +public final class GameServerClusterConnectionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + GameServerClusterConnectionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use GameServerClusterConnectionInfo.newBuilder() to construct. + private GameServerClusterConnectionInfo( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GameServerClusterConnectionInfo() { + namespace_ = ""; + gkeName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GameServerClusterConnectionInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + namespace_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + gkeName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.class, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder.class); + } + + public static final int NAMESPACE_FIELD_NUMBER = 5; + private volatile java.lang.Object namespace_; + /** + * + * + *
+   * Namespace for Kubernetes API server endpoint.
+   * 
+ * + * string namespace = 5; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } + } + /** + * + * + *
+   * Namespace for Kubernetes API server endpoint.
+   * 
+ * + * string namespace = 5; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GKE_NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object gkeName_; + /** + * + * + *
+   * This is the gkeName where the game server cluster is installed.
+   * It must the format "projects/*/locations/*/clusters/*". For example,
+   * "projects/my-project/locations/us-central1/clusters/test".
+   * 
+ * + * string gke_name = 6; + */ + public java.lang.String getGkeName() { + java.lang.Object ref = gkeName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gkeName_ = s; + return s; + } + } + /** + * + * + *
+   * This is the gkeName where the game server cluster is installed.
+   * It must the format "projects/*/locations/*/clusters/*". For example,
+   * "projects/my-project/locations/us-central1/clusters/test".
+   * 
+ * + * string gke_name = 6; + */ + public com.google.protobuf.ByteString getGkeNameBytes() { + java.lang.Object ref = gkeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gkeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNamespaceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, namespace_); + } + if (!getGkeNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, gkeName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNamespaceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, namespace_); + } + if (!getGkeNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, gkeName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo other = + (com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) obj; + + if (!getNamespace().equals(other.getNamespace())) return false; + if (!getGkeName().equals(other.getGkeName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + hash = (37 * hash) + GKE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGkeName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Game server cluster connection information.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.class, + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + namespace_ = ""; + + gkeName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo build() { + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo buildPartial() { + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo result = + new com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo(this); + result.namespace_ = namespace_; + result.gkeName_ = gkeName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo other) { + if (other + == com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo.getDefaultInstance()) + return this; + if (!other.getNamespace().isEmpty()) { + namespace_ = other.namespace_; + onChanged(); + } + if (!other.getGkeName().isEmpty()) { + gkeName_ = other.gkeName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object namespace_ = ""; + /** + * + * + *
+     * Namespace for Kubernetes API server endpoint.
+     * 
+ * + * string namespace = 5; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Namespace for Kubernetes API server endpoint.
+     * 
+ * + * string namespace = 5; + */ + public com.google.protobuf.ByteString getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Namespace for Kubernetes API server endpoint.
+     * 
+ * + * string namespace = 5; + */ + public Builder setNamespace(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + namespace_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Namespace for Kubernetes API server endpoint.
+     * 
+ * + * string namespace = 5; + */ + public Builder clearNamespace() { + + namespace_ = getDefaultInstance().getNamespace(); + onChanged(); + return this; + } + /** + * + * + *
+     * Namespace for Kubernetes API server endpoint.
+     * 
+ * + * string namespace = 5; + */ + public Builder setNamespaceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + namespace_ = value; + onChanged(); + return this; + } + + private java.lang.Object gkeName_ = ""; + /** + * + * + *
+     * This is the gkeName where the game server cluster is installed.
+     * It must the format "projects/*/locations/*/clusters/*". For example,
+     * "projects/my-project/locations/us-central1/clusters/test".
+     * 
+ * + * string gke_name = 6; + */ + public java.lang.String getGkeName() { + java.lang.Object ref = gkeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gkeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This is the gkeName where the game server cluster is installed.
+     * It must the format "projects/*/locations/*/clusters/*". For example,
+     * "projects/my-project/locations/us-central1/clusters/test".
+     * 
+ * + * string gke_name = 6; + */ + public com.google.protobuf.ByteString getGkeNameBytes() { + java.lang.Object ref = gkeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gkeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This is the gkeName where the game server cluster is installed.
+     * It must the format "projects/*/locations/*/clusters/*". For example,
+     * "projects/my-project/locations/us-central1/clusters/test".
+     * 
+ * + * string gke_name = 6; + */ + public Builder setGkeName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gkeName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This is the gkeName where the game server cluster is installed.
+     * It must the format "projects/*/locations/*/clusters/*". For example,
+     * "projects/my-project/locations/us-central1/clusters/test".
+     * 
+ * + * string gke_name = 6; + */ + public Builder clearGkeName() { + + gkeName_ = getDefaultInstance().getGkeName(); + onChanged(); + return this; + } + /** + * + * + *
+     * This is the gkeName where the game server cluster is installed.
+     * It must the format "projects/*/locations/*/clusters/*". For example,
+     * "projects/my-project/locations/us-central1/clusters/test".
+     * 
+ * + * string gke_name = 6; + */ + public Builder setGkeNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gkeName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + private static final com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo(); + } + + public static com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GameServerClusterConnectionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GameServerClusterConnectionInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfoOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfoOrBuilder.java new file mode 100644 index 000000000000..265e79787136 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterConnectionInfoOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GameServerClusterConnectionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Namespace for Kubernetes API server endpoint.
+   * 
+ * + * string namespace = 5; + */ + java.lang.String getNamespace(); + /** + * + * + *
+   * Namespace for Kubernetes API server endpoint.
+   * 
+ * + * string namespace = 5; + */ + com.google.protobuf.ByteString getNamespaceBytes(); + + /** + * + * + *
+   * This is the gkeName where the game server cluster is installed.
+   * It must the format "projects/*/locations/*/clusters/*". For example,
+   * "projects/my-project/locations/us-central1/clusters/test".
+   * 
+ * + * string gke_name = 6; + */ + java.lang.String getGkeName(); + /** + * + * + *
+   * This is the gkeName where the game server cluster is installed.
+   * It must the format "projects/*/locations/*/clusters/*". For example,
+   * "projects/my-project/locations/us-central1/clusters/test".
+   * 
+ * + * string gke_name = 6; + */ + com.google.protobuf.ByteString getGkeNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterName.java new file mode 100644 index 000000000000..d4347e925e69 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterName.java @@ -0,0 +1,249 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class GameServerClusterName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{game_server_cluster}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String realm; + private final String gameServerCluster; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRealm() { + return realm; + } + + public String getGameServerCluster() { + return gameServerCluster; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private GameServerClusterName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + realm = Preconditions.checkNotNull(builder.getRealm()); + gameServerCluster = Preconditions.checkNotNull(builder.getGameServerCluster()); + } + + public static GameServerClusterName of( + String project, String location, String realm, String gameServerCluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRealm(realm) + .setGameServerCluster(gameServerCluster) + .build(); + } + + public static String format( + String project, String location, String realm, String gameServerCluster) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRealm(realm) + .setGameServerCluster(gameServerCluster) + .build() + .toString(); + } + + public static GameServerClusterName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "GameServerClusterName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("realm"), + matchMap.get("game_server_cluster")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (GameServerClusterName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("realm", realm); + fieldMapBuilder.put("gameServerCluster", gameServerCluster); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "realm", + realm, + "game_server_cluster", + gameServerCluster); + } + + /** Builder for GameServerClusterName. */ + public static class Builder { + + private String project; + private String location; + private String realm; + private String gameServerCluster; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRealm() { + return realm; + } + + public String getGameServerCluster() { + return gameServerCluster; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRealm(String realm) { + this.realm = realm; + return this; + } + + public Builder setGameServerCluster(String gameServerCluster) { + this.gameServerCluster = gameServerCluster; + return this; + } + + private Builder() {} + + private Builder(GameServerClusterName gameServerClusterName) { + project = gameServerClusterName.project; + location = gameServerClusterName.location; + realm = gameServerClusterName.realm; + gameServerCluster = gameServerClusterName.gameServerCluster; + } + + public GameServerClusterName build() { + return new GameServerClusterName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GameServerClusterName) { + GameServerClusterName that = (GameServerClusterName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.realm.equals(that.realm)) + && (this.gameServerCluster.equals(that.gameServerCluster)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= realm.hashCode(); + h *= 1000003; + h ^= gameServerCluster.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterOrBuilder.java new file mode 100644 index 000000000000..5d0819f9be5b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusterOrBuilder.java @@ -0,0 +1,193 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GameServerClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GameServerCluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the game server cluster, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the game server cluster, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels associated with this game server cluster. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + boolean hasConnectionInfo(); + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo getConnectionInfo(); + /** + * + * + *
+   * Game server cluster connection information. This information is used to
+   * manage game server clusters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerClusterConnectionInfo connection_info = 5; + */ + com.google.cloud.gaming.v1alpha.GameServerClusterConnectionInfoOrBuilder + getConnectionInfoOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusters.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusters.java new file mode 100644 index 000000000000..0faee4264f8f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClusters.java @@ -0,0 +1,232 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public final class GameServerClusters { + private GameServerClusters() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/gaming/v1alpha/game_serve" + + "r_clusters.proto\022\033google.cloud.gaming.v1" + + "alpha\032\034google/api/annotations.proto\032#goo" + + "gle/longrunning/operations.proto\032 google" + + "/protobuf/field_mask.proto\032\037google/proto" + + "buf/timestamp.proto\032\027google/api/client.p" + + "roto\"x\n\035ListGameServerClustersRequest\022\016\n" + + "\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by" + + "\030\005 \001(\t\"\207\001\n\036ListGameServerClustersRespons" + + "e\022L\n\024game_server_clusters\030\001 \003(\0132..google" + + ".cloud.gaming.v1alpha.GameServerCluster\022" + + "\027\n\017next_page_token\030\002 \001(\t\"+\n\033GetGameServe" + + "rClusterRequest\022\014\n\004name\030\001 \001(\t\"\235\001\n\036Create" + + "GameServerClusterRequest\022\016\n\006parent\030\001 \001(\t" + + "\022\036\n\026game_server_cluster_id\030\002 \001(\t\022K\n\023game" + + "_server_cluster\030\003 \001(\0132..google.cloud.gam" + + "ing.v1alpha.GameServerCluster\".\n\036DeleteG" + + "ameServerClusterRequest\022\014\n\004name\030\001 \001(\t\"\236\001" + + "\n\036UpdateGameServerClusterRequest\022K\n\023game" + + "_server_cluster\030\001 \001(\0132..google.cloud.gam" + + "ing.v1alpha.GameServerCluster\022/\n\013update_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"F" + + "\n\037GameServerClusterConnectionInfo\022\021\n\tnam" + + "espace\030\005 \001(\t\022\020\n\010gke_name\030\006 \001(\t\"\325\002\n\021GameS" + + "erverCluster\022\014\n\004name\030\001 \001(\t\022/\n\013create_tim" + + "e\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n\013u" + + "pdate_time\030\003 \001(\0132\032.google.protobuf.Times" + + "tamp\022J\n\006labels\030\004 \003(\0132:.google.cloud.gami" + + "ng.v1alpha.GameServerCluster.LabelsEntry" + + "\022U\n\017connection_info\030\005 \001(\0132<.google.cloud" + + ".gaming.v1alpha.GameServerClusterConnect" + + "ionInfo\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\0012\376\010\n\031GameServerClustersSer" + + "vice\022\337\001\n\026ListGameServerClusters\022:.google" + + ".cloud.gaming.v1alpha.ListGameServerClus" + + "tersRequest\032;.google.cloud.gaming.v1alph" + + "a.ListGameServerClustersResponse\"L\202\323\344\223\002F" + + "\022D/v1alpha/{parent=projects/*/locations/" + + "*/realms/*}/gameServerClusters\022\316\001\n\024GetGa" + + "meServerCluster\0228.google.cloud.gaming.v1" + + "alpha.GetGameServerClusterRequest\032..goog" + + "le.cloud.gaming.v1alpha.GameServerCluste" + + "r\"L\202\323\344\223\002F\022D/v1alpha/{name=projects/*/loc" + + "ations/*/realms/*/gameServerClusters/*}\022" + + "\330\001\n\027CreateGameServerCluster\022;.google.clo" + + "ud.gaming.v1alpha.CreateGameServerCluste" + + "rRequest\032\035.google.longrunning.Operation\"" + + "a\202\323\344\223\002[\"D/v1alpha/{parent=projects/*/loc" + + "ations/*/realms/*}/gameServerClusters:\023g" + + "ame_server_cluster\022\303\001\n\027DeleteGameServerC" + + "luster\022;.google.cloud.gaming.v1alpha.Del" + + "eteGameServerClusterRequest\032\035.google.lon" + + "grunning.Operation\"L\202\323\344\223\002F*D/v1alpha/{na" + + "me=projects/*/locations/*/realms/*/gameS" + + "erverClusters/*}\022\354\001\n\027UpdateGameServerClu" + + "ster\022;.google.cloud.gaming.v1alpha.Updat" + + "eGameServerClusterRequest\032\035.google.longr" + + "unning.Operation\"u\202\323\344\223\002o2X/v1alpha/{game" + + "_server_cluster.name=projects/*/location" + + "s/*/realms/*/gameServerClusters/*}:\023game" + + "_server_cluster\032\036\312A\033gameservices.googlea" + + "pis.comBf\n\037com.google.cloud.gaming.v1alp" + + "haP\001ZAgoogle.golang.org/genproto/googlea" + + "pis/cloud/gaming/v1alpha;gamingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor, + new java.lang.String[] { + "GameServerClusters", "NextPageToken", + }); + internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CreateGameServerClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "GameServerClusterId", "GameServerCluster", + }); + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor, + new java.lang.String[] { + "GameServerCluster", "UpdateMask", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerClusterConnectionInfo_descriptor, + new java.lang.String[] { + "Namespace", "GkeName", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor, + new java.lang.String[] { + "Name", "CreateTime", "UpdateTime", "Labels", "ConnectionInfo", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerCluster_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployment.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployment.java new file mode 100644 index 000000000000..a5ae66a2f0e5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployment.java @@ -0,0 +1,2018 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * A game server deployment resource.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerDeployment} + */ +public final class GameServerDeployment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GameServerDeployment) + GameServerDeploymentOrBuilder { + private static final long serialVersionUID = 0L; + // Use GameServerDeployment.newBuilder() to construct. + private GameServerDeployment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GameServerDeployment() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GameServerDeployment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder subBuilder = null; + if (stableGameServerTemplate_ != null) { + subBuilder = stableGameServerTemplate_.toBuilder(); + } + stableGameServerTemplate_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerTemplate.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(stableGameServerTemplate_); + stableGameServerTemplate_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder subBuilder = null; + if (newGameServerTemplate_ != null) { + subBuilder = newGameServerTemplate_.toBuilder(); + } + newGameServerTemplate_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerTemplate.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newGameServerTemplate_); + newGameServerTemplate_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerDeployment.class, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the game server deployment, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the game server deployment, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STABLE_GAME_SERVER_TEMPLATE_FIELD_NUMBER = 5; + private com.google.cloud.gaming.v1alpha.GameServerTemplate stableGameServerTemplate_; + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public boolean hasStableGameServerTemplate() { + return stableGameServerTemplate_ != null; + } + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getStableGameServerTemplate() { + return stableGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : stableGameServerTemplate_; + } + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getStableGameServerTemplateOrBuilder() { + return getStableGameServerTemplate(); + } + + public static final int NEW_GAME_SERVER_TEMPLATE_FIELD_NUMBER = 6; + private com.google.cloud.gaming.v1alpha.GameServerTemplate newGameServerTemplate_; + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public boolean hasNewGameServerTemplate() { + return newGameServerTemplate_ != null; + } + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate() { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getNewGameServerTemplateOrBuilder() { + return getNewGameServerTemplate(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (stableGameServerTemplate_ != null) { + output.writeMessage(5, getStableGameServerTemplate()); + } + if (newGameServerTemplate_ != null) { + output.writeMessage(6, getNewGameServerTemplate()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (stableGameServerTemplate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, getStableGameServerTemplate()); + } + if (newGameServerTemplate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getNewGameServerTemplate()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GameServerDeployment)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GameServerDeployment other = + (com.google.cloud.gaming.v1alpha.GameServerDeployment) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasStableGameServerTemplate() != other.hasStableGameServerTemplate()) return false; + if (hasStableGameServerTemplate()) { + if (!getStableGameServerTemplate().equals(other.getStableGameServerTemplate())) return false; + } + if (hasNewGameServerTemplate() != other.hasNewGameServerTemplate()) return false; + if (hasNewGameServerTemplate()) { + if (!getNewGameServerTemplate().equals(other.getNewGameServerTemplate())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasStableGameServerTemplate()) { + hash = (37 * hash) + STABLE_GAME_SERVER_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getStableGameServerTemplate().hashCode(); + } + if (hasNewGameServerTemplate()) { + hash = (37 * hash) + NEW_GAME_SERVER_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getNewGameServerTemplate().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.GameServerDeployment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A game server deployment resource.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerDeployment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GameServerDeployment) + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerDeployment.class, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GameServerDeployment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (stableGameServerTemplateBuilder_ == null) { + stableGameServerTemplate_ = null; + } else { + stableGameServerTemplate_ = null; + stableGameServerTemplateBuilder_ = null; + } + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = null; + } else { + newGameServerTemplate_ = null; + newGameServerTemplateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerDeployment getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerDeployment build() { + com.google.cloud.gaming.v1alpha.GameServerDeployment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerDeployment buildPartial() { + com.google.cloud.gaming.v1alpha.GameServerDeployment result = + new com.google.cloud.gaming.v1alpha.GameServerDeployment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (stableGameServerTemplateBuilder_ == null) { + result.stableGameServerTemplate_ = stableGameServerTemplate_; + } else { + result.stableGameServerTemplate_ = stableGameServerTemplateBuilder_.build(); + } + if (newGameServerTemplateBuilder_ == null) { + result.newGameServerTemplate_ = newGameServerTemplate_; + } else { + result.newGameServerTemplate_ = newGameServerTemplateBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GameServerDeployment) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GameServerDeployment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GameServerDeployment other) { + if (other == com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasStableGameServerTemplate()) { + mergeStableGameServerTemplate(other.getStableGameServerTemplate()); + } + if (other.hasNewGameServerTemplate()) { + mergeNewGameServerTemplate(other.getNewGameServerTemplate()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GameServerDeployment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GameServerDeployment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the game server deployment, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the game server deployment, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the game server deployment, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the game server deployment, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the game server deployment, using the form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels associated with this game server deployment. Each label is a
+     * key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerTemplate stableGameServerTemplate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + stableGameServerTemplateBuilder_; + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public boolean hasStableGameServerTemplate() { + return stableGameServerTemplateBuilder_ != null || stableGameServerTemplate_ != null; + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getStableGameServerTemplate() { + if (stableGameServerTemplateBuilder_ == null) { + return stableGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : stableGameServerTemplate_; + } else { + return stableGameServerTemplateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public Builder setStableGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (stableGameServerTemplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stableGameServerTemplate_ = value; + onChanged(); + } else { + stableGameServerTemplateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public Builder setStableGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder builderForValue) { + if (stableGameServerTemplateBuilder_ == null) { + stableGameServerTemplate_ = builderForValue.build(); + onChanged(); + } else { + stableGameServerTemplateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public Builder mergeStableGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (stableGameServerTemplateBuilder_ == null) { + if (stableGameServerTemplate_ != null) { + stableGameServerTemplate_ = + com.google.cloud.gaming.v1alpha.GameServerTemplate.newBuilder( + stableGameServerTemplate_) + .mergeFrom(value) + .buildPartial(); + } else { + stableGameServerTemplate_ = value; + } + onChanged(); + } else { + stableGameServerTemplateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public Builder clearStableGameServerTemplate() { + if (stableGameServerTemplateBuilder_ == null) { + stableGameServerTemplate_ = null; + onChanged(); + } else { + stableGameServerTemplate_ = null; + stableGameServerTemplateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder + getStableGameServerTemplateBuilder() { + + onChanged(); + return getStableGameServerTemplateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getStableGameServerTemplateOrBuilder() { + if (stableGameServerTemplateBuilder_ != null) { + return stableGameServerTemplateBuilder_.getMessageOrBuilder(); + } else { + return stableGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : stableGameServerTemplate_; + } + } + /** + * + * + *
+     * Output only. The GameServerTemplate whose rollout was completed.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + getStableGameServerTemplateFieldBuilder() { + if (stableGameServerTemplateBuilder_ == null) { + stableGameServerTemplateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder>( + getStableGameServerTemplate(), getParentForChildren(), isClean()); + stableGameServerTemplate_ = null; + } + return stableGameServerTemplateBuilder_; + } + + private com.google.cloud.gaming.v1alpha.GameServerTemplate newGameServerTemplate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + newGameServerTemplateBuilder_; + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public boolean hasNewGameServerTemplate() { + return newGameServerTemplateBuilder_ != null || newGameServerTemplate_ != null; + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate() { + if (newGameServerTemplateBuilder_ == null) { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } else { + return newGameServerTemplateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public Builder setNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (newGameServerTemplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newGameServerTemplate_ = value; + onChanged(); + } else { + newGameServerTemplateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public Builder setNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder builderForValue) { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = builderForValue.build(); + onChanged(); + } else { + newGameServerTemplateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public Builder mergeNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (newGameServerTemplateBuilder_ == null) { + if (newGameServerTemplate_ != null) { + newGameServerTemplate_ = + com.google.cloud.gaming.v1alpha.GameServerTemplate.newBuilder(newGameServerTemplate_) + .mergeFrom(value) + .buildPartial(); + } else { + newGameServerTemplate_ = value; + } + onChanged(); + } else { + newGameServerTemplateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public Builder clearNewGameServerTemplate() { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = null; + onChanged(); + } else { + newGameServerTemplate_ = null; + newGameServerTemplateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder + getNewGameServerTemplateBuilder() { + + onChanged(); + return getNewGameServerTemplateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getNewGameServerTemplateOrBuilder() { + if (newGameServerTemplateBuilder_ != null) { + return newGameServerTemplateBuilder_.getMessageOrBuilder(); + } else { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } + } + /** + * + * + *
+     * The GameServerTemplate whose rollout is ongoing.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + getNewGameServerTemplateFieldBuilder() { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder>( + getNewGameServerTemplate(), getParentForChildren(), isClean()); + newGameServerTemplate_ = null; + } + return newGameServerTemplateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GameServerDeployment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GameServerDeployment) + private static final com.google.cloud.gaming.v1alpha.GameServerDeployment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GameServerDeployment(); + } + + public static com.google.cloud.gaming.v1alpha.GameServerDeployment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GameServerDeployment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GameServerDeployment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerDeployment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentName.java new file mode 100644 index 000000000000..39b777c2becb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentName.java @@ -0,0 +1,215 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class GameServerDeploymentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/gameServerDeployments/{game_server_deployment}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String gameServerDeployment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getGameServerDeployment() { + return gameServerDeployment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private GameServerDeploymentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + gameServerDeployment = Preconditions.checkNotNull(builder.getGameServerDeployment()); + } + + public static GameServerDeploymentName of( + String project, String location, String gameServerDeployment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setGameServerDeployment(gameServerDeployment) + .build(); + } + + public static String format(String project, String location, String gameServerDeployment) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setGameServerDeployment(gameServerDeployment) + .build() + .toString(); + } + + public static GameServerDeploymentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "GameServerDeploymentName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("game_server_deployment")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (GameServerDeploymentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("gameServerDeployment", gameServerDeployment); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "game_server_deployment", gameServerDeployment); + } + + /** Builder for GameServerDeploymentName. */ + public static class Builder { + + private String project; + private String location; + private String gameServerDeployment; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getGameServerDeployment() { + return gameServerDeployment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setGameServerDeployment(String gameServerDeployment) { + this.gameServerDeployment = gameServerDeployment; + return this; + } + + private Builder() {} + + private Builder(GameServerDeploymentName gameServerDeploymentName) { + project = gameServerDeploymentName.project; + location = gameServerDeploymentName.location; + gameServerDeployment = gameServerDeploymentName.gameServerDeployment; + } + + public GameServerDeploymentName build() { + return new GameServerDeploymentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GameServerDeploymentName) { + GameServerDeploymentName that = (GameServerDeploymentName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.gameServerDeployment.equals(that.gameServerDeployment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= gameServerDeployment.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentOrBuilder.java new file mode 100644 index 000000000000..b0ccd6c4d67d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentOrBuilder.java @@ -0,0 +1,221 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GameServerDeploymentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GameServerDeployment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the game server deployment, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the game server deployment, using the form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels associated with this game server deployment. Each label is a
+   * key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + boolean hasStableGameServerTemplate(); + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplate getStableGameServerTemplate(); + /** + * + * + *
+   * Output only. The GameServerTemplate whose rollout was completed.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate stable_game_server_template = 5; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getStableGameServerTemplateOrBuilder(); + + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + boolean hasNewGameServerTemplate(); + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate(); + /** + * + * + *
+   * The GameServerTemplate whose rollout is ongoing.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 6; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder getNewGameServerTemplateOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployments.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployments.java new file mode 100644 index 000000000000..6f19ed516c3b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeployments.java @@ -0,0 +1,386 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public final class GameServerDeployments { + private GameServerDeployments() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/gaming/v1alpha/game_serve" + + "r_deployments.proto\022\033google.cloud.gaming" + + ".v1alpha\032\034google/api/annotations.proto\032(" + + "google/cloud/gaming/v1alpha/common.proto" + + "\032#google/longrunning/operations.proto\032 g" + + "oogle/protobuf/field_mask.proto\032\037google/" + + "protobuf/timestamp.proto\032\027google/api/cli" + + "ent.proto\"{\n ListGameServerDeploymentsRe" + + "quest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005" + + "\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010" + + "order_by\030\005 \001(\t\"\220\001\n!ListGameServerDeploym" + + "entsResponse\022R\n\027game_server_deployments\030" + + "\001 \003(\01321.google.cloud.gaming.v1alpha.Game" + + "ServerDeployment\022\027\n\017next_page_token\030\002 \001(" + + "\t\".\n\036GetGameServerDeploymentRequest\022\014\n\004n" + + "ame\030\001 \001(\t\"\235\001\n!CreateGameServerDeployment" + + "Request\022\016\n\006parent\030\001 \001(\t\022\025\n\rdeployment_id" + + "\030\002 \001(\t\022Q\n\026game_server_deployment\030\003 \001(\01321" + + ".google.cloud.gaming.v1alpha.GameServerD" + + "eployment\"1\n!DeleteGameServerDeploymentR" + + "equest\022\014\n\004name\030\001 \001(\t\"\247\001\n!UpdateGameServe" + + "rDeploymentRequest\022Q\n\026game_server_deploy" + + "ment\030\001 \001(\01321.google.cloud.gaming.v1alpha" + + ".GameServerDeployment\022/\n\013update_mask\030\002 \001" + + "(\0132\032.google.protobuf.FieldMask\"v\n\023StartR" + + "olloutRequest\022\014\n\004name\030\001 \001(\t\022Q\n\030new_game_" + + "server_template\030\002 \001(\0132/.google.cloud.gam" + + "ing.v1alpha.GameServerTemplate\"\204\001\n\027SetRo" + + "lloutTargetRequest\022\014\n\004name\030\001 \001(\t\022[\n\033clus" + + "ter_percentage_selector\030\002 \003(\01326.google.c" + + "loud.gaming.v1alpha.ClusterPercentageSel" + + "ector\"$\n\024CommitRolloutRequest\022\014\n\004name\030\001 " + + "\001(\t\"$\n\024RevertRolloutRequest\022\014\n\004name\030\001 \001(" + + "\t\"*\n\032GetDeploymentTargetRequest\022\014\n\004name\030" + + "\001 \001(\t\"r\n\031ClusterPercentageSelector\022D\n\020cl" + + "uster_selector\030\001 \001(\0132*.google.cloud.gami" + + "ng.v1alpha.LabelSelector\022\017\n\007percent\030\002 \001(" + + "\005\"\252\001\n\022GameServerTemplate\022\023\n\013description\030" + + "\001 \001(\t\022\014\n\004spec\030\002 \001(\t\022\\\n\034cluster_percentag" + + "e_selectors\030\003 \003(\01326.google.cloud.gaming." + + "v1alpha.ClusterPercentageSelector\022\023\n\013tem" + + "plate_id\030\004 \001(\t\"\315\001\n\020DeploymentTarget\022T\n\010c" + + "lusters\030\001 \003(\0132B.google.cloud.gaming.v1al" + + "pha.DeploymentTarget.ClusterRolloutTarge" + + "t\032c\n\024ClusterRolloutTarget\022\r\n\005realm\030\001 \001(\t" + + "\022\017\n\007cluster\030\002 \001(\t\022\026\n\016stable_percent\030\003 \001(" + + "\005\022\023\n\013new_percent\030\004 \001(\005\"\255\003\n\024GameServerDep" + + "loyment\022\014\n\004name\030\001 \001(\t\022/\n\013create_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022/\n\013update" + + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022" + + "M\n\006labels\030\004 \003(\0132=.google.cloud.gaming.v1" + + "alpha.GameServerDeployment.LabelsEntry\022T" + + "\n\033stable_game_server_template\030\005 \001(\0132/.go" + + "ogle.cloud.gaming.v1alpha.GameServerTemp" + + "late\022Q\n\030new_game_server_template\030\006 \001(\0132/" + + ".google.cloud.gaming.v1alpha.GameServerT" + + "emplate\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\0012\346\020\n\034GameServerDeployments" + + "Service\022\342\001\n\031ListGameServerDeployments\022=." + + "google.cloud.gaming.v1alpha.ListGameServ" + + "erDeploymentsRequest\032>.google.cloud.gami" + + "ng.v1alpha.ListGameServerDeploymentsResp" + + "onse\"F\202\323\344\223\002@\022>/v1alpha/{parent=projects/" + + "*/locations/*}/gameServerDeployments\022\321\001\n" + + "\027GetGameServerDeployment\022;.google.cloud." + + "gaming.v1alpha.GetGameServerDeploymentRe" + + "quest\0321.google.cloud.gaming.v1alpha.Game" + + "ServerDeployment\"F\202\323\344\223\002@\022>/v1alpha/{name" + + "=projects/*/locations/*/gameServerDeploy" + + "ments/*}\022\333\001\n\032CreateGameServerDeployment\022" + + ">.google.cloud.gaming.v1alpha.CreateGame" + + "ServerDeploymentRequest\032\035.google.longrun" + + "ning.Operation\"^\202\323\344\223\002X\">/v1alpha/{parent" + + "=projects/*/locations/*}/gameServerDeplo" + + "yments:\026game_server_deployment\022\303\001\n\032Delet" + + "eGameServerDeployment\022>.google.cloud.gam" + + "ing.v1alpha.DeleteGameServerDeploymentRe" + + "quest\032\035.google.longrunning.Operation\"F\202\323" + + "\344\223\002@*>/v1alpha/{name=projects/*/location" + + "s/*/gameServerDeployments/*}\022\362\001\n\032UpdateG" + + "ameServerDeployment\022>.google.cloud.gamin" + + "g.v1alpha.UpdateGameServerDeploymentRequ" + + "est\032\035.google.longrunning.Operation\"u\202\323\344\223" + + "\002o2U/v1alpha/{game_server_deployment.nam" + + "e=projects/*/locations/*/gameServerDeplo" + + "yments/*}:\026game_server_deployment\022\267\001\n\014St" + + "artRollout\0220.google.cloud.gaming.v1alpha" + + ".StartRolloutRequest\032\035.google.longrunnin" + + "g.Operation\"V\202\323\344\223\002P\"K/v1alpha/{name=proj" + + "ects/*/locations/*/gameServerDeployments" + + "/*}:startRollout:\001*\022\303\001\n\020SetRolloutTarget" + + "\0224.google.cloud.gaming.v1alpha.SetRollou" + + "tTargetRequest\032\035.google.longrunning.Oper" + + "ation\"Z\202\323\344\223\002T\"O/v1alpha/{name=projects/*" + + "/locations/*/gameServerDeployments/*}:se" + + "tRolloutTarget:\001*\022\272\001\n\rCommitRollout\0221.go" + + "ogle.cloud.gaming.v1alpha.CommitRolloutR" + + "equest\032\035.google.longrunning.Operation\"W\202" + + "\323\344\223\002Q\"L/v1alpha/{name=projects/*/locatio" + + "ns/*/gameServerDeployments/*}:commitRoll" + + "out:\001*\022\272\001\n\rRevertRollout\0221.google.cloud." + + "gaming.v1alpha.RevertRolloutRequest\032\035.go" + + "ogle.longrunning.Operation\"W\202\323\344\223\002Q\"L/v1a" + + "lpha/{name=projects/*/locations/*/gameSe" + + "rverDeployments/*}:revertRollout:\001*\022\331\001\n\023" + + "GetDeploymentTarget\0227.google.cloud.gamin" + + "g.v1alpha.GetDeploymentTargetRequest\032-.g" + + "oogle.cloud.gaming.v1alpha.DeploymentTar" + + "get\"Z\202\323\344\223\002T\022R/v1alpha/{name=projects/*/l" + + "ocations/*/gameServerDeployments/*}:getD" + + "eploymentTarget\032\036\312A\033gameservices.googlea" + + "pis.comBf\n\037com.google.cloud.gaming.v1alp" + + "haP\001ZAgoogle.golang.org/genproto/googlea" + + "pis/cloud/gaming/v1alpha;gamingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.gaming.v1alpha.Common.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor, + new java.lang.String[] { + "GameServerDeployments", "NextPageToken", + }); + internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CreateGameServerDeploymentRequest_descriptor, + new java.lang.String[] { + "Parent", "DeploymentId", "GameServerDeployment", + }); + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeleteGameServerDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor, + new java.lang.String[] { + "GameServerDeployment", "UpdateMask", + }); + internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor, + new java.lang.String[] { + "Name", "NewGameServerTemplate", + }); + internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor, + new java.lang.String[] { + "Name", "ClusterPercentageSelector", + }); + internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CommitRolloutRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ClusterPercentageSelector_descriptor, + new java.lang.String[] { + "ClusterSelector", "Percent", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor, + new java.lang.String[] { + "Description", "Spec", "ClusterPercentageSelectors", "TemplateId", + }); + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor, + new java.lang.String[] { + "Clusters", + }); + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor = + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeploymentTarget_ClusterRolloutTarget_descriptor, + new java.lang.String[] { + "Realm", "Cluster", "StablePercent", "NewPercent", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "StableGameServerTemplate", + "NewGameServerTemplate", + }); + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GameServerDeployment_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.gaming.v1alpha.Common.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplate.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplate.java new file mode 100644 index 000000000000..7a99b3504039 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplate.java @@ -0,0 +1,1513 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * The game server spec sent to Agones and the rollout target.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerTemplate} + */ +public final class GameServerTemplate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GameServerTemplate) + GameServerTemplateOrBuilder { + private static final long serialVersionUID = 0L; + // Use GameServerTemplate.newBuilder() to construct. + private GameServerTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GameServerTemplate() { + description_ = ""; + spec_ = ""; + clusterPercentageSelectors_ = java.util.Collections.emptyList(); + templateId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GameServerTemplate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + spec_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + clusterPercentageSelectors_ = + new java.util.ArrayList< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector>(); + mutable_bitField0_ |= 0x00000004; + } + clusterPercentageSelectors_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.parser(), + extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + templateId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + clusterPercentageSelectors_ = + java.util.Collections.unmodifiableList(clusterPercentageSelectors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerTemplate.class, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder.class); + } + + private int bitField0_; + public static final int DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the game server template.
+   * 
+ * + * string description = 1; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The description of the game server template.
+   * 
+ * + * string description = 1; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPEC_FIELD_NUMBER = 2; + private volatile java.lang.Object spec_; + /** + * + * + *
+   * The game server spec, which is sent to Agones.
+   * 
+ * + * string spec = 2; + */ + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spec_ = s; + return s; + } + } + /** + * + * + *
+   * The game server spec, which is sent to Agones.
+   * 
+ * + * string spec = 2; + */ + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_PERCENTAGE_SELECTORS_FIELD_NUMBER = 3; + private java.util.List + clusterPercentageSelectors_; + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public java.util.List + getClusterPercentageSelectorsList() { + return clusterPercentageSelectors_; + } + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorsOrBuilderList() { + return clusterPercentageSelectors_; + } + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public int getClusterPercentageSelectorsCount() { + return clusterPercentageSelectors_.size(); + } + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelectors( + int index) { + return clusterPercentageSelectors_.get(index); + } + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorsOrBuilder(int index) { + return clusterPercentageSelectors_.get(index); + } + + public static final int TEMPLATE_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object templateId_; + /** + * + * + *
+   * The ID of the game server template, specified by the user.
+   * 
+ * + * string template_id = 4; + */ + public java.lang.String getTemplateId() { + java.lang.Object ref = templateId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + templateId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the game server template, specified by the user.
+   * 
+ * + * string template_id = 4; + */ + public com.google.protobuf.ByteString getTemplateIdBytes() { + java.lang.Object ref = templateId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + templateId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (!getSpecBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spec_); + } + for (int i = 0; i < clusterPercentageSelectors_.size(); i++) { + output.writeMessage(3, clusterPercentageSelectors_.get(i)); + } + if (!getTemplateIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, templateId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (!getSpecBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spec_); + } + for (int i = 0; i < clusterPercentageSelectors_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, clusterPercentageSelectors_.get(i)); + } + if (!getTemplateIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, templateId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GameServerTemplate)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GameServerTemplate other = + (com.google.cloud.gaming.v1alpha.GameServerTemplate) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getSpec().equals(other.getSpec())) return false; + if (!getClusterPercentageSelectorsList().equals(other.getClusterPercentageSelectorsList())) + return false; + if (!getTemplateId().equals(other.getTemplateId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpec().hashCode(); + if (getClusterPercentageSelectorsCount() > 0) { + hash = (37 * hash) + CLUSTER_PERCENTAGE_SELECTORS_FIELD_NUMBER; + hash = (53 * hash) + getClusterPercentageSelectorsList().hashCode(); + } + hash = (37 * hash) + TEMPLATE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTemplateId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.GameServerTemplate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The game server spec sent to Agones and the rollout target.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GameServerTemplate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GameServerTemplate) + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GameServerTemplate.class, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GameServerTemplate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterPercentageSelectorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + description_ = ""; + + spec_ = ""; + + if (clusterPercentageSelectorsBuilder_ == null) { + clusterPercentageSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + clusterPercentageSelectorsBuilder_.clear(); + } + templateId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GameServerTemplate_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerTemplate getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerTemplate build() { + com.google.cloud.gaming.v1alpha.GameServerTemplate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerTemplate buildPartial() { + com.google.cloud.gaming.v1alpha.GameServerTemplate result = + new com.google.cloud.gaming.v1alpha.GameServerTemplate(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.description_ = description_; + result.spec_ = spec_; + if (clusterPercentageSelectorsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + clusterPercentageSelectors_ = + java.util.Collections.unmodifiableList(clusterPercentageSelectors_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.clusterPercentageSelectors_ = clusterPercentageSelectors_; + } else { + result.clusterPercentageSelectors_ = clusterPercentageSelectorsBuilder_.build(); + } + result.templateId_ = templateId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GameServerTemplate) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GameServerTemplate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GameServerTemplate other) { + if (other == com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance()) + return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getSpec().isEmpty()) { + spec_ = other.spec_; + onChanged(); + } + if (clusterPercentageSelectorsBuilder_ == null) { + if (!other.clusterPercentageSelectors_.isEmpty()) { + if (clusterPercentageSelectors_.isEmpty()) { + clusterPercentageSelectors_ = other.clusterPercentageSelectors_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.addAll(other.clusterPercentageSelectors_); + } + onChanged(); + } + } else { + if (!other.clusterPercentageSelectors_.isEmpty()) { + if (clusterPercentageSelectorsBuilder_.isEmpty()) { + clusterPercentageSelectorsBuilder_.dispose(); + clusterPercentageSelectorsBuilder_ = null; + clusterPercentageSelectors_ = other.clusterPercentageSelectors_; + bitField0_ = (bitField0_ & ~0x00000004); + clusterPercentageSelectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClusterPercentageSelectorsFieldBuilder() + : null; + } else { + clusterPercentageSelectorsBuilder_.addAllMessages(other.clusterPercentageSelectors_); + } + } + } + if (!other.getTemplateId().isEmpty()) { + templateId_ = other.templateId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GameServerTemplate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GameServerTemplate) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the game server template.
+     * 
+ * + * string description = 1; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The description of the game server template.
+     * 
+ * + * string description = 1; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The description of the game server template.
+     * 
+ * + * string description = 1; + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the game server template.
+     * 
+ * + * string description = 1; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the game server template.
+     * 
+ * + * string description = 1; + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object spec_ = ""; + /** + * + * + *
+     * The game server spec, which is sent to Agones.
+     * 
+ * + * string spec = 2; + */ + public java.lang.String getSpec() { + java.lang.Object ref = spec_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spec_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The game server spec, which is sent to Agones.
+     * 
+ * + * string spec = 2; + */ + public com.google.protobuf.ByteString getSpecBytes() { + java.lang.Object ref = spec_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The game server spec, which is sent to Agones.
+     * 
+ * + * string spec = 2; + */ + public Builder setSpec(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + spec_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The game server spec, which is sent to Agones.
+     * 
+ * + * string spec = 2; + */ + public Builder clearSpec() { + + spec_ = getDefaultInstance().getSpec(); + onChanged(); + return this; + } + /** + * + * + *
+     * The game server spec, which is sent to Agones.
+     * 
+ * + * string spec = 2; + */ + public Builder setSpecBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + spec_ = value; + onChanged(); + return this; + } + + private java.util.List + clusterPercentageSelectors_ = java.util.Collections.emptyList(); + + private void ensureClusterPercentageSelectorsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + clusterPercentageSelectors_ = + new java.util.ArrayList( + clusterPercentageSelectors_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + clusterPercentageSelectorsBuilder_; + + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public java.util.List + getClusterPercentageSelectorsList() { + if (clusterPercentageSelectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusterPercentageSelectors_); + } else { + return clusterPercentageSelectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public int getClusterPercentageSelectorsCount() { + if (clusterPercentageSelectorsBuilder_ == null) { + return clusterPercentageSelectors_.size(); + } else { + return clusterPercentageSelectorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelectors( + int index) { + if (clusterPercentageSelectorsBuilder_ == null) { + return clusterPercentageSelectors_.get(index); + } else { + return clusterPercentageSelectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder setClusterPercentageSelectors( + int index, com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.set(index, value); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder setClusterPercentageSelectors( + int index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorsBuilder_ == null) { + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.set(index, builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder addClusterPercentageSelectors( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.add(value); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder addClusterPercentageSelectors( + int index, com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.add(index, value); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder addClusterPercentageSelectors( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorsBuilder_ == null) { + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.add(builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder addClusterPercentageSelectors( + int index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorsBuilder_ == null) { + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.add(index, builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder addAllClusterPercentageSelectors( + java.lang.Iterable + values) { + if (clusterPercentageSelectorsBuilder_ == null) { + ensureClusterPercentageSelectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterPercentageSelectors_); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder clearClusterPercentageSelectors() { + if (clusterPercentageSelectorsBuilder_ == null) { + clusterPercentageSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public Builder removeClusterPercentageSelectors(int index) { + if (clusterPercentageSelectorsBuilder_ == null) { + ensureClusterPercentageSelectorsIsMutable(); + clusterPercentageSelectors_.remove(index); + onChanged(); + } else { + clusterPercentageSelectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + getClusterPercentageSelectorsBuilder(int index) { + return getClusterPercentageSelectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorsOrBuilder(int index) { + if (clusterPercentageSelectorsBuilder_ == null) { + return clusterPercentageSelectors_.get(index); + } else { + return clusterPercentageSelectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorsOrBuilderList() { + if (clusterPercentageSelectorsBuilder_ != null) { + return clusterPercentageSelectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusterPercentageSelectors_); + } + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + addClusterPercentageSelectorsBuilder() { + return getClusterPercentageSelectorsFieldBuilder() + .addBuilder( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + addClusterPercentageSelectorsBuilder(int index) { + return getClusterPercentageSelectorsFieldBuilder() + .addBuilder( + index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The percentage of game servers running this game server
+     * template in the selected clusters.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + public java.util.List + getClusterPercentageSelectorsBuilderList() { + return getClusterPercentageSelectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorsFieldBuilder() { + if (clusterPercentageSelectorsBuilder_ == null) { + clusterPercentageSelectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder>( + clusterPercentageSelectors_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + clusterPercentageSelectors_ = null; + } + return clusterPercentageSelectorsBuilder_; + } + + private java.lang.Object templateId_ = ""; + /** + * + * + *
+     * The ID of the game server template, specified by the user.
+     * 
+ * + * string template_id = 4; + */ + public java.lang.String getTemplateId() { + java.lang.Object ref = templateId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + templateId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the game server template, specified by the user.
+     * 
+ * + * string template_id = 4; + */ + public com.google.protobuf.ByteString getTemplateIdBytes() { + java.lang.Object ref = templateId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + templateId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the game server template, specified by the user.
+     * 
+ * + * string template_id = 4; + */ + public Builder setTemplateId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + templateId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the game server template, specified by the user.
+     * 
+ * + * string template_id = 4; + */ + public Builder clearTemplateId() { + + templateId_ = getDefaultInstance().getTemplateId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the game server template, specified by the user.
+     * 
+ * + * string template_id = 4; + */ + public Builder setTemplateIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + templateId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GameServerTemplate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GameServerTemplate) + private static final com.google.cloud.gaming.v1alpha.GameServerTemplate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GameServerTemplate(); + } + + public static com.google.cloud.gaming.v1alpha.GameServerTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GameServerTemplate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GameServerTemplate(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GameServerTemplate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplateOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplateOrBuilder.java new file mode 100644 index 000000000000..de3def67174c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GameServerTemplateOrBuilder.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GameServerTemplateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GameServerTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The description of the game server template.
+   * 
+ * + * string description = 1; + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the game server template.
+   * 
+ * + * string description = 1; + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The game server spec, which is sent to Agones.
+   * 
+ * + * string spec = 2; + */ + java.lang.String getSpec(); + /** + * + * + *
+   * The game server spec, which is sent to Agones.
+   * 
+ * + * string spec = 2; + */ + com.google.protobuf.ByteString getSpecBytes(); + + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + java.util.List + getClusterPercentageSelectorsList(); + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelectors( + int index); + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + int getClusterPercentageSelectorsCount(); + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + java.util.List + getClusterPercentageSelectorsOrBuilderList(); + /** + * + * + *
+   * Output only. The percentage of game servers running this game server
+   * template in the selected clusters.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selectors = 3; + * + */ + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorsOrBuilder(int index); + + /** + * + * + *
+   * The ID of the game server template, specified by the user.
+   * 
+ * + * string template_id = 4; + */ + java.lang.String getTemplateId(); + /** + * + * + *
+   * The ID of the game server template, specified by the user.
+   * 
+ * + * string template_id = 4; + */ + com.google.protobuf.ByteString getTemplateIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequest.java new file mode 100644 index 000000000000..734f911e27e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequest.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for AllocationPoliciesService.GetAllocationPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetAllocationPolicyRequest} + */ +public final class GetAllocationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) + GetAllocationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAllocationPolicyRequest.newBuilder() to construct. + private GetAllocationPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAllocationPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetAllocationPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the allocation policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the allocation policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest other = + (com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for AllocationPoliciesService.GetAllocationPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetAllocationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_GetAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest build() { + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest result = + new com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest other) { + if (other == com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the allocation policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the allocation policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the allocation policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the allocation policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the allocation policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAllocationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetAllocationPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..6faad39e28f8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetAllocationPolicyRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetAllocationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetAllocationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the allocation policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the allocation policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequest.java new file mode 100644 index 000000000000..2c1e3a79bab3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequest.java @@ -0,0 +1,613 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.GetDeploymentTarget.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetDeploymentTargetRequest} + */ +public final class GetDeploymentTargetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) + GetDeploymentTargetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDeploymentTargetRequest.newBuilder() to construct. + private GetDeploymentTargetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDeploymentTargetRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDeploymentTargetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.class, + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest other = + (com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.GetDeploymentTarget.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetDeploymentTargetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.class, + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetDeploymentTargetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest build() { + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest result = + new com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest other) { + if (other == com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) + private static final com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDeploymentTargetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDeploymentTargetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequestOrBuilder.java new file mode 100644 index 000000000000..ca0532b0606f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetDeploymentTargetRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetDeploymentTargetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetDeploymentTargetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequest.java new file mode 100644 index 000000000000..4b5aa9406c41 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequest.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerClustersService.GetGameServerCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetGameServerClusterRequest} + */ +public final class GetGameServerClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetGameServerClusterRequest) + GetGameServerClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetGameServerClusterRequest.newBuilder() to construct. + private GetGameServerClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetGameServerClusterRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetGameServerClusterRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server cluster to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server cluster to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest other = + (com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerClustersService.GetGameServerCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetGameServerClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetGameServerClusterRequest) + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_GetGameServerClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest build() { + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest result = + new com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest other) { + if (other == com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server cluster to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server cluster to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server cluster to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server cluster to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server cluster to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetGameServerClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetGameServerClusterRequest) + private static final com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetGameServerClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetGameServerClusterRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequestOrBuilder.java new file mode 100644 index 000000000000..ab12b0c3a754 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerClusterRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetGameServerClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetGameServerClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server cluster to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server cluster to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequest.java new file mode 100644 index 000000000000..0b57a3e8741d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequest.java @@ -0,0 +1,620 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.GetGameServerDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest} + */ +public final class GetGameServerDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + GetGameServerDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetGameServerDeploymentRequest.newBuilder() to construct. + private GetGameServerDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetGameServerDeploymentRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetGameServerDeploymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment to retrieve, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment to retrieve, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest other = + (com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.GetGameServerDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_GetGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest build() { + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest result = + new com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment to retrieve, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to retrieve, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to retrieve, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to retrieve, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to retrieve, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + private static final com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetGameServerDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetGameServerDeploymentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..535455573c4d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetGameServerDeploymentRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetGameServerDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment to retrieve, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment to retrieve, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequest.java new file mode 100644 index 000000000000..6d33ad6e3fa5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequest.java @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for RealmsService.GetRealm.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetRealmRequest} + */ +public final class GetRealmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetRealmRequest) + GetRealmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetRealmRequest.newBuilder() to construct. + private GetRealmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRealmRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetRealmRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetRealmRequest.class, + com.google.cloud.gaming.v1alpha.GetRealmRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the realm to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the realm to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetRealmRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetRealmRequest other = + (com.google.cloud.gaming.v1alpha.GetRealmRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.GetRealmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RealmsService.GetRealm.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetRealmRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetRealmRequest) + com.google.cloud.gaming.v1alpha.GetRealmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetRealmRequest.class, + com.google.cloud.gaming.v1alpha.GetRealmRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetRealmRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetRealmRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetRealmRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetRealmRequest build() { + com.google.cloud.gaming.v1alpha.GetRealmRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetRealmRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetRealmRequest result = + new com.google.cloud.gaming.v1alpha.GetRealmRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetRealmRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetRealmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetRealmRequest other) { + if (other == com.google.cloud.gaming.v1alpha.GetRealmRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetRealmRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.GetRealmRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the realm to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the realm to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the realm to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the realm to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the realm to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetRealmRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetRealmRequest) + private static final com.google.cloud.gaming.v1alpha.GetRealmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetRealmRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetRealmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRealmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetRealmRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetRealmRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequestOrBuilder.java new file mode 100644 index 000000000000..e084d458abd4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetRealmRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetRealmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetRealmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the realm to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the realm to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequest.java new file mode 100644 index 000000000000..636b32185141 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequest.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for ScalingPoliciesService.GetScalingPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetScalingPolicyRequest} + */ +public final class GetScalingPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.GetScalingPolicyRequest) + GetScalingPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetScalingPolicyRequest.newBuilder() to construct. + private GetScalingPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetScalingPolicyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetScalingPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the scaling policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the scaling policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest other = + (com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ScalingPoliciesService.GetScalingPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.GetScalingPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.GetScalingPolicyRequest) + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest build() { + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest result = + new com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest other) { + if (other == com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the scaling policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the scaling policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the scaling policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the scaling policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the scaling policy to retrieve, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.GetScalingPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.GetScalingPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetScalingPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetScalingPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..e654d08e3f70 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/GetScalingPolicyRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface GetScalingPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.GetScalingPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the scaling policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the scaling policy to retrieve, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelector.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelector.java new file mode 100644 index 000000000000..2e888fc8d97b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelector.java @@ -0,0 +1,659 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * The label selector, used to group labels on the resources.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.LabelSelector} + */ +public final class LabelSelector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.LabelSelector) + LabelSelectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use LabelSelector.newBuilder() to construct. + private LabelSelector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LabelSelector() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LabelSelector( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.LabelSelector.class, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder.class); + } + + public static final int LABELS_FIELD_NUMBER = 1; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** map<string, string> labels = 1; */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** map<string, string> labels = 1; */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** map<string, string> labels = 1; */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** map<string, string> labels = 1; */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, labels__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.LabelSelector)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.LabelSelector other = + (com.google.cloud.gaming.v1alpha.LabelSelector) obj; + + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.LabelSelector prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The label selector, used to group labels on the resources.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.LabelSelector} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.LabelSelector) + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.LabelSelector.class, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.LabelSelector.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_LabelSelector_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.LabelSelector getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.LabelSelector build() { + com.google.cloud.gaming.v1alpha.LabelSelector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.LabelSelector buildPartial() { + com.google.cloud.gaming.v1alpha.LabelSelector result = + new com.google.cloud.gaming.v1alpha.LabelSelector(this); + int from_bitField0_ = bitField0_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.LabelSelector) { + return mergeFrom((com.google.cloud.gaming.v1alpha.LabelSelector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.LabelSelector other) { + if (other == com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance()) return this; + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.LabelSelector parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.LabelSelector) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** map<string, string> labels = 1; */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** map<string, string> labels = 1; */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** map<string, string> labels = 1; */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** map<string, string> labels = 1; */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** map<string, string> labels = 1; */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** map<string, string> labels = 1; */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** map<string, string> labels = 1; */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.LabelSelector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.LabelSelector) + private static final com.google.cloud.gaming.v1alpha.LabelSelector DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.LabelSelector(); + } + + public static com.google.cloud.gaming.v1alpha.LabelSelector getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelSelector parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelSelector(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.LabelSelector getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelectorOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelectorOrBuilder.java new file mode 100644 index 000000000000..ac1b5f3c3ce5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LabelSelectorOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +public interface LabelSelectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.LabelSelector) + com.google.protobuf.MessageOrBuilder { + + /** map<string, string> labels = 1; */ + int getLabelsCount(); + /** map<string, string> labels = 1; */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** map<string, string> labels = 1; */ + java.util.Map getLabelsMap(); + /** map<string, string> labels = 1; */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** map<string, string> labels = 1; */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequest.java new file mode 100644 index 000000000000..f7741865c077 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequest.java @@ -0,0 +1,1202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for AllocationPoliciesService.ListAllocationPolicies.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest} + */ +public final class ListAllocationPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + ListAllocationPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAllocationPoliciesRequest.newBuilder() to construct. + private ListAllocationPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAllocationPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAllocationPoliciesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.class, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to
+   * determine if there are more AllocationPolicies left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest other = + (com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for AllocationPoliciesService.ListAllocationPolicies.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.class, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest build() { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest buildPartial() { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest result = + new com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to
+     * determine if there are more AllocationPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to
+     * determine if there are more AllocationPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to
+     * determine if there are more AllocationPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + private static final com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest(); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAllocationPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAllocationPoliciesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequestOrBuilder.java new file mode 100644 index 000000000000..f8a722335e91 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListAllocationPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to
+   * determine if there are more AllocationPolicies left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponse.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponse.java new file mode 100644 index 000000000000..b0d5757ba905 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponse.java @@ -0,0 +1,1119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Response message for AllocationPoliciesService.ListAllocationPolicies.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse} + */ +public final class ListAllocationPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + ListAllocationPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAllocationPoliciesResponse.newBuilder() to construct. + private ListAllocationPoliciesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAllocationPoliciesResponse() { + allocationPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAllocationPoliciesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allocationPolicies_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allocationPolicies_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.AllocationPolicy.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allocationPolicies_ = java.util.Collections.unmodifiableList(allocationPolicies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.class, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.Builder.class); + } + + private int bitField0_; + public static final int ALLOCATION_POLICIES_FIELD_NUMBER = 1; + private java.util.List allocationPolicies_; + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public java.util.List + getAllocationPoliciesList() { + return allocationPolicies_; + } + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public java.util.List + getAllocationPoliciesOrBuilderList() { + return allocationPolicies_; + } + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public int getAllocationPoliciesCount() { + return allocationPolicies_.size(); + } + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicies(int index) { + return allocationPolicies_.get(index); + } + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPoliciesOrBuilder( + int index) { + return allocationPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < allocationPolicies_.size(); i++) { + output.writeMessage(1, allocationPolicies_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < allocationPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, allocationPolicies_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse other = + (com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) obj; + + if (!getAllocationPoliciesList().equals(other.getAllocationPoliciesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAllocationPoliciesCount() > 0) { + hash = (37 * hash) + ALLOCATION_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getAllocationPoliciesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for AllocationPoliciesService.ListAllocationPolicies.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.class, + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAllocationPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (allocationPoliciesBuilder_ == null) { + allocationPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + allocationPoliciesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_ListAllocationPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse build() { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse buildPartial() { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse result = + new com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (allocationPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + allocationPolicies_ = java.util.Collections.unmodifiableList(allocationPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allocationPolicies_ = allocationPolicies_; + } else { + result.allocationPolicies_ = allocationPoliciesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse other) { + if (other + == com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.getDefaultInstance()) + return this; + if (allocationPoliciesBuilder_ == null) { + if (!other.allocationPolicies_.isEmpty()) { + if (allocationPolicies_.isEmpty()) { + allocationPolicies_ = other.allocationPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.addAll(other.allocationPolicies_); + } + onChanged(); + } + } else { + if (!other.allocationPolicies_.isEmpty()) { + if (allocationPoliciesBuilder_.isEmpty()) { + allocationPoliciesBuilder_.dispose(); + allocationPoliciesBuilder_ = null; + allocationPolicies_ = other.allocationPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + allocationPoliciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAllocationPoliciesFieldBuilder() + : null; + } else { + allocationPoliciesBuilder_.addAllMessages(other.allocationPolicies_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List allocationPolicies_ = + java.util.Collections.emptyList(); + + private void ensureAllocationPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allocationPolicies_ = + new java.util.ArrayList( + allocationPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + allocationPoliciesBuilder_; + + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public java.util.List + getAllocationPoliciesList() { + if (allocationPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(allocationPolicies_); + } else { + return allocationPoliciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public int getAllocationPoliciesCount() { + if (allocationPoliciesBuilder_ == null) { + return allocationPolicies_.size(); + } else { + return allocationPoliciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicies(int index) { + if (allocationPoliciesBuilder_ == null) { + return allocationPolicies_.get(index); + } else { + return allocationPoliciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder setAllocationPolicies( + int index, com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.set(index, value); + onChanged(); + } else { + allocationPoliciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder setAllocationPolicies( + int index, com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPoliciesBuilder_ == null) { + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + allocationPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder addAllocationPolicies(com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.add(value); + onChanged(); + } else { + allocationPoliciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder addAllocationPolicies( + int index, com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.add(index, value); + onChanged(); + } else { + allocationPoliciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder addAllocationPolicies( + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPoliciesBuilder_ == null) { + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.add(builderForValue.build()); + onChanged(); + } else { + allocationPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder addAllocationPolicies( + int index, com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPoliciesBuilder_ == null) { + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + allocationPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder addAllAllocationPolicies( + java.lang.Iterable values) { + if (allocationPoliciesBuilder_ == null) { + ensureAllocationPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allocationPolicies_); + onChanged(); + } else { + allocationPoliciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder clearAllocationPolicies() { + if (allocationPoliciesBuilder_ == null) { + allocationPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + allocationPoliciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public Builder removeAllocationPolicies(int index) { + if (allocationPoliciesBuilder_ == null) { + ensureAllocationPoliciesIsMutable(); + allocationPolicies_.remove(index); + onChanged(); + } else { + allocationPoliciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder getAllocationPoliciesBuilder( + int index) { + return getAllocationPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPoliciesOrBuilder( + int index) { + if (allocationPoliciesBuilder_ == null) { + return allocationPolicies_.get(index); + } else { + return allocationPoliciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public java.util.List + getAllocationPoliciesOrBuilderList() { + if (allocationPoliciesBuilder_ != null) { + return allocationPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allocationPolicies_); + } + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder addAllocationPoliciesBuilder() { + return getAllocationPoliciesFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder addAllocationPoliciesBuilder( + int index) { + return getAllocationPoliciesFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * The list of allocation policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + public java.util.List + getAllocationPoliciesBuilderList() { + return getAllocationPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + getAllocationPoliciesFieldBuilder() { + if (allocationPoliciesBuilder_ == null) { + allocationPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder>( + allocationPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + allocationPolicies_ = null; + } + return allocationPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + private static final com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse(); + } + + public static com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAllocationPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAllocationPoliciesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponseOrBuilder.java new file mode 100644 index 000000000000..5b8abb89d25b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListAllocationPoliciesResponseOrBuilder.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListAllocationPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + java.util.List getAllocationPoliciesList(); + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicies(int index); + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + int getAllocationPoliciesCount(); + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + java.util.List + getAllocationPoliciesOrBuilderList(); + /** + * + * + *
+   * The list of allocation policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policies = 1; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPoliciesOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequest.java new file mode 100644 index 000000000000..bdd731906591 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequest.java @@ -0,0 +1,1202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerClustersService.ListGameServerClusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerClustersRequest} + */ +public final class ListGameServerClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + ListGameServerClustersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListGameServerClustersRequest.newBuilder() to construct. + private ListGameServerClustersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListGameServerClustersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListGameServerClustersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.class, + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to
+   * determine if there are more GameServerClusters left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest other = + (com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerClustersService.ListGameServerClusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.class, + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest build() { + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest buildPartial() { + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest result = + new com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to
+     * determine if there are more GameServerClusters left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to
+     * determine if there are more GameServerClusters left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to
+     * determine if there are more GameServerClusters left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + private static final com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest(); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListGameServerClustersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListGameServerClustersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequestOrBuilder.java new file mode 100644 index 000000000000..2310865126f0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListGameServerClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListGameServerClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to
+   * determine if there are more GameServerClusters left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponse.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponse.java new file mode 100644 index 000000000000..f4d2b75f155d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponse.java @@ -0,0 +1,1139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Response message for GameServerClustersService.ListGameServerClusters.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerClustersResponse} + */ +public final class ListGameServerClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + ListGameServerClustersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListGameServerClustersResponse.newBuilder() to construct. + private ListGameServerClustersResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListGameServerClustersResponse() { + gameServerClusters_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListGameServerClustersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + gameServerClusters_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + gameServerClusters_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerCluster.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + gameServerClusters_ = java.util.Collections.unmodifiableList(gameServerClusters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.class, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.Builder.class); + } + + private int bitField0_; + public static final int GAME_SERVER_CLUSTERS_FIELD_NUMBER = 1; + private java.util.List gameServerClusters_; + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + public java.util.List + getGameServerClustersList() { + return gameServerClusters_; + } + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + public java.util.List + getGameServerClustersOrBuilderList() { + return gameServerClusters_; + } + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + public int getGameServerClustersCount() { + return gameServerClusters_.size(); + } + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerClusters(int index) { + return gameServerClusters_.get(index); + } + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder getGameServerClustersOrBuilder( + int index) { + return gameServerClusters_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < gameServerClusters_.size(); i++) { + output.writeMessage(1, gameServerClusters_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < gameServerClusters_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, gameServerClusters_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse other = + (com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse) obj; + + if (!getGameServerClustersList().equals(other.getGameServerClustersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGameServerClustersCount() > 0) { + hash = (37 * hash) + GAME_SERVER_CLUSTERS_FIELD_NUMBER; + hash = (53 * hash) + getGameServerClustersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for GameServerClustersService.ListGameServerClusters.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.class, + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGameServerClustersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gameServerClustersBuilder_ == null) { + gameServerClusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + gameServerClustersBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_ListGameServerClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse build() { + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse buildPartial() { + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse result = + new com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (gameServerClustersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + gameServerClusters_ = java.util.Collections.unmodifiableList(gameServerClusters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.gameServerClusters_ = gameServerClusters_; + } else { + result.gameServerClusters_ = gameServerClustersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse other) { + if (other + == com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse.getDefaultInstance()) + return this; + if (gameServerClustersBuilder_ == null) { + if (!other.gameServerClusters_.isEmpty()) { + if (gameServerClusters_.isEmpty()) { + gameServerClusters_ = other.gameServerClusters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGameServerClustersIsMutable(); + gameServerClusters_.addAll(other.gameServerClusters_); + } + onChanged(); + } + } else { + if (!other.gameServerClusters_.isEmpty()) { + if (gameServerClustersBuilder_.isEmpty()) { + gameServerClustersBuilder_.dispose(); + gameServerClustersBuilder_ = null; + gameServerClusters_ = other.gameServerClusters_; + bitField0_ = (bitField0_ & ~0x00000001); + gameServerClustersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGameServerClustersFieldBuilder() + : null; + } else { + gameServerClustersBuilder_.addAllMessages(other.gameServerClusters_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List gameServerClusters_ = + java.util.Collections.emptyList(); + + private void ensureGameServerClustersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + gameServerClusters_ = + new java.util.ArrayList( + gameServerClusters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + gameServerClustersBuilder_; + + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public java.util.List + getGameServerClustersList() { + if (gameServerClustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(gameServerClusters_); + } else { + return gameServerClustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public int getGameServerClustersCount() { + if (gameServerClustersBuilder_ == null) { + return gameServerClusters_.size(); + } else { + return gameServerClustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerClusters(int index) { + if (gameServerClustersBuilder_ == null) { + return gameServerClusters_.get(index); + } else { + return gameServerClustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder setGameServerClusters( + int index, com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerClustersIsMutable(); + gameServerClusters_.set(index, value); + onChanged(); + } else { + gameServerClustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder setGameServerClusters( + int index, com.google.cloud.gaming.v1alpha.GameServerCluster.Builder builderForValue) { + if (gameServerClustersBuilder_ == null) { + ensureGameServerClustersIsMutable(); + gameServerClusters_.set(index, builderForValue.build()); + onChanged(); + } else { + gameServerClustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder addGameServerClusters(com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerClustersIsMutable(); + gameServerClusters_.add(value); + onChanged(); + } else { + gameServerClustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder addGameServerClusters( + int index, com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerClustersIsMutable(); + gameServerClusters_.add(index, value); + onChanged(); + } else { + gameServerClustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder addGameServerClusters( + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder builderForValue) { + if (gameServerClustersBuilder_ == null) { + ensureGameServerClustersIsMutable(); + gameServerClusters_.add(builderForValue.build()); + onChanged(); + } else { + gameServerClustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder addGameServerClusters( + int index, com.google.cloud.gaming.v1alpha.GameServerCluster.Builder builderForValue) { + if (gameServerClustersBuilder_ == null) { + ensureGameServerClustersIsMutable(); + gameServerClusters_.add(index, builderForValue.build()); + onChanged(); + } else { + gameServerClustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder addAllGameServerClusters( + java.lang.Iterable values) { + if (gameServerClustersBuilder_ == null) { + ensureGameServerClustersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, gameServerClusters_); + onChanged(); + } else { + gameServerClustersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder clearGameServerClusters() { + if (gameServerClustersBuilder_ == null) { + gameServerClusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + gameServerClustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public Builder removeGameServerClusters(int index) { + if (gameServerClustersBuilder_ == null) { + ensureGameServerClustersIsMutable(); + gameServerClusters_.remove(index); + onChanged(); + } else { + gameServerClustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster.Builder getGameServerClustersBuilder( + int index) { + return getGameServerClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder + getGameServerClustersOrBuilder(int index) { + if (gameServerClustersBuilder_ == null) { + return gameServerClusters_.get(index); + } else { + return gameServerClustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public java.util.List + getGameServerClustersOrBuilderList() { + if (gameServerClustersBuilder_ != null) { + return gameServerClustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(gameServerClusters_); + } + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster.Builder + addGameServerClustersBuilder() { + return getGameServerClustersFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster.Builder addGameServerClustersBuilder( + int index) { + return getGameServerClustersFieldBuilder() + .addBuilder( + index, com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance()); + } + /** + * + * + *
+     * The list of game server clusters.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + * + */ + public java.util.List + getGameServerClustersBuilderList() { + return getGameServerClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + getGameServerClustersFieldBuilder() { + if (gameServerClustersBuilder_ == null) { + gameServerClustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder>( + gameServerClusters_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + gameServerClusters_ = null; + } + return gameServerClustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + private static final com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse(); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListGameServerClustersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListGameServerClustersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponseOrBuilder.java new file mode 100644 index 000000000000..c8039c46d7f9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerClustersResponseOrBuilder.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListGameServerClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListGameServerClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + java.util.List getGameServerClustersList(); + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerClusters(int index); + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + int getGameServerClustersCount(); + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + java.util.List + getGameServerClustersOrBuilderList(); + /** + * + * + *
+   * The list of game server clusters.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerCluster game_server_clusters = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder getGameServerClustersOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequest.java new file mode 100644 index 000000000000..ede361f4b235 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequest.java @@ -0,0 +1,1206 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.ListGameServerDeployments.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest} + */ +public final class ListGameServerDeploymentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + ListGameServerDeploymentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListGameServerDeploymentsRequest.newBuilder() to construct. + private ListGameServerDeploymentsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListGameServerDeploymentsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListGameServerDeploymentsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.class, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to
+   * determine if there are more GameServerDeployments left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest other = + (com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.ListGameServerDeployments.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.class, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest build() { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest buildPartial() { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest result = + new com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to
+     * determine if there are more GameServerDeployments left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to
+     * determine if there are more GameServerDeployments left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to
+     * determine if there are more GameServerDeployments left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + private static final com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest(); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListGameServerDeploymentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListGameServerDeploymentsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequestOrBuilder.java new file mode 100644 index 000000000000..aa1863ec9000 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListGameServerDeploymentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to
+   * determine if there are more GameServerDeployments left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponse.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponse.java new file mode 100644 index 000000000000..25a7cb1b9b28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponse.java @@ -0,0 +1,1151 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Response message for GameServerDeploymentsService.ListGameServerDeployments.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse} + */ +public final class ListGameServerDeploymentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + ListGameServerDeploymentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListGameServerDeploymentsResponse.newBuilder() to construct. + private ListGameServerDeploymentsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListGameServerDeploymentsResponse() { + gameServerDeployments_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListGameServerDeploymentsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + gameServerDeployments_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + gameServerDeployments_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerDeployment.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + gameServerDeployments_ = java.util.Collections.unmodifiableList(gameServerDeployments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.class, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.Builder.class); + } + + private int bitField0_; + public static final int GAME_SERVER_DEPLOYMENTS_FIELD_NUMBER = 1; + private java.util.List + gameServerDeployments_; + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public java.util.List + getGameServerDeploymentsList() { + return gameServerDeployments_; + } + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public java.util.List + getGameServerDeploymentsOrBuilderList() { + return gameServerDeployments_; + } + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public int getGameServerDeploymentsCount() { + return gameServerDeployments_.size(); + } + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployments(int index) { + return gameServerDeployments_.get(index); + } + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentsOrBuilder(int index) { + return gameServerDeployments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < gameServerDeployments_.size(); i++) { + output.writeMessage(1, gameServerDeployments_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < gameServerDeployments_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, gameServerDeployments_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse other = + (com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) obj; + + if (!getGameServerDeploymentsList().equals(other.getGameServerDeploymentsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGameServerDeploymentsCount() > 0) { + hash = (37 * hash) + GAME_SERVER_DEPLOYMENTS_FIELD_NUMBER; + hash = (53 * hash) + getGameServerDeploymentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for GameServerDeploymentsService.ListGameServerDeployments.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.class, + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGameServerDeploymentsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gameServerDeploymentsBuilder_ == null) { + gameServerDeployments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + gameServerDeploymentsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_ListGameServerDeploymentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse build() { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse buildPartial() { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse result = + new com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (gameServerDeploymentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + gameServerDeployments_ = java.util.Collections.unmodifiableList(gameServerDeployments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.gameServerDeployments_ = gameServerDeployments_; + } else { + result.gameServerDeployments_ = gameServerDeploymentsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse other) { + if (other + == com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.getDefaultInstance()) + return this; + if (gameServerDeploymentsBuilder_ == null) { + if (!other.gameServerDeployments_.isEmpty()) { + if (gameServerDeployments_.isEmpty()) { + gameServerDeployments_ = other.gameServerDeployments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.addAll(other.gameServerDeployments_); + } + onChanged(); + } + } else { + if (!other.gameServerDeployments_.isEmpty()) { + if (gameServerDeploymentsBuilder_.isEmpty()) { + gameServerDeploymentsBuilder_.dispose(); + gameServerDeploymentsBuilder_ = null; + gameServerDeployments_ = other.gameServerDeployments_; + bitField0_ = (bitField0_ & ~0x00000001); + gameServerDeploymentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGameServerDeploymentsFieldBuilder() + : null; + } else { + gameServerDeploymentsBuilder_.addAllMessages(other.gameServerDeployments_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + gameServerDeployments_ = java.util.Collections.emptyList(); + + private void ensureGameServerDeploymentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + gameServerDeployments_ = + new java.util.ArrayList( + gameServerDeployments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + gameServerDeploymentsBuilder_; + + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public java.util.List + getGameServerDeploymentsList() { + if (gameServerDeploymentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(gameServerDeployments_); + } else { + return gameServerDeploymentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public int getGameServerDeploymentsCount() { + if (gameServerDeploymentsBuilder_ == null) { + return gameServerDeployments_.size(); + } else { + return gameServerDeploymentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployments( + int index) { + if (gameServerDeploymentsBuilder_ == null) { + return gameServerDeployments_.get(index); + } else { + return gameServerDeploymentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder setGameServerDeployments( + int index, com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.set(index, value); + onChanged(); + } else { + gameServerDeploymentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder setGameServerDeployments( + int index, com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder builderForValue) { + if (gameServerDeploymentsBuilder_ == null) { + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.set(index, builderForValue.build()); + onChanged(); + } else { + gameServerDeploymentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder addGameServerDeployments( + com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.add(value); + onChanged(); + } else { + gameServerDeploymentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder addGameServerDeployments( + int index, com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.add(index, value); + onChanged(); + } else { + gameServerDeploymentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder addGameServerDeployments( + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder builderForValue) { + if (gameServerDeploymentsBuilder_ == null) { + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.add(builderForValue.build()); + onChanged(); + } else { + gameServerDeploymentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder addGameServerDeployments( + int index, com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder builderForValue) { + if (gameServerDeploymentsBuilder_ == null) { + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.add(index, builderForValue.build()); + onChanged(); + } else { + gameServerDeploymentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder addAllGameServerDeployments( + java.lang.Iterable values) { + if (gameServerDeploymentsBuilder_ == null) { + ensureGameServerDeploymentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, gameServerDeployments_); + onChanged(); + } else { + gameServerDeploymentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder clearGameServerDeployments() { + if (gameServerDeploymentsBuilder_ == null) { + gameServerDeployments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + gameServerDeploymentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public Builder removeGameServerDeployments(int index) { + if (gameServerDeploymentsBuilder_ == null) { + ensureGameServerDeploymentsIsMutable(); + gameServerDeployments_.remove(index); + onChanged(); + } else { + gameServerDeploymentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder + getGameServerDeploymentsBuilder(int index) { + return getGameServerDeploymentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentsOrBuilder(int index) { + if (gameServerDeploymentsBuilder_ == null) { + return gameServerDeployments_.get(index); + } else { + return gameServerDeploymentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public java.util.List + getGameServerDeploymentsOrBuilderList() { + if (gameServerDeploymentsBuilder_ != null) { + return gameServerDeploymentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(gameServerDeployments_); + } + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder + addGameServerDeploymentsBuilder() { + return getGameServerDeploymentsFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder + addGameServerDeploymentsBuilder(int index) { + return getGameServerDeploymentsFieldBuilder() + .addBuilder( + index, com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of game server delpoyments.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + public java.util.List + getGameServerDeploymentsBuilderList() { + return getGameServerDeploymentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + getGameServerDeploymentsFieldBuilder() { + if (gameServerDeploymentsBuilder_ == null) { + gameServerDeploymentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder>( + gameServerDeployments_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + gameServerDeployments_ = null; + } + return gameServerDeploymentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + private static final com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse(); + } + + public static com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListGameServerDeploymentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListGameServerDeploymentsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponseOrBuilder.java new file mode 100644 index 000000000000..a0edc52d29f5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListGameServerDeploymentsResponseOrBuilder.java @@ -0,0 +1,92 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListGameServerDeploymentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + java.util.List + getGameServerDeploymentsList(); + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployments(int index); + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + int getGameServerDeploymentsCount(); + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + java.util.List + getGameServerDeploymentsOrBuilderList(); + /** + * + * + *
+   * The list of game server delpoyments.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployments = 1; + * + */ + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder getGameServerDeploymentsOrBuilder( + int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequest.java new file mode 100644 index 000000000000..22d461a81b78 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequest.java @@ -0,0 +1,1197 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for RealmsService.ListRealms.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListRealmsRequest} + */ +public final class ListRealmsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListRealmsRequest) + ListRealmsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRealmsRequest.newBuilder() to construct. + private ListRealmsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRealmsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRealmsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListRealmsRequest.class, + com.google.cloud.gaming.v1alpha.ListRealmsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to
+   * determine if there are more Realms left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListRealmsRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListRealmsRequest other = + (com.google.cloud.gaming.v1alpha.ListRealmsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.ListRealmsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for RealmsService.ListRealms.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListRealmsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListRealmsRequest) + com.google.cloud.gaming.v1alpha.ListRealmsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListRealmsRequest.class, + com.google.cloud.gaming.v1alpha.ListRealmsRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListRealmsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListRealmsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsRequest build() { + com.google.cloud.gaming.v1alpha.ListRealmsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsRequest buildPartial() { + com.google.cloud.gaming.v1alpha.ListRealmsRequest result = + new com.google.cloud.gaming.v1alpha.ListRealmsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListRealmsRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListRealmsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListRealmsRequest other) { + if (other == com.google.cloud.gaming.v1alpha.ListRealmsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListRealmsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListRealmsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to
+     * determine if there are more Realms left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to
+     * determine if there are more Realms left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to
+     * determine if there are more Realms left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListRealmsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListRealmsRequest) + private static final com.google.cloud.gaming.v1alpha.ListRealmsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListRealmsRequest(); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRealmsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRealmsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequestOrBuilder.java new file mode 100644 index 000000000000..fadd4359d3a7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListRealmsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListRealmsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to
+   * determine if there are more Realms left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponse.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponse.java new file mode 100644 index 000000000000..97e9c99417aa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponse.java @@ -0,0 +1,1093 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Response message for RealmsService.ListRealms.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListRealmsResponse} + */ +public final class ListRealmsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListRealmsResponse) + ListRealmsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRealmsResponse.newBuilder() to construct. + private ListRealmsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRealmsResponse() { + realms_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRealmsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + realms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + realms_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.Realm.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + realms_ = java.util.Collections.unmodifiableList(realms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListRealmsResponse.class, + com.google.cloud.gaming.v1alpha.ListRealmsResponse.Builder.class); + } + + private int bitField0_; + public static final int REALMS_FIELD_NUMBER = 1; + private java.util.List realms_; + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public java.util.List getRealmsList() { + return realms_; + } + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public java.util.List + getRealmsOrBuilderList() { + return realms_; + } + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public int getRealmsCount() { + return realms_.size(); + } + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealms(int index) { + return realms_.get(index); + } + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmsOrBuilder(int index) { + return realms_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < realms_.size(); i++) { + output.writeMessage(1, realms_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < realms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, realms_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListRealmsResponse)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListRealmsResponse other = + (com.google.cloud.gaming.v1alpha.ListRealmsResponse) obj; + + if (!getRealmsList().equals(other.getRealmsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRealmsCount() > 0) { + hash = (37 * hash) + REALMS_FIELD_NUMBER; + hash = (53 * hash) + getRealmsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.ListRealmsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for RealmsService.ListRealms.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListRealmsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListRealmsResponse) + com.google.cloud.gaming.v1alpha.ListRealmsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListRealmsResponse.class, + com.google.cloud.gaming.v1alpha.ListRealmsResponse.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListRealmsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRealmsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (realmsBuilder_ == null) { + realms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + realmsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsResponse getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListRealmsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsResponse build() { + com.google.cloud.gaming.v1alpha.ListRealmsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsResponse buildPartial() { + com.google.cloud.gaming.v1alpha.ListRealmsResponse result = + new com.google.cloud.gaming.v1alpha.ListRealmsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (realmsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + realms_ = java.util.Collections.unmodifiableList(realms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.realms_ = realms_; + } else { + result.realms_ = realmsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListRealmsResponse) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListRealmsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListRealmsResponse other) { + if (other == com.google.cloud.gaming.v1alpha.ListRealmsResponse.getDefaultInstance()) + return this; + if (realmsBuilder_ == null) { + if (!other.realms_.isEmpty()) { + if (realms_.isEmpty()) { + realms_ = other.realms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRealmsIsMutable(); + realms_.addAll(other.realms_); + } + onChanged(); + } + } else { + if (!other.realms_.isEmpty()) { + if (realmsBuilder_.isEmpty()) { + realmsBuilder_.dispose(); + realmsBuilder_ = null; + realms_ = other.realms_; + bitField0_ = (bitField0_ & ~0x00000001); + realmsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRealmsFieldBuilder() + : null; + } else { + realmsBuilder_.addAllMessages(other.realms_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListRealmsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListRealmsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List realms_ = + java.util.Collections.emptyList(); + + private void ensureRealmsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + realms_ = new java.util.ArrayList(realms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + realmsBuilder_; + + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public java.util.List getRealmsList() { + if (realmsBuilder_ == null) { + return java.util.Collections.unmodifiableList(realms_); + } else { + return realmsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public int getRealmsCount() { + if (realmsBuilder_ == null) { + return realms_.size(); + } else { + return realmsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealms(int index) { + if (realmsBuilder_ == null) { + return realms_.get(index); + } else { + return realmsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder setRealms(int index, com.google.cloud.gaming.v1alpha.Realm value) { + if (realmsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealmsIsMutable(); + realms_.set(index, value); + onChanged(); + } else { + realmsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder setRealms( + int index, com.google.cloud.gaming.v1alpha.Realm.Builder builderForValue) { + if (realmsBuilder_ == null) { + ensureRealmsIsMutable(); + realms_.set(index, builderForValue.build()); + onChanged(); + } else { + realmsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder addRealms(com.google.cloud.gaming.v1alpha.Realm value) { + if (realmsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealmsIsMutable(); + realms_.add(value); + onChanged(); + } else { + realmsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder addRealms(int index, com.google.cloud.gaming.v1alpha.Realm value) { + if (realmsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRealmsIsMutable(); + realms_.add(index, value); + onChanged(); + } else { + realmsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder addRealms(com.google.cloud.gaming.v1alpha.Realm.Builder builderForValue) { + if (realmsBuilder_ == null) { + ensureRealmsIsMutable(); + realms_.add(builderForValue.build()); + onChanged(); + } else { + realmsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder addRealms( + int index, com.google.cloud.gaming.v1alpha.Realm.Builder builderForValue) { + if (realmsBuilder_ == null) { + ensureRealmsIsMutable(); + realms_.add(index, builderForValue.build()); + onChanged(); + } else { + realmsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder addAllRealms( + java.lang.Iterable values) { + if (realmsBuilder_ == null) { + ensureRealmsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, realms_); + onChanged(); + } else { + realmsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder clearRealms() { + if (realmsBuilder_ == null) { + realms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + realmsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public Builder removeRealms(int index) { + if (realmsBuilder_ == null) { + ensureRealmsIsMutable(); + realms_.remove(index); + onChanged(); + } else { + realmsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm.Builder getRealmsBuilder(int index) { + return getRealmsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmsOrBuilder(int index) { + if (realmsBuilder_ == null) { + return realms_.get(index); + } else { + return realmsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public java.util.List + getRealmsOrBuilderList() { + if (realmsBuilder_ != null) { + return realmsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(realms_); + } + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm.Builder addRealmsBuilder() { + return getRealmsFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance()); + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm.Builder addRealmsBuilder(int index) { + return getRealmsFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance()); + } + /** + * + * + *
+     * The list of realms
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + public java.util.List getRealmsBuilderList() { + return getRealmsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + getRealmsFieldBuilder() { + if (realmsBuilder_ == null) { + realmsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder>( + realms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + realms_ = null; + } + return realmsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListRealmsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListRealmsResponse) + private static final com.google.cloud.gaming.v1alpha.ListRealmsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListRealmsResponse(); + } + + public static com.google.cloud.gaming.v1alpha.ListRealmsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRealmsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRealmsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListRealmsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponseOrBuilder.java new file mode 100644 index 000000000000..c84115ef9da7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListRealmsResponseOrBuilder.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListRealmsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListRealmsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + java.util.List getRealmsList(); + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + com.google.cloud.gaming.v1alpha.Realm getRealms(int index); + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + int getRealmsCount(); + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + java.util.List getRealmsOrBuilderList(); + /** + * + * + *
+   * The list of realms
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Realm realms = 1; + */ + com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequest.java new file mode 100644 index 000000000000..aa8651dfc6b5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequest.java @@ -0,0 +1,1198 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for ScalingPoliciesService.ListScalingPolicies.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListScalingPoliciesRequest} + */ +public final class ListScalingPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) + ListScalingPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScalingPoliciesRequest.newBuilder() to construct. + private ListScalingPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScalingPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScalingPoliciesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.class, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * / Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to
+   * determine if there are more ScalingPolicies left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest other = + (com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ScalingPoliciesService.ListScalingPolicies.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListScalingPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.class, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest build() { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest buildPartial() { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest result = + new com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest other) { + if (other == com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, using the form:
+     * `projects/{project_id}/locations/{location}`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * / Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to
+     * determine if there are more ScalingPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * / Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to
+     * determine if there are more ScalingPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * / Optional. The maximum number of items to return.  If unspecified, server
+     * will pick an appropriate default. Server may return fewer items than
+     * requested. A caller should only rely on response's
+     * [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to
+     * determine if there are more ScalingPolicies left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to apply to list results.
+     * 
+ * + * string filter = 4; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the ordering of results following syntax at
+     * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+     * 
+ * + * string order_by = 5; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) + private static final com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest(); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScalingPoliciesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScalingPoliciesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequestOrBuilder.java new file mode 100644 index 000000000000..0bc07b1b3f90 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListScalingPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListScalingPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, using the form:
+   * `projects/{project_id}/locations/{location}`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * / Optional. The maximum number of items to return.  If unspecified, server
+   * will pick an appropriate default. Server may return fewer items than
+   * requested. A caller should only rely on response's
+   * [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to
+   * determine if there are more ScalingPolicies left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to apply to list results.
+   * 
+ * + * string filter = 4; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Specifies the ordering of results following syntax at
+   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
+   * 
+ * + * string order_by = 5; + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponse.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponse.java new file mode 100644 index 000000000000..c6cab8329bd3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponse.java @@ -0,0 +1,1108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Response message for ScalingPoliciesService.ListScalingPolicies.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListScalingPoliciesResponse} + */ +public final class ListScalingPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) + ListScalingPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScalingPoliciesResponse.newBuilder() to construct. + private ListScalingPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScalingPoliciesResponse() { + scalingPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScalingPoliciesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scalingPolicies_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scalingPolicies_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.ScalingPolicy.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + scalingPolicies_ = java.util.Collections.unmodifiableList(scalingPolicies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.class, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.Builder.class); + } + + private int bitField0_; + public static final int SCALING_POLICIES_FIELD_NUMBER = 1; + private java.util.List scalingPolicies_; + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public java.util.List getScalingPoliciesList() { + return scalingPolicies_; + } + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public java.util.List + getScalingPoliciesOrBuilderList() { + return scalingPolicies_; + } + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public int getScalingPoliciesCount() { + return scalingPolicies_.size(); + } + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicies(int index) { + return scalingPolicies_.get(index); + } + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPoliciesOrBuilder( + int index) { + return scalingPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < scalingPolicies_.size(); i++) { + output.writeMessage(1, scalingPolicies_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < scalingPolicies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, scalingPolicies_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse other = + (com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) obj; + + if (!getScalingPoliciesList().equals(other.getScalingPoliciesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getScalingPoliciesCount() > 0) { + hash = (37 * hash) + SCALING_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getScalingPoliciesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ScalingPoliciesService.ListScalingPolicies.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ListScalingPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.class, + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getScalingPoliciesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scalingPoliciesBuilder_ == null) { + scalingPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + scalingPoliciesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse build() { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse buildPartial() { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse result = + new com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (scalingPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + scalingPolicies_ = java.util.Collections.unmodifiableList(scalingPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scalingPolicies_ = scalingPolicies_; + } else { + result.scalingPolicies_ = scalingPoliciesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse other) { + if (other == com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.getDefaultInstance()) + return this; + if (scalingPoliciesBuilder_ == null) { + if (!other.scalingPolicies_.isEmpty()) { + if (scalingPolicies_.isEmpty()) { + scalingPolicies_ = other.scalingPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScalingPoliciesIsMutable(); + scalingPolicies_.addAll(other.scalingPolicies_); + } + onChanged(); + } + } else { + if (!other.scalingPolicies_.isEmpty()) { + if (scalingPoliciesBuilder_.isEmpty()) { + scalingPoliciesBuilder_.dispose(); + scalingPoliciesBuilder_ = null; + scalingPolicies_ = other.scalingPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + scalingPoliciesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getScalingPoliciesFieldBuilder() + : null; + } else { + scalingPoliciesBuilder_.addAllMessages(other.scalingPolicies_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List scalingPolicies_ = + java.util.Collections.emptyList(); + + private void ensureScalingPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + scalingPolicies_ = + new java.util.ArrayList( + scalingPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + scalingPoliciesBuilder_; + + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public java.util.List getScalingPoliciesList() { + if (scalingPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(scalingPolicies_); + } else { + return scalingPoliciesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public int getScalingPoliciesCount() { + if (scalingPoliciesBuilder_ == null) { + return scalingPolicies_.size(); + } else { + return scalingPoliciesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicies(int index) { + if (scalingPoliciesBuilder_ == null) { + return scalingPolicies_.get(index); + } else { + return scalingPoliciesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder setScalingPolicies( + int index, com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScalingPoliciesIsMutable(); + scalingPolicies_.set(index, value); + onChanged(); + } else { + scalingPoliciesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder setScalingPolicies( + int index, com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder builderForValue) { + if (scalingPoliciesBuilder_ == null) { + ensureScalingPoliciesIsMutable(); + scalingPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + scalingPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder addScalingPolicies(com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScalingPoliciesIsMutable(); + scalingPolicies_.add(value); + onChanged(); + } else { + scalingPoliciesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder addScalingPolicies( + int index, com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScalingPoliciesIsMutable(); + scalingPolicies_.add(index, value); + onChanged(); + } else { + scalingPoliciesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder addScalingPolicies( + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder builderForValue) { + if (scalingPoliciesBuilder_ == null) { + ensureScalingPoliciesIsMutable(); + scalingPolicies_.add(builderForValue.build()); + onChanged(); + } else { + scalingPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder addScalingPolicies( + int index, com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder builderForValue) { + if (scalingPoliciesBuilder_ == null) { + ensureScalingPoliciesIsMutable(); + scalingPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + scalingPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder addAllScalingPolicies( + java.lang.Iterable values) { + if (scalingPoliciesBuilder_ == null) { + ensureScalingPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scalingPolicies_); + onChanged(); + } else { + scalingPoliciesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder clearScalingPolicies() { + if (scalingPoliciesBuilder_ == null) { + scalingPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + scalingPoliciesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public Builder removeScalingPolicies(int index) { + if (scalingPoliciesBuilder_ == null) { + ensureScalingPoliciesIsMutable(); + scalingPolicies_.remove(index); + onChanged(); + } else { + scalingPoliciesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder getScalingPoliciesBuilder( + int index) { + return getScalingPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPoliciesOrBuilder( + int index) { + if (scalingPoliciesBuilder_ == null) { + return scalingPolicies_.get(index); + } else { + return scalingPoliciesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public java.util.List + getScalingPoliciesOrBuilderList() { + if (scalingPoliciesBuilder_ != null) { + return scalingPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scalingPolicies_); + } + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder addScalingPoliciesBuilder() { + return getScalingPoliciesFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder addScalingPoliciesBuilder( + int index) { + return getScalingPoliciesFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance()); + } + /** + * + * + *
+     * The list of scaling policies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + public java.util.List + getScalingPoliciesBuilderList() { + return getScalingPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + getScalingPoliciesFieldBuilder() { + if (scalingPoliciesBuilder_ == null) { + scalingPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder>( + scalingPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + scalingPolicies_ = null; + } + return scalingPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) + private static final com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse(); + } + + public static com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScalingPoliciesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScalingPoliciesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponseOrBuilder.java new file mode 100644 index 000000000000..e49a23c3c8b9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ListScalingPoliciesResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ListScalingPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ListScalingPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + java.util.List getScalingPoliciesList(); + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicies(int index); + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + int getScalingPoliciesCount(); + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + java.util.List + getScalingPoliciesOrBuilderList(); + /** + * + * + *
+   * The list of scaling policies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policies = 1; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPoliciesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LocationName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LocationName.java new file mode 100644 index 000000000000..d922102087f0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/LocationName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadata.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadata.java new file mode 100644 index 000000000000..e8fba8d55a24 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadata.java @@ -0,0 +1,1690 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 48: + { + requestedCancellation_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.OperationMetadata.class, + com.google.cloud.gaming.v1alpha.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + private volatile java.lang.Object statusMessage_; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5; + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5; + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6; + */ + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7; + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7; + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.OperationMetadata other = + (com.google.cloud.gaming.v1alpha.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.OperationMetadata) + com.google.cloud.gaming.v1alpha.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.OperationMetadata.class, + com.google.cloud.gaming.v1alpha.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusMessage_ = ""; + + requestedCancellation_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.OperationMetadata build() { + com.google.cloud.gaming.v1alpha.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.OperationMetadata buildPartial() { + com.google.cloud.gaming.v1alpha.OperationMetadata result = + new com.google.cloud.gaming.v1alpha.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusMessage_ = statusMessage_; + result.requestedCancellation_ = requestedCancellation_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.OperationMetadata) { + return mergeFrom((com.google.cloud.gaming.v1alpha.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.OperationMetadata other) { + if (other == com.google.cloud.gaming.v1alpha.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5; + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5; + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5; + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5; + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5; + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6; + */ + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6; + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6; + */ + public Builder clearRequestedCancellation() { + + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7; + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7; + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7; + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7; + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7; + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.OperationMetadata) + private static final com.google.cloud.gaming.v1alpha.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.OperationMetadata(); + } + + public static com.google.cloud.gaming.v1alpha.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..ff15f99abf81 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/OperationMetadataOrBuilder.java @@ -0,0 +1,170 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5; + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5; + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6; + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7; + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7; + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realm.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realm.java new file mode 100644 index 000000000000..f7f9fc1a62d1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realm.java @@ -0,0 +1,1628 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * A Realm resource.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.Realm} + */ +public final class Realm extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.Realm) + RealmOrBuilder { + private static final long serialVersionUID = 0L; + // Use Realm.newBuilder() to construct. + private Realm(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Realm() { + name_ = ""; + timeZone_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Realm( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + timeZone_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.Realm.class, + com.google.cloud.gaming.v1alpha.Realm.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the realm, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+   * example, `projects/my-project/locations/{location}/realms/my-realm`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the realm, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+   * example, `projects/my-project/locations/{location}/realms/my-realm`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TIME_ZONE_FIELD_NUMBER = 6; + private volatile java.lang.Object timeZone_; + /** + * + * + *
+   * Time zone where all realm-specific policies are evaluated. The value of
+   * this field must be from the IANA time zone database:
+   * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+   * default.
+   * 
+ * + * string time_zone = 6; + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } + } + /** + * + * + *
+   * Time zone where all realm-specific policies are evaluated. The value of
+   * this field must be from the IANA time zone database:
+   * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+   * default.
+   * 
+ * + * string time_zone = 6; + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!getTimeZoneBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, timeZone_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (!getTimeZoneBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, timeZone_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.Realm)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.Realm other = (com.google.cloud.gaming.v1alpha.Realm) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Realm parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.Realm prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Realm resource.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.Realm} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.Realm) + com.google.cloud.gaming.v1alpha.RealmOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.Realm.class, + com.google.cloud.gaming.v1alpha.Realm.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.Realm.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + timeZone_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_Realm_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Realm getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Realm build() { + com.google.cloud.gaming.v1alpha.Realm result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Realm buildPartial() { + com.google.cloud.gaming.v1alpha.Realm result = + new com.google.cloud.gaming.v1alpha.Realm(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.timeZone_ = timeZone_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.Realm) { + return mergeFrom((com.google.cloud.gaming.v1alpha.Realm) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.Realm other) { + if (other == com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.Realm parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.Realm) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the realm, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+     * example, `projects/my-project/locations/{location}/realms/my-realm`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the realm, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+     * example, `projects/my-project/locations/{location}/realms/my-realm`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the realm, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+     * example, `projects/my-project/locations/{location}/realms/my-realm`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the realm, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+     * example, `projects/my-project/locations/{location}/realms/my-realm`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the realm, using the form:
+     * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+     * example, `projects/my-project/locations/{location}/realms/my-realm`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels associated with this realm. Each label is a key-value pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object timeZone_ = ""; + /** + * + * + *
+     * Time zone where all realm-specific policies are evaluated. The value of
+     * this field must be from the IANA time zone database:
+     * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+     * default.
+     * 
+ * + * string time_zone = 6; + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Time zone where all realm-specific policies are evaluated. The value of
+     * this field must be from the IANA time zone database:
+     * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+     * default.
+     * 
+ * + * string time_zone = 6; + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Time zone where all realm-specific policies are evaluated. The value of
+     * this field must be from the IANA time zone database:
+     * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+     * default.
+     * 
+ * + * string time_zone = 6; + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeZone_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Time zone where all realm-specific policies are evaluated. The value of
+     * this field must be from the IANA time zone database:
+     * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+     * default.
+     * 
+ * + * string time_zone = 6; + */ + public Builder clearTimeZone() { + + timeZone_ = getDefaultInstance().getTimeZone(); + onChanged(); + return this; + } + /** + * + * + *
+     * Time zone where all realm-specific policies are evaluated. The value of
+     * this field must be from the IANA time zone database:
+     * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+     * default.
+     * 
+ * + * string time_zone = 6; + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeZone_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.Realm) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.Realm) + private static final com.google.cloud.gaming.v1alpha.Realm DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.Realm(); + } + + public static com.google.cloud.gaming.v1alpha.Realm getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Realm parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Realm(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Realm getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmName.java new file mode 100644 index 000000000000..f3c11bd086c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmName.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class RealmName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/realms/{realm}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String realm; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRealm() { + return realm; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private RealmName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + realm = Preconditions.checkNotNull(builder.getRealm()); + } + + public static RealmName of(String project, String location, String realm) { + return newBuilder().setProject(project).setLocation(location).setRealm(realm).build(); + } + + public static String format(String project, String location, String realm) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRealm(realm) + .build() + .toString(); + } + + public static RealmName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "RealmName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("realm")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (RealmName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("realm", realm); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location, "realm", realm); + } + + /** Builder for RealmName. */ + public static class Builder { + + private String project; + private String location; + private String realm; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRealm() { + return realm; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRealm(String realm) { + this.realm = realm; + return this; + } + + private Builder() {} + + private Builder(RealmName realmName) { + project = realmName.project; + location = realmName.location; + realm = realmName.realm; + } + + public RealmName build() { + return new RealmName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof RealmName) { + RealmName that = (RealmName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.realm.equals(that.realm)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= realm.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmOrBuilder.java new file mode 100644 index 000000000000..18fed4d2aa7c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RealmOrBuilder.java @@ -0,0 +1,178 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface RealmOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.Realm) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the realm, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+   * example, `projects/my-project/locations/{location}/realms/my-realm`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the realm, using the form:
+   * `projects/{project_id}/locations/{location}/realms/{realm_id}`. For
+   * example, `projects/my-project/locations/{location}/realms/my-realm`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels associated with this realm. Each label is a key-value pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Time zone where all realm-specific policies are evaluated. The value of
+   * this field must be from the IANA time zone database:
+   * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+   * default.
+   * 
+ * + * string time_zone = 6; + */ + java.lang.String getTimeZone(); + /** + * + * + *
+   * Time zone where all realm-specific policies are evaluated. The value of
+   * this field must be from the IANA time zone database:
+   * https://www.iana.org/time-zones. If not specified, UTC is assumed by
+   * default.
+   * 
+ * + * string time_zone = 6; + */ + com.google.protobuf.ByteString getTimeZoneBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realms.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realms.java new file mode 100644 index 000000000000..c9dfb33ec5b8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Realms.java @@ -0,0 +1,202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public final class Realms { + private Realms() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_Realm_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_Realm_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/gaming/v1alpha/realms.pro" + + "to\022\033google.cloud.gaming.v1alpha\032\034google/" + + "api/annotations.proto\032#google/longrunnin" + + "g/operations.proto\032 google/protobuf/fiel" + + "d_mask.proto\032\037google/protobuf/timestamp." + + "proto\032\027google/api/client.proto\"l\n\021ListRe" + + "almsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001" + + "(\t\022\020\n\010order_by\030\005 \001(\t\"a\n\022ListRealmsRespon" + + "se\0222\n\006realms\030\001 \003(\0132\".google.cloud.gaming" + + ".v1alpha.Realm\022\027\n\017next_page_token\030\002 \001(\t\"" + + "\037\n\017GetRealmRequest\022\014\n\004name\030\001 \001(\t\"i\n\022Crea" + + "teRealmRequest\022\016\n\006parent\030\001 \001(\t\022\020\n\010realm_" + + "id\030\002 \001(\t\0221\n\005realm\030\003 \001(\0132\".google.cloud.g" + + "aming.v1alpha.Realm\"\"\n\022DeleteRealmReques" + + "t\022\014\n\004name\030\001 \001(\t\"x\n\022UpdateRealmRequest\0221\n" + + "\005realm\030\001 \001(\0132\".google.cloud.gaming.v1alp" + + "ha.Realm\022/\n\013update_mask\030\002 \001(\0132\032.google.p" + + "rotobuf.FieldMask\"\371\001\n\005Realm\022\014\n\004name\030\001 \001(" + + "\t\022/\n\013create_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\022/\n\013update_time\030\003 \001(\0132\032.google" + + ".protobuf.Timestamp\022>\n\006labels\030\004 \003(\0132..go" + + "ogle.cloud.gaming.v1alpha.Realm.LabelsEn" + + "try\022\021\n\ttime_zone\030\006 \001(\t\032-\n\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\317\006\n\rRealms" + + "Service\022\246\001\n\nListRealms\022..google.cloud.ga" + + "ming.v1alpha.ListRealmsRequest\032/.google." + + "cloud.gaming.v1alpha.ListRealmsResponse\"" + + "7\202\323\344\223\0021\022//v1alpha/{parent=projects/*/loc" + + "ations/*}/realms\022\225\001\n\010GetRealm\022,.google.c" + + "loud.gaming.v1alpha.GetRealmRequest\032\".go" + + "ogle.cloud.gaming.v1alpha.Realm\"7\202\323\344\223\0021\022" + + "//v1alpha/{name=projects/*/locations/*/r" + + "ealms/*}\022\235\001\n\013CreateRealm\022/.google.cloud." + + "gaming.v1alpha.CreateRealmRequest\032\035.goog" + + "le.longrunning.Operation\">\202\323\344\223\0028\"//v1alp" + + "ha/{parent=projects/*/locations/*}/realm" + + "s:\005realm\022\226\001\n\013DeleteRealm\022/.google.cloud." + + "gaming.v1alpha.DeleteRealmRequest\032\035.goog" + + "le.longrunning.Operation\"7\202\323\344\223\0021*//v1alp" + + "ha/{name=projects/*/locations/*/realms/*" + + "}\022\243\001\n\013UpdateRealm\022/.google.cloud.gaming." + + "v1alpha.UpdateRealmRequest\032\035.google.long" + + "running.Operation\"D\202\323\344\223\002>25/v1alpha/{rea" + + "lm.name=projects/*/locations/*/realms/*}" + + ":\005realm\032\036\312A\033gameservices.googleapis.comB" + + "f\n\037com.google.cloud.gaming.v1alphaP\001ZAgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/gaming/v1alpha;gamingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListRealmsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListRealmsResponse_descriptor, + new java.lang.String[] { + "Realms", "NextPageToken", + }); + internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetRealmRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CreateRealmRequest_descriptor, + new java.lang.String[] { + "Parent", "RealmId", "Realm", + }); + internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeleteRealmRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor, + new java.lang.String[] { + "Realm", "UpdateMask", + }); + internal_static_google_cloud_gaming_v1alpha_Realm_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_gaming_v1alpha_Realm_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_Realm_descriptor, + new java.lang.String[] { + "Name", "CreateTime", "UpdateTime", "Labels", "TimeZone", + }); + internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_Realm_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_Realm_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequest.java new file mode 100644 index 000000000000..5931405766ae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequest.java @@ -0,0 +1,612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.RevertRollout.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.RevertRolloutRequest} + */ +public final class RevertRolloutRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.RevertRolloutRequest) + RevertRolloutRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RevertRolloutRequest.newBuilder() to construct. + private RevertRolloutRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RevertRolloutRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RevertRolloutRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest.class, + com.google.cloud.gaming.v1alpha.RevertRolloutRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment to deploy, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment to deploy, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.RevertRolloutRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.RevertRolloutRequest other = + (com.google.cloud.gaming.v1alpha.RevertRolloutRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.RevertRolloutRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.RevertRollout.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.RevertRolloutRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.RevertRolloutRequest) + com.google.cloud.gaming.v1alpha.RevertRolloutRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.RevertRolloutRequest.class, + com.google.cloud.gaming.v1alpha.RevertRolloutRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.RevertRolloutRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_RevertRolloutRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.RevertRolloutRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.RevertRolloutRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.RevertRolloutRequest build() { + com.google.cloud.gaming.v1alpha.RevertRolloutRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.RevertRolloutRequest buildPartial() { + com.google.cloud.gaming.v1alpha.RevertRolloutRequest result = + new com.google.cloud.gaming.v1alpha.RevertRolloutRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.RevertRolloutRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.RevertRolloutRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.RevertRolloutRequest other) { + if (other == com.google.cloud.gaming.v1alpha.RevertRolloutRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.RevertRolloutRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.RevertRolloutRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment to deploy, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to deploy, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment to deploy, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to deploy, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment to deploy, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.RevertRolloutRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.RevertRolloutRequest) + private static final com.google.cloud.gaming.v1alpha.RevertRolloutRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.RevertRolloutRequest(); + } + + public static com.google.cloud.gaming.v1alpha.RevertRolloutRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RevertRolloutRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RevertRolloutRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.RevertRolloutRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequestOrBuilder.java new file mode 100644 index 000000000000..949cef2985c9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/RevertRolloutRequestOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface RevertRolloutRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.RevertRolloutRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment to deploy, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment to deploy, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicies.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicies.java new file mode 100644 index 000000000000..704dce2efd18 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicies.java @@ -0,0 +1,256 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public final class ScalingPolicies { + private ScalingPolicies() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/gaming/v1alpha/scaling_po" + + "licies.proto\022\033google.cloud.gaming.v1alph" + + "a\032\034google/api/annotations.proto\032(google/" + + "cloud/gaming/v1alpha/common.proto\032#googl" + + "e/longrunning/operations.proto\032\036google/p" + + "rotobuf/duration.proto\032 google/protobuf/" + + "field_mask.proto\032\037google/protobuf/timest" + + "amp.proto\032\036google/protobuf/wrappers.prot" + + "o\032\027google/api/client.proto\"u\n\032ListScalin" + + "gPoliciesRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage" + + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filte" + + "r\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"|\n\033ListScaling" + + "PoliciesResponse\022D\n\020scaling_policies\030\001 \003" + + "(\0132*.google.cloud.gaming.v1alpha.Scaling" + + "Policy\022\027\n\017next_page_token\030\002 \001(\t\"\'\n\027GetSc" + + "alingPolicyRequest\022\014\n\004name\030\001 \001(\t\"\213\001\n\032Cre" + + "ateScalingPolicyRequest\022\016\n\006parent\030\001 \001(\t\022" + + "\031\n\021scaling_policy_id\030\002 \001(\t\022B\n\016scaling_po" + + "licy\030\003 \001(\0132*.google.cloud.gaming.v1alpha" + + ".ScalingPolicy\"*\n\032DeleteScalingPolicyReq" + + "uest\022\014\n\004name\030\001 \001(\t\"\221\001\n\032UpdateScalingPoli" + + "cyRequest\022B\n\016scaling_policy\030\001 \001(\0132*.goog" + + "le.cloud.gaming.v1alpha.ScalingPolicy\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.Fie" + + "ldMask\"\226\001\n\027FleetAutoscalerSettings\022\036\n\024bu" + + "ffer_size_absolute\030\001 \001(\003H\000\022 \n\026buffer_siz" + + "e_percentage\030\002 \001(\002H\000\022\024\n\014min_replicas\030\003 \001" + + "(\003\022\024\n\014max_replicas\030\004 \001(\003B\r\n\013buffer_size\"" + + "\237\004\n\rScalingPolicy\022\014\n\004name\030\001 \001(\t\022/\n\013creat" + + "e_time\030\002 \001(\0132\032.google.protobuf.Timestamp" + + "\022/\n\013update_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\022F\n\006labels\030\004 \003(\01326.google.cloud" + + ".gaming.v1alpha.ScalingPolicy.LabelsEntr" + + "y\022W\n\031fleet_autoscaler_settings\030\005 \001(\01324.g" + + "oogle.cloud.gaming.v1alpha.FleetAutoscal" + + "erSettings\022-\n\010priority\030\006 \001(\0132\033.google.pr" + + "otobuf.Int32Value\022E\n\021cluster_selectors\030\007" + + " \003(\0132*.google.cloud.gaming.v1alpha.Label" + + "Selector\0228\n\tschedules\030\010 \003(\0132%.google.clo" + + "ud.gaming.v1alpha.Schedule\022\036\n\026game_serve" + + "r_deployment\030\t \001(\t\032-\n\013LabelsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\203\010\n\026ScalingPol" + + "iciesService\022\312\001\n\023ListScalingPolicies\0227.g" + + "oogle.cloud.gaming.v1alpha.ListScalingPo" + + "liciesRequest\0328.google.cloud.gaming.v1al" + + "pha.ListScalingPoliciesResponse\"@\202\323\344\223\002:\022" + + "8/v1alpha/{parent=projects/*/locations/*" + + "}/scalingPolicies\022\266\001\n\020GetScalingPolicy\0224" + + ".google.cloud.gaming.v1alpha.GetScalingP" + + "olicyRequest\032*.google.cloud.gaming.v1alp" + + "ha.ScalingPolicy\"@\202\323\344\223\002:\0228/v1alpha/{name" + + "=projects/*/locations/*/scalingPolicies/" + + "*}\022\277\001\n\023CreateScalingPolicy\0227.google.clou" + + "d.gaming.v1alpha.CreateScalingPolicyRequ" + + "est\032\035.google.longrunning.Operation\"P\202\323\344\223" + + "\002J\"8/v1alpha/{parent=projects/*/location" + + "s/*}/scalingPolicies:\016scaling_policy\022\257\001\n" + + "\023DeleteScalingPolicy\0227.google.cloud.gami" + + "ng.v1alpha.DeleteScalingPolicyRequest\032\035." + + "google.longrunning.Operation\"@\202\323\344\223\002:*8/v" + + "1alpha/{name=projects/*/locations/*/scal" + + "ingPolicies/*}\022\316\001\n\023UpdateScalingPolicy\0227" + + ".google.cloud.gaming.v1alpha.UpdateScali" + + "ngPolicyRequest\032\035.google.longrunning.Ope" + + "ration\"_\202\323\344\223\002Y2G/v1alpha/{scaling_policy" + + ".name=projects/*/locations/*/scalingPoli" + + "cies/*}:\016scaling_policy\032\036\312A\033gameservices" + + ".googleapis.comBf\n\037com.google.cloud.gami" + + "ng.v1alphaP\001ZAgoogle.golang.org/genproto" + + "/googleapis/cloud/gaming/v1alpha;gamingb" + + "\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.gaming.v1alpha.Common.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ListScalingPoliciesResponse_descriptor, + new java.lang.String[] { + "ScalingPolicies", "NextPageToken", + }); + internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_GetScalingPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_CreateScalingPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", "ScalingPolicyId", "ScalingPolicy", + }); + internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_DeleteScalingPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor, + new java.lang.String[] { + "ScalingPolicy", "UpdateMask", + }); + internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_FleetAutoscalerSettings_descriptor, + new java.lang.String[] { + "BufferSizeAbsolute", + "BufferSizePercentage", + "MinReplicas", + "MaxReplicas", + "BufferSize", + }); + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "FleetAutoscalerSettings", + "Priority", + "ClusterSelectors", + "Schedules", + "GameServerDeployment", + }); + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_descriptor = + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.gaming.v1alpha.Common.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicy.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicy.java new file mode 100644 index 000000000000..297cab611015 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicy.java @@ -0,0 +1,3214 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * A scaling policy resource.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ScalingPolicy} + */ +public final class ScalingPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.ScalingPolicy) + ScalingPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScalingPolicy.newBuilder() to construct. + private ScalingPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScalingPolicy() { + name_ = ""; + clusterSelectors_ = java.util.Collections.emptyList(); + schedules_ = java.util.Collections.emptyList(); + gameServerDeployment_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScalingPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder subBuilder = null; + if (fleetAutoscalerSettings_ != null) { + subBuilder = fleetAutoscalerSettings_.toBuilder(); + } + fleetAutoscalerSettings_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fleetAutoscalerSettings_); + fleetAutoscalerSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Int32Value.Builder subBuilder = null; + if (priority_ != null) { + subBuilder = priority_.toBuilder(); + } + priority_ = + input.readMessage(com.google.protobuf.Int32Value.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(priority_); + priority_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + clusterSelectors_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.LabelSelector.parser(), extensionRegistry)); + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000080) != 0)) { + schedules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + schedules_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.Schedule.parser(), extensionRegistry)); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + gameServerDeployment_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = java.util.Collections.unmodifiableList(clusterSelectors_); + } + if (((mutable_bitField0_ & 0x00000080) != 0)) { + schedules_ = java.util.Collections.unmodifiableList(schedules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ScalingPolicy.class, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the scaling policy, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the scaling policy, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FLEET_AUTOSCALER_SETTINGS_FIELD_NUMBER = 5; + private com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleetAutoscalerSettings_; + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public boolean hasFleetAutoscalerSettings() { + return fleetAutoscalerSettings_ != null; + } + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getFleetAutoscalerSettings() { + return fleetAutoscalerSettings_ == null + ? com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.getDefaultInstance() + : fleetAutoscalerSettings_; + } + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder + getFleetAutoscalerSettingsOrBuilder() { + return getFleetAutoscalerSettings(); + } + + public static final int PRIORITY_FIELD_NUMBER = 6; + private com.google.protobuf.Int32Value priority_; + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public boolean hasPriority() { + return priority_ != null; + } + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public com.google.protobuf.Int32Value getPriority() { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder() { + return getPriority(); + } + + public static final int CLUSTER_SELECTORS_FIELD_NUMBER = 7; + private java.util.List clusterSelectors_; + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public java.util.List getClusterSelectorsList() { + return clusterSelectors_; + } + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public java.util.List + getClusterSelectorsOrBuilderList() { + return clusterSelectors_; + } + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public int getClusterSelectorsCount() { + return clusterSelectors_.size(); + } + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index) { + return clusterSelectors_.get(index); + } + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder( + int index) { + return clusterSelectors_.get(index); + } + + public static final int SCHEDULES_FIELD_NUMBER = 8; + private java.util.List schedules_; + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public java.util.List getSchedulesList() { + return schedules_; + } + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public java.util.List + getSchedulesOrBuilderList() { + return schedules_; + } + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public int getSchedulesCount() { + return schedules_.size(); + } + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index) { + return schedules_.get(index); + } + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index) { + return schedules_.get(index); + } + + public static final int GAME_SERVER_DEPLOYMENT_FIELD_NUMBER = 9; + private volatile java.lang.Object gameServerDeployment_; + /** + * + * + *
+   * The game server deployment for this scaling policy. For example,
+   * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+   * 
+ * + * string game_server_deployment = 9; + */ + public java.lang.String getGameServerDeployment() { + java.lang.Object ref = gameServerDeployment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gameServerDeployment_ = s; + return s; + } + } + /** + * + * + *
+   * The game server deployment for this scaling policy. For example,
+   * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+   * 
+ * + * string game_server_deployment = 9; + */ + public com.google.protobuf.ByteString getGameServerDeploymentBytes() { + java.lang.Object ref = gameServerDeployment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gameServerDeployment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (fleetAutoscalerSettings_ != null) { + output.writeMessage(5, getFleetAutoscalerSettings()); + } + if (priority_ != null) { + output.writeMessage(6, getPriority()); + } + for (int i = 0; i < clusterSelectors_.size(); i++) { + output.writeMessage(7, clusterSelectors_.get(i)); + } + for (int i = 0; i < schedules_.size(); i++) { + output.writeMessage(8, schedules_.get(i)); + } + if (!getGameServerDeploymentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, gameServerDeployment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (fleetAutoscalerSettings_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFleetAutoscalerSettings()); + } + if (priority_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPriority()); + } + for (int i = 0; i < clusterSelectors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, clusterSelectors_.get(i)); + } + for (int i = 0; i < schedules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, schedules_.get(i)); + } + if (!getGameServerDeploymentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, gameServerDeployment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.ScalingPolicy)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.ScalingPolicy other = + (com.google.cloud.gaming.v1alpha.ScalingPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasFleetAutoscalerSettings() != other.hasFleetAutoscalerSettings()) return false; + if (hasFleetAutoscalerSettings()) { + if (!getFleetAutoscalerSettings().equals(other.getFleetAutoscalerSettings())) return false; + } + if (hasPriority() != other.hasPriority()) return false; + if (hasPriority()) { + if (!getPriority().equals(other.getPriority())) return false; + } + if (!getClusterSelectorsList().equals(other.getClusterSelectorsList())) return false; + if (!getSchedulesList().equals(other.getSchedulesList())) return false; + if (!getGameServerDeployment().equals(other.getGameServerDeployment())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasFleetAutoscalerSettings()) { + hash = (37 * hash) + FLEET_AUTOSCALER_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getFleetAutoscalerSettings().hashCode(); + } + if (hasPriority()) { + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority().hashCode(); + } + if (getClusterSelectorsCount() > 0) { + hash = (37 * hash) + CLUSTER_SELECTORS_FIELD_NUMBER; + hash = (53 * hash) + getClusterSelectorsList().hashCode(); + } + if (getSchedulesCount() > 0) { + hash = (37 * hash) + SCHEDULES_FIELD_NUMBER; + hash = (53 * hash) + getSchedulesList().hashCode(); + } + hash = (37 * hash) + GAME_SERVER_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getGameServerDeployment().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.ScalingPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A scaling policy resource.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.ScalingPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.ScalingPolicy) + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.ScalingPolicy.class, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.ScalingPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterSelectorsFieldBuilder(); + getSchedulesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (fleetAutoscalerSettingsBuilder_ == null) { + fleetAutoscalerSettings_ = null; + } else { + fleetAutoscalerSettings_ = null; + fleetAutoscalerSettingsBuilder_ = null; + } + if (priorityBuilder_ == null) { + priority_ = null; + } else { + priority_ = null; + priorityBuilder_ = null; + } + if (clusterSelectorsBuilder_ == null) { + clusterSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + clusterSelectorsBuilder_.clear(); + } + if (schedulesBuilder_ == null) { + schedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + schedulesBuilder_.clear(); + } + gameServerDeployment_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_ScalingPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ScalingPolicy getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ScalingPolicy build() { + com.google.cloud.gaming.v1alpha.ScalingPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ScalingPolicy buildPartial() { + com.google.cloud.gaming.v1alpha.ScalingPolicy result = + new com.google.cloud.gaming.v1alpha.ScalingPolicy(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (fleetAutoscalerSettingsBuilder_ == null) { + result.fleetAutoscalerSettings_ = fleetAutoscalerSettings_; + } else { + result.fleetAutoscalerSettings_ = fleetAutoscalerSettingsBuilder_.build(); + } + if (priorityBuilder_ == null) { + result.priority_ = priority_; + } else { + result.priority_ = priorityBuilder_.build(); + } + if (clusterSelectorsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = java.util.Collections.unmodifiableList(clusterSelectors_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.clusterSelectors_ = clusterSelectors_; + } else { + result.clusterSelectors_ = clusterSelectorsBuilder_.build(); + } + if (schedulesBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + schedules_ = java.util.Collections.unmodifiableList(schedules_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.schedules_ = schedules_; + } else { + result.schedules_ = schedulesBuilder_.build(); + } + result.gameServerDeployment_ = gameServerDeployment_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.ScalingPolicy) { + return mergeFrom((com.google.cloud.gaming.v1alpha.ScalingPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.ScalingPolicy other) { + if (other == com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasFleetAutoscalerSettings()) { + mergeFleetAutoscalerSettings(other.getFleetAutoscalerSettings()); + } + if (other.hasPriority()) { + mergePriority(other.getPriority()); + } + if (clusterSelectorsBuilder_ == null) { + if (!other.clusterSelectors_.isEmpty()) { + if (clusterSelectors_.isEmpty()) { + clusterSelectors_ = other.clusterSelectors_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.addAll(other.clusterSelectors_); + } + onChanged(); + } + } else { + if (!other.clusterSelectors_.isEmpty()) { + if (clusterSelectorsBuilder_.isEmpty()) { + clusterSelectorsBuilder_.dispose(); + clusterSelectorsBuilder_ = null; + clusterSelectors_ = other.clusterSelectors_; + bitField0_ = (bitField0_ & ~0x00000040); + clusterSelectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClusterSelectorsFieldBuilder() + : null; + } else { + clusterSelectorsBuilder_.addAllMessages(other.clusterSelectors_); + } + } + } + if (schedulesBuilder_ == null) { + if (!other.schedules_.isEmpty()) { + if (schedules_.isEmpty()) { + schedules_ = other.schedules_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureSchedulesIsMutable(); + schedules_.addAll(other.schedules_); + } + onChanged(); + } + } else { + if (!other.schedules_.isEmpty()) { + if (schedulesBuilder_.isEmpty()) { + schedulesBuilder_.dispose(); + schedulesBuilder_ = null; + schedules_ = other.schedules_; + bitField0_ = (bitField0_ & ~0x00000080); + schedulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSchedulesFieldBuilder() + : null; + } else { + schedulesBuilder_.addAllMessages(other.schedules_); + } + } + } + if (!other.getGameServerDeployment().isEmpty()) { + gameServerDeployment_ = other.gameServerDeployment_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.ScalingPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.ScalingPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the scaling policy, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the scaling policy, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the scaling policy, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the scaling policy, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the scaling policy, using the form:
+     * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+     * For example,
+     * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last-modified time.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The labels associated with this scaling policy. Each label is a key-value
+     * pair.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleetAutoscalerSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder> + fleetAutoscalerSettingsBuilder_; + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public boolean hasFleetAutoscalerSettings() { + return fleetAutoscalerSettingsBuilder_ != null || fleetAutoscalerSettings_ != null; + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getFleetAutoscalerSettings() { + if (fleetAutoscalerSettingsBuilder_ == null) { + return fleetAutoscalerSettings_ == null + ? com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.getDefaultInstance() + : fleetAutoscalerSettings_; + } else { + return fleetAutoscalerSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public Builder setFleetAutoscalerSettings( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings value) { + if (fleetAutoscalerSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fleetAutoscalerSettings_ = value; + onChanged(); + } else { + fleetAutoscalerSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public Builder setFleetAutoscalerSettings( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder builderForValue) { + if (fleetAutoscalerSettingsBuilder_ == null) { + fleetAutoscalerSettings_ = builderForValue.build(); + onChanged(); + } else { + fleetAutoscalerSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public Builder mergeFleetAutoscalerSettings( + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings value) { + if (fleetAutoscalerSettingsBuilder_ == null) { + if (fleetAutoscalerSettings_ != null) { + fleetAutoscalerSettings_ = + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.newBuilder( + fleetAutoscalerSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + fleetAutoscalerSettings_ = value; + } + onChanged(); + } else { + fleetAutoscalerSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public Builder clearFleetAutoscalerSettings() { + if (fleetAutoscalerSettingsBuilder_ == null) { + fleetAutoscalerSettings_ = null; + onChanged(); + } else { + fleetAutoscalerSettings_ = null; + fleetAutoscalerSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder + getFleetAutoscalerSettingsBuilder() { + + onChanged(); + return getFleetAutoscalerSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + public com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder + getFleetAutoscalerSettingsOrBuilder() { + if (fleetAutoscalerSettingsBuilder_ != null) { + return fleetAutoscalerSettingsBuilder_.getMessageOrBuilder(); + } else { + return fleetAutoscalerSettings_ == null + ? com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.getDefaultInstance() + : fleetAutoscalerSettings_; + } + } + /** + * + * + *
+     * Fleet autoscaler parameters.
+     * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder> + getFleetAutoscalerSettingsFieldBuilder() { + if (fleetAutoscalerSettingsBuilder_ == null) { + fleetAutoscalerSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings.Builder, + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder>( + getFleetAutoscalerSettings(), getParentForChildren(), isClean()); + fleetAutoscalerSettings_ = null; + } + return fleetAutoscalerSettingsBuilder_; + } + + private com.google.protobuf.Int32Value priority_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + priorityBuilder_; + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public boolean hasPriority() { + return priorityBuilder_ != null || priority_ != null; + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public com.google.protobuf.Int32Value getPriority() { + if (priorityBuilder_ == null) { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } else { + return priorityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public Builder setPriority(com.google.protobuf.Int32Value value) { + if (priorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + priority_ = value; + onChanged(); + } else { + priorityBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public Builder setPriority(com.google.protobuf.Int32Value.Builder builderForValue) { + if (priorityBuilder_ == null) { + priority_ = builderForValue.build(); + onChanged(); + } else { + priorityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public Builder mergePriority(com.google.protobuf.Int32Value value) { + if (priorityBuilder_ == null) { + if (priority_ != null) { + priority_ = + com.google.protobuf.Int32Value.newBuilder(priority_).mergeFrom(value).buildPartial(); + } else { + priority_ = value; + } + onChanged(); + } else { + priorityBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public Builder clearPriority() { + if (priorityBuilder_ == null) { + priority_ = null; + onChanged(); + } else { + priority_ = null; + priorityBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public com.google.protobuf.Int32Value.Builder getPriorityBuilder() { + + onChanged(); + return getPriorityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + public com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder() { + if (priorityBuilder_ != null) { + return priorityBuilder_.getMessageOrBuilder(); + } else { + return priority_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : priority_; + } + } + /** + * + * + *
+     * Required. The priority of the policy. A smaller value indicates a higher
+     * priority.
+     * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getPriorityFieldBuilder() { + if (priorityBuilder_ == null) { + priorityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getPriority(), getParentForChildren(), isClean()); + priority_ = null; + } + return priorityBuilder_; + } + + private java.util.List clusterSelectors_ = + java.util.Collections.emptyList(); + + private void ensureClusterSelectorsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + clusterSelectors_ = + new java.util.ArrayList( + clusterSelectors_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + clusterSelectorsBuilder_; + + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public java.util.List getClusterSelectorsList() { + if (clusterSelectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusterSelectors_); + } else { + return clusterSelectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public int getClusterSelectorsCount() { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.size(); + } else { + return clusterSelectorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index) { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.get(index); + } else { + return clusterSelectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder setClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.set(index, value); + onChanged(); + } else { + clusterSelectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder setClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.set(index, builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder addClusterSelectors(com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(value); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder addClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector value) { + if (clusterSelectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(index, value); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder addClusterSelectors( + com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder addClusterSelectors( + int index, com.google.cloud.gaming.v1alpha.LabelSelector.Builder builderForValue) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.add(index, builderForValue.build()); + onChanged(); + } else { + clusterSelectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder addAllClusterSelectors( + java.lang.Iterable values) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterSelectors_); + onChanged(); + } else { + clusterSelectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder clearClusterSelectors() { + if (clusterSelectorsBuilder_ == null) { + clusterSelectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + clusterSelectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public Builder removeClusterSelectors(int index) { + if (clusterSelectorsBuilder_ == null) { + ensureClusterSelectorsIsMutable(); + clusterSelectors_.remove(index); + onChanged(); + } else { + clusterSelectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder getClusterSelectorsBuilder( + int index) { + return getClusterSelectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder( + int index) { + if (clusterSelectorsBuilder_ == null) { + return clusterSelectors_.get(index); + } else { + return clusterSelectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public java.util.List + getClusterSelectorsOrBuilderList() { + if (clusterSelectorsBuilder_ != null) { + return clusterSelectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusterSelectors_); + } + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder addClusterSelectorsBuilder() { + return getClusterSelectorsFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public com.google.cloud.gaming.v1alpha.LabelSelector.Builder addClusterSelectorsBuilder( + int index) { + return getClusterSelectorsFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.LabelSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Labels used to identify the clusters to which this scaling policy applies.
+     * A cluster is subject to this scaling policy if its labels match any of the
+     * cluster selector entries.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + public java.util.List + getClusterSelectorsBuilderList() { + return getClusterSelectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder> + getClusterSelectorsFieldBuilder() { + if (clusterSelectorsBuilder_ == null) { + clusterSelectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.LabelSelector, + com.google.cloud.gaming.v1alpha.LabelSelector.Builder, + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder>( + clusterSelectors_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + clusterSelectors_ = null; + } + return clusterSelectorsBuilder_; + } + + private java.util.List schedules_ = + java.util.Collections.emptyList(); + + private void ensureSchedulesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + schedules_ = new java.util.ArrayList(schedules_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder> + schedulesBuilder_; + + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public java.util.List getSchedulesList() { + if (schedulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(schedules_); + } else { + return schedulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public int getSchedulesCount() { + if (schedulesBuilder_ == null) { + return schedules_.size(); + } else { + return schedulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index) { + if (schedulesBuilder_ == null) { + return schedules_.get(index); + } else { + return schedulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder setSchedules(int index, com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.set(index, value); + onChanged(); + } else { + schedulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder setSchedules( + int index, com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.set(index, builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder addSchedules(com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.add(value); + onChanged(); + } else { + schedulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder addSchedules(int index, com.google.cloud.gaming.v1alpha.Schedule value) { + if (schedulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchedulesIsMutable(); + schedules_.add(index, value); + onChanged(); + } else { + schedulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder addSchedules(com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.add(builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder addSchedules( + int index, com.google.cloud.gaming.v1alpha.Schedule.Builder builderForValue) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.add(index, builderForValue.build()); + onChanged(); + } else { + schedulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder addAllSchedules( + java.lang.Iterable values) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, schedules_); + onChanged(); + } else { + schedulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder clearSchedules() { + if (schedulesBuilder_ == null) { + schedules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + schedulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public Builder removeSchedules(int index) { + if (schedulesBuilder_ == null) { + ensureSchedulesIsMutable(); + schedules_.remove(index); + onChanged(); + } else { + schedulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder getSchedulesBuilder(int index) { + return getSchedulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index) { + if (schedulesBuilder_ == null) { + return schedules_.get(index); + } else { + return schedulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public java.util.List + getSchedulesOrBuilderList() { + if (schedulesBuilder_ != null) { + return schedulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(schedules_); + } + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder addSchedulesBuilder() { + return getSchedulesFieldBuilder() + .addBuilder(com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance()); + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public com.google.cloud.gaming.v1alpha.Schedule.Builder addSchedulesBuilder(int index) { + return getSchedulesFieldBuilder() + .addBuilder(index, com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance()); + } + /** + * + * + *
+     * The schedules to which this scaling policy applies.
+     * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + public java.util.List + getSchedulesBuilderList() { + return getSchedulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder> + getSchedulesFieldBuilder() { + if (schedulesBuilder_ == null) { + schedulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Schedule, + com.google.cloud.gaming.v1alpha.Schedule.Builder, + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder>( + schedules_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); + schedules_ = null; + } + return schedulesBuilder_; + } + + private java.lang.Object gameServerDeployment_ = ""; + /** + * + * + *
+     * The game server deployment for this scaling policy. For example,
+     * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+     * 
+ * + * string game_server_deployment = 9; + */ + public java.lang.String getGameServerDeployment() { + java.lang.Object ref = gameServerDeployment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gameServerDeployment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The game server deployment for this scaling policy. For example,
+     * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+     * 
+ * + * string game_server_deployment = 9; + */ + public com.google.protobuf.ByteString getGameServerDeploymentBytes() { + java.lang.Object ref = gameServerDeployment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gameServerDeployment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The game server deployment for this scaling policy. For example,
+     * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+     * 
+ * + * string game_server_deployment = 9; + */ + public Builder setGameServerDeployment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gameServerDeployment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The game server deployment for this scaling policy. For example,
+     * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+     * 
+ * + * string game_server_deployment = 9; + */ + public Builder clearGameServerDeployment() { + + gameServerDeployment_ = getDefaultInstance().getGameServerDeployment(); + onChanged(); + return this; + } + /** + * + * + *
+     * The game server deployment for this scaling policy. For example,
+     * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+     * 
+ * + * string game_server_deployment = 9; + */ + public Builder setGameServerDeploymentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gameServerDeployment_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.ScalingPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.ScalingPolicy) + private static final com.google.cloud.gaming.v1alpha.ScalingPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.ScalingPolicy(); + } + + public static com.google.cloud.gaming.v1alpha.ScalingPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScalingPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScalingPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.ScalingPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyName.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyName.java new file mode 100644 index 000000000000..29595fab5f22 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyName.java @@ -0,0 +1,213 @@ +/* + * Copyright 2018 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 + * + * http://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.gaming.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScalingPolicyName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/scalingPolicies/{scaling_policy}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String scalingPolicy; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getScalingPolicy() { + return scalingPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScalingPolicyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + scalingPolicy = Preconditions.checkNotNull(builder.getScalingPolicy()); + } + + public static ScalingPolicyName of(String project, String location, String scalingPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setScalingPolicy(scalingPolicy) + .build(); + } + + public static String format(String project, String location, String scalingPolicy) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setScalingPolicy(scalingPolicy) + .build() + .toString(); + } + + public static ScalingPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ScalingPolicyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("scaling_policy")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ScalingPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("scalingPolicy", scalingPolicy); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "scaling_policy", scalingPolicy); + } + + /** Builder for ScalingPolicyName. */ + public static class Builder { + + private String project; + private String location; + private String scalingPolicy; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getScalingPolicy() { + return scalingPolicy; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setScalingPolicy(String scalingPolicy) { + this.scalingPolicy = scalingPolicy; + return this; + } + + private Builder() {} + + private Builder(ScalingPolicyName scalingPolicyName) { + project = scalingPolicyName.project; + location = scalingPolicyName.location; + scalingPolicy = scalingPolicyName.scalingPolicy; + } + + public ScalingPolicyName build() { + return new ScalingPolicyName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScalingPolicyName) { + ScalingPolicyName that = (ScalingPolicyName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.scalingPolicy.equals(that.scalingPolicy)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= scalingPolicy.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyOrBuilder.java new file mode 100644 index 000000000000..bff41d7ccd6f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPolicyOrBuilder.java @@ -0,0 +1,364 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ScalingPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.ScalingPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the scaling policy, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the scaling policy, using the form:
+   * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`.
+   * For example,
+   * `projects/my-project/locations/{location}/scalingPolicies/my-policy`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last-modified time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The labels associated with this scaling policy. Each label is a key-value
+   * pair.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + boolean hasFleetAutoscalerSettings(); + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettings getFleetAutoscalerSettings(); + /** + * + * + *
+   * Fleet autoscaler parameters.
+   * 
+ * + * .google.cloud.gaming.v1alpha.FleetAutoscalerSettings fleet_autoscaler_settings = 5; + * + */ + com.google.cloud.gaming.v1alpha.FleetAutoscalerSettingsOrBuilder + getFleetAutoscalerSettingsOrBuilder(); + + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + boolean hasPriority(); + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + com.google.protobuf.Int32Value getPriority(); + /** + * + * + *
+   * Required. The priority of the policy. A smaller value indicates a higher
+   * priority.
+   * 
+ * + * .google.protobuf.Int32Value priority = 6; + */ + com.google.protobuf.Int32ValueOrBuilder getPriorityOrBuilder(); + + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + java.util.List getClusterSelectorsList(); + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + com.google.cloud.gaming.v1alpha.LabelSelector getClusterSelectors(int index); + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + int getClusterSelectorsCount(); + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + java.util.List + getClusterSelectorsOrBuilderList(); + /** + * + * + *
+   * Labels used to identify the clusters to which this scaling policy applies.
+   * A cluster is subject to this scaling policy if its labels match any of the
+   * cluster selector entries.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.LabelSelector cluster_selectors = 7; + */ + com.google.cloud.gaming.v1alpha.LabelSelectorOrBuilder getClusterSelectorsOrBuilder(int index); + + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + java.util.List getSchedulesList(); + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + com.google.cloud.gaming.v1alpha.Schedule getSchedules(int index); + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + int getSchedulesCount(); + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + java.util.List + getSchedulesOrBuilderList(); + /** + * + * + *
+   * The schedules to which this scaling policy applies.
+   * 
+ * + * repeated .google.cloud.gaming.v1alpha.Schedule schedules = 8; + */ + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder getSchedulesOrBuilder(int index); + + /** + * + * + *
+   * The game server deployment for this scaling policy. For example,
+   * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+   * 
+ * + * string game_server_deployment = 9; + */ + java.lang.String getGameServerDeployment(); + /** + * + * + *
+   * The game server deployment for this scaling policy. For example,
+   * "projects/my-project/locations/{location}/gameServerDeployments/my-deployment".
+   * 
+ * + * string game_server_deployment = 9; + */ + com.google.protobuf.ByteString getGameServerDeploymentBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Schedule.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Schedule.java new file mode 100644 index 000000000000..d5669c9c41a5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/Schedule.java @@ -0,0 +1,1414 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * The schedule of an event - the event can be recurring or one time.  The
+ * event's time span is specified by start_time and end_time. If the scheduled
+ * event's timespan is larger than the cron_spec + cron_job_duration the event
+ * will be recurring.
+ * If cron_spec + cron_job_duration is only specified, the event is effective
+ * starting at the local time specified by cron_spec and is recurrent.
+ *   start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time
+ *   cron job: cron spec start time + duration
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.Schedule} + */ +public final class Schedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.Schedule) + ScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schedule.newBuilder() to construct. + private Schedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schedule() { + cronSpec_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Schedule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (cronJobDuration_ != null) { + subBuilder = cronJobDuration_.toBuilder(); + } + cronJobDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cronJobDuration_); + cronJobDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + cronSpec_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_Schedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.Schedule.class, + com.google.cloud.gaming.v1alpha.Schedule.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int CRON_JOB_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration cronJobDuration_; + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public boolean hasCronJobDuration() { + return cronJobDuration_ != null; + } + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public com.google.protobuf.Duration getCronJobDuration() { + return cronJobDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : cronJobDuration_; + } + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getCronJobDurationOrBuilder() { + return getCronJobDuration(); + } + + public static final int CRON_SPEC_FIELD_NUMBER = 4; + private volatile java.lang.Object cronSpec_; + /** + * + * + *
+   * The cron definition of the scheduled event. See
+   * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+   * defined by the realm.
+   * 
+ * + * string cron_spec = 4; + */ + public java.lang.String getCronSpec() { + java.lang.Object ref = cronSpec_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cronSpec_ = s; + return s; + } + } + /** + * + * + *
+   * The cron definition of the scheduled event. See
+   * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+   * defined by the realm.
+   * 
+ * + * string cron_spec = 4; + */ + public com.google.protobuf.ByteString getCronSpecBytes() { + java.lang.Object ref = cronSpec_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cronSpec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (cronJobDuration_ != null) { + output.writeMessage(3, getCronJobDuration()); + } + if (!getCronSpecBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, cronSpec_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (cronJobDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCronJobDuration()); + } + if (!getCronSpecBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, cronSpec_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.Schedule)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.Schedule other = (com.google.cloud.gaming.v1alpha.Schedule) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasCronJobDuration() != other.hasCronJobDuration()) return false; + if (hasCronJobDuration()) { + if (!getCronJobDuration().equals(other.getCronJobDuration())) return false; + } + if (!getCronSpec().equals(other.getCronSpec())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasCronJobDuration()) { + hash = (37 * hash) + CRON_JOB_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCronJobDuration().hashCode(); + } + hash = (37 * hash) + CRON_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getCronSpec().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.Schedule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.Schedule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The schedule of an event - the event can be recurring or one time.  The
+   * event's time span is specified by start_time and end_time. If the scheduled
+   * event's timespan is larger than the cron_spec + cron_job_duration the event
+   * will be recurring.
+   * If cron_spec + cron_job_duration is only specified, the event is effective
+   * starting at the local time specified by cron_spec and is recurrent.
+   *   start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time
+   *   cron job: cron spec start time + duration
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.Schedule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.Schedule) + com.google.cloud.gaming.v1alpha.ScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_Schedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.Schedule.class, + com.google.cloud.gaming.v1alpha.Schedule.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.Schedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + if (cronJobDurationBuilder_ == null) { + cronJobDuration_ = null; + } else { + cronJobDuration_ = null; + cronJobDurationBuilder_ = null; + } + cronSpec_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Common + .internal_static_google_cloud_gaming_v1alpha_Schedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Schedule getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Schedule build() { + com.google.cloud.gaming.v1alpha.Schedule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Schedule buildPartial() { + com.google.cloud.gaming.v1alpha.Schedule result = + new com.google.cloud.gaming.v1alpha.Schedule(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + if (cronJobDurationBuilder_ == null) { + result.cronJobDuration_ = cronJobDuration_; + } else { + result.cronJobDuration_ = cronJobDurationBuilder_.build(); + } + result.cronSpec_ = cronSpec_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.Schedule) { + return mergeFrom((com.google.cloud.gaming.v1alpha.Schedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.Schedule other) { + if (other == com.google.cloud.gaming.v1alpha.Schedule.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasCronJobDuration()) { + mergeCronJobDuration(other.getCronJobDuration()); + } + if (!other.getCronSpec().isEmpty()) { + cronSpec_ = other.cronSpec_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.Schedule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.gaming.v1alpha.Schedule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The start time of the event.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The end time of the event.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Duration cronJobDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + cronJobDurationBuilder_; + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public boolean hasCronJobDuration() { + return cronJobDurationBuilder_ != null || cronJobDuration_ != null; + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public com.google.protobuf.Duration getCronJobDuration() { + if (cronJobDurationBuilder_ == null) { + return cronJobDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : cronJobDuration_; + } else { + return cronJobDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public Builder setCronJobDuration(com.google.protobuf.Duration value) { + if (cronJobDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cronJobDuration_ = value; + onChanged(); + } else { + cronJobDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public Builder setCronJobDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (cronJobDurationBuilder_ == null) { + cronJobDuration_ = builderForValue.build(); + onChanged(); + } else { + cronJobDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public Builder mergeCronJobDuration(com.google.protobuf.Duration value) { + if (cronJobDurationBuilder_ == null) { + if (cronJobDuration_ != null) { + cronJobDuration_ = + com.google.protobuf.Duration.newBuilder(cronJobDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + cronJobDuration_ = value; + } + onChanged(); + } else { + cronJobDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public Builder clearCronJobDuration() { + if (cronJobDurationBuilder_ == null) { + cronJobDuration_ = null; + onChanged(); + } else { + cronJobDuration_ = null; + cronJobDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public com.google.protobuf.Duration.Builder getCronJobDurationBuilder() { + + onChanged(); + return getCronJobDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getCronJobDurationOrBuilder() { + if (cronJobDurationBuilder_ != null) { + return cronJobDurationBuilder_.getMessageOrBuilder(); + } else { + return cronJobDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : cronJobDuration_; + } + } + /** + * + * + *
+     * The duration for the cron job event. The duration of the event is effective
+     * after the cron job's start time.
+     * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCronJobDurationFieldBuilder() { + if (cronJobDurationBuilder_ == null) { + cronJobDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCronJobDuration(), getParentForChildren(), isClean()); + cronJobDuration_ = null; + } + return cronJobDurationBuilder_; + } + + private java.lang.Object cronSpec_ = ""; + /** + * + * + *
+     * The cron definition of the scheduled event. See
+     * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+     * defined by the realm.
+     * 
+ * + * string cron_spec = 4; + */ + public java.lang.String getCronSpec() { + java.lang.Object ref = cronSpec_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cronSpec_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The cron definition of the scheduled event. See
+     * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+     * defined by the realm.
+     * 
+ * + * string cron_spec = 4; + */ + public com.google.protobuf.ByteString getCronSpecBytes() { + java.lang.Object ref = cronSpec_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cronSpec_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The cron definition of the scheduled event. See
+     * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+     * defined by the realm.
+     * 
+ * + * string cron_spec = 4; + */ + public Builder setCronSpec(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cronSpec_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The cron definition of the scheduled event. See
+     * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+     * defined by the realm.
+     * 
+ * + * string cron_spec = 4; + */ + public Builder clearCronSpec() { + + cronSpec_ = getDefaultInstance().getCronSpec(); + onChanged(); + return this; + } + /** + * + * + *
+     * The cron definition of the scheduled event. See
+     * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+     * defined by the realm.
+     * 
+ * + * string cron_spec = 4; + */ + public Builder setCronSpecBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cronSpec_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.Schedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.Schedule) + private static final com.google.cloud.gaming.v1alpha.Schedule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.Schedule(); + } + + public static com.google.cloud.gaming.v1alpha.Schedule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Schedule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.Schedule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScheduleOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScheduleOrBuilder.java new file mode 100644 index 000000000000..949cc55f513a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/ScheduleOrBuilder.java @@ -0,0 +1,131 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/common.proto + +package com.google.cloud.gaming.v1alpha; + +public interface ScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.Schedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The start time of the event.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The end time of the event.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + boolean hasCronJobDuration(); + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + com.google.protobuf.Duration getCronJobDuration(); + /** + * + * + *
+   * The duration for the cron job event. The duration of the event is effective
+   * after the cron job's start time.
+   * 
+ * + * .google.protobuf.Duration cron_job_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getCronJobDurationOrBuilder(); + + /** + * + * + *
+   * The cron definition of the scheduled event. See
+   * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+   * defined by the realm.
+   * 
+ * + * string cron_spec = 4; + */ + java.lang.String getCronSpec(); + /** + * + * + *
+   * The cron definition of the scheduled event. See
+   * https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
+   * defined by the realm.
+   * 
+ * + * string cron_spec = 4; + */ + com.google.protobuf.ByteString getCronSpecBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequest.java new file mode 100644 index 000000000000..0dd779650f02 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequest.java @@ -0,0 +1,1206 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.SetRolloutTarget.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.SetRolloutTargetRequest} + */ +public final class SetRolloutTargetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.SetRolloutTargetRequest) + SetRolloutTargetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetRolloutTargetRequest.newBuilder() to construct. + private SetRolloutTargetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetRolloutTargetRequest() { + name_ = ""; + clusterPercentageSelector_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetRolloutTargetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + clusterPercentageSelector_ = + new java.util.ArrayList< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector>(); + mutable_bitField0_ |= 0x00000002; + } + clusterPercentageSelector_.add( + input.readMessage( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + clusterPercentageSelector_ = + java.util.Collections.unmodifiableList(clusterPercentageSelector_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.class, + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_PERCENTAGE_SELECTOR_FIELD_NUMBER = 2; + private java.util.List + clusterPercentageSelector_; + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public java.util.List + getClusterPercentageSelectorList() { + return clusterPercentageSelector_; + } + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorOrBuilderList() { + return clusterPercentageSelector_; + } + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public int getClusterPercentageSelectorCount() { + return clusterPercentageSelector_.size(); + } + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelector( + int index) { + return clusterPercentageSelector_.get(index); + } + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorOrBuilder(int index) { + return clusterPercentageSelector_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < clusterPercentageSelector_.size(); i++) { + output.writeMessage(2, clusterPercentageSelector_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < clusterPercentageSelector_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, clusterPercentageSelector_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest other = + (com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getClusterPercentageSelectorList().equals(other.getClusterPercentageSelectorList())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getClusterPercentageSelectorCount() > 0) { + hash = (37 * hash) + CLUSTER_PERCENTAGE_SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getClusterPercentageSelectorList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.SetRolloutTarget.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.SetRolloutTargetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.SetRolloutTargetRequest) + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.class, + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterPercentageSelectorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (clusterPercentageSelectorBuilder_ == null) { + clusterPercentageSelector_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + clusterPercentageSelectorBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_SetRolloutTargetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest build() { + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest buildPartial() { + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest result = + new com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (clusterPercentageSelectorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + clusterPercentageSelector_ = + java.util.Collections.unmodifiableList(clusterPercentageSelector_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.clusterPercentageSelector_ = clusterPercentageSelector_; + } else { + result.clusterPercentageSelector_ = clusterPercentageSelectorBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest other) { + if (other == com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (clusterPercentageSelectorBuilder_ == null) { + if (!other.clusterPercentageSelector_.isEmpty()) { + if (clusterPercentageSelector_.isEmpty()) { + clusterPercentageSelector_ = other.clusterPercentageSelector_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.addAll(other.clusterPercentageSelector_); + } + onChanged(); + } + } else { + if (!other.clusterPercentageSelector_.isEmpty()) { + if (clusterPercentageSelectorBuilder_.isEmpty()) { + clusterPercentageSelectorBuilder_.dispose(); + clusterPercentageSelectorBuilder_ = null; + clusterPercentageSelector_ = other.clusterPercentageSelector_; + bitField0_ = (bitField0_ & ~0x00000002); + clusterPercentageSelectorBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getClusterPercentageSelectorFieldBuilder() + : null; + } else { + clusterPercentageSelectorBuilder_.addAllMessages(other.clusterPercentageSelector_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List + clusterPercentageSelector_ = java.util.Collections.emptyList(); + + private void ensureClusterPercentageSelectorIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + clusterPercentageSelector_ = + new java.util.ArrayList( + clusterPercentageSelector_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + clusterPercentageSelectorBuilder_; + + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public java.util.List + getClusterPercentageSelectorList() { + if (clusterPercentageSelectorBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusterPercentageSelector_); + } else { + return clusterPercentageSelectorBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public int getClusterPercentageSelectorCount() { + if (clusterPercentageSelectorBuilder_ == null) { + return clusterPercentageSelector_.size(); + } else { + return clusterPercentageSelectorBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelector( + int index) { + if (clusterPercentageSelectorBuilder_ == null) { + return clusterPercentageSelector_.get(index); + } else { + return clusterPercentageSelectorBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder setClusterPercentageSelector( + int index, com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.set(index, value); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder setClusterPercentageSelector( + int index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorBuilder_ == null) { + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.set(index, builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder addClusterPercentageSelector( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.add(value); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder addClusterPercentageSelector( + int index, com.google.cloud.gaming.v1alpha.ClusterPercentageSelector value) { + if (clusterPercentageSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.add(index, value); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder addClusterPercentageSelector( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorBuilder_ == null) { + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.add(builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder addClusterPercentageSelector( + int index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder builderForValue) { + if (clusterPercentageSelectorBuilder_ == null) { + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.add(index, builderForValue.build()); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder addAllClusterPercentageSelector( + java.lang.Iterable + values) { + if (clusterPercentageSelectorBuilder_ == null) { + ensureClusterPercentageSelectorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterPercentageSelector_); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder clearClusterPercentageSelector() { + if (clusterPercentageSelectorBuilder_ == null) { + clusterPercentageSelector_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public Builder removeClusterPercentageSelector(int index) { + if (clusterPercentageSelectorBuilder_ == null) { + ensureClusterPercentageSelectorIsMutable(); + clusterPercentageSelector_.remove(index); + onChanged(); + } else { + clusterPercentageSelectorBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + getClusterPercentageSelectorBuilder(int index) { + return getClusterPercentageSelectorFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorOrBuilder(int index) { + if (clusterPercentageSelectorBuilder_ == null) { + return clusterPercentageSelector_.get(index); + } else { + return clusterPercentageSelectorBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorOrBuilderList() { + if (clusterPercentageSelectorBuilder_ != null) { + return clusterPercentageSelectorBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusterPercentageSelector_); + } + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + addClusterPercentageSelectorBuilder() { + return getClusterPercentageSelectorFieldBuilder() + .addBuilder( + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder + addClusterPercentageSelectorBuilder(int index) { + return getClusterPercentageSelectorFieldBuilder() + .addBuilder( + index, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The percentage of game servers that should run the new game
+     * server template in the specified clusters. Default is 0.
+     * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + public java.util.List + getClusterPercentageSelectorBuilderList() { + return getClusterPercentageSelectorFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder> + getClusterPercentageSelectorFieldBuilder() { + if (clusterPercentageSelectorBuilder_ == null) { + clusterPercentageSelectorBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector.Builder, + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder>( + clusterPercentageSelector_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + clusterPercentageSelector_ = null; + } + return clusterPercentageSelectorBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.SetRolloutTargetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.SetRolloutTargetRequest) + private static final com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest(); + } + + public static com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetRolloutTargetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetRolloutTargetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequestOrBuilder.java new file mode 100644 index 000000000000..0b6b64d6ff16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/SetRolloutTargetRequestOrBuilder.java @@ -0,0 +1,104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface SetRolloutTargetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.SetRolloutTargetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + java.util.List + getClusterPercentageSelectorList(); + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + com.google.cloud.gaming.v1alpha.ClusterPercentageSelector getClusterPercentageSelector(int index); + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + int getClusterPercentageSelectorCount(); + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + java.util.List + getClusterPercentageSelectorOrBuilderList(); + /** + * + * + *
+   * Required. The percentage of game servers that should run the new game
+   * server template in the specified clusters. Default is 0.
+   * 
+ * + * + * repeated .google.cloud.gaming.v1alpha.ClusterPercentageSelector cluster_percentage_selector = 2; + * + */ + com.google.cloud.gaming.v1alpha.ClusterPercentageSelectorOrBuilder + getClusterPercentageSelectorOrBuilder(int index); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequest.java new file mode 100644 index 000000000000..d8d18b1a34f0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequest.java @@ -0,0 +1,886 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.StartRollout.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.StartRolloutRequest} + */ +public final class StartRolloutRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.StartRolloutRequest) + StartRolloutRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartRolloutRequest.newBuilder() to construct. + private StartRolloutRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartRolloutRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartRolloutRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder subBuilder = null; + if (newGameServerTemplate_ != null) { + subBuilder = newGameServerTemplate_.toBuilder(); + } + newGameServerTemplate_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerTemplate.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(newGameServerTemplate_); + newGameServerTemplate_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.StartRolloutRequest.class, + com.google.cloud.gaming.v1alpha.StartRolloutRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEW_GAME_SERVER_TEMPLATE_FIELD_NUMBER = 2; + private com.google.cloud.gaming.v1alpha.GameServerTemplate newGameServerTemplate_; + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public boolean hasNewGameServerTemplate() { + return newGameServerTemplate_ != null; + } + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate() { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getNewGameServerTemplateOrBuilder() { + return getNewGameServerTemplate(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (newGameServerTemplate_ != null) { + output.writeMessage(2, getNewGameServerTemplate()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (newGameServerTemplate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getNewGameServerTemplate()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.StartRolloutRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.StartRolloutRequest other = + (com.google.cloud.gaming.v1alpha.StartRolloutRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasNewGameServerTemplate() != other.hasNewGameServerTemplate()) return false; + if (hasNewGameServerTemplate()) { + if (!getNewGameServerTemplate().equals(other.getNewGameServerTemplate())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasNewGameServerTemplate()) { + hash = (37 * hash) + NEW_GAME_SERVER_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getNewGameServerTemplate().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.StartRolloutRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.StartRollout.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.StartRolloutRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.StartRolloutRequest) + com.google.cloud.gaming.v1alpha.StartRolloutRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.StartRolloutRequest.class, + com.google.cloud.gaming.v1alpha.StartRolloutRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.StartRolloutRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = null; + } else { + newGameServerTemplate_ = null; + newGameServerTemplateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_StartRolloutRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.StartRolloutRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.StartRolloutRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.StartRolloutRequest build() { + com.google.cloud.gaming.v1alpha.StartRolloutRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.StartRolloutRequest buildPartial() { + com.google.cloud.gaming.v1alpha.StartRolloutRequest result = + new com.google.cloud.gaming.v1alpha.StartRolloutRequest(this); + result.name_ = name_; + if (newGameServerTemplateBuilder_ == null) { + result.newGameServerTemplate_ = newGameServerTemplate_; + } else { + result.newGameServerTemplate_ = newGameServerTemplateBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.StartRolloutRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.StartRolloutRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.StartRolloutRequest other) { + if (other == com.google.cloud.gaming.v1alpha.StartRolloutRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasNewGameServerTemplate()) { + mergeNewGameServerTemplate(other.getNewGameServerTemplate()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.StartRolloutRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.StartRolloutRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the game server deployment, using the
+     * form:
+     * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerTemplate newGameServerTemplate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + newGameServerTemplateBuilder_; + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public boolean hasNewGameServerTemplate() { + return newGameServerTemplateBuilder_ != null || newGameServerTemplate_ != null; + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate() { + if (newGameServerTemplateBuilder_ == null) { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } else { + return newGameServerTemplateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public Builder setNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (newGameServerTemplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newGameServerTemplate_ = value; + onChanged(); + } else { + newGameServerTemplateBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public Builder setNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder builderForValue) { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = builderForValue.build(); + onChanged(); + } else { + newGameServerTemplateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public Builder mergeNewGameServerTemplate( + com.google.cloud.gaming.v1alpha.GameServerTemplate value) { + if (newGameServerTemplateBuilder_ == null) { + if (newGameServerTemplate_ != null) { + newGameServerTemplate_ = + com.google.cloud.gaming.v1alpha.GameServerTemplate.newBuilder(newGameServerTemplate_) + .mergeFrom(value) + .buildPartial(); + } else { + newGameServerTemplate_ = value; + } + onChanged(); + } else { + newGameServerTemplateBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public Builder clearNewGameServerTemplate() { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplate_ = null; + onChanged(); + } else { + newGameServerTemplate_ = null; + newGameServerTemplateBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder + getNewGameServerTemplateBuilder() { + + onChanged(); + return getNewGameServerTemplateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + public com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder + getNewGameServerTemplateOrBuilder() { + if (newGameServerTemplateBuilder_ != null) { + return newGameServerTemplateBuilder_.getMessageOrBuilder(); + } else { + return newGameServerTemplate_ == null + ? com.google.cloud.gaming.v1alpha.GameServerTemplate.getDefaultInstance() + : newGameServerTemplate_; + } + } + /** + * + * + *
+     * Required. The game server template for the new rollout.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder> + getNewGameServerTemplateFieldBuilder() { + if (newGameServerTemplateBuilder_ == null) { + newGameServerTemplateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerTemplate, + com.google.cloud.gaming.v1alpha.GameServerTemplate.Builder, + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder>( + getNewGameServerTemplate(), getParentForChildren(), isClean()); + newGameServerTemplate_ = null; + } + return newGameServerTemplateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.StartRolloutRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.StartRolloutRequest) + private static final com.google.cloud.gaming.v1alpha.StartRolloutRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.StartRolloutRequest(); + } + + public static com.google.cloud.gaming.v1alpha.StartRolloutRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartRolloutRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartRolloutRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.StartRolloutRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequestOrBuilder.java new file mode 100644 index 000000000000..feae56a63206 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/StartRolloutRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface StartRolloutRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.StartRolloutRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the game server deployment, using the
+   * form:
+   * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + boolean hasNewGameServerTemplate(); + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplate getNewGameServerTemplate(); + /** + * + * + *
+   * Required. The game server template for the new rollout.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerTemplate new_game_server_template = 2; + */ + com.google.cloud.gaming.v1alpha.GameServerTemplateOrBuilder getNewGameServerTemplateOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequest.java new file mode 100644 index 000000000000..e71a986bb2b3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequest.java @@ -0,0 +1,1030 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for AllocationPoliciesService.UpdateAllocationPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest} + */ +public final class UpdateAllocationPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + UpdateAllocationPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAllocationPolicyRequest.newBuilder() to construct. + private UpdateAllocationPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAllocationPolicyRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateAllocationPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder subBuilder = null; + if (allocationPolicy_ != null) { + subBuilder = allocationPolicy_.toBuilder(); + } + allocationPolicy_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.AllocationPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(allocationPolicy_); + allocationPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.Builder.class); + } + + public static final int ALLOCATION_POLICY_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.AllocationPolicy allocationPolicy_; + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public boolean hasAllocationPolicy() { + return allocationPolicy_ != null; + } + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy() { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder() { + return getAllocationPolicy(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (allocationPolicy_ != null) { + output.writeMessage(1, getAllocationPolicy()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (allocationPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAllocationPolicy()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest other = + (com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) obj; + + if (hasAllocationPolicy() != other.hasAllocationPolicy()) return false; + if (hasAllocationPolicy()) { + if (!getAllocationPolicy().equals(other.getAllocationPolicy())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAllocationPolicy()) { + hash = (37 * hash) + ALLOCATION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAllocationPolicy().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for AllocationPoliciesService.UpdateAllocationPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.class, + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.AllocationPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateAllocationPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest build() { + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest result = + new com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest(this); + if (allocationPolicyBuilder_ == null) { + result.allocationPolicy_ = allocationPolicy_; + } else { + result.allocationPolicy_ = allocationPolicyBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest.getDefaultInstance()) + return this; + if (other.hasAllocationPolicy()) { + mergeAllocationPolicy(other.getAllocationPolicy()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.AllocationPolicy allocationPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + allocationPolicyBuilder_; + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public boolean hasAllocationPolicy() { + return allocationPolicyBuilder_ != null || allocationPolicy_ != null; + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } else { + return allocationPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public Builder setAllocationPolicy(com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocationPolicy_ = value; + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public Builder setAllocationPolicy( + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder builderForValue) { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = builderForValue.build(); + onChanged(); + } else { + allocationPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public Builder mergeAllocationPolicy(com.google.cloud.gaming.v1alpha.AllocationPolicy value) { + if (allocationPolicyBuilder_ == null) { + if (allocationPolicy_ != null) { + allocationPolicy_ = + com.google.cloud.gaming.v1alpha.AllocationPolicy.newBuilder(allocationPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + allocationPolicy_ = value; + } + onChanged(); + } else { + allocationPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public Builder clearAllocationPolicy() { + if (allocationPolicyBuilder_ == null) { + allocationPolicy_ = null; + onChanged(); + } else { + allocationPolicy_ = null; + allocationPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder getAllocationPolicyBuilder() { + + onChanged(); + return getAllocationPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder + getAllocationPolicyOrBuilder() { + if (allocationPolicyBuilder_ != null) { + return allocationPolicyBuilder_.getMessageOrBuilder(); + } else { + return allocationPolicy_ == null + ? com.google.cloud.gaming.v1alpha.AllocationPolicy.getDefaultInstance() + : allocationPolicy_; + } + } + /** + * + * + *
+     * Required. The allocation policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder> + getAllocationPolicyFieldBuilder() { + if (allocationPolicyBuilder_ == null) { + allocationPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.AllocationPolicy, + com.google.cloud.gaming.v1alpha.AllocationPolicy.Builder, + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder>( + getAllocationPolicy(), getParentForChildren(), isClean()); + allocationPolicy_ = null; + } + return allocationPolicyBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAllocationPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateAllocationPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..7892de149e69 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateAllocationPolicyRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/allocation_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface UpdateAllocationPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + boolean hasAllocationPolicy(); + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicy getAllocationPolicy(); + /** + * + * + *
+   * Required. The allocation policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.AllocationPolicy allocation_policy = 1; + */ + com.google.cloud.gaming.v1alpha.AllocationPolicyOrBuilder getAllocationPolicyOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequest.java new file mode 100644 index 000000000000..de1ad0098a03 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequest.java @@ -0,0 +1,1035 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerClustersService.UpdateGameServerCluster.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest} + */ +public final class UpdateGameServerClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + UpdateGameServerClusterRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateGameServerClusterRequest.newBuilder() to construct. + private UpdateGameServerClusterRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateGameServerClusterRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateGameServerClusterRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder subBuilder = null; + if (gameServerCluster_ != null) { + subBuilder = gameServerCluster_.toBuilder(); + } + gameServerCluster_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerCluster.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gameServerCluster_); + gameServerCluster_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.Builder.class); + } + + public static final int GAME_SERVER_CLUSTER_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.GameServerCluster gameServerCluster_; + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public boolean hasGameServerCluster() { + return gameServerCluster_ != null; + } + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster() { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder + getGameServerClusterOrBuilder() { + return getGameServerCluster(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gameServerCluster_ != null) { + output.writeMessage(1, getGameServerCluster()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gameServerCluster_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGameServerCluster()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest other = + (com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) obj; + + if (hasGameServerCluster() != other.hasGameServerCluster()) return false; + if (hasGameServerCluster()) { + if (!getGameServerCluster().equals(other.getGameServerCluster())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGameServerCluster()) { + hash = (37 * hash) + GAME_SERVER_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getGameServerCluster().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerClustersService.UpdateGameServerCluster.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.class, + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = null; + } else { + gameServerCluster_ = null; + gameServerClusterBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerClusters + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest build() { + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest buildPartial() { + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest result = + new com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest(this); + if (gameServerClusterBuilder_ == null) { + result.gameServerCluster_ = gameServerCluster_; + } else { + result.gameServerCluster_ = gameServerClusterBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest.getDefaultInstance()) + return this; + if (other.hasGameServerCluster()) { + mergeGameServerCluster(other.getGameServerCluster()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerCluster gameServerCluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + gameServerClusterBuilder_; + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public boolean hasGameServerCluster() { + return gameServerClusterBuilder_ != null || gameServerCluster_ != null; + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster() { + if (gameServerClusterBuilder_ == null) { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } else { + return gameServerClusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public Builder setGameServerCluster(com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gameServerCluster_ = value; + onChanged(); + } else { + gameServerClusterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public Builder setGameServerCluster( + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder builderForValue) { + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = builderForValue.build(); + onChanged(); + } else { + gameServerClusterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public Builder mergeGameServerCluster(com.google.cloud.gaming.v1alpha.GameServerCluster value) { + if (gameServerClusterBuilder_ == null) { + if (gameServerCluster_ != null) { + gameServerCluster_ = + com.google.cloud.gaming.v1alpha.GameServerCluster.newBuilder(gameServerCluster_) + .mergeFrom(value) + .buildPartial(); + } else { + gameServerCluster_ = value; + } + onChanged(); + } else { + gameServerClusterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public Builder clearGameServerCluster() { + if (gameServerClusterBuilder_ == null) { + gameServerCluster_ = null; + onChanged(); + } else { + gameServerCluster_ = null; + gameServerClusterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerCluster.Builder getGameServerClusterBuilder() { + + onChanged(); + return getGameServerClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder + getGameServerClusterOrBuilder() { + if (gameServerClusterBuilder_ != null) { + return gameServerClusterBuilder_.getMessageOrBuilder(); + } else { + return gameServerCluster_ == null + ? com.google.cloud.gaming.v1alpha.GameServerCluster.getDefaultInstance() + : gameServerCluster_; + } + } + /** + * + * + *
+     * Required. The game server cluster to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder> + getGameServerClusterFieldBuilder() { + if (gameServerClusterBuilder_ == null) { + gameServerClusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerCluster, + com.google.cloud.gaming.v1alpha.GameServerCluster.Builder, + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder>( + getGameServerCluster(), getParentForChildren(), isClean()); + gameServerCluster_ = null; + } + return gameServerClusterBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + private static final com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest(); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateGameServerClusterRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateGameServerClusterRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequestOrBuilder.java new file mode 100644 index 000000000000..9ae1ddf8af73 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerClusterRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_clusters.proto + +package com.google.cloud.gaming.v1alpha; + +public interface UpdateGameServerClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + boolean hasGameServerCluster(); + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerCluster getGameServerCluster(); + /** + * + * + *
+   * Required. The game server cluster to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerCluster game_server_cluster = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerClusterOrBuilder getGameServerClusterOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequest.java new file mode 100644 index 000000000000..4e24c04843a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequest.java @@ -0,0 +1,1044 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for GameServerDeploymentsService.UpdateGameServerDeployment.
+ * Only allows updates for labels.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest} + */ +public final class UpdateGameServerDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + UpdateGameServerDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateGameServerDeploymentRequest.newBuilder() to construct. + private UpdateGameServerDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateGameServerDeploymentRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateGameServerDeploymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder subBuilder = null; + if (gameServerDeployment_ != null) { + subBuilder = gameServerDeployment_.toBuilder(); + } + gameServerDeployment_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.GameServerDeployment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(gameServerDeployment_); + gameServerDeployment_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.Builder.class); + } + + public static final int GAME_SERVER_DEPLOYMENT_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.GameServerDeployment gameServerDeployment_; + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public boolean hasGameServerDeployment() { + return gameServerDeployment_ != null; + } + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment() { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentOrBuilder() { + return getGameServerDeployment(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gameServerDeployment_ != null) { + output.writeMessage(1, getGameServerDeployment()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gameServerDeployment_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGameServerDeployment()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest other = + (com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) obj; + + if (hasGameServerDeployment() != other.hasGameServerDeployment()) return false; + if (hasGameServerDeployment()) { + if (!getGameServerDeployment().equals(other.getGameServerDeployment())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGameServerDeployment()) { + hash = (37 * hash) + GAME_SERVER_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getGameServerDeployment().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GameServerDeploymentsService.UpdateGameServerDeployment.
+   * Only allows updates for labels.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.class, + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = null; + } else { + gameServerDeployment_ = null; + gameServerDeploymentBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.GameServerDeployments + .internal_static_google_cloud_gaming_v1alpha_UpdateGameServerDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest build() { + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest buildPartial() { + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest result = + new com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest(this); + if (gameServerDeploymentBuilder_ == null) { + result.gameServerDeployment_ = gameServerDeployment_; + } else { + result.gameServerDeployment_ = gameServerDeploymentBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest other) { + if (other + == com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest.getDefaultInstance()) + return this; + if (other.hasGameServerDeployment()) { + mergeGameServerDeployment(other.getGameServerDeployment()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.GameServerDeployment gameServerDeployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + gameServerDeploymentBuilder_; + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public boolean hasGameServerDeployment() { + return gameServerDeploymentBuilder_ != null || gameServerDeployment_ != null; + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment() { + if (gameServerDeploymentBuilder_ == null) { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } else { + return gameServerDeploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public Builder setGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gameServerDeployment_ = value; + onChanged(); + } else { + gameServerDeploymentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public Builder setGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder builderForValue) { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = builderForValue.build(); + onChanged(); + } else { + gameServerDeploymentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public Builder mergeGameServerDeployment( + com.google.cloud.gaming.v1alpha.GameServerDeployment value) { + if (gameServerDeploymentBuilder_ == null) { + if (gameServerDeployment_ != null) { + gameServerDeployment_ = + com.google.cloud.gaming.v1alpha.GameServerDeployment.newBuilder(gameServerDeployment_) + .mergeFrom(value) + .buildPartial(); + } else { + gameServerDeployment_ = value; + } + onChanged(); + } else { + gameServerDeploymentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public Builder clearGameServerDeployment() { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeployment_ = null; + onChanged(); + } else { + gameServerDeployment_ = null; + gameServerDeploymentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder + getGameServerDeploymentBuilder() { + + onChanged(); + return getGameServerDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + public com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder + getGameServerDeploymentOrBuilder() { + if (gameServerDeploymentBuilder_ != null) { + return gameServerDeploymentBuilder_.getMessageOrBuilder(); + } else { + return gameServerDeployment_ == null + ? com.google.cloud.gaming.v1alpha.GameServerDeployment.getDefaultInstance() + : gameServerDeployment_; + } + } + /** + * + * + *
+     * Required. The game server deployment to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder> + getGameServerDeploymentFieldBuilder() { + if (gameServerDeploymentBuilder_ == null) { + gameServerDeploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.GameServerDeployment, + com.google.cloud.gaming.v1alpha.GameServerDeployment.Builder, + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder>( + getGameServerDeployment(), getParentForChildren(), isClean()); + gameServerDeployment_ = null; + } + return gameServerDeploymentBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + private static final com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest(); + } + + public static com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateGameServerDeploymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateGameServerDeploymentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..3e64cb55c4ef --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateGameServerDeploymentRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/game_server_deployments.proto + +package com.google.cloud.gaming.v1alpha; + +public interface UpdateGameServerDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + boolean hasGameServerDeployment(); + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerDeployment getGameServerDeployment(); + /** + * + * + *
+   * Required. The game server deployment to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.GameServerDeployment game_server_deployment = 1; + */ + com.google.cloud.gaming.v1alpha.GameServerDeploymentOrBuilder getGameServerDeploymentOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequest.java new file mode 100644 index 000000000000..02dffc1d1ea9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequest.java @@ -0,0 +1,1001 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +/** Protobuf type {@code google.cloud.gaming.v1alpha.UpdateRealmRequest} */ +public final class UpdateRealmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.UpdateRealmRequest) + UpdateRealmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateRealmRequest.newBuilder() to construct. + private UpdateRealmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateRealmRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateRealmRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.Realm.Builder subBuilder = null; + if (realm_ != null) { + subBuilder = realm_.toBuilder(); + } + realm_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.Realm.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(realm_); + realm_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest.class, + com.google.cloud.gaming.v1alpha.UpdateRealmRequest.Builder.class); + } + + public static final int REALM_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.Realm realm_; + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public boolean hasRealm() { + return realm_ != null; + } + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealm() { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder() { + return getRealm(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (realm_ != null) { + output.writeMessage(1, getRealm()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (realm_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRealm()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.UpdateRealmRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.UpdateRealmRequest other = + (com.google.cloud.gaming.v1alpha.UpdateRealmRequest) obj; + + if (hasRealm() != other.hasRealm()) return false; + if (hasRealm()) { + if (!getRealm().equals(other.getRealm())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRealm()) { + hash = (37 * hash) + REALM_FIELD_NUMBER; + hash = (53 * hash) + getRealm().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gaming.v1alpha.UpdateRealmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.gaming.v1alpha.UpdateRealmRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.UpdateRealmRequest) + com.google.cloud.gaming.v1alpha.UpdateRealmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateRealmRequest.class, + com.google.cloud.gaming.v1alpha.UpdateRealmRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.UpdateRealmRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (realmBuilder_ == null) { + realm_ = null; + } else { + realm_ = null; + realmBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.Realms + .internal_static_google_cloud_gaming_v1alpha_UpdateRealmRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateRealmRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.UpdateRealmRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateRealmRequest build() { + com.google.cloud.gaming.v1alpha.UpdateRealmRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateRealmRequest buildPartial() { + com.google.cloud.gaming.v1alpha.UpdateRealmRequest result = + new com.google.cloud.gaming.v1alpha.UpdateRealmRequest(this); + if (realmBuilder_ == null) { + result.realm_ = realm_; + } else { + result.realm_ = realmBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.UpdateRealmRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.UpdateRealmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.UpdateRealmRequest other) { + if (other == com.google.cloud.gaming.v1alpha.UpdateRealmRequest.getDefaultInstance()) + return this; + if (other.hasRealm()) { + mergeRealm(other.getRealm()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.UpdateRealmRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.UpdateRealmRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.Realm realm_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + realmBuilder_; + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public boolean hasRealm() { + return realmBuilder_ != null || realm_ != null; + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm getRealm() { + if (realmBuilder_ == null) { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } else { + return realmBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public Builder setRealm(com.google.cloud.gaming.v1alpha.Realm value) { + if (realmBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + realm_ = value; + onChanged(); + } else { + realmBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public Builder setRealm(com.google.cloud.gaming.v1alpha.Realm.Builder builderForValue) { + if (realmBuilder_ == null) { + realm_ = builderForValue.build(); + onChanged(); + } else { + realmBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public Builder mergeRealm(com.google.cloud.gaming.v1alpha.Realm value) { + if (realmBuilder_ == null) { + if (realm_ != null) { + realm_ = + com.google.cloud.gaming.v1alpha.Realm.newBuilder(realm_) + .mergeFrom(value) + .buildPartial(); + } else { + realm_ = value; + } + onChanged(); + } else { + realmBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public Builder clearRealm() { + if (realmBuilder_ == null) { + realm_ = null; + onChanged(); + } else { + realm_ = null; + realmBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public com.google.cloud.gaming.v1alpha.Realm.Builder getRealmBuilder() { + + onChanged(); + return getRealmFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + public com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder() { + if (realmBuilder_ != null) { + return realmBuilder_.getMessageOrBuilder(); + } else { + return realm_ == null ? com.google.cloud.gaming.v1alpha.Realm.getDefaultInstance() : realm_; + } + } + /** + * + * + *
+     * Required. The realm to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder> + getRealmFieldBuilder() { + if (realmBuilder_ == null) { + realmBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.Realm, + com.google.cloud.gaming.v1alpha.Realm.Builder, + com.google.cloud.gaming.v1alpha.RealmOrBuilder>( + getRealm(), getParentForChildren(), isClean()); + realm_ = null; + } + return realmBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask`
+     * definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.UpdateRealmRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.UpdateRealmRequest) + private static final com.google.cloud.gaming.v1alpha.UpdateRealmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.UpdateRealmRequest(); + } + + public static com.google.cloud.gaming.v1alpha.UpdateRealmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRealmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateRealmRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateRealmRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequestOrBuilder.java new file mode 100644 index 000000000000..c8d90e08635a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateRealmRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/realms.proto + +package com.google.cloud.gaming.v1alpha; + +public interface UpdateRealmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.UpdateRealmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + boolean hasRealm(); + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + com.google.cloud.gaming.v1alpha.Realm getRealm(); + /** + * + * + *
+   * Required. The realm to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.Realm realm = 1; + */ + com.google.cloud.gaming.v1alpha.RealmOrBuilder getRealmOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask`
+   * definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequest.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequest.java new file mode 100644 index 000000000000..0192eaa65496 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequest.java @@ -0,0 +1,1025 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +/** + * + * + *
+ * Request message for ScalingPoliciesService.UpdateScalingPolicy.
+ * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest} + */ +public final class UpdateScalingPolicyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) + UpdateScalingPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateScalingPolicyRequest.newBuilder() to construct. + private UpdateScalingPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateScalingPolicyRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateScalingPolicyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder subBuilder = null; + if (scalingPolicy_ != null) { + subBuilder = scalingPolicy_.toBuilder(); + } + scalingPolicy_ = + input.readMessage( + com.google.cloud.gaming.v1alpha.ScalingPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scalingPolicy_); + scalingPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.Builder.class); + } + + public static final int SCALING_POLICY_FIELD_NUMBER = 1; + private com.google.cloud.gaming.v1alpha.ScalingPolicy scalingPolicy_; + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public boolean hasScalingPolicy() { + return scalingPolicy_ != null; + } + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy() { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder() { + return getScalingPolicy(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (scalingPolicy_ != null) { + output.writeMessage(1, getScalingPolicy()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (scalingPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getScalingPolicy()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest)) { + return super.equals(obj); + } + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest other = + (com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) obj; + + if (hasScalingPolicy() != other.hasScalingPolicy()) return false; + if (hasScalingPolicy()) { + if (!getScalingPolicy().equals(other.getScalingPolicy())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasScalingPolicy()) { + hash = (37 * hash) + SCALING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getScalingPolicy().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ScalingPoliciesService.UpdateScalingPolicy.
+   * 
+ * + * Protobuf type {@code google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.class, + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.Builder.class); + } + + // Construct using com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = null; + } else { + scalingPolicy_ = null; + scalingPolicyBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gaming.v1alpha.ScalingPolicies + .internal_static_google_cloud_gaming_v1alpha_UpdateScalingPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest getDefaultInstanceForType() { + return com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest build() { + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest buildPartial() { + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest result = + new com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest(this); + if (scalingPolicyBuilder_ == null) { + result.scalingPolicy_ = scalingPolicy_; + } else { + result.scalingPolicy_ = scalingPolicyBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) { + return mergeFrom((com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest other) { + if (other == com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest.getDefaultInstance()) + return this; + if (other.hasScalingPolicy()) { + mergeScalingPolicy(other.getScalingPolicy()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.gaming.v1alpha.ScalingPolicy scalingPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + scalingPolicyBuilder_; + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public boolean hasScalingPolicy() { + return scalingPolicyBuilder_ != null || scalingPolicy_ != null; + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy() { + if (scalingPolicyBuilder_ == null) { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } else { + return scalingPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public Builder setScalingPolicy(com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scalingPolicy_ = value; + onChanged(); + } else { + scalingPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public Builder setScalingPolicy( + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder builderForValue) { + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = builderForValue.build(); + onChanged(); + } else { + scalingPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public Builder mergeScalingPolicy(com.google.cloud.gaming.v1alpha.ScalingPolicy value) { + if (scalingPolicyBuilder_ == null) { + if (scalingPolicy_ != null) { + scalingPolicy_ = + com.google.cloud.gaming.v1alpha.ScalingPolicy.newBuilder(scalingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + scalingPolicy_ = value; + } + onChanged(); + } else { + scalingPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public Builder clearScalingPolicy() { + if (scalingPolicyBuilder_ == null) { + scalingPolicy_ = null; + onChanged(); + } else { + scalingPolicy_ = null; + scalingPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder getScalingPolicyBuilder() { + + onChanged(); + return getScalingPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + public com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder() { + if (scalingPolicyBuilder_ != null) { + return scalingPolicyBuilder_.getMessageOrBuilder(); + } else { + return scalingPolicy_ == null + ? com.google.cloud.gaming.v1alpha.ScalingPolicy.getDefaultInstance() + : scalingPolicy_; + } + } + /** + * + * + *
+     * Required. The scaling policy to be updated.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder> + getScalingPolicyFieldBuilder() { + if (scalingPolicyBuilder_ == null) { + scalingPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gaming.v1alpha.ScalingPolicy, + com.google.cloud.gaming.v1alpha.ScalingPolicy.Builder, + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder>( + getScalingPolicy(), getParentForChildren(), isClean()); + scalingPolicy_ = null; + } + return scalingPolicyBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. For the `FieldMask` definition, see
+     * https:
+     * //developers.google.com/protocol-buffers
+     * // /docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) + private static final com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest(); + } + + public static com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateScalingPolicyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateScalingPolicyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequestOrBuilder.java new file mode 100644 index 000000000000..022b80c1478d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/java/com/google/cloud/gaming/v1alpha/UpdateScalingPolicyRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/gaming/v1alpha/scaling_policies.proto + +package com.google.cloud.gaming.v1alpha; + +public interface UpdateScalingPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + boolean hasScalingPolicy(); + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicy getScalingPolicy(); + /** + * + * + *
+   * Required. The scaling policy to be updated.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.gaming.v1alpha.ScalingPolicy scaling_policy = 1; + */ + com.google.cloud.gaming.v1alpha.ScalingPolicyOrBuilder getScalingPolicyOrBuilder(); + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. For the `FieldMask` definition, see
+   * https:
+   * //developers.google.com/protocol-buffers
+   * // /docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/allocation_policies.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/allocation_policies.proto new file mode 100644 index 000000000000..0692fe0e5dfd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/allocation_policies.proto @@ -0,0 +1,196 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/cloud/gaming/v1alpha/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// The cloud gaming allocation policy is used as the controller's recipe for the +// allocating game servers from clusters. The policy has three modes: +// 1. Default mode which is not limited to time. +// 2. Time based mode which is temporary and overrides the default mode when +// effective. +// 3. Periodic mode which follows the time base mode, but happens +// periodically using local time, identified by cron specs. +service AllocationPoliciesService { + option (google.api.default_host) = "gameservices.googleapis.com"; + + // List allocation policies in a given project and location. + rpc ListAllocationPolicies(ListAllocationPoliciesRequest) returns (ListAllocationPoliciesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/allocationPolicies" + }; + } + + // Gets details of a single allocation policy. + rpc GetAllocationPolicy(GetAllocationPolicyRequest) returns (AllocationPolicy) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/allocationPolicies/*}" + }; + } + + // Creates a new allocation policy in a given project and location. + rpc CreateAllocationPolicy(CreateAllocationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/allocationPolicies" + body: "allocation_policy" + }; + } + + // Deletes a single allocation policy. + rpc DeleteAllocationPolicy(DeleteAllocationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/allocationPolicies/*}" + }; + } + + // Patches a single allocation policy. + rpc UpdateAllocationPolicy(UpdateAllocationPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{allocation_policy.name=projects/*/locations/*/allocationPolicies/*}" + body: "allocation_policy" + }; + } +} + +// Request message for AllocationPoliciesService.ListAllocationPolicies. +message ListAllocationPoliciesRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse.next_page_token] to + // determine if there are more AllocationPolicies left to be queried. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // Optional. The filter to apply to list results. + string filter = 4; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for AllocationPoliciesService.ListAllocationPolicies. +message ListAllocationPoliciesResponse { + // The list of allocation policies. + repeated AllocationPolicy allocation_policies = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for AllocationPoliciesService.GetAllocationPolicy. +message GetAllocationPolicyRequest { + // Required. The name of the allocation policy to retrieve, using the form: + // + // `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}` + string name = 1; +} + +// Request message for AllocationPoliciesService.CreateAllocationPolicy. +message CreateAllocationPolicyRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Required. The ID of the allocation policy resource to be created. + string allocation_policy_id = 2; + + // Required. The allocation policy resource to be created. + AllocationPolicy allocation_policy = 3; +} + +// Request message for AllocationPoliciesService.DeleteAllocationPolicy. +message DeleteAllocationPolicyRequest { + // Required. The name of the allocation policy to delete, using the form: + // + // `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}` + string name = 1; +} + +// Request message for AllocationPoliciesService.UpdateAllocationPolicy. +message UpdateAllocationPolicyRequest { + // Required. The allocation policy to be updated. + // Only fields specified in update_mask are updated. + AllocationPolicy allocation_policy = 1; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; +} + +// An allocation policy resource. +message AllocationPolicy { + // The resource name of the allocation policy, using the form: + // + // `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`. + // For example, + // `projects/my-project/locations/{location}/allocationPolicies/my-policy`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3; + + // The labels associated with the allocation policy. Each label is a key-value + // pair. + map labels = 4; + + // Required. The priority of the policy for allocation. A smaller value + // indicates a higher priority. + google.protobuf.Int32Value priority = 8; + + // The relative weight of the policy based on its priority - If there are + // multiple policies with the same priority, the probability of using a policy + // is based on its weight. + int32 weight = 9; + + // The cluster labels are used to identify the clusters that a policy is + // applied to. + repeated LabelSelector cluster_selectors = 10; + + // The event schedules - If specified, the policy is time based and when the + // schedule is effective overrides the default policy. + repeated Schedule schedules = 11; +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/common.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/common.proto new file mode 100644 index 000000000000..eeb4f3c2fbe2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/common.proto @@ -0,0 +1,86 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3; + + // Output only. Name of the verb executed by the operation. + string verb = 4; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6; + + // Output only. API version used to start the operation. + string api_version = 7; +} + +// The label selector, used to group labels on the resources. +message LabelSelector { + map labels = 1; +} + +// The schedule of an event - the event can be recurring or one time. The +// event's time span is specified by start_time and end_time. If the scheduled +// event's timespan is larger than the cron_spec + cron_job_duration the event +// will be recurring. +// If cron_spec + cron_job_duration is only specified, the event is effective +// starting at the local time specified by cron_spec and is recurrent. +// +// start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time +// cron job: cron spec start time + duration +message Schedule { + // The start time of the event. + google.protobuf.Timestamp start_time = 1; + + // The end time of the event. + google.protobuf.Timestamp end_time = 2; + + // The duration for the cron job event. The duration of the event is effective + // after the cron job's start time. + google.protobuf.Duration cron_job_duration = 3; + + // The cron definition of the scheduled event. See + // https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as + // defined by the realm. + string cron_spec = 4; +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_clusters.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_clusters.proto new file mode 100644 index 000000000000..0490265f785f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_clusters.proto @@ -0,0 +1,187 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// The game server cluster is used to capture the game server cluster's settings +// which are used to manage game server clusters. +service GameServerClustersService { + option (google.api.default_host) = "gameservices.googleapis.com"; + + // Lists game server clusters in a given project and location. + rpc ListGameServerClusters(ListGameServerClustersRequest) returns (ListGameServerClustersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + }; + } + + // Gets details of a single game server cluster. + rpc GetGameServerCluster(GetGameServerClusterRequest) returns (GameServerCluster) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + } + + // Creates a new game server cluster in a given project and location. + rpc CreateGameServerCluster(CreateGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + body: "game_server_cluster" + }; + } + + // Deletes a single game server cluster. + rpc DeleteGameServerCluster(DeleteGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + } + + // Patches a single game server cluster. + rpc UpdateGameServerCluster(UpdateGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}" + body: "game_server_cluster" + }; + } +} + +// Request message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersRequest { + // Required. The parent resource name, using the form: + // "projects/{project_id}/locations/{location}/realms/{realm-id}". + string parent = 1; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1alpha.ListGameServerClustersResponse.next_page_token] to + // determine if there are more GameServerClusters left to be queried. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // Optional. The filter to apply to list results. + string filter = 4; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersResponse { + // The list of game server clusters. + repeated GameServerCluster game_server_clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for GameServerClustersService.GetGameServerCluster. +message GetGameServerClusterRequest { + // Required. The name of the game server cluster to retrieve, using the form: + // + // `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}` + string name = 1; +} + +// Request message for GameServerClustersService.CreateGameServerCluster. +message CreateGameServerClusterRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}/realms/{realm-id}`. + string parent = 1; + + // Required. The ID of the game server cluster resource to be created. + string game_server_cluster_id = 2; + + // Required. The game server cluster resource to be created. + GameServerCluster game_server_cluster = 3; +} + +// Request message for GameServerClustersService.DeleteGameServerCluster. +message DeleteGameServerClusterRequest { + // Required. The name of the game server cluster to delete, using the form: + // + // `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}` + string name = 1; +} + +// Request message for GameServerClustersService.UpdateGameServerCluster. +message UpdateGameServerClusterRequest { + // Required. The game server cluster to be updated. + // Only fields specified in update_mask are updated. + GameServerCluster game_server_cluster = 1; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; +} + +// Game server cluster connection information. +message GameServerClusterConnectionInfo { + // Namespace for Kubernetes API server endpoint. + string namespace = 5; + + // This is the gkeName where the game server cluster is installed. + // It must the format "projects/*/locations/*/clusters/*". For example, + // "projects/my-project/locations/us-central1/clusters/test". + string gke_name = 6; +} + +// A game server cluster resource. +message GameServerCluster { + // The resource name of the game server cluster, using the form: + // + // `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`. + // For example, + // + // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3; + + // The labels associated with this game server cluster. Each label is a + // key-value pair. + map labels = 4; + + // Game server cluster connection information. This information is used to + // manage game server clusters. + GameServerClusterConnectionInfo connection_info = 5; +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_deployments.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_deployments.proto new file mode 100644 index 000000000000..d07f1743b6e3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/game_server_deployments.proto @@ -0,0 +1,333 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/cloud/gaming/v1alpha/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// The game server deployment is used to configure the deployment of game server +// software to Agones Fleets in game server clusters. +service GameServerDeploymentsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + + // Lists game server deployments in a given project and location. + rpc ListGameServerDeployments(ListGameServerDeploymentsRequest) returns (ListGameServerDeploymentsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/gameServerDeployments" + }; + } + + // Gets details of a single game server deployment. + rpc GetGameServerDeployment(GetGameServerDeploymentRequest) returns (GameServerDeployment) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + } + + // Creates a new game server deployment in a given project and location. + rpc CreateGameServerDeployment(CreateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/gameServerDeployments" + body: "game_server_deployment" + }; + } + + // Deletes a single game server deployment. + rpc DeleteGameServerDeployment(DeleteGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + } + + // Patches a game server deployment. + rpc UpdateGameServerDeployment(UpdateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}" + body: "game_server_deployment" + }; + } + + // Starts rollout of this game server deployment based on the given game + // server template. + rpc StartRollout(StartRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}:startRollout" + body: "*" + }; + } + + // Sets rollout target for the ongoing game server deployment rollout in the + // specified clusters and based on the given rollout percentage. Default is 0. + rpc SetRolloutTarget(SetRolloutTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}:setRolloutTarget" + body: "*" + }; + } + + // Commits the ongoing game server deployment rollout by setting the rollout + // percentage to 100 in all clusters whose labels match labels in the game + // server template. + rpc CommitRollout(CommitRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}:commitRollout" + body: "*" + }; + } + + // Rolls back the ongoing game server deployment rollout by setting the + // rollout percentage to 0 in all clusters whose labels match labels in the + // game server template. + rpc RevertRollout(RevertRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}:revertRollout" + body: "*" + }; + } + + // Retrieves information on the rollout target of the deployment, e.g. the + // target percentage of game servers running stable_game_server_template and + // new_game_server_template in clusters. + rpc GetDeploymentTarget(GetDeploymentTargetRequest) returns (DeploymentTarget) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/gameServerDeployments/*}:getDeploymentTarget" + }; + } +} + +// Request message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse.next_page_token] to + // determine if there are more GameServerDeployments left to be queried. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // Optional. The filter to apply to list results. + string filter = 4; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsResponse { + // The list of game server delpoyments. + repeated GameServerDeployment game_server_deployments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for GameServerDeploymentsService.GetGameServerDeployment. +message GetGameServerDeploymentRequest { + // Required. The name of the game server deployment to retrieve, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; +} + +// Request message for GameServerDeploymentsService.CreateGameServerDeployment. +message CreateGameServerDeploymentRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Required. The ID of the game server deployment resource to be created. + string deployment_id = 2; + + // Required. The game server deployment resource to be created. + GameServerDeployment game_server_deployment = 3; +} + +// Request message for GameServerDeploymentsService.DeleteGameServerDeployment. +message DeleteGameServerDeploymentRequest { + // Required. The name of the game server deployment to delete, using the form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; +} + +// Request message for GameServerDeploymentsService.UpdateGameServerDeployment. +// Only allows updates for labels. +message UpdateGameServerDeploymentRequest { + // Required. The game server deployment to be updated. + // Only fields specified in update_mask are updated. + GameServerDeployment game_server_deployment = 1; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for GameServerDeploymentsService.StartRollout. +message StartRolloutRequest { + // Required. The name of the game server deployment, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; + + // Required. The game server template for the new rollout. + GameServerTemplate new_game_server_template = 2; +} + +// Request message for GameServerDeploymentsService.SetRolloutTarget. +message SetRolloutTargetRequest { + // Required. The name of the game server deployment, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; + + // Required. The percentage of game servers that should run the new game + // server template in the specified clusters. Default is 0. + repeated ClusterPercentageSelector cluster_percentage_selector = 2; +} + +// Request message for GameServerDeploymentsService.CommitRollout. +message CommitRolloutRequest { + // Required. The name of the game server deployment, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; +} + +// Request message for GameServerDeploymentsService.RevertRollout. +message RevertRolloutRequest { + // Required. The name of the game server deployment to deploy, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; +} + +// Request message for GameServerDeploymentsService.GetDeploymentTarget. +message GetDeploymentTargetRequest { + // Required. The name of the game server deployment, using the + // form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + string name = 1; +} + +// The percentage of game servers running this game server template in the +// selected clusters. +message ClusterPercentageSelector { + // Labels used to identify the clusters to which this game server template + // applies. + LabelSelector cluster_selector = 1; + + // The percentage of game servers running this game server depolyment. The + // percentage is applied to game server clusters which contain all of the + // labels in the cluster selector field. + int32 percent = 2; +} + +// The game server spec sent to Agones and the rollout target. +message GameServerTemplate { + // The description of the game server template. + string description = 1; + + // The game server spec, which is sent to Agones. + string spec = 2; + + // Output only. The percentage of game servers running this game server + // template in the selected clusters. + repeated ClusterPercentageSelector cluster_percentage_selectors = 3; + + // The ID of the game server template, specified by the user. + string template_id = 4; +} + +// The rollout target of the deployment, e.g. the target percentage of game +// servers running stable_game_server_template and new_game_server_template in +// clusters. +message DeploymentTarget { + // The rollout target of a cluster, i.e. the percentage of game servers + // running stable_game_server_template and new_game_server_template. + message ClusterRolloutTarget { + // The realm name. + string realm = 1; + + // The cluster name. + string cluster = 2; + + // The desired percentage of game servers that run + // stable_game_server_template. + int32 stable_percent = 3; + + // The desired percentage of game servers that run new_game_server_template. + int32 new_percent = 4; + } + + repeated ClusterRolloutTarget clusters = 1; +} + +// A game server deployment resource. +message GameServerDeployment { + // The resource name of the game server deployment, using the form: + // + // `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`. + // For example, + // + // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3; + + // The labels associated with this game server deployment. Each label is a + // key-value pair. + map labels = 4; + + // Output only. The GameServerTemplate whose rollout was completed. + GameServerTemplate stable_game_server_template = 5; + + // The GameServerTemplate whose rollout is ongoing. + GameServerTemplate new_game_server_template = 6; +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/realms.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/realms.proto new file mode 100644 index 000000000000..ff45d81e0859 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/realms.proto @@ -0,0 +1,171 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// Realm provides grouping of game server clusters that are serving particular +// gamer population. +service RealmsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + + // Lists realms in a given project and location. + rpc ListRealms(ListRealmsRequest) returns (ListRealmsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/realms" + }; + } + + // Gets details of a single realm. + rpc GetRealm(GetRealmRequest) returns (Realm) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/realms/*}" + }; + } + + // Creates a new Realm in a given project and location. + rpc CreateRealm(CreateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/realms" + body: "realm" + }; + } + + // Deletes a single realm. + rpc DeleteRealm(DeleteRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/realms/*}" + }; + } + + // Patches a single Realm. + rpc UpdateRealm(UpdateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{realm.name=projects/*/locations/*/realms/*}" + body: "realm" + }; + } +} + +// Request message for RealmsService.ListRealms. +message ListRealmsRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1alpha.ListRealmsResponse.next_page_token] to + // determine if there are more Realms left to be queried. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // Optional. The filter to apply to list results. + string filter = 4; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for RealmsService.ListRealms. +message ListRealmsResponse { + // The list of realms + repeated Realm realms = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for RealmsService.GetRealm. +message GetRealmRequest { + // Required. The name of the realm to retrieve, using the form: + // `projects/{project_id}/locations/{location}/realms/{realm_id}` + string name = 1; +} + +// Request message for RealmsService.CreateRealm. +message CreateRealmRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Required. The ID of the realm resource to be created. + string realm_id = 2; + + // Required. The realm resource to be created. + Realm realm = 3; +} + +// Request message for RealmsService.DeleteRealm. +message DeleteRealmRequest { + // Required. The name of the realm to delete, using the form: + // `projects/{project_id}/locations/{location}/realms/{realm_id}` + string name = 1; +} + +message UpdateRealmRequest { + // Required. The realm to be updated. + // Only fields specified in update_mask are updated. + Realm realm = 1; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; +} + +// A Realm resource. +message Realm { + // The resource name of the realm, using the form: + // `projects/{project_id}/locations/{location}/realms/{realm_id}`. For + // example, `projects/my-project/locations/{location}/realms/my-realm`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3; + + // The labels associated with this realm. Each label is a key-value pair. + map labels = 4; + + // Time zone where all realm-specific policies are evaluated. The value of + // this field must be from the IANA time zone database: + // https://www.iana.org/time-zones. If not specified, UTC is assumed by + // default. + string time_zone = 6; +} diff --git a/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/scaling_policies.proto b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/scaling_policies.proto new file mode 100644 index 000000000000..71e1ebb1c099 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-gameservices-v1alpha/src/main/proto/google/cloud/gaming/v1alpha/scaling_policies.proto @@ -0,0 +1,215 @@ +// Copyright 2019 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1alpha; + +import "google/api/annotations.proto"; +import "google/cloud/gaming/v1alpha/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1alpha;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1alpha"; + +// The cloud gaming scaling policy is used to configure scaling parameters for +// each fleet. +service ScalingPoliciesService { + option (google.api.default_host) = "gameservices.googleapis.com"; + + // Lists ScalingPolicies in a given project and location. + rpc ListScalingPolicies(ListScalingPoliciesRequest) returns (ListScalingPoliciesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/scalingPolicies" + }; + } + + // Gets details of a single scaling policy. + rpc GetScalingPolicy(GetScalingPolicyRequest) returns (ScalingPolicy) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/scalingPolicies/*}" + }; + } + + // Creates a new scaling policy in a given project and location. + rpc CreateScalingPolicy(CreateScalingPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/scalingPolicies" + body: "scaling_policy" + }; + } + + // Deletes a single scaling policy. + rpc DeleteScalingPolicy(DeleteScalingPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/scalingPolicies/*}" + }; + } + + // Patches a single scaling policy. + rpc UpdateScalingPolicy(UpdateScalingPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{scaling_policy.name=projects/*/locations/*/scalingPolicies/*}" + body: "scaling_policy" + }; + } +} + +// Request message for ScalingPoliciesService.ListScalingPolicies. +message ListScalingPoliciesRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // / Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1alpha.ListScalingPoliciesResponse.next_page_token] to + // determine if there are more ScalingPolicies left to be queried. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // Optional. The filter to apply to list results. + string filter = 4; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for ScalingPoliciesService.ListScalingPolicies. +message ListScalingPoliciesResponse { + // The list of scaling policies. + repeated ScalingPolicy scaling_policies = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for ScalingPoliciesService.GetScalingPolicy. +message GetScalingPolicyRequest { + // Required. The name of the scaling policy to retrieve, using the form: + // + // `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}` + string name = 1; +} + +// Request message for ScalingPoliciesService.CreateScalingPolicy. +message CreateScalingPolicyRequest { + // Required. The parent resource name, using the form: + // `projects/{project_id}/locations/{location}`. + string parent = 1; + + // Required. The ID of the scaling policy resource to be created. + string scaling_policy_id = 2; + + // Required. The scaling policy resource to be created. + ScalingPolicy scaling_policy = 3; +} + +// Request message for ScalingPoliciesService.DeleteScalingPolicy. +message DeleteScalingPolicyRequest { + // Required. The name of the scaling policy to delete, using the form: + // + // `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}` + string name = 1; +} + +// Request message for ScalingPoliciesService.UpdateScalingPolicy. +message UpdateScalingPolicyRequest { + // Required. The scaling policy to be updated. + // Only fields specified in update_mask are updated. + ScalingPolicy scaling_policy = 1; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2; +} + +// Fleet autoscaling parameters. +message FleetAutoscalerSettings { + oneof buffer_size { + // The size of a buffer of ready game server instances in absolute number. + // As game server instances get allocated or terminated, the fleet will be + // scaled up and down so that this buffer is maintained. + int64 buffer_size_absolute = 1; + + // The size of a buffer of ready game server instances in percentage. + // As game server instances get allocated or terminated, the fleet will be + // scaled up and down so that this buffer is maintained. + float buffer_size_percentage = 2; + } + + // The minimum fleet size. + int64 min_replicas = 3; + + // The maximum fleet size. + int64 max_replicas = 4; +} + +// A scaling policy resource. +message ScalingPolicy { + // The resource name of the scaling policy, using the form: + // + // `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`. + // For example, + // `projects/my-project/locations/{location}/scalingPolicies/my-policy`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3; + + // The labels associated with this scaling policy. Each label is a key-value + // pair. + map labels = 4; + + // Fleet autoscaler parameters. + FleetAutoscalerSettings fleet_autoscaler_settings = 5; + + // Required. The priority of the policy. A smaller value indicates a higher + // priority. + google.protobuf.Int32Value priority = 6; + + // Labels used to identify the clusters to which this scaling policy applies. + // A cluster is subject to this scaling policy if its labels match any of the + // cluster selector entries. + repeated LabelSelector cluster_selectors = 7; + + // The schedules to which this scaling policy applies. + repeated Schedule schedules = 8; + + // The game server deployment for this scaling policy. For example, + // + // "projects/my-project/locations/{location}/gameServerDeployments/my-deployment". + string game_server_deployment = 9; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 5efd71ffc1c5..3b683739414d 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -1115,6 +1115,21 @@ grafeas 0.2.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-gameservices-v1alpha + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-gameservices + 0.0.1-SNAPSHOT + diff --git a/google-cloud-clients/google-cloud-gameservices/README.md b/google-cloud-clients/google-cloud-gameservices/README.md new file mode 100644 index 000000000000..eed0697c46c3 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/README.md @@ -0,0 +1,100 @@ +Google Cloud Java Client for Game Services API +=================================================== + +Java idiomatic client for [Game Services API][product-overview]. + +[![Kokoro CI](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.svg)](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.html) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-gameservices.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-gameservices.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) + +- [Product Documentation][product-docs] +- [Client Library Documentation][lib-docs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-gameservices:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-gameservices + 0.0.0 + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-gameservices:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-gameservices" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) section in the base directory's README. + +About Game Services API +---------------------------- + +[Game Services API][product-overview] Game Services API + +See the [Game Services API client library docs][lib-docs] to learn how to use this Game Services API Client Library. + +Getting Started +--------------- +#### Prerequisites +You will need a [Google Developers Console](https://console.developers.google.com/) project with the Game Services API API enabled. [Follow these instructions](https://cloud.google.com/resource-manager/docs/creating-managing-projects) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-gameservices` library. See the [Quickstart](#quickstart) section to add `google-cloud-gameservices` as a dependency in your code. + +Troubleshooting +--------------- + +To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting). + +Transport +--------- +Game Services API uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/googleapis/google-cloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/googleapis/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/googleapis/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/googleapis/google-cloud-java/blob/master/LICENSE +[cloud-platform]: https://cloud.google.com/ +[product-overview]: https://developers.google.com/games/services/ +[product-docs]: https://developers.google.com/games/services/ +[lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/gameservices/v1alpha/package-summary.html \ No newline at end of file diff --git a/google-cloud-clients/google-cloud-gameservices/pom.xml b/google-cloud-clients/google-cloud-gameservices/pom.xml new file mode 100644 index 000000000000..94169d7b23da --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + google-cloud-gameservices + 0.0.1-SNAPSHOT + jar + Game Services API + https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-gameservices + + Game Services API + + + com.google.cloud + google-cloud-clients + 0.99.1-alpha-SNAPSHOT + + + google-cloud-gameservices + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-gameservices-v1alpha + + + com.google.api.grpc + grpc-google-cloud-gameservices-v1alpha + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + ${project.groupId} + google-cloud-core + test-jar + test + + + junit + junit + test + + + org.easymock + easymock + test + + + org.objenesis + objenesis + test + + + com.google.truth + truth + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + com.google.api + gax-grpc + testlib + test + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/proto-google-cloud-gameservices-v1alpha/target/site/apidocs/ + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/grpc-google-cloud-gameservices-v1alpha/target/site/apidocs/ + + + + + + + diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClient.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClient.java new file mode 100644 index 000000000000..1af9561b1c59 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClient.java @@ -0,0 +1,900 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.gaming.v1alpha.stub.AllocationPoliciesServiceStub; +import com.google.cloud.gaming.v1alpha.stub.AllocationPoliciesServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The cloud gaming allocation policy is used as the controller's recipe for + * the allocating game servers from clusters. The policy has three modes: 1. Default mode which is + * not limited to time. 2. Time based mode which is temporary and overrides the default mode when + * effective. 3. Periodic mode which follows the time base mode, but happens periodically using + * local time, identified by cron specs. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+ *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+ *   AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the allocationPoliciesServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * AllocationPoliciesServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings =
+ *     AllocationPoliciesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AllocationPoliciesServiceClient allocationPoliciesServiceClient =
+ *     AllocationPoliciesServiceClient.create(allocationPoliciesServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings =
+ *     AllocationPoliciesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AllocationPoliciesServiceClient allocationPoliciesServiceClient =
+ *     AllocationPoliciesServiceClient.create(allocationPoliciesServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AllocationPoliciesServiceClient implements BackgroundResource { + private final AllocationPoliciesServiceSettings settings; + private final AllocationPoliciesServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate ALLOCATION_POLICY_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/allocationPolicies/{allocation_policy}"); + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + /** + * Formats a string containing the fully-qualified path to represent a allocation_policy resource. + * + * @deprecated Use the {@link AllocationPolicyName} class instead. + */ + @Deprecated + public static final String formatAllocationPolicyName( + String project, String location, String allocationPolicy) { + return ALLOCATION_POLICY_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "allocation_policy", allocationPolicy); + } + + /** + * Formats a string containing the fully-qualified path to represent a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String formatLocationName(String project, String location) { + return LOCATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location); + } + + /** + * Parses the project from the given fully-qualified path which represents a allocation_policy + * resource. + * + * @deprecated Use the {@link AllocationPolicyName} class instead. + */ + @Deprecated + public static final String parseProjectFromAllocationPolicyName(String allocationPolicyName) { + return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a allocation_policy + * resource. + * + * @deprecated Use the {@link AllocationPolicyName} class instead. + */ + @Deprecated + public static final String parseLocationFromAllocationPolicyName(String allocationPolicyName) { + return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("location"); + } + + /** + * Parses the allocation_policy from the given fully-qualified path which represents a + * allocation_policy resource. + * + * @deprecated Use the {@link AllocationPolicyName} class instead. + */ + @Deprecated + public static final String parseAllocationPolicyFromAllocationPolicyName( + String allocationPolicyName) { + return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("allocation_policy"); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseProjectFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseLocationFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); + } + + /** Constructs an instance of AllocationPoliciesServiceClient with default settings. */ + public static final AllocationPoliciesServiceClient create() throws IOException { + return create(AllocationPoliciesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AllocationPoliciesServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final AllocationPoliciesServiceClient create( + AllocationPoliciesServiceSettings settings) throws IOException { + return new AllocationPoliciesServiceClient(settings); + } + + /** + * Constructs an instance of AllocationPoliciesServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use AllocationPoliciesServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AllocationPoliciesServiceClient create(AllocationPoliciesServiceStub stub) { + return new AllocationPoliciesServiceClient(stub); + } + + /** + * Constructs an instance of AllocationPoliciesServiceClient, 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 AllocationPoliciesServiceClient(AllocationPoliciesServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((AllocationPoliciesServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AllocationPoliciesServiceClient(AllocationPoliciesServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AllocationPoliciesServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AllocationPoliciesServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List allocation policies in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (AllocationPolicy element : allocationPoliciesServiceClient.listAllocationPolicies(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAllocationPoliciesPagedResponse listAllocationPolicies(String parent) { + LOCATION_PATH_TEMPLATE.validate(parent, "listAllocationPolicies"); + ListAllocationPoliciesRequest request = + ListAllocationPoliciesRequest.newBuilder().setParent(parent).build(); + return listAllocationPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List allocation policies in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (AllocationPolicy element : allocationPoliciesServiceClient.listAllocationPolicies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAllocationPoliciesPagedResponse listAllocationPolicies( + ListAllocationPoliciesRequest request) { + return listAllocationPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List allocation policies in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListAllocationPoliciesPagedResponse> future = allocationPoliciesServiceClient.listAllocationPoliciesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (AllocationPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listAllocationPoliciesPagedCallable() { + return stub.listAllocationPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List allocation policies in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListAllocationPoliciesResponse response = allocationPoliciesServiceClient.listAllocationPoliciesCallable().call(request);
+   *     for (AllocationPolicy element : response.getAllocationPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listAllocationPoliciesCallable() { + return stub.listAllocationPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the allocation policy to retrieve, using the form: + *

`projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AllocationPolicy getAllocationPolicy(String name) { + ALLOCATION_POLICY_PATH_TEMPLATE.validate(name, "getAllocationPolicy"); + GetAllocationPolicyRequest request = + GetAllocationPolicyRequest.newBuilder().setName(name).build(); + return getAllocationPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   GetAllocationPolicyRequest request = GetAllocationPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AllocationPolicy getAllocationPolicy(GetAllocationPolicyRequest request) { + return getAllocationPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   GetAllocationPolicyRequest request = GetAllocationPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<AllocationPolicy> future = allocationPoliciesServiceClient.getAllocationPolicyCallable().futureCall(request);
+   *   // Do something
+   *   AllocationPolicy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getAllocationPolicyCallable() { + return stub.getAllocationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new allocation policy in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String allocationPolicyId = "";
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   AllocationPolicy response = allocationPoliciesServiceClient.createAllocationPolicyAsync(formattedParent, allocationPolicyId, allocationPolicy).get();
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @param allocationPolicyId Required. The ID of the allocation policy resource to be created. + * @param allocationPolicy Required. The allocation policy resource to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createAllocationPolicyAsync( + String parent, String allocationPolicyId, AllocationPolicy allocationPolicy) { + LOCATION_PATH_TEMPLATE.validate(parent, "createAllocationPolicy"); + CreateAllocationPolicyRequest request = + CreateAllocationPolicyRequest.newBuilder() + .setParent(parent) + .setAllocationPolicyId(allocationPolicyId) + .setAllocationPolicy(allocationPolicy) + .build(); + return createAllocationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new allocation policy in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String allocationPolicyId = "";
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setAllocationPolicyId(allocationPolicyId)
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .build();
+   *   AllocationPolicy response = allocationPoliciesServiceClient.createAllocationPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createAllocationPolicyAsync( + CreateAllocationPolicyRequest request) { + return createAllocationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new allocation policy in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String allocationPolicyId = "";
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setAllocationPolicyId(allocationPolicyId)
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .build();
+   *   OperationFuture<AllocationPolicy, Empty> future = allocationPoliciesServiceClient.createAllocationPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   AllocationPolicy response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createAllocationPolicyOperationCallable() { + return stub.createAllocationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new allocation policy in a given project and location. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String allocationPolicyId = "";
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setAllocationPolicyId(allocationPolicyId)
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .build();
+   *   ApiFuture<Operation> future = allocationPoliciesServiceClient.createAllocationPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createAllocationPolicyCallable() { + return stub.createAllocationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   allocationPoliciesServiceClient.deleteAllocationPolicyAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the allocation policy to delete, using the form: + *

`projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteAllocationPolicyAsync(String name) { + ALLOCATION_POLICY_PATH_TEMPLATE.validate(name, "deleteAllocationPolicy"); + DeleteAllocationPolicyRequest request = + DeleteAllocationPolicyRequest.newBuilder().setName(name).build(); + return deleteAllocationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   allocationPoliciesServiceClient.deleteAllocationPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteAllocationPolicyAsync( + DeleteAllocationPolicyRequest request) { + return deleteAllocationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = allocationPoliciesServiceClient.deleteAllocationPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteAllocationPolicyOperationCallable() { + return stub.deleteAllocationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+   *   DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = allocationPoliciesServiceClient.deleteAllocationPolicyCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteAllocationPolicyCallable() { + return stub.deleteAllocationPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AllocationPolicy response = allocationPoliciesServiceClient.updateAllocationPolicyAsync(allocationPolicy, updateMask).get();
+   * }
+   * 
+ * + * @param allocationPolicy Required. The allocation policy to be updated. Only fields specified in + * update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + *

https: //developers.google.com/protocol-buffers // + * /docs/reference/google.protobuf#fieldmask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateAllocationPolicyAsync( + AllocationPolicy allocationPolicy, FieldMask updateMask) { + + UpdateAllocationPolicyRequest request = + UpdateAllocationPolicyRequest.newBuilder() + .setAllocationPolicy(allocationPolicy) + .setUpdateMask(updateMask) + .build(); + return updateAllocationPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   AllocationPolicy response = allocationPoliciesServiceClient.updateAllocationPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateAllocationPolicyAsync( + UpdateAllocationPolicyRequest request) { + return updateAllocationPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<AllocationPolicy, Empty> future = allocationPoliciesServiceClient.updateAllocationPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   AllocationPolicy response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateAllocationPolicyOperationCallable() { + return stub.updateAllocationPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single allocation policy. + * + *

Sample code: + * + *


+   * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+   *   AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
+   *     .setAllocationPolicy(allocationPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = allocationPoliciesServiceClient.updateAllocationPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateAllocationPolicyCallable() { + return stub.updateAllocationPolicyCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListAllocationPoliciesPagedResponse + extends AbstractPagedListResponse< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + AllocationPolicy, + ListAllocationPoliciesPage, + ListAllocationPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAllocationPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAllocationPoliciesPagedResponse apply(ListAllocationPoliciesPage input) { + return new ListAllocationPoliciesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAllocationPoliciesPagedResponse(ListAllocationPoliciesPage page) { + super(page, ListAllocationPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAllocationPoliciesPage + extends AbstractPage< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + AllocationPolicy, + ListAllocationPoliciesPage> { + + private ListAllocationPoliciesPage( + PageContext + context, + ListAllocationPoliciesResponse response) { + super(context, response); + } + + private static ListAllocationPoliciesPage createEmptyPage() { + return new ListAllocationPoliciesPage(null, null); + } + + @Override + protected ListAllocationPoliciesPage createPage( + PageContext + context, + ListAllocationPoliciesResponse response) { + return new ListAllocationPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAllocationPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + AllocationPolicy, + ListAllocationPoliciesPage, + ListAllocationPoliciesFixedSizeCollection> { + + private ListAllocationPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAllocationPoliciesFixedSizeCollection createEmptyCollection() { + return new ListAllocationPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListAllocationPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAllocationPoliciesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceSettings.java new file mode 100644 index 000000000000..90b0833d0dc1 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceSettings.java @@ -0,0 +1,294 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gaming.v1alpha.stub.AllocationPoliciesServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AllocationPoliciesServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getAllocationPolicy to 30 seconds: + * + *

+ * 
+ * AllocationPoliciesServiceSettings.Builder allocationPoliciesServiceSettingsBuilder =
+ *     AllocationPoliciesServiceSettings.newBuilder();
+ * allocationPoliciesServiceSettingsBuilder.getAllocationPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings = allocationPoliciesServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AllocationPoliciesServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to listAllocationPolicies. */ + public PagedCallSettings< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .listAllocationPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getAllocationPolicy. */ + public UnaryCallSettings + getAllocationPolicySettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .getAllocationPolicySettings(); + } + + /** Returns the object with the settings used for calls to createAllocationPolicy. */ + public UnaryCallSettings + createAllocationPolicySettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .createAllocationPolicySettings(); + } + + /** Returns the object with the settings used for calls to createAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createAllocationPolicyOperationSettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .createAllocationPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteAllocationPolicy. */ + public UnaryCallSettings + deleteAllocationPolicySettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .deleteAllocationPolicySettings(); + } + + /** Returns the object with the settings used for calls to deleteAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteAllocationPolicyOperationSettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .deleteAllocationPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateAllocationPolicy. */ + public UnaryCallSettings + updateAllocationPolicySettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .updateAllocationPolicySettings(); + } + + /** Returns the object with the settings used for calls to updateAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateAllocationPolicyOperationSettings() { + return ((AllocationPoliciesServiceStubSettings) getStubSettings()) + .updateAllocationPolicyOperationSettings(); + } + + public static final AllocationPoliciesServiceSettings create( + AllocationPoliciesServiceStubSettings stub) throws IOException { + return new AllocationPoliciesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AllocationPoliciesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AllocationPoliciesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AllocationPoliciesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AllocationPoliciesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AllocationPoliciesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AllocationPoliciesServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AllocationPoliciesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AllocationPoliciesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AllocationPoliciesServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AllocationPoliciesServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AllocationPoliciesServiceStubSettings.newBuilder()); + } + + protected Builder(AllocationPoliciesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AllocationPoliciesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AllocationPoliciesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AllocationPoliciesServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listAllocationPolicies. */ + public PagedCallSettings.Builder< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings() { + return getStubSettingsBuilder().listAllocationPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getAllocationPolicy. */ + public UnaryCallSettings.Builder + getAllocationPolicySettings() { + return getStubSettingsBuilder().getAllocationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createAllocationPolicy. */ + public UnaryCallSettings.Builder + createAllocationPolicySettings() { + return getStubSettingsBuilder().createAllocationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createAllocationPolicyOperationSettings() { + return getStubSettingsBuilder().createAllocationPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAllocationPolicy. */ + public UnaryCallSettings.Builder + deleteAllocationPolicySettings() { + return getStubSettingsBuilder().deleteAllocationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to deleteAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteAllocationPolicyOperationSettings() { + return getStubSettingsBuilder().deleteAllocationPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateAllocationPolicy. */ + public UnaryCallSettings.Builder + updateAllocationPolicySettings() { + return getStubSettingsBuilder().updateAllocationPolicySettings(); + } + + /** Returns the builder for the settings used for calls to updateAllocationPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateAllocationPolicyOperationSettings() { + return getStubSettingsBuilder().updateAllocationPolicyOperationSettings(); + } + + @Override + public AllocationPoliciesServiceSettings build() throws IOException { + return new AllocationPoliciesServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClient.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClient.java new file mode 100644 index 000000000000..acc2b55da2f0 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClient.java @@ -0,0 +1,928 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.gaming.v1alpha.stub.GameServerClustersServiceStub; +import com.google.cloud.gaming.v1alpha.stub.GameServerClustersServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The game server cluster is used to capture the game server cluster's + * settings which are used to manage game server clusters. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+ *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the gameServerClustersServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * GameServerClustersServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * GameServerClustersServiceSettings gameServerClustersServiceSettings =
+ *     GameServerClustersServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GameServerClustersServiceClient gameServerClustersServiceClient =
+ *     GameServerClustersServiceClient.create(gameServerClustersServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GameServerClustersServiceSettings gameServerClustersServiceSettings =
+ *     GameServerClustersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GameServerClustersServiceClient gameServerClustersServiceClient =
+ *     GameServerClustersServiceClient.create(gameServerClustersServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerClustersServiceClient implements BackgroundResource { + private final GameServerClustersServiceSettings settings; + private final GameServerClustersServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate GAME_SERVER_CLUSTER_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{game_server_cluster}"); + + private static final PathTemplate REALM_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/realms/{realm}"); + + /** + * Formats a string containing the fully-qualified path to represent a game_server_cluster + * resource. + * + * @deprecated Use the {@link GameServerClusterName} class instead. + */ + @Deprecated + public static final String formatGameServerClusterName( + String project, String location, String realm, String gameServerCluster) { + return GAME_SERVER_CLUSTER_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "realm", realm, + "game_server_cluster", gameServerCluster); + } + + /** + * Formats a string containing the fully-qualified path to represent a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String formatRealmName(String project, String location, String realm) { + return REALM_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "realm", realm); + } + + /** + * Parses the project from the given fully-qualified path which represents a game_server_cluster + * resource. + * + * @deprecated Use the {@link GameServerClusterName} class instead. + */ + @Deprecated + public static final String parseProjectFromGameServerClusterName(String gameServerClusterName) { + return GAME_SERVER_CLUSTER_PATH_TEMPLATE.parse(gameServerClusterName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a game_server_cluster + * resource. + * + * @deprecated Use the {@link GameServerClusterName} class instead. + */ + @Deprecated + public static final String parseLocationFromGameServerClusterName(String gameServerClusterName) { + return GAME_SERVER_CLUSTER_PATH_TEMPLATE.parse(gameServerClusterName).get("location"); + } + + /** + * Parses the realm from the given fully-qualified path which represents a game_server_cluster + * resource. + * + * @deprecated Use the {@link GameServerClusterName} class instead. + */ + @Deprecated + public static final String parseRealmFromGameServerClusterName(String gameServerClusterName) { + return GAME_SERVER_CLUSTER_PATH_TEMPLATE.parse(gameServerClusterName).get("realm"); + } + + /** + * Parses the game_server_cluster from the given fully-qualified path which represents a + * game_server_cluster resource. + * + * @deprecated Use the {@link GameServerClusterName} class instead. + */ + @Deprecated + public static final String parseGameServerClusterFromGameServerClusterName( + String gameServerClusterName) { + return GAME_SERVER_CLUSTER_PATH_TEMPLATE + .parse(gameServerClusterName) + .get("game_server_cluster"); + } + + /** + * Parses the project from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseProjectFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseLocationFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("location"); + } + + /** + * Parses the realm from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseRealmFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("realm"); + } + + /** Constructs an instance of GameServerClustersServiceClient with default settings. */ + public static final GameServerClustersServiceClient create() throws IOException { + return create(GameServerClustersServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GameServerClustersServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final GameServerClustersServiceClient create( + GameServerClustersServiceSettings settings) throws IOException { + return new GameServerClustersServiceClient(settings); + } + + /** + * Constructs an instance of GameServerClustersServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use GameServerClustersServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GameServerClustersServiceClient create(GameServerClustersServiceStub stub) { + return new GameServerClustersServiceClient(stub); + } + + /** + * Constructs an instance of GameServerClustersServiceClient, 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 GameServerClustersServiceClient(GameServerClustersServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((GameServerClustersServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GameServerClustersServiceClient(GameServerClustersServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final GameServerClustersServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GameServerClustersServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server clusters in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   for (GameServerCluster element : gameServerClustersServiceClient.listGameServerClusters(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * "projects/{project_id}/locations/{location}/realms/{realm-id}". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListGameServerClustersPagedResponse listGameServerClusters(String parent) { + REALM_PATH_TEMPLATE.validate(parent, "listGameServerClusters"); + ListGameServerClustersRequest request = + ListGameServerClustersRequest.newBuilder().setParent(parent).build(); + return listGameServerClusters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server clusters in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   ListGameServerClustersRequest request = ListGameServerClustersRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (GameServerCluster element : gameServerClustersServiceClient.listGameServerClusters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListGameServerClustersPagedResponse listGameServerClusters( + ListGameServerClustersRequest request) { + return listGameServerClustersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server clusters in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   ListGameServerClustersRequest request = ListGameServerClustersRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListGameServerClustersPagedResponse> future = gameServerClustersServiceClient.listGameServerClustersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (GameServerCluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listGameServerClustersPagedCallable() { + return stub.listGameServerClustersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server clusters in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   ListGameServerClustersRequest request = ListGameServerClustersRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListGameServerClustersResponse response = gameServerClustersServiceClient.listGameServerClustersCallable().call(request);
+   *     for (GameServerCluster element : response.getGameServerClustersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listGameServerClustersCallable() { + return stub.listGameServerClustersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the game server cluster to retrieve, using the form: + *

`projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GameServerCluster getGameServerCluster(String name) { + GAME_SERVER_CLUSTER_PATH_TEMPLATE.validate(name, "getGameServerCluster"); + GetGameServerClusterRequest request = + GetGameServerClusterRequest.newBuilder().setName(name).build(); + return getGameServerCluster(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   GetGameServerClusterRequest request = GetGameServerClusterRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest request) { + return getGameServerClusterCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   GetGameServerClusterRequest request = GetGameServerClusterRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<GameServerCluster> future = gameServerClustersServiceClient.getGameServerClusterCallable().futureCall(request);
+   *   // Do something
+   *   GameServerCluster response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getGameServerClusterCallable() { + return stub.getGameServerClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server cluster in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   String gameServerClusterId = "";
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   GameServerCluster response = gameServerClustersServiceClient.createGameServerClusterAsync(formattedParent, gameServerClusterId, gameServerCluster).get();
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}/realms/{realm-id}`. + * @param gameServerClusterId Required. The ID of the game server cluster resource to be created. + * @param gameServerCluster Required. The game server cluster resource to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createGameServerClusterAsync( + String parent, String gameServerClusterId, GameServerCluster gameServerCluster) { + REALM_PATH_TEMPLATE.validate(parent, "createGameServerCluster"); + CreateGameServerClusterRequest request = + CreateGameServerClusterRequest.newBuilder() + .setParent(parent) + .setGameServerClusterId(gameServerClusterId) + .setGameServerCluster(gameServerCluster) + .build(); + return createGameServerClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server cluster in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   String gameServerClusterId = "";
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   CreateGameServerClusterRequest request = CreateGameServerClusterRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setGameServerClusterId(gameServerClusterId)
+   *     .setGameServerCluster(gameServerCluster)
+   *     .build();
+   *   GameServerCluster response = gameServerClustersServiceClient.createGameServerClusterAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createGameServerClusterAsync( + CreateGameServerClusterRequest request) { + return createGameServerClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server cluster in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   String gameServerClusterId = "";
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   CreateGameServerClusterRequest request = CreateGameServerClusterRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setGameServerClusterId(gameServerClusterId)
+   *     .setGameServerCluster(gameServerCluster)
+   *     .build();
+   *   OperationFuture<GameServerCluster, Empty> future = gameServerClustersServiceClient.createGameServerClusterOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerCluster response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createGameServerClusterOperationCallable() { + return stub.createGameServerClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server cluster in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedParent = GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   String gameServerClusterId = "";
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   CreateGameServerClusterRequest request = CreateGameServerClusterRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setGameServerClusterId(gameServerClusterId)
+   *     .setGameServerCluster(gameServerCluster)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerClustersServiceClient.createGameServerClusterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createGameServerClusterCallable() { + return stub.createGameServerClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server cluster to delete, using the form: + *

`projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteGameServerClusterAsync(String name) { + GAME_SERVER_CLUSTER_PATH_TEMPLATE.validate(name, "deleteGameServerCluster"); + DeleteGameServerClusterRequest request = + DeleteGameServerClusterRequest.newBuilder().setName(name).build(); + return deleteGameServerClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   DeleteGameServerClusterRequest request = DeleteGameServerClusterRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteGameServerClusterAsync( + DeleteGameServerClusterRequest request) { + return deleteGameServerClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   DeleteGameServerClusterRequest request = DeleteGameServerClusterRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = gameServerClustersServiceClient.deleteGameServerClusterOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteGameServerClusterOperationCallable() { + return stub.deleteGameServerClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+   *   DeleteGameServerClusterRequest request = DeleteGameServerClusterRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerClustersServiceClient.deleteGameServerClusterCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteGameServerClusterCallable() { + return stub.deleteGameServerClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerCluster response = gameServerClustersServiceClient.updateGameServerClusterAsync(gameServerCluster, updateMask).get();
+   * }
+   * 
+ * + * @param gameServerCluster Required. The game server cluster to be updated. Only fields specified + * in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + *

https: //developers.google.com/protocol-buffers // + * /docs/reference/google.protobuf#fieldmask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateGameServerClusterAsync( + GameServerCluster gameServerCluster, FieldMask updateMask) { + + UpdateGameServerClusterRequest request = + UpdateGameServerClusterRequest.newBuilder() + .setGameServerCluster(gameServerCluster) + .setUpdateMask(updateMask) + .build(); + return updateGameServerClusterAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerClusterRequest request = UpdateGameServerClusterRequest.newBuilder()
+   *     .setGameServerCluster(gameServerCluster)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   GameServerCluster response = gameServerClustersServiceClient.updateGameServerClusterAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateGameServerClusterAsync( + UpdateGameServerClusterRequest request) { + return updateGameServerClusterOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerClusterRequest request = UpdateGameServerClusterRequest.newBuilder()
+   *     .setGameServerCluster(gameServerCluster)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<GameServerCluster, Empty> future = gameServerClustersServiceClient.updateGameServerClusterOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerCluster response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateGameServerClusterOperationCallable() { + return stub.updateGameServerClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single game server cluster. + * + *

Sample code: + * + *


+   * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerClusterRequest request = UpdateGameServerClusterRequest.newBuilder()
+   *     .setGameServerCluster(gameServerCluster)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerClustersServiceClient.updateGameServerClusterCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateGameServerClusterCallable() { + return stub.updateGameServerClusterCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListGameServerClustersPagedResponse + extends AbstractPagedListResponse< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + GameServerCluster, + ListGameServerClustersPage, + ListGameServerClustersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListGameServerClustersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListGameServerClustersPagedResponse apply(ListGameServerClustersPage input) { + return new ListGameServerClustersPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListGameServerClustersPagedResponse(ListGameServerClustersPage page) { + super(page, ListGameServerClustersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListGameServerClustersPage + extends AbstractPage< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + GameServerCluster, + ListGameServerClustersPage> { + + private ListGameServerClustersPage( + PageContext< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster> + context, + ListGameServerClustersResponse response) { + super(context, response); + } + + private static ListGameServerClustersPage createEmptyPage() { + return new ListGameServerClustersPage(null, null); + } + + @Override + protected ListGameServerClustersPage createPage( + PageContext< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster> + context, + ListGameServerClustersResponse response) { + return new ListGameServerClustersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListGameServerClustersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + GameServerCluster, + ListGameServerClustersPage, + ListGameServerClustersFixedSizeCollection> { + + private ListGameServerClustersFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListGameServerClustersFixedSizeCollection createEmptyCollection() { + return new ListGameServerClustersFixedSizeCollection(null, 0); + } + + @Override + protected ListGameServerClustersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListGameServerClustersFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java new file mode 100644 index 000000000000..0a3b80debcba --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java @@ -0,0 +1,294 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.GameServerClustersServiceClient.ListGameServerClustersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gaming.v1alpha.stub.GameServerClustersServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GameServerClustersServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGameServerCluster to 30 seconds: + * + *

+ * 
+ * GameServerClustersServiceSettings.Builder gameServerClustersServiceSettingsBuilder =
+ *     GameServerClustersServiceSettings.newBuilder();
+ * gameServerClustersServiceSettingsBuilder.getGameServerClusterSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GameServerClustersServiceSettings gameServerClustersServiceSettings = gameServerClustersServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerClustersServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to listGameServerClusters. */ + public PagedCallSettings< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .listGameServerClustersSettings(); + } + + /** Returns the object with the settings used for calls to getGameServerCluster. */ + public UnaryCallSettings + getGameServerClusterSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .getGameServerClusterSettings(); + } + + /** Returns the object with the settings used for calls to createGameServerCluster. */ + public UnaryCallSettings + createGameServerClusterSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .createGameServerClusterSettings(); + } + + /** Returns the object with the settings used for calls to createGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createGameServerClusterOperationSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .createGameServerClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteGameServerCluster. */ + public UnaryCallSettings + deleteGameServerClusterSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .deleteGameServerClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteGameServerClusterOperationSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .deleteGameServerClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateGameServerCluster. */ + public UnaryCallSettings + updateGameServerClusterSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .updateGameServerClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateGameServerClusterOperationSettings() { + return ((GameServerClustersServiceStubSettings) getStubSettings()) + .updateGameServerClusterOperationSettings(); + } + + public static final GameServerClustersServiceSettings create( + GameServerClustersServiceStubSettings stub) throws IOException { + return new GameServerClustersServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GameServerClustersServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return GameServerClustersServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return GameServerClustersServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GameServerClustersServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return GameServerClustersServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GameServerClustersServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GameServerClustersServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GameServerClustersServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for GameServerClustersServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GameServerClustersServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GameServerClustersServiceStubSettings.newBuilder()); + } + + protected Builder(GameServerClustersServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GameServerClustersServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public GameServerClustersServiceStubSettings.Builder getStubSettingsBuilder() { + return ((GameServerClustersServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listGameServerClusters. */ + public PagedCallSettings.Builder< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings() { + return getStubSettingsBuilder().listGameServerClustersSettings(); + } + + /** Returns the builder for the settings used for calls to getGameServerCluster. */ + public UnaryCallSettings.Builder + getGameServerClusterSettings() { + return getStubSettingsBuilder().getGameServerClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createGameServerCluster. */ + public UnaryCallSettings.Builder + createGameServerClusterSettings() { + return getStubSettingsBuilder().createGameServerClusterSettings(); + } + + /** Returns the builder for the settings used for calls to createGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createGameServerClusterOperationSettings() { + return getStubSettingsBuilder().createGameServerClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteGameServerCluster. */ + public UnaryCallSettings.Builder + deleteGameServerClusterSettings() { + return getStubSettingsBuilder().deleteGameServerClusterSettings(); + } + + /** Returns the builder for the settings used for calls to deleteGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteGameServerClusterOperationSettings() { + return getStubSettingsBuilder().deleteGameServerClusterOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateGameServerCluster. */ + public UnaryCallSettings.Builder + updateGameServerClusterSettings() { + return getStubSettingsBuilder().updateGameServerClusterSettings(); + } + + /** Returns the builder for the settings used for calls to updateGameServerCluster. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateGameServerClusterOperationSettings() { + return getStubSettingsBuilder().updateGameServerClusterOperationSettings(); + } + + @Override + public GameServerClustersServiceSettings build() throws IOException { + return new GameServerClustersServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java new file mode 100644 index 000000000000..edb69d89baf5 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java @@ -0,0 +1,1419 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.gaming.v1alpha.stub.GameServerDeploymentsServiceStub; +import com.google.cloud.gaming.v1alpha.stub.GameServerDeploymentsServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The game server deployment is used to configure the deployment of game + * server software to Agones Fleets in game server clusters. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+ *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+ *   GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the gameServerDeploymentsServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * GameServerDeploymentsServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * GameServerDeploymentsServiceSettings gameServerDeploymentsServiceSettings =
+ *     GameServerDeploymentsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create(gameServerDeploymentsServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GameServerDeploymentsServiceSettings gameServerDeploymentsServiceSettings =
+ *     GameServerDeploymentsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create(gameServerDeploymentsServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerDeploymentsServiceClient implements BackgroundResource { + private final GameServerDeploymentsServiceSettings settings; + private final GameServerDeploymentsServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/gameServerDeployments/{game_server_deployment}"); + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + /** + * Formats a string containing the fully-qualified path to represent a game_server_deployment + * resource. + * + * @deprecated Use the {@link GameServerDeploymentName} class instead. + */ + @Deprecated + public static final String formatGameServerDeploymentName( + String project, String location, String gameServerDeployment) { + return GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "game_server_deployment", gameServerDeployment); + } + + /** + * Formats a string containing the fully-qualified path to represent a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String formatLocationName(String project, String location) { + return LOCATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location); + } + + /** + * Parses the project from the given fully-qualified path which represents a + * game_server_deployment resource. + * + * @deprecated Use the {@link GameServerDeploymentName} class instead. + */ + @Deprecated + public static final String parseProjectFromGameServerDeploymentName( + String gameServerDeploymentName) { + return GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.parse(gameServerDeploymentName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a + * game_server_deployment resource. + * + * @deprecated Use the {@link GameServerDeploymentName} class instead. + */ + @Deprecated + public static final String parseLocationFromGameServerDeploymentName( + String gameServerDeploymentName) { + return GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.parse(gameServerDeploymentName).get("location"); + } + + /** + * Parses the game_server_deployment from the given fully-qualified path which represents a + * game_server_deployment resource. + * + * @deprecated Use the {@link GameServerDeploymentName} class instead. + */ + @Deprecated + public static final String parseGameServerDeploymentFromGameServerDeploymentName( + String gameServerDeploymentName) { + return GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE + .parse(gameServerDeploymentName) + .get("game_server_deployment"); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseProjectFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseLocationFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); + } + + /** Constructs an instance of GameServerDeploymentsServiceClient with default settings. */ + public static final GameServerDeploymentsServiceClient create() throws IOException { + return create(GameServerDeploymentsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of GameServerDeploymentsServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final GameServerDeploymentsServiceClient create( + GameServerDeploymentsServiceSettings settings) throws IOException { + return new GameServerDeploymentsServiceClient(settings); + } + + /** + * Constructs an instance of GameServerDeploymentsServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use GameServerDeploymentsServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GameServerDeploymentsServiceClient create( + GameServerDeploymentsServiceStub stub) { + return new GameServerDeploymentsServiceClient(stub); + } + + /** + * Constructs an instance of GameServerDeploymentsServiceClient, 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 GameServerDeploymentsServiceClient(GameServerDeploymentsServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((GameServerDeploymentsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GameServerDeploymentsServiceClient(GameServerDeploymentsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final GameServerDeploymentsServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GameServerDeploymentsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server deployments in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (GameServerDeployment element : gameServerDeploymentsServiceClient.listGameServerDeployments(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListGameServerDeploymentsPagedResponse listGameServerDeployments(String parent) { + LOCATION_PATH_TEMPLATE.validate(parent, "listGameServerDeployments"); + ListGameServerDeploymentsRequest request = + ListGameServerDeploymentsRequest.newBuilder().setParent(parent).build(); + return listGameServerDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server deployments in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (GameServerDeployment element : gameServerDeploymentsServiceClient.listGameServerDeployments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( + ListGameServerDeploymentsRequest request) { + return listGameServerDeploymentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server deployments in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListGameServerDeploymentsPagedResponse> future = gameServerDeploymentsServiceClient.listGameServerDeploymentsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (GameServerDeployment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListGameServerDeploymentsRequest, ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsPagedCallable() { + return stub.listGameServerDeploymentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists game server deployments in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListGameServerDeploymentsResponse response = gameServerDeploymentsServiceClient.listGameServerDeploymentsCallable().call(request);
+   *     for (GameServerDeployment element : response.getGameServerDeploymentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listGameServerDeploymentsCallable() { + return stub.listGameServerDeploymentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment to retrieve, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GameServerDeployment getGameServerDeployment(String name) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "getGameServerDeployment"); + GetGameServerDeploymentRequest request = + GetGameServerDeploymentRequest.newBuilder().setName(name).build(); + return getGameServerDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GetGameServerDeploymentRequest request = GetGameServerDeploymentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GameServerDeployment getGameServerDeployment( + GetGameServerDeploymentRequest request) { + return getGameServerDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GetGameServerDeploymentRequest request = GetGameServerDeploymentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<GameServerDeployment> future = gameServerDeploymentsServiceClient.getGameServerDeploymentCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getGameServerDeploymentCallable() { + return stub.getGameServerDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server deployment in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String deploymentId = "";
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(formattedParent, deploymentId, gameServerDeployment).get();
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @param deploymentId Required. The ID of the game server deployment resource to be created. + * @param gameServerDeployment Required. The game server deployment resource to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createGameServerDeploymentAsync( + String parent, String deploymentId, GameServerDeployment gameServerDeployment) { + LOCATION_PATH_TEMPLATE.validate(parent, "createGameServerDeployment"); + CreateGameServerDeploymentRequest request = + CreateGameServerDeploymentRequest.newBuilder() + .setParent(parent) + .setDeploymentId(deploymentId) + .setGameServerDeployment(gameServerDeployment) + .build(); + return createGameServerDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server deployment in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String deploymentId = "";
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setDeploymentId(deploymentId)
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createGameServerDeploymentAsync( + CreateGameServerDeploymentRequest request) { + return createGameServerDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server deployment in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String deploymentId = "";
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setDeploymentId(deploymentId)
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.createGameServerDeploymentOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createGameServerDeploymentOperationCallable() { + return stub.createGameServerDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new game server deployment in a given project and location. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String deploymentId = "";
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setDeploymentId(deploymentId)
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.createGameServerDeploymentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + createGameServerDeploymentCallable() { + return stub.createGameServerDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment to delete, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteGameServerDeploymentAsync(String name) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "deleteGameServerDeployment"); + DeleteGameServerDeploymentRequest request = + DeleteGameServerDeploymentRequest.newBuilder().setName(name).build(); + return deleteGameServerDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteGameServerDeploymentAsync( + DeleteGameServerDeploymentRequest request) { + return deleteGameServerDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = gameServerDeploymentsServiceClient.deleteGameServerDeploymentOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteGameServerDeploymentOperationCallable() { + return stub.deleteGameServerDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.deleteGameServerDeploymentCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteGameServerDeploymentCallable() { + return stub.deleteGameServerDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(gameServerDeployment, updateMask).get();
+   * }
+   * 
+ * + * @param gameServerDeployment Required. The game server deployment to be updated. Only fields + * specified in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + *

https: //developers.google.com/protocol-buffers // + * /docs/reference/google.protobuf#fieldmask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateGameServerDeploymentAsync( + GameServerDeployment gameServerDeployment, FieldMask updateMask) { + + UpdateGameServerDeploymentRequest request = + UpdateGameServerDeploymentRequest.newBuilder() + .setGameServerDeployment(gameServerDeployment) + .setUpdateMask(updateMask) + .build(); + return updateGameServerDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateGameServerDeploymentAsync( + UpdateGameServerDeploymentRequest request) { + return updateGameServerDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.updateGameServerDeploymentOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateGameServerDeploymentOperationCallable() { + return stub.updateGameServerDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a game server deployment. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
+   *     .setGameServerDeployment(gameServerDeployment)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.updateGameServerDeploymentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateGameServerDeploymentCallable() { + return stub.updateGameServerDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts rollout of this game server deployment based on the given game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(formattedName, newGameServerTemplate).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @param newGameServerTemplate Required. The game server template for the new rollout. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture startRolloutAsync( + String name, GameServerTemplate newGameServerTemplate) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "startRollout"); + StartRolloutRequest request = + StartRolloutRequest.newBuilder() + .setName(name) + .setNewGameServerTemplate(newGameServerTemplate) + .build(); + return startRolloutAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts rollout of this game server deployment based on the given game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
+   *   StartRolloutRequest request = StartRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setNewGameServerTemplate(newGameServerTemplate)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture startRolloutAsync( + StartRolloutRequest request) { + return startRolloutOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts rollout of this game server deployment based on the given game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
+   *   StartRolloutRequest request = StartRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setNewGameServerTemplate(newGameServerTemplate)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.startRolloutOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + startRolloutOperationCallable() { + return stub.startRolloutOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Starts rollout of this game server deployment based on the given game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
+   *   StartRolloutRequest request = StartRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setNewGameServerTemplate(newGameServerTemplate)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.startRolloutCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable startRolloutCallable() { + return stub.startRolloutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets rollout target for the ongoing game server deployment rollout in the specified clusters + * and based on the given rollout percentage. Default is 0. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(formattedName, clusterPercentageSelector).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @param clusterPercentageSelector Required. The percentage of game servers that should run the + * new game server template in the specified clusters. Default is 0. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture setRolloutTargetAsync( + String name, List clusterPercentageSelector) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "setRolloutTarget"); + SetRolloutTargetRequest request = + SetRolloutTargetRequest.newBuilder() + .setName(name) + .addAllClusterPercentageSelector(clusterPercentageSelector) + .build(); + return setRolloutTargetAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets rollout target for the ongoing game server deployment rollout in the specified clusters + * and based on the given rollout percentage. Default is 0. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
+   *   SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .addAllClusterPercentageSelector(clusterPercentageSelector)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture setRolloutTargetAsync( + SetRolloutTargetRequest request) { + return setRolloutTargetOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets rollout target for the ongoing game server deployment rollout in the specified clusters + * and based on the given rollout percentage. Default is 0. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
+   *   SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .addAllClusterPercentageSelector(clusterPercentageSelector)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.setRolloutTargetOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + setRolloutTargetOperationCallable() { + return stub.setRolloutTargetOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets rollout target for the ongoing game server deployment rollout in the specified clusters + * and based on the given rollout percentage. Default is 0. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
+   *   SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .addAllClusterPercentageSelector(clusterPercentageSelector)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.setRolloutTargetCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setRolloutTargetCallable() { + return stub.setRolloutTargetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture commitRolloutAsync(String name) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "commitRollout"); + CommitRolloutRequest request = CommitRolloutRequest.newBuilder().setName(name).build(); + return commitRolloutAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture commitRolloutAsync( + CommitRolloutRequest request) { + return commitRolloutOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.commitRolloutOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + commitRolloutOperationCallable() { + return stub.commitRolloutOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.commitRolloutCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable commitRolloutCallable() { + return stub.commitRolloutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment to deploy, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture revertRolloutAsync(String name) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "revertRollout"); + RevertRolloutRequest request = RevertRolloutRequest.newBuilder().setName(name).build(); + return revertRolloutAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture revertRolloutAsync( + RevertRolloutRequest request) { + return revertRolloutOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.revertRolloutOperationCallable().futureCall(request);
+   *   // Do something
+   *   GameServerDeployment response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + revertRolloutOperationCallable() { + return stub.revertRolloutOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in + * all clusters whose labels match labels in the game server template. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = gameServerDeploymentsServiceClient.revertRolloutCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable revertRolloutCallable() { + return stub.revertRolloutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves information on the rollout target of the deployment, e.g. the target percentage of + * game servers running stable_game_server_template and new_game_server_template in clusters. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the game server deployment, using the form: + *

`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeploymentTarget getDeploymentTarget(String name) { + GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "getDeploymentTarget"); + GetDeploymentTargetRequest request = + GetDeploymentTargetRequest.newBuilder().setName(name).build(); + return getDeploymentTarget(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves information on the rollout target of the deployment, e.g. the target percentage of + * game servers running stable_game_server_template and new_game_server_template in clusters. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeploymentTarget getDeploymentTarget(GetDeploymentTargetRequest request) { + return getDeploymentTargetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves information on the rollout target of the deployment, e.g. the target percentage of + * game servers running stable_game_server_template and new_game_server_template in clusters. + * + *

Sample code: + * + *


+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+   *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+   *   GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<DeploymentTarget> future = gameServerDeploymentsServiceClient.getDeploymentTargetCallable().futureCall(request);
+   *   // Do something
+   *   DeploymentTarget response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getDeploymentTargetCallable() { + return stub.getDeploymentTargetCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListGameServerDeploymentsPagedResponse + extends AbstractPagedListResponse< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment, + ListGameServerDeploymentsPage, + ListGameServerDeploymentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListGameServerDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListGameServerDeploymentsPagedResponse apply( + ListGameServerDeploymentsPage input) { + return new ListGameServerDeploymentsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListGameServerDeploymentsPagedResponse(ListGameServerDeploymentsPage page) { + super(page, ListGameServerDeploymentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListGameServerDeploymentsPage + extends AbstractPage< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment, + ListGameServerDeploymentsPage> { + + private ListGameServerDeploymentsPage( + PageContext< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment> + context, + ListGameServerDeploymentsResponse response) { + super(context, response); + } + + private static ListGameServerDeploymentsPage createEmptyPage() { + return new ListGameServerDeploymentsPage(null, null); + } + + @Override + protected ListGameServerDeploymentsPage createPage( + PageContext< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment> + context, + ListGameServerDeploymentsResponse response) { + return new ListGameServerDeploymentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListGameServerDeploymentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment, + ListGameServerDeploymentsPage, + ListGameServerDeploymentsFixedSizeCollection> { + + private ListGameServerDeploymentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListGameServerDeploymentsFixedSizeCollection createEmptyCollection() { + return new ListGameServerDeploymentsFixedSizeCollection(null, 0); + } + + @Override + protected ListGameServerDeploymentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListGameServerDeploymentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceSettings.java new file mode 100644 index 000000000000..ff81d3c4b3bd --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceSettings.java @@ -0,0 +1,419 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gaming.v1alpha.stub.GameServerDeploymentsServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GameServerDeploymentsServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGameServerDeployment to 30 seconds: + * + *

+ * 
+ * GameServerDeploymentsServiceSettings.Builder gameServerDeploymentsServiceSettingsBuilder =
+ *     GameServerDeploymentsServiceSettings.newBuilder();
+ * gameServerDeploymentsServiceSettingsBuilder.getGameServerDeploymentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GameServerDeploymentsServiceSettings gameServerDeploymentsServiceSettings = gameServerDeploymentsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerDeploymentsServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to listGameServerDeployments. */ + public PagedCallSettings< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .listGameServerDeploymentsSettings(); + } + + /** Returns the object with the settings used for calls to getGameServerDeployment. */ + public UnaryCallSettings + getGameServerDeploymentSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .getGameServerDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to createGameServerDeployment. */ + public UnaryCallSettings + createGameServerDeploymentSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .createGameServerDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to createGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createGameServerDeploymentOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .createGameServerDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteGameServerDeployment. */ + public UnaryCallSettings + deleteGameServerDeploymentSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .deleteGameServerDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to deleteGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteGameServerDeploymentOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .deleteGameServerDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateGameServerDeployment. */ + public UnaryCallSettings + updateGameServerDeploymentSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .updateGameServerDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to updateGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateGameServerDeploymentOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .updateGameServerDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to startRollout. */ + public UnaryCallSettings startRolloutSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()).startRolloutSettings(); + } + + /** Returns the object with the settings used for calls to startRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + startRolloutOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .startRolloutOperationSettings(); + } + + /** Returns the object with the settings used for calls to setRolloutTarget. */ + public UnaryCallSettings setRolloutTargetSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .setRolloutTargetSettings(); + } + + /** Returns the object with the settings used for calls to setRolloutTarget. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + setRolloutTargetOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .setRolloutTargetOperationSettings(); + } + + /** Returns the object with the settings used for calls to commitRollout. */ + public UnaryCallSettings commitRolloutSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()).commitRolloutSettings(); + } + + /** Returns the object with the settings used for calls to commitRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + commitRolloutOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .commitRolloutOperationSettings(); + } + + /** Returns the object with the settings used for calls to revertRollout. */ + public UnaryCallSettings revertRolloutSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()).revertRolloutSettings(); + } + + /** Returns the object with the settings used for calls to revertRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + revertRolloutOperationSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .revertRolloutOperationSettings(); + } + + /** Returns the object with the settings used for calls to getDeploymentTarget. */ + public UnaryCallSettings + getDeploymentTargetSettings() { + return ((GameServerDeploymentsServiceStubSettings) getStubSettings()) + .getDeploymentTargetSettings(); + } + + public static final GameServerDeploymentsServiceSettings create( + GameServerDeploymentsServiceStubSettings stub) throws IOException { + return new GameServerDeploymentsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GameServerDeploymentsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return GameServerDeploymentsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return GameServerDeploymentsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GameServerDeploymentsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return GameServerDeploymentsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GameServerDeploymentsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GameServerDeploymentsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GameServerDeploymentsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for GameServerDeploymentsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GameServerDeploymentsServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GameServerDeploymentsServiceStubSettings.newBuilder()); + } + + protected Builder(GameServerDeploymentsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GameServerDeploymentsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public GameServerDeploymentsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((GameServerDeploymentsServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listGameServerDeployments. */ + public PagedCallSettings.Builder< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings() { + return getStubSettingsBuilder().listGameServerDeploymentsSettings(); + } + + /** Returns the builder for the settings used for calls to getGameServerDeployment. */ + public UnaryCallSettings.Builder + getGameServerDeploymentSettings() { + return getStubSettingsBuilder().getGameServerDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to createGameServerDeployment. */ + public UnaryCallSettings.Builder + createGameServerDeploymentSettings() { + return getStubSettingsBuilder().createGameServerDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to createGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateGameServerDeploymentRequest, GameServerDeployment, Empty> + createGameServerDeploymentOperationSettings() { + return getStubSettingsBuilder().createGameServerDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteGameServerDeployment. */ + public UnaryCallSettings.Builder + deleteGameServerDeploymentSettings() { + return getStubSettingsBuilder().deleteGameServerDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteGameServerDeploymentOperationSettings() { + return getStubSettingsBuilder().deleteGameServerDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateGameServerDeployment. */ + public UnaryCallSettings.Builder + updateGameServerDeploymentSettings() { + return getStubSettingsBuilder().updateGameServerDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to updateGameServerDeployment. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateGameServerDeploymentRequest, GameServerDeployment, Empty> + updateGameServerDeploymentOperationSettings() { + return getStubSettingsBuilder().updateGameServerDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to startRollout. */ + public UnaryCallSettings.Builder startRolloutSettings() { + return getStubSettingsBuilder().startRolloutSettings(); + } + + /** Returns the builder for the settings used for calls to startRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + startRolloutOperationSettings() { + return getStubSettingsBuilder().startRolloutOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setRolloutTarget. */ + public UnaryCallSettings.Builder + setRolloutTargetSettings() { + return getStubSettingsBuilder().setRolloutTargetSettings(); + } + + /** Returns the builder for the settings used for calls to setRolloutTarget. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + setRolloutTargetOperationSettings() { + return getStubSettingsBuilder().setRolloutTargetOperationSettings(); + } + + /** Returns the builder for the settings used for calls to commitRollout. */ + public UnaryCallSettings.Builder commitRolloutSettings() { + return getStubSettingsBuilder().commitRolloutSettings(); + } + + /** Returns the builder for the settings used for calls to commitRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + commitRolloutOperationSettings() { + return getStubSettingsBuilder().commitRolloutOperationSettings(); + } + + /** Returns the builder for the settings used for calls to revertRollout. */ + public UnaryCallSettings.Builder revertRolloutSettings() { + return getStubSettingsBuilder().revertRolloutSettings(); + } + + /** Returns the builder for the settings used for calls to revertRollout. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + revertRolloutOperationSettings() { + return getStubSettingsBuilder().revertRolloutOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getDeploymentTarget. */ + public UnaryCallSettings.Builder + getDeploymentTargetSettings() { + return getStubSettingsBuilder().getDeploymentTargetSettings(); + } + + @Override + public GameServerDeploymentsServiceSettings build() throws IOException { + return new GameServerDeploymentsServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceClient.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceClient.java new file mode 100644 index 000000000000..1000dcdc7db2 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceClient.java @@ -0,0 +1,860 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.gaming.v1alpha.stub.RealmsServiceStub; +import com.google.cloud.gaming.v1alpha.stub.RealmsServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Realm provides grouping of game server clusters that are serving particular + * gamer population. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+ *   Realm response = realmsServiceClient.getRealm(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the realmsServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of RealmsServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * RealmsServiceSettings realmsServiceSettings =
+ *     RealmsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RealmsServiceClient realmsServiceClient =
+ *     RealmsServiceClient.create(realmsServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RealmsServiceSettings realmsServiceSettings =
+ *     RealmsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RealmsServiceClient realmsServiceClient =
+ *     RealmsServiceClient.create(realmsServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RealmsServiceClient implements BackgroundResource { + private final RealmsServiceSettings settings; + private final RealmsServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private static final PathTemplate REALM_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/realms/{realm}"); + + /** + * Formats a string containing the fully-qualified path to represent a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String formatLocationName(String project, String location) { + return LOCATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location); + } + + /** + * Formats a string containing the fully-qualified path to represent a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String formatRealmName(String project, String location, String realm) { + return REALM_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "realm", realm); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseProjectFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseLocationFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); + } + + /** + * Parses the project from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseProjectFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseLocationFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("location"); + } + + /** + * Parses the realm from the given fully-qualified path which represents a realm resource. + * + * @deprecated Use the {@link RealmName} class instead. + */ + @Deprecated + public static final String parseRealmFromRealmName(String realmName) { + return REALM_PATH_TEMPLATE.parse(realmName).get("realm"); + } + + /** Constructs an instance of RealmsServiceClient with default settings. */ + public static final RealmsServiceClient create() throws IOException { + return create(RealmsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RealmsServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final RealmsServiceClient create(RealmsServiceSettings settings) + throws IOException { + return new RealmsServiceClient(settings); + } + + /** + * Constructs an instance of RealmsServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer to use RealmsServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RealmsServiceClient create(RealmsServiceStub stub) { + return new RealmsServiceClient(stub); + } + + /** + * Constructs an instance of RealmsServiceClient, 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 RealmsServiceClient(RealmsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RealmsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RealmsServiceClient(RealmsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final RealmsServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RealmsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists realms in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (Realm element : realmsServiceClient.listRealms(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRealmsPagedResponse listRealms(String parent) { + LOCATION_PATH_TEMPLATE.validate(parent, "listRealms"); + ListRealmsRequest request = ListRealmsRequest.newBuilder().setParent(parent).build(); + return listRealms(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists realms in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListRealmsRequest request = ListRealmsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Realm element : realmsServiceClient.listRealms(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRealmsPagedResponse listRealms(ListRealmsRequest request) { + return listRealmsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists realms in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListRealmsRequest request = ListRealmsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListRealmsPagedResponse> future = realmsServiceClient.listRealmsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Realm element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listRealmsPagedCallable() { + return stub.listRealmsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists realms in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListRealmsRequest request = ListRealmsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListRealmsResponse response = realmsServiceClient.listRealmsCallable().call(request);
+   *     for (Realm element : response.getRealmsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listRealmsCallable() { + return stub.listRealmsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   Realm response = realmsServiceClient.getRealm(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the realm to retrieve, using the form: + * `projects/{project_id}/locations/{location}/realms/{realm_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Realm getRealm(String name) { + REALM_PATH_TEMPLATE.validate(name, "getRealm"); + GetRealmRequest request = GetRealmRequest.newBuilder().setName(name).build(); + return getRealm(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   GetRealmRequest request = GetRealmRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Realm response = realmsServiceClient.getRealm(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Realm getRealm(GetRealmRequest request) { + return getRealmCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   GetRealmRequest request = GetRealmRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Realm> future = realmsServiceClient.getRealmCallable().futureCall(request);
+   *   // Do something
+   *   Realm response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getRealmCallable() { + return stub.getRealmCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new Realm in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String realmId = "";
+   *   Realm realm = Realm.newBuilder().build();
+   *   Realm response = realmsServiceClient.createRealmAsync(formattedParent, realmId, realm).get();
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @param realmId Required. The ID of the realm resource to be created. + * @param realm Required. The realm resource to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createRealmAsync( + String parent, String realmId, Realm realm) { + LOCATION_PATH_TEMPLATE.validate(parent, "createRealm"); + CreateRealmRequest request = + CreateRealmRequest.newBuilder() + .setParent(parent) + .setRealmId(realmId) + .setRealm(realm) + .build(); + return createRealmAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new Realm in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String realmId = "";
+   *   Realm realm = Realm.newBuilder().build();
+   *   CreateRealmRequest request = CreateRealmRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setRealmId(realmId)
+   *     .setRealm(realm)
+   *     .build();
+   *   Realm response = realmsServiceClient.createRealmAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createRealmAsync(CreateRealmRequest request) { + return createRealmOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new Realm in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String realmId = "";
+   *   Realm realm = Realm.newBuilder().build();
+   *   CreateRealmRequest request = CreateRealmRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setRealmId(realmId)
+   *     .setRealm(realm)
+   *     .build();
+   *   OperationFuture<Realm, Empty> future = realmsServiceClient.createRealmOperationCallable().futureCall(request);
+   *   // Do something
+   *   Realm response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable createRealmOperationCallable() { + return stub.createRealmOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new Realm in a given project and location. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String realmId = "";
+   *   Realm realm = Realm.newBuilder().build();
+   *   CreateRealmRequest request = CreateRealmRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setRealmId(realmId)
+   *     .setRealm(realm)
+   *     .build();
+   *   ApiFuture<Operation> future = realmsServiceClient.createRealmCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createRealmCallable() { + return stub.createRealmCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   realmsServiceClient.deleteRealmAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the realm to delete, using the form: + * `projects/{project_id}/locations/{location}/realms/{realm_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteRealmAsync(String name) { + REALM_PATH_TEMPLATE.validate(name, "deleteRealm"); + DeleteRealmRequest request = DeleteRealmRequest.newBuilder().setName(name).build(); + return deleteRealmAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   DeleteRealmRequest request = DeleteRealmRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   realmsServiceClient.deleteRealmAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteRealmAsync(DeleteRealmRequest request) { + return deleteRealmOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   DeleteRealmRequest request = DeleteRealmRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = realmsServiceClient.deleteRealmOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable deleteRealmOperationCallable() { + return stub.deleteRealmOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   DeleteRealmRequest request = DeleteRealmRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = realmsServiceClient.deleteRealmCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteRealmCallable() { + return stub.deleteRealmCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single Realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(realm, updateMask).get();
+   * }
+   * 
+ * + * @param realm Required. The realm to be updated. Only fields specified in update_mask are + * updated. + * @param updateMask Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + *

https: //developers.google.com/protocol-buffers // + * /docs/reference/google.protobuf#fieldmask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateRealmAsync(Realm realm, FieldMask updateMask) { + + UpdateRealmRequest request = + UpdateRealmRequest.newBuilder().setRealm(realm).setUpdateMask(updateMask).build(); + return updateRealmAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single Realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateRealmRequest request = UpdateRealmRequest.newBuilder()
+   *     .setRealm(realm)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateRealmAsync(UpdateRealmRequest request) { + return updateRealmOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single Realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateRealmRequest request = UpdateRealmRequest.newBuilder()
+   *     .setRealm(realm)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<Realm, Empty> future = realmsServiceClient.updateRealmOperationCallable().futureCall(request);
+   *   // Do something
+   *   Realm response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable updateRealmOperationCallable() { + return stub.updateRealmOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single Realm. + * + *

Sample code: + * + *


+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateRealmRequest request = UpdateRealmRequest.newBuilder()
+   *     .setRealm(realm)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = realmsServiceClient.updateRealmCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateRealmCallable() { + return stub.updateRealmCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRealmsPagedResponse + extends AbstractPagedListResponse< + ListRealmsRequest, + ListRealmsResponse, + Realm, + ListRealmsPage, + ListRealmsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRealmsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListRealmsPagedResponse apply(ListRealmsPage input) { + return new ListRealmsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListRealmsPagedResponse(ListRealmsPage page) { + super(page, ListRealmsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRealmsPage + extends AbstractPage { + + private ListRealmsPage( + PageContext context, + ListRealmsResponse response) { + super(context, response); + } + + private static ListRealmsPage createEmptyPage() { + return new ListRealmsPage(null, null); + } + + @Override + protected ListRealmsPage createPage( + PageContext context, + ListRealmsResponse response) { + return new ListRealmsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRealmsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRealmsRequest, + ListRealmsResponse, + Realm, + ListRealmsPage, + ListRealmsFixedSizeCollection> { + + private ListRealmsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRealmsFixedSizeCollection createEmptyCollection() { + return new ListRealmsFixedSizeCollection(null, 0); + } + + @Override + protected ListRealmsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRealmsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceSettings.java new file mode 100644 index 000000000000..1979b82e8cbe --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/RealmsServiceSettings.java @@ -0,0 +1,267 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.RealmsServiceClient.ListRealmsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gaming.v1alpha.stub.RealmsServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RealmsServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRealm to 30 seconds: + * + *

+ * 
+ * RealmsServiceSettings.Builder realmsServiceSettingsBuilder =
+ *     RealmsServiceSettings.newBuilder();
+ * realmsServiceSettingsBuilder.getRealmSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RealmsServiceSettings realmsServiceSettings = realmsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RealmsServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listRealms. */ + public PagedCallSettings + listRealmsSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).listRealmsSettings(); + } + + /** Returns the object with the settings used for calls to getRealm. */ + public UnaryCallSettings getRealmSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).getRealmSettings(); + } + + /** Returns the object with the settings used for calls to createRealm. */ + public UnaryCallSettings createRealmSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).createRealmSettings(); + } + + /** Returns the object with the settings used for calls to createRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings createRealmOperationSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).createRealmOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteRealm. */ + public UnaryCallSettings deleteRealmSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).deleteRealmSettings(); + } + + /** Returns the object with the settings used for calls to deleteRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings deleteRealmOperationSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).deleteRealmOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateRealm. */ + public UnaryCallSettings updateRealmSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).updateRealmSettings(); + } + + /** Returns the object with the settings used for calls to updateRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings updateRealmOperationSettings() { + return ((RealmsServiceStubSettings) getStubSettings()).updateRealmOperationSettings(); + } + + public static final RealmsServiceSettings create(RealmsServiceStubSettings stub) + throws IOException { + return new RealmsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RealmsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RealmsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RealmsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RealmsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RealmsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RealmsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RealmsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RealmsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RealmsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RealmsServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RealmsServiceStubSettings.newBuilder()); + } + + protected Builder(RealmsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RealmsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public RealmsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RealmsServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listRealms. */ + public PagedCallSettings.Builder + listRealmsSettings() { + return getStubSettingsBuilder().listRealmsSettings(); + } + + /** Returns the builder for the settings used for calls to getRealm. */ + public UnaryCallSettings.Builder getRealmSettings() { + return getStubSettingsBuilder().getRealmSettings(); + } + + /** Returns the builder for the settings used for calls to createRealm. */ + public UnaryCallSettings.Builder createRealmSettings() { + return getStubSettingsBuilder().createRealmSettings(); + } + + /** Returns the builder for the settings used for calls to createRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createRealmOperationSettings() { + return getStubSettingsBuilder().createRealmOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRealm. */ + public UnaryCallSettings.Builder deleteRealmSettings() { + return getStubSettingsBuilder().deleteRealmSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteRealmOperationSettings() { + return getStubSettingsBuilder().deleteRealmOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateRealm. */ + public UnaryCallSettings.Builder updateRealmSettings() { + return getStubSettingsBuilder().updateRealmSettings(); + } + + /** Returns the builder for the settings used for calls to updateRealm. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateRealmOperationSettings() { + return getStubSettingsBuilder().updateRealmOperationSettings(); + } + + @Override + public RealmsServiceSettings build() throws IOException { + return new RealmsServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClient.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClient.java new file mode 100644 index 000000000000..dd6326538422 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClient.java @@ -0,0 +1,886 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.gaming.v1alpha.stub.ScalingPoliciesServiceStub; +import com.google.cloud.gaming.v1alpha.stub.ScalingPoliciesServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: The cloud gaming scaling policy is used to configure scaling parameters for + * each fleet. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+ *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+ *   ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the scalingPoliciesServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ScalingPoliciesServiceSettings + * to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings =
+ *     ScalingPoliciesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ScalingPoliciesServiceClient scalingPoliciesServiceClient =
+ *     ScalingPoliciesServiceClient.create(scalingPoliciesServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings =
+ *     ScalingPoliciesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ScalingPoliciesServiceClient scalingPoliciesServiceClient =
+ *     ScalingPoliciesServiceClient.create(scalingPoliciesServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ScalingPoliciesServiceClient implements BackgroundResource { + private final ScalingPoliciesServiceSettings settings; + private final ScalingPoliciesServiceStub stub; + private final OperationsClient operationsClient; + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private static final PathTemplate SCALING_POLICY_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/scalingPolicies/{scaling_policy}"); + + /** + * Formats a string containing the fully-qualified path to represent a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String formatLocationName(String project, String location) { + return LOCATION_PATH_TEMPLATE.instantiate( + "project", project, + "location", location); + } + + /** + * Formats a string containing the fully-qualified path to represent a scaling_policy resource. + * + * @deprecated Use the {@link ScalingPolicyName} class instead. + */ + @Deprecated + public static final String formatScalingPolicyName( + String project, String location, String scalingPolicy) { + return SCALING_POLICY_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "scaling_policy", scalingPolicy); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseProjectFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a location resource. + * + * @deprecated Use the {@link LocationName} class instead. + */ + @Deprecated + public static final String parseLocationFromLocationName(String locationName) { + return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); + } + + /** + * Parses the project from the given fully-qualified path which represents a scaling_policy + * resource. + * + * @deprecated Use the {@link ScalingPolicyName} class instead. + */ + @Deprecated + public static final String parseProjectFromScalingPolicyName(String scalingPolicyName) { + return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("project"); + } + + /** + * Parses the location from the given fully-qualified path which represents a scaling_policy + * resource. + * + * @deprecated Use the {@link ScalingPolicyName} class instead. + */ + @Deprecated + public static final String parseLocationFromScalingPolicyName(String scalingPolicyName) { + return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("location"); + } + + /** + * Parses the scaling_policy from the given fully-qualified path which represents a scaling_policy + * resource. + * + * @deprecated Use the {@link ScalingPolicyName} class instead. + */ + @Deprecated + public static final String parseScalingPolicyFromScalingPolicyName(String scalingPolicyName) { + return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("scaling_policy"); + } + + /** Constructs an instance of ScalingPoliciesServiceClient with default settings. */ + public static final ScalingPoliciesServiceClient create() throws IOException { + return create(ScalingPoliciesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ScalingPoliciesServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ScalingPoliciesServiceClient create(ScalingPoliciesServiceSettings settings) + throws IOException { + return new ScalingPoliciesServiceClient(settings); + } + + /** + * Constructs an instance of ScalingPoliciesServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer to use ScalingPoliciesServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ScalingPoliciesServiceClient create(ScalingPoliciesServiceStub stub) { + return new ScalingPoliciesServiceClient(stub); + } + + /** + * Constructs an instance of ScalingPoliciesServiceClient, 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 ScalingPoliciesServiceClient(ScalingPoliciesServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((ScalingPoliciesServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ScalingPoliciesServiceClient(ScalingPoliciesServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ScalingPoliciesServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ScalingPoliciesServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScalingPolicies in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (ScalingPolicy element : scalingPoliciesServiceClient.listScalingPolicies(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListScalingPoliciesPagedResponse listScalingPolicies(String parent) { + LOCATION_PATH_TEMPLATE.validate(parent, "listScalingPolicies"); + ListScalingPoliciesRequest request = + ListScalingPoliciesRequest.newBuilder().setParent(parent).build(); + return listScalingPolicies(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScalingPolicies in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (ScalingPolicy element : scalingPoliciesServiceClient.listScalingPolicies(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListScalingPoliciesPagedResponse listScalingPolicies( + ListScalingPoliciesRequest request) { + return listScalingPoliciesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScalingPolicies in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListScalingPoliciesPagedResponse> future = scalingPoliciesServiceClient.listScalingPoliciesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ScalingPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScalingPoliciesPagedCallable() { + return stub.listScalingPoliciesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScalingPolicies in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListScalingPoliciesResponse response = scalingPoliciesServiceClient.listScalingPoliciesCallable().call(request);
+   *     for (ScalingPolicy element : response.getScalingPoliciesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScalingPoliciesCallable() { + return stub.listScalingPoliciesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
+   * }
+   * 
+ * + * @param name Required. The name of the scaling policy to retrieve, using the form: + *

`projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ScalingPolicy getScalingPolicy(String name) { + SCALING_POLICY_PATH_TEMPLATE.validate(name, "getScalingPolicy"); + GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder().setName(name).build(); + return getScalingPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ScalingPolicy getScalingPolicy(GetScalingPolicyRequest request) { + return getScalingPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets details of a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<ScalingPolicy> future = scalingPoliciesServiceClient.getScalingPolicyCallable().futureCall(request);
+   *   // Do something
+   *   ScalingPolicy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getScalingPolicyCallable() { + return stub.getScalingPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new scaling policy in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String scalingPolicyId = "";
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   ScalingPolicy response = scalingPoliciesServiceClient.createScalingPolicyAsync(formattedParent, scalingPolicyId, scalingPolicy).get();
+   * }
+   * 
+ * + * @param parent Required. The parent resource name, using the form: + * `projects/{project_id}/locations/{location}`. + * @param scalingPolicyId Required. The ID of the scaling policy resource to be created. + * @param scalingPolicy Required. The scaling policy resource to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createScalingPolicyAsync( + String parent, String scalingPolicyId, ScalingPolicy scalingPolicy) { + LOCATION_PATH_TEMPLATE.validate(parent, "createScalingPolicy"); + CreateScalingPolicyRequest request = + CreateScalingPolicyRequest.newBuilder() + .setParent(parent) + .setScalingPolicyId(scalingPolicyId) + .setScalingPolicy(scalingPolicy) + .build(); + return createScalingPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new scaling policy in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String scalingPolicyId = "";
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setScalingPolicyId(scalingPolicyId)
+   *     .setScalingPolicy(scalingPolicy)
+   *     .build();
+   *   ScalingPolicy response = scalingPoliciesServiceClient.createScalingPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createScalingPolicyAsync( + CreateScalingPolicyRequest request) { + return createScalingPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new scaling policy in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String scalingPolicyId = "";
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setScalingPolicyId(scalingPolicyId)
+   *     .setScalingPolicy(scalingPolicy)
+   *     .build();
+   *   OperationFuture<ScalingPolicy, Empty> future = scalingPoliciesServiceClient.createScalingPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   ScalingPolicy response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createScalingPolicyOperationCallable() { + return stub.createScalingPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new scaling policy in a given project and location. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   String scalingPolicyId = "";
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setScalingPolicyId(scalingPolicyId)
+   *     .setScalingPolicy(scalingPolicy)
+   *     .build();
+   *   ApiFuture<Operation> future = scalingPoliciesServiceClient.createScalingPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createScalingPolicyCallable() { + return stub.createScalingPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   scalingPoliciesServiceClient.deleteScalingPolicyAsync(formattedName).get();
+   * }
+   * 
+ * + * @param name Required. The name of the scaling policy to delete, using the form: + *

`projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteScalingPolicyAsync(String name) { + SCALING_POLICY_PATH_TEMPLATE.validate(name, "deleteScalingPolicy"); + DeleteScalingPolicyRequest request = + DeleteScalingPolicyRequest.newBuilder().setName(name).build(); + return deleteScalingPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   scalingPoliciesServiceClient.deleteScalingPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteScalingPolicyAsync( + DeleteScalingPolicyRequest request) { + return deleteScalingPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = scalingPoliciesServiceClient.deleteScalingPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteScalingPolicyOperationCallable() { + return stub.deleteScalingPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+   *   DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = scalingPoliciesServiceClient.deleteScalingPolicyCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteScalingPolicyCallable() { + return stub.deleteScalingPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ScalingPolicy response = scalingPoliciesServiceClient.updateScalingPolicyAsync(scalingPolicy, updateMask).get();
+   * }
+   * 
+ * + * @param scalingPolicy Required. The scaling policy to be updated. Only fields specified in + * update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + *

https: //developers.google.com/protocol-buffers // + * /docs/reference/google.protobuf#fieldmask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateScalingPolicyAsync( + ScalingPolicy scalingPolicy, FieldMask updateMask) { + + UpdateScalingPolicyRequest request = + UpdateScalingPolicyRequest.newBuilder() + .setScalingPolicy(scalingPolicy) + .setUpdateMask(updateMask) + .build(); + return updateScalingPolicyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
+   *     .setScalingPolicy(scalingPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ScalingPolicy response = scalingPoliciesServiceClient.updateScalingPolicyAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateScalingPolicyAsync( + UpdateScalingPolicyRequest request) { + return updateScalingPolicyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
+   *     .setScalingPolicy(scalingPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   OperationFuture<ScalingPolicy, Empty> future = scalingPoliciesServiceClient.updateScalingPolicyOperationCallable().futureCall(request);
+   *   // Do something
+   *   ScalingPolicy response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateScalingPolicyOperationCallable() { + return stub.updateScalingPolicyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Patches a single scaling policy. + * + *

Sample code: + * + *


+   * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+   *   ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
+   *     .setScalingPolicy(scalingPolicy)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Operation> future = scalingPoliciesServiceClient.updateScalingPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateScalingPolicyCallable() { + return stub.updateScalingPolicyCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListScalingPoliciesPagedResponse + extends AbstractPagedListResponse< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ScalingPolicy, + ListScalingPoliciesPage, + ListScalingPoliciesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListScalingPoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListScalingPoliciesPagedResponse apply(ListScalingPoliciesPage input) { + return new ListScalingPoliciesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListScalingPoliciesPagedResponse(ListScalingPoliciesPage page) { + super(page, ListScalingPoliciesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListScalingPoliciesPage + extends AbstractPage< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ScalingPolicy, + ListScalingPoliciesPage> { + + private ListScalingPoliciesPage( + PageContext context, + ListScalingPoliciesResponse response) { + super(context, response); + } + + private static ListScalingPoliciesPage createEmptyPage() { + return new ListScalingPoliciesPage(null, null); + } + + @Override + protected ListScalingPoliciesPage createPage( + PageContext context, + ListScalingPoliciesResponse response) { + return new ListScalingPoliciesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListScalingPoliciesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ScalingPolicy, + ListScalingPoliciesPage, + ListScalingPoliciesFixedSizeCollection> { + + private ListScalingPoliciesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListScalingPoliciesFixedSizeCollection createEmptyCollection() { + return new ListScalingPoliciesFixedSizeCollection(null, 0); + } + + @Override + protected ListScalingPoliciesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListScalingPoliciesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceSettings.java new file mode 100644 index 000000000000..12a58623a620 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceSettings.java @@ -0,0 +1,282 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceClient.ListScalingPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.gaming.v1alpha.stub.ScalingPoliciesServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ScalingPoliciesServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getScalingPolicy to 30 seconds: + * + *

+ * 
+ * ScalingPoliciesServiceSettings.Builder scalingPoliciesServiceSettingsBuilder =
+ *     ScalingPoliciesServiceSettings.newBuilder();
+ * scalingPoliciesServiceSettingsBuilder.getScalingPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings = scalingPoliciesServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ScalingPoliciesServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listScalingPolicies. */ + public PagedCallSettings< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()).listScalingPoliciesSettings(); + } + + /** Returns the object with the settings used for calls to getScalingPolicy. */ + public UnaryCallSettings getScalingPolicySettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()).getScalingPolicySettings(); + } + + /** Returns the object with the settings used for calls to createScalingPolicy. */ + public UnaryCallSettings createScalingPolicySettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()).createScalingPolicySettings(); + } + + /** Returns the object with the settings used for calls to createScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createScalingPolicyOperationSettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()) + .createScalingPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteScalingPolicy. */ + public UnaryCallSettings deleteScalingPolicySettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()).deleteScalingPolicySettings(); + } + + /** Returns the object with the settings used for calls to deleteScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteScalingPolicyOperationSettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()) + .deleteScalingPolicyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateScalingPolicy. */ + public UnaryCallSettings updateScalingPolicySettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()).updateScalingPolicySettings(); + } + + /** Returns the object with the settings used for calls to updateScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateScalingPolicyOperationSettings() { + return ((ScalingPoliciesServiceStubSettings) getStubSettings()) + .updateScalingPolicyOperationSettings(); + } + + public static final ScalingPoliciesServiceSettings create(ScalingPoliciesServiceStubSettings stub) + throws IOException { + return new ScalingPoliciesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ScalingPoliciesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ScalingPoliciesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ScalingPoliciesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ScalingPoliciesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ScalingPoliciesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ScalingPoliciesServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ScalingPoliciesServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ScalingPoliciesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ScalingPoliciesServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ScalingPoliciesServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ScalingPoliciesServiceStubSettings.newBuilder()); + } + + protected Builder(ScalingPoliciesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ScalingPoliciesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ScalingPoliciesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ScalingPoliciesServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listScalingPolicies. */ + public PagedCallSettings.Builder< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings() { + return getStubSettingsBuilder().listScalingPoliciesSettings(); + } + + /** Returns the builder for the settings used for calls to getScalingPolicy. */ + public UnaryCallSettings.Builder + getScalingPolicySettings() { + return getStubSettingsBuilder().getScalingPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createScalingPolicy. */ + public UnaryCallSettings.Builder + createScalingPolicySettings() { + return getStubSettingsBuilder().createScalingPolicySettings(); + } + + /** Returns the builder for the settings used for calls to createScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createScalingPolicyOperationSettings() { + return getStubSettingsBuilder().createScalingPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteScalingPolicy. */ + public UnaryCallSettings.Builder + deleteScalingPolicySettings() { + return getStubSettingsBuilder().deleteScalingPolicySettings(); + } + + /** Returns the builder for the settings used for calls to deleteScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteScalingPolicyOperationSettings() { + return getStubSettingsBuilder().deleteScalingPolicyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateScalingPolicy. */ + public UnaryCallSettings.Builder + updateScalingPolicySettings() { + return getStubSettingsBuilder().updateScalingPolicySettings(); + } + + /** Returns the builder for the settings used for calls to updateScalingPolicy. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateScalingPolicyOperationSettings() { + return getStubSettingsBuilder().updateScalingPolicyOperationSettings(); + } + + @Override + public ScalingPoliciesServiceSettings build() throws IOException { + return new ScalingPoliciesServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/package-info.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/package-info.java new file mode 100644 index 000000000000..220a0745d690 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/package-info.java @@ -0,0 +1,107 @@ +/* + * Copyright 2019 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. + */ + +/** + * A client to gameservices API (prod). + * + *

The interfaces provided are listed below, along with usage samples. + * + *

=============================== AllocationPoliciesServiceClient + * =============================== + * + *

Service Description: The cloud gaming allocation policy is used as the controller's recipe for + * the allocating game servers from clusters. The policy has three modes: 1. Default mode which is + * not limited to time. 2. Time based mode which is temporary and overrides the default mode when + * effective. 3. Periodic mode which follows the time base mode, but happens periodically using + * local time, identified by cron specs. + * + *

Sample for AllocationPoliciesServiceClient: + * + *

+ * 
+ * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
+ *   String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
+ *   AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
+ * }
+ * 
+ * 
+ * + * =============================== GameServerClustersServiceClient =============================== + * + *

Service Description: The game server cluster is used to capture the game server cluster's + * settings which are used to manage game server clusters. + * + *

Sample for GameServerClustersServiceClient: + * + *

+ * 
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ *   String formattedName = GameServerClustersServiceClient.formatGameServerClusterName("[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]");
+ *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(formattedName);
+ * }
+ * 
+ * 
+ * + * ================================== GameServerDeploymentsServiceClient + * ================================== + * + *

Service Description: The game server deployment is used to configure the deployment of game + * server software to Agones Fleets in game server clusters. + * + *

Sample for GameServerDeploymentsServiceClient: + * + *

+ * 
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
+ *   String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
+ *   GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(formattedName);
+ * }
+ * 
+ * 
+ * + * =================== RealmsServiceClient =================== + * + *

Service Description: Realm provides grouping of game server clusters that are serving + * particular gamer population. + * + *

Sample for RealmsServiceClient: + * + *

+ * 
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ *   String formattedName = RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]");
+ *   Realm response = realmsServiceClient.getRealm(formattedName);
+ * }
+ * 
+ * 
+ * + * ============================ ScalingPoliciesServiceClient ============================ + * + *

Service Description: The cloud gaming scaling policy is used to configure scaling parameters + * for each fleet. + * + *

Sample for ScalingPoliciesServiceClient: + * + *

+ * 
+ * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
+ *   String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
+ *   ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.gaming.v1alpha; diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java new file mode 100644 index 000000000000..51d7268ce3ef --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java @@ -0,0 +1,101 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.AllocationPolicy; +import com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse; +import com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AllocationPoliciesServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listAllocationPoliciesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAllocationPoliciesPagedCallable()"); + } + + public UnaryCallable + listAllocationPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listAllocationPoliciesCallable()"); + } + + public UnaryCallable getAllocationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getAllocationPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createAllocationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createAllocationPolicyOperationCallable()"); + } + + public UnaryCallable createAllocationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createAllocationPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteAllocationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAllocationPolicyOperationCallable()"); + } + + public UnaryCallable deleteAllocationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAllocationPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateAllocationPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateAllocationPolicyOperationCallable()"); + } + + public UnaryCallable updateAllocationPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateAllocationPolicyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStubSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStubSettings.java new file mode 100644 index 000000000000..73ddb8e59a4d --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStubSettings.java @@ -0,0 +1,629 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.AllocationPolicy; +import com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse; +import com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link AllocationPoliciesServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getAllocationPolicy to 30 seconds: + * + *

+ * 
+ * AllocationPoliciesServiceStubSettings.Builder allocationPoliciesServiceSettingsBuilder =
+ *     AllocationPoliciesServiceStubSettings.newBuilder();
+ * allocationPoliciesServiceSettingsBuilder.getAllocationPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * AllocationPoliciesServiceStubSettings allocationPoliciesServiceSettings = allocationPoliciesServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AllocationPoliciesServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings; + private final UnaryCallSettings + getAllocationPolicySettings; + private final UnaryCallSettings + createAllocationPolicySettings; + private final OperationCallSettings + createAllocationPolicyOperationSettings; + private final UnaryCallSettings + deleteAllocationPolicySettings; + private final OperationCallSettings + deleteAllocationPolicyOperationSettings; + private final UnaryCallSettings + updateAllocationPolicySettings; + private final OperationCallSettings + updateAllocationPolicyOperationSettings; + + /** Returns the object with the settings used for calls to listAllocationPolicies. */ + public PagedCallSettings< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings() { + return listAllocationPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getAllocationPolicy. */ + public UnaryCallSettings + getAllocationPolicySettings() { + return getAllocationPolicySettings; + } + + /** Returns the object with the settings used for calls to createAllocationPolicy. */ + public UnaryCallSettings + createAllocationPolicySettings() { + return createAllocationPolicySettings; + } + + /** Returns the object with the settings used for calls to createAllocationPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createAllocationPolicyOperationSettings() { + return createAllocationPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteAllocationPolicy. */ + public UnaryCallSettings + deleteAllocationPolicySettings() { + return deleteAllocationPolicySettings; + } + + /** Returns the object with the settings used for calls to deleteAllocationPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteAllocationPolicyOperationSettings() { + return deleteAllocationPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateAllocationPolicy. */ + public UnaryCallSettings + updateAllocationPolicySettings() { + return updateAllocationPolicySettings; + } + + /** Returns the object with the settings used for calls to updateAllocationPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateAllocationPolicyOperationSettings() { + return updateAllocationPolicyOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AllocationPoliciesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAllocationPoliciesServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "gameservices.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AllocationPoliciesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AllocationPoliciesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAllocationPoliciesSettings = settingsBuilder.listAllocationPoliciesSettings().build(); + getAllocationPolicySettings = settingsBuilder.getAllocationPolicySettings().build(); + createAllocationPolicySettings = settingsBuilder.createAllocationPolicySettings().build(); + createAllocationPolicyOperationSettings = + settingsBuilder.createAllocationPolicyOperationSettings().build(); + deleteAllocationPolicySettings = settingsBuilder.deleteAllocationPolicySettings().build(); + deleteAllocationPolicyOperationSettings = + settingsBuilder.deleteAllocationPolicyOperationSettings().build(); + updateAllocationPolicySettings = settingsBuilder.updateAllocationPolicySettings().build(); + updateAllocationPolicyOperationSettings = + settingsBuilder.updateAllocationPolicyOperationSettings().build(); + } + + private static final PagedListDescriptor< + ListAllocationPoliciesRequest, ListAllocationPoliciesResponse, AllocationPolicy> + LIST_ALLOCATION_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListAllocationPoliciesRequest, ListAllocationPoliciesResponse, AllocationPolicy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAllocationPoliciesRequest injectToken( + ListAllocationPoliciesRequest payload, String token) { + return ListAllocationPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAllocationPoliciesRequest injectPageSize( + ListAllocationPoliciesRequest payload, int pageSize) { + return ListAllocationPoliciesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListAllocationPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAllocationPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAllocationPoliciesResponse payload) { + return payload.getAllocationPoliciesList() != null + ? payload.getAllocationPoliciesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + LIST_ALLOCATION_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListAllocationPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + AllocationPolicy> + pageContext = + PageContext.create( + callable, LIST_ALLOCATION_POLICIES_PAGE_STR_DESC, request, context); + return ListAllocationPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AllocationPoliciesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings; + private final UnaryCallSettings.Builder + getAllocationPolicySettings; + private final UnaryCallSettings.Builder + createAllocationPolicySettings; + private final OperationCallSettings.Builder< + CreateAllocationPolicyRequest, AllocationPolicy, Empty> + createAllocationPolicyOperationSettings; + private final UnaryCallSettings.Builder + deleteAllocationPolicySettings; + private final OperationCallSettings.Builder + deleteAllocationPolicyOperationSettings; + private final UnaryCallSettings.Builder + updateAllocationPolicySettings; + private final OperationCallSettings.Builder< + UpdateAllocationPolicyRequest, AllocationPolicy, Empty> + updateAllocationPolicyOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAllocationPoliciesSettings = + PagedCallSettings.newBuilder(LIST_ALLOCATION_POLICIES_PAGE_STR_FACT); + + getAllocationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createAllocationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createAllocationPolicyOperationSettings = OperationCallSettings.newBuilder(); + + deleteAllocationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteAllocationPolicyOperationSettings = OperationCallSettings.newBuilder(); + + updateAllocationPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateAllocationPolicyOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAllocationPoliciesSettings, + getAllocationPolicySettings, + createAllocationPolicySettings, + deleteAllocationPolicySettings, + updateAllocationPolicySettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listAllocationPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getAllocationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createAllocationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteAllocationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateAllocationPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createAllocationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AllocationPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteAllocationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateAllocationPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AllocationPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(AllocationPoliciesServiceStubSettings settings) { + super(settings); + + listAllocationPoliciesSettings = settings.listAllocationPoliciesSettings.toBuilder(); + getAllocationPolicySettings = settings.getAllocationPolicySettings.toBuilder(); + createAllocationPolicySettings = settings.createAllocationPolicySettings.toBuilder(); + createAllocationPolicyOperationSettings = + settings.createAllocationPolicyOperationSettings.toBuilder(); + deleteAllocationPolicySettings = settings.deleteAllocationPolicySettings.toBuilder(); + deleteAllocationPolicyOperationSettings = + settings.deleteAllocationPolicyOperationSettings.toBuilder(); + updateAllocationPolicySettings = settings.updateAllocationPolicySettings.toBuilder(); + updateAllocationPolicyOperationSettings = + settings.updateAllocationPolicyOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAllocationPoliciesSettings, + getAllocationPolicySettings, + createAllocationPolicySettings, + deleteAllocationPolicySettings, + updateAllocationPolicySettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listAllocationPolicies. */ + public PagedCallSettings.Builder< + ListAllocationPoliciesRequest, + ListAllocationPoliciesResponse, + ListAllocationPoliciesPagedResponse> + listAllocationPoliciesSettings() { + return listAllocationPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getAllocationPolicy. */ + public UnaryCallSettings.Builder + getAllocationPolicySettings() { + return getAllocationPolicySettings; + } + + /** Returns the builder for the settings used for calls to createAllocationPolicy. */ + public UnaryCallSettings.Builder + createAllocationPolicySettings() { + return createAllocationPolicySettings; + } + + /** Returns the builder for the settings used for calls to createAllocationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createAllocationPolicyOperationSettings() { + return createAllocationPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteAllocationPolicy. */ + public UnaryCallSettings.Builder + deleteAllocationPolicySettings() { + return deleteAllocationPolicySettings; + } + + /** Returns the builder for the settings used for calls to deleteAllocationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteAllocationPolicyOperationSettings() { + return deleteAllocationPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateAllocationPolicy. */ + public UnaryCallSettings.Builder + updateAllocationPolicySettings() { + return updateAllocationPolicySettings; + } + + /** Returns the builder for the settings used for calls to updateAllocationPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateAllocationPolicyOperationSettings() { + return updateAllocationPolicyOperationSettings; + } + + @Override + public AllocationPoliciesServiceStubSettings build() throws IOException { + return new AllocationPoliciesServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStub.java new file mode 100644 index 000000000000..20f67af7e037 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStub.java @@ -0,0 +1,105 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerClustersServiceClient.ListGameServerClustersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.GameServerCluster; +import com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse; +import com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class GameServerClustersServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listGameServerClustersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listGameServerClustersPagedCallable()"); + } + + public UnaryCallable + listGameServerClustersCallable() { + throw new UnsupportedOperationException("Not implemented: listGameServerClustersCallable()"); + } + + public UnaryCallable + getGameServerClusterCallable() { + throw new UnsupportedOperationException("Not implemented: getGameServerClusterCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createGameServerClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createGameServerClusterOperationCallable()"); + } + + public UnaryCallable + createGameServerClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createGameServerClusterCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteGameServerClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteGameServerClusterOperationCallable()"); + } + + public UnaryCallable + deleteGameServerClusterCallable() { + throw new UnsupportedOperationException("Not implemented: deleteGameServerClusterCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateGameServerClusterOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateGameServerClusterOperationCallable()"); + } + + public UnaryCallable + updateGameServerClusterCallable() { + throw new UnsupportedOperationException("Not implemented: updateGameServerClusterCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStubSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStubSettings.java new file mode 100644 index 000000000000..88dfc273d01e --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerClustersServiceStubSettings.java @@ -0,0 +1,629 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerClustersServiceClient.ListGameServerClustersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.GameServerCluster; +import com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse; +import com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GameServerClustersServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGameServerCluster to 30 seconds: + * + *

+ * 
+ * GameServerClustersServiceStubSettings.Builder gameServerClustersServiceSettingsBuilder =
+ *     GameServerClustersServiceStubSettings.newBuilder();
+ * gameServerClustersServiceSettingsBuilder.getGameServerClusterSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GameServerClustersServiceStubSettings gameServerClustersServiceSettings = gameServerClustersServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerClustersServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings; + private final UnaryCallSettings + getGameServerClusterSettings; + private final UnaryCallSettings + createGameServerClusterSettings; + private final OperationCallSettings + createGameServerClusterOperationSettings; + private final UnaryCallSettings + deleteGameServerClusterSettings; + private final OperationCallSettings + deleteGameServerClusterOperationSettings; + private final UnaryCallSettings + updateGameServerClusterSettings; + private final OperationCallSettings + updateGameServerClusterOperationSettings; + + /** Returns the object with the settings used for calls to listGameServerClusters. */ + public PagedCallSettings< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings() { + return listGameServerClustersSettings; + } + + /** Returns the object with the settings used for calls to getGameServerCluster. */ + public UnaryCallSettings + getGameServerClusterSettings() { + return getGameServerClusterSettings; + } + + /** Returns the object with the settings used for calls to createGameServerCluster. */ + public UnaryCallSettings + createGameServerClusterSettings() { + return createGameServerClusterSettings; + } + + /** Returns the object with the settings used for calls to createGameServerCluster. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createGameServerClusterOperationSettings() { + return createGameServerClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteGameServerCluster. */ + public UnaryCallSettings + deleteGameServerClusterSettings() { + return deleteGameServerClusterSettings; + } + + /** Returns the object with the settings used for calls to deleteGameServerCluster. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteGameServerClusterOperationSettings() { + return deleteGameServerClusterOperationSettings; + } + + /** Returns the object with the settings used for calls to updateGameServerCluster. */ + public UnaryCallSettings + updateGameServerClusterSettings() { + return updateGameServerClusterSettings; + } + + /** Returns the object with the settings used for calls to updateGameServerCluster. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateGameServerClusterOperationSettings() { + return updateGameServerClusterOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GameServerClustersServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcGameServerClustersServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "gameservices.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(GameServerClustersServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GameServerClustersServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listGameServerClustersSettings = settingsBuilder.listGameServerClustersSettings().build(); + getGameServerClusterSettings = settingsBuilder.getGameServerClusterSettings().build(); + createGameServerClusterSettings = settingsBuilder.createGameServerClusterSettings().build(); + createGameServerClusterOperationSettings = + settingsBuilder.createGameServerClusterOperationSettings().build(); + deleteGameServerClusterSettings = settingsBuilder.deleteGameServerClusterSettings().build(); + deleteGameServerClusterOperationSettings = + settingsBuilder.deleteGameServerClusterOperationSettings().build(); + updateGameServerClusterSettings = settingsBuilder.updateGameServerClusterSettings().build(); + updateGameServerClusterOperationSettings = + settingsBuilder.updateGameServerClusterOperationSettings().build(); + } + + private static final PagedListDescriptor< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster> + LIST_GAME_SERVER_CLUSTERS_PAGE_STR_DESC = + new PagedListDescriptor< + ListGameServerClustersRequest, ListGameServerClustersResponse, GameServerCluster>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListGameServerClustersRequest injectToken( + ListGameServerClustersRequest payload, String token) { + return ListGameServerClustersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListGameServerClustersRequest injectPageSize( + ListGameServerClustersRequest payload, int pageSize) { + return ListGameServerClustersRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListGameServerClustersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListGameServerClustersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListGameServerClustersResponse payload) { + return payload.getGameServerClustersList() != null + ? payload.getGameServerClustersList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + LIST_GAME_SERVER_CLUSTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListGameServerClustersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + GameServerCluster> + pageContext = + PageContext.create( + callable, LIST_GAME_SERVER_CLUSTERS_PAGE_STR_DESC, request, context); + return ListGameServerClustersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for GameServerClustersServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings; + private final UnaryCallSettings.Builder + getGameServerClusterSettings; + private final UnaryCallSettings.Builder + createGameServerClusterSettings; + private final OperationCallSettings.Builder< + CreateGameServerClusterRequest, GameServerCluster, Empty> + createGameServerClusterOperationSettings; + private final UnaryCallSettings.Builder + deleteGameServerClusterSettings; + private final OperationCallSettings.Builder + deleteGameServerClusterOperationSettings; + private final UnaryCallSettings.Builder + updateGameServerClusterSettings; + private final OperationCallSettings.Builder< + UpdateGameServerClusterRequest, GameServerCluster, Empty> + updateGameServerClusterOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listGameServerClustersSettings = + PagedCallSettings.newBuilder(LIST_GAME_SERVER_CLUSTERS_PAGE_STR_FACT); + + getGameServerClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createGameServerClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createGameServerClusterOperationSettings = OperationCallSettings.newBuilder(); + + deleteGameServerClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteGameServerClusterOperationSettings = OperationCallSettings.newBuilder(); + + updateGameServerClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateGameServerClusterOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listGameServerClustersSettings, + getGameServerClusterSettings, + createGameServerClusterSettings, + deleteGameServerClusterSettings, + updateGameServerClusterSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listGameServerClustersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getGameServerClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createGameServerClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteGameServerClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateGameServerClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createGameServerClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerCluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteGameServerClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateGameServerClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerCluster.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(GameServerClustersServiceStubSettings settings) { + super(settings); + + listGameServerClustersSettings = settings.listGameServerClustersSettings.toBuilder(); + getGameServerClusterSettings = settings.getGameServerClusterSettings.toBuilder(); + createGameServerClusterSettings = settings.createGameServerClusterSettings.toBuilder(); + createGameServerClusterOperationSettings = + settings.createGameServerClusterOperationSettings.toBuilder(); + deleteGameServerClusterSettings = settings.deleteGameServerClusterSettings.toBuilder(); + deleteGameServerClusterOperationSettings = + settings.deleteGameServerClusterOperationSettings.toBuilder(); + updateGameServerClusterSettings = settings.updateGameServerClusterSettings.toBuilder(); + updateGameServerClusterOperationSettings = + settings.updateGameServerClusterOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listGameServerClustersSettings, + getGameServerClusterSettings, + createGameServerClusterSettings, + deleteGameServerClusterSettings, + updateGameServerClusterSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listGameServerClusters. */ + public PagedCallSettings.Builder< + ListGameServerClustersRequest, + ListGameServerClustersResponse, + ListGameServerClustersPagedResponse> + listGameServerClustersSettings() { + return listGameServerClustersSettings; + } + + /** Returns the builder for the settings used for calls to getGameServerCluster. */ + public UnaryCallSettings.Builder + getGameServerClusterSettings() { + return getGameServerClusterSettings; + } + + /** Returns the builder for the settings used for calls to createGameServerCluster. */ + public UnaryCallSettings.Builder + createGameServerClusterSettings() { + return createGameServerClusterSettings; + } + + /** Returns the builder for the settings used for calls to createGameServerCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createGameServerClusterOperationSettings() { + return createGameServerClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteGameServerCluster. */ + public UnaryCallSettings.Builder + deleteGameServerClusterSettings() { + return deleteGameServerClusterSettings; + } + + /** Returns the builder for the settings used for calls to deleteGameServerCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteGameServerClusterOperationSettings() { + return deleteGameServerClusterOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateGameServerCluster. */ + public UnaryCallSettings.Builder + updateGameServerClusterSettings() { + return updateGameServerClusterSettings; + } + + /** Returns the builder for the settings used for calls to updateGameServerCluster. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateGameServerClusterOperationSettings() { + return updateGameServerClusterOperationSettings; + } + + @Override + public GameServerClustersServiceStubSettings build() throws IOException { + return new GameServerClustersServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStub.java new file mode 100644 index 000000000000..1e691ca1b141 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStub.java @@ -0,0 +1,158 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CommitRolloutRequest; +import com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeploymentTarget; +import com.google.cloud.gaming.v1alpha.GameServerDeployment; +import com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest; +import com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse; +import com.google.cloud.gaming.v1alpha.RevertRolloutRequest; +import com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest; +import com.google.cloud.gaming.v1alpha.StartRolloutRequest; +import com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class GameServerDeploymentsServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listGameServerDeploymentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listGameServerDeploymentsPagedCallable()"); + } + + public UnaryCallable + listGameServerDeploymentsCallable() { + throw new UnsupportedOperationException("Not implemented: listGameServerDeploymentsCallable()"); + } + + public UnaryCallable + getGameServerDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: getGameServerDeploymentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createGameServerDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createGameServerDeploymentOperationCallable()"); + } + + public UnaryCallable + createGameServerDeploymentCallable() { + throw new UnsupportedOperationException( + "Not implemented: createGameServerDeploymentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteGameServerDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteGameServerDeploymentOperationCallable()"); + } + + public UnaryCallable + deleteGameServerDeploymentCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteGameServerDeploymentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateGameServerDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateGameServerDeploymentOperationCallable()"); + } + + public UnaryCallable + updateGameServerDeploymentCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateGameServerDeploymentCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + startRolloutOperationCallable() { + throw new UnsupportedOperationException("Not implemented: startRolloutOperationCallable()"); + } + + public UnaryCallable startRolloutCallable() { + throw new UnsupportedOperationException("Not implemented: startRolloutCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + setRolloutTargetOperationCallable() { + throw new UnsupportedOperationException("Not implemented: setRolloutTargetOperationCallable()"); + } + + public UnaryCallable setRolloutTargetCallable() { + throw new UnsupportedOperationException("Not implemented: setRolloutTargetCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + commitRolloutOperationCallable() { + throw new UnsupportedOperationException("Not implemented: commitRolloutOperationCallable()"); + } + + public UnaryCallable commitRolloutCallable() { + throw new UnsupportedOperationException("Not implemented: commitRolloutCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + revertRolloutOperationCallable() { + throw new UnsupportedOperationException("Not implemented: revertRolloutOperationCallable()"); + } + + public UnaryCallable revertRolloutCallable() { + throw new UnsupportedOperationException("Not implemented: revertRolloutCallable()"); + } + + public UnaryCallable getDeploymentTargetCallable() { + throw new UnsupportedOperationException("Not implemented: getDeploymentTargetCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStubSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStubSettings.java new file mode 100644 index 000000000000..bf0f89eb3426 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GameServerDeploymentsServiceStubSettings.java @@ -0,0 +1,957 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CommitRolloutRequest; +import com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeploymentTarget; +import com.google.cloud.gaming.v1alpha.GameServerDeployment; +import com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest; +import com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse; +import com.google.cloud.gaming.v1alpha.RevertRolloutRequest; +import com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest; +import com.google.cloud.gaming.v1alpha.StartRolloutRequest; +import com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link GameServerDeploymentsServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGameServerDeployment to 30 seconds: + * + *

+ * 
+ * GameServerDeploymentsServiceStubSettings.Builder gameServerDeploymentsServiceSettingsBuilder =
+ *     GameServerDeploymentsServiceStubSettings.newBuilder();
+ * gameServerDeploymentsServiceSettingsBuilder.getGameServerDeploymentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GameServerDeploymentsServiceStubSettings gameServerDeploymentsServiceSettings = gameServerDeploymentsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GameServerDeploymentsServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings; + private final UnaryCallSettings + getGameServerDeploymentSettings; + private final UnaryCallSettings + createGameServerDeploymentSettings; + private final OperationCallSettings< + CreateGameServerDeploymentRequest, GameServerDeployment, Empty> + createGameServerDeploymentOperationSettings; + private final UnaryCallSettings + deleteGameServerDeploymentSettings; + private final OperationCallSettings + deleteGameServerDeploymentOperationSettings; + private final UnaryCallSettings + updateGameServerDeploymentSettings; + private final OperationCallSettings< + UpdateGameServerDeploymentRequest, GameServerDeployment, Empty> + updateGameServerDeploymentOperationSettings; + private final UnaryCallSettings startRolloutSettings; + private final OperationCallSettings + startRolloutOperationSettings; + private final UnaryCallSettings setRolloutTargetSettings; + private final OperationCallSettings + setRolloutTargetOperationSettings; + private final UnaryCallSettings commitRolloutSettings; + private final OperationCallSettings + commitRolloutOperationSettings; + private final UnaryCallSettings revertRolloutSettings; + private final OperationCallSettings + revertRolloutOperationSettings; + private final UnaryCallSettings + getDeploymentTargetSettings; + + /** Returns the object with the settings used for calls to listGameServerDeployments. */ + public PagedCallSettings< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings() { + return listGameServerDeploymentsSettings; + } + + /** Returns the object with the settings used for calls to getGameServerDeployment. */ + public UnaryCallSettings + getGameServerDeploymentSettings() { + return getGameServerDeploymentSettings; + } + + /** Returns the object with the settings used for calls to createGameServerDeployment. */ + public UnaryCallSettings + createGameServerDeploymentSettings() { + return createGameServerDeploymentSettings; + } + + /** Returns the object with the settings used for calls to createGameServerDeployment. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createGameServerDeploymentOperationSettings() { + return createGameServerDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteGameServerDeployment. */ + public UnaryCallSettings + deleteGameServerDeploymentSettings() { + return deleteGameServerDeploymentSettings; + } + + /** Returns the object with the settings used for calls to deleteGameServerDeployment. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteGameServerDeploymentOperationSettings() { + return deleteGameServerDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to updateGameServerDeployment. */ + public UnaryCallSettings + updateGameServerDeploymentSettings() { + return updateGameServerDeploymentSettings; + } + + /** Returns the object with the settings used for calls to updateGameServerDeployment. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateGameServerDeploymentOperationSettings() { + return updateGameServerDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to startRollout. */ + public UnaryCallSettings startRolloutSettings() { + return startRolloutSettings; + } + + /** Returns the object with the settings used for calls to startRollout. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + startRolloutOperationSettings() { + return startRolloutOperationSettings; + } + + /** Returns the object with the settings used for calls to setRolloutTarget. */ + public UnaryCallSettings setRolloutTargetSettings() { + return setRolloutTargetSettings; + } + + /** Returns the object with the settings used for calls to setRolloutTarget. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + setRolloutTargetOperationSettings() { + return setRolloutTargetOperationSettings; + } + + /** Returns the object with the settings used for calls to commitRollout. */ + public UnaryCallSettings commitRolloutSettings() { + return commitRolloutSettings; + } + + /** Returns the object with the settings used for calls to commitRollout. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + commitRolloutOperationSettings() { + return commitRolloutOperationSettings; + } + + /** Returns the object with the settings used for calls to revertRollout. */ + public UnaryCallSettings revertRolloutSettings() { + return revertRolloutSettings; + } + + /** Returns the object with the settings used for calls to revertRollout. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + revertRolloutOperationSettings() { + return revertRolloutOperationSettings; + } + + /** Returns the object with the settings used for calls to getDeploymentTarget. */ + public UnaryCallSettings + getDeploymentTargetSettings() { + return getDeploymentTargetSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GameServerDeploymentsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcGameServerDeploymentsServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "gameservices.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(GameServerDeploymentsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected GameServerDeploymentsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listGameServerDeploymentsSettings = settingsBuilder.listGameServerDeploymentsSettings().build(); + getGameServerDeploymentSettings = settingsBuilder.getGameServerDeploymentSettings().build(); + createGameServerDeploymentSettings = + settingsBuilder.createGameServerDeploymentSettings().build(); + createGameServerDeploymentOperationSettings = + settingsBuilder.createGameServerDeploymentOperationSettings().build(); + deleteGameServerDeploymentSettings = + settingsBuilder.deleteGameServerDeploymentSettings().build(); + deleteGameServerDeploymentOperationSettings = + settingsBuilder.deleteGameServerDeploymentOperationSettings().build(); + updateGameServerDeploymentSettings = + settingsBuilder.updateGameServerDeploymentSettings().build(); + updateGameServerDeploymentOperationSettings = + settingsBuilder.updateGameServerDeploymentOperationSettings().build(); + startRolloutSettings = settingsBuilder.startRolloutSettings().build(); + startRolloutOperationSettings = settingsBuilder.startRolloutOperationSettings().build(); + setRolloutTargetSettings = settingsBuilder.setRolloutTargetSettings().build(); + setRolloutTargetOperationSettings = settingsBuilder.setRolloutTargetOperationSettings().build(); + commitRolloutSettings = settingsBuilder.commitRolloutSettings().build(); + commitRolloutOperationSettings = settingsBuilder.commitRolloutOperationSettings().build(); + revertRolloutSettings = settingsBuilder.revertRolloutSettings().build(); + revertRolloutOperationSettings = settingsBuilder.revertRolloutOperationSettings().build(); + getDeploymentTargetSettings = settingsBuilder.getDeploymentTargetSettings().build(); + } + + private static final PagedListDescriptor< + ListGameServerDeploymentsRequest, ListGameServerDeploymentsResponse, GameServerDeployment> + LIST_GAME_SERVER_DEPLOYMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListGameServerDeploymentsRequest injectToken( + ListGameServerDeploymentsRequest payload, String token) { + return ListGameServerDeploymentsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListGameServerDeploymentsRequest injectPageSize( + ListGameServerDeploymentsRequest payload, int pageSize) { + return ListGameServerDeploymentsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListGameServerDeploymentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListGameServerDeploymentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListGameServerDeploymentsResponse payload) { + return payload.getGameServerDeploymentsList() != null + ? payload.getGameServerDeploymentsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + LIST_GAME_SERVER_DEPLOYMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListGameServerDeploymentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + GameServerDeployment> + pageContext = + PageContext.create( + callable, LIST_GAME_SERVER_DEPLOYMENTS_PAGE_STR_DESC, request, context); + return ListGameServerDeploymentsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Builder for GameServerDeploymentsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings; + private final UnaryCallSettings.Builder + getGameServerDeploymentSettings; + private final UnaryCallSettings.Builder + createGameServerDeploymentSettings; + private final OperationCallSettings.Builder< + CreateGameServerDeploymentRequest, GameServerDeployment, Empty> + createGameServerDeploymentOperationSettings; + private final UnaryCallSettings.Builder + deleteGameServerDeploymentSettings; + private final OperationCallSettings.Builder + deleteGameServerDeploymentOperationSettings; + private final UnaryCallSettings.Builder + updateGameServerDeploymentSettings; + private final OperationCallSettings.Builder< + UpdateGameServerDeploymentRequest, GameServerDeployment, Empty> + updateGameServerDeploymentOperationSettings; + private final UnaryCallSettings.Builder startRolloutSettings; + private final OperationCallSettings.Builder + startRolloutOperationSettings; + private final UnaryCallSettings.Builder + setRolloutTargetSettings; + private final OperationCallSettings.Builder< + SetRolloutTargetRequest, GameServerDeployment, Empty> + setRolloutTargetOperationSettings; + private final UnaryCallSettings.Builder commitRolloutSettings; + private final OperationCallSettings.Builder + commitRolloutOperationSettings; + private final UnaryCallSettings.Builder revertRolloutSettings; + private final OperationCallSettings.Builder + revertRolloutOperationSettings; + private final UnaryCallSettings.Builder + getDeploymentTargetSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listGameServerDeploymentsSettings = + PagedCallSettings.newBuilder(LIST_GAME_SERVER_DEPLOYMENTS_PAGE_STR_FACT); + + getGameServerDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createGameServerDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createGameServerDeploymentOperationSettings = OperationCallSettings.newBuilder(); + + deleteGameServerDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteGameServerDeploymentOperationSettings = OperationCallSettings.newBuilder(); + + updateGameServerDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateGameServerDeploymentOperationSettings = OperationCallSettings.newBuilder(); + + startRolloutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + startRolloutOperationSettings = OperationCallSettings.newBuilder(); + + setRolloutTargetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setRolloutTargetOperationSettings = OperationCallSettings.newBuilder(); + + commitRolloutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + commitRolloutOperationSettings = OperationCallSettings.newBuilder(); + + revertRolloutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + revertRolloutOperationSettings = OperationCallSettings.newBuilder(); + + getDeploymentTargetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listGameServerDeploymentsSettings, + getGameServerDeploymentSettings, + createGameServerDeploymentSettings, + deleteGameServerDeploymentSettings, + updateGameServerDeploymentSettings, + startRolloutSettings, + setRolloutTargetSettings, + commitRolloutSettings, + revertRolloutSettings, + getDeploymentTargetSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listGameServerDeploymentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getGameServerDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createGameServerDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteGameServerDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateGameServerDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .startRolloutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setRolloutTargetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .commitRolloutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .revertRolloutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getDeploymentTargetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createGameServerDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteGameServerDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateGameServerDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . + newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .startRolloutOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .setRolloutTargetOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .commitRolloutOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .revertRolloutOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(GameServerDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(GameServerDeploymentsServiceStubSettings settings) { + super(settings); + + listGameServerDeploymentsSettings = settings.listGameServerDeploymentsSettings.toBuilder(); + getGameServerDeploymentSettings = settings.getGameServerDeploymentSettings.toBuilder(); + createGameServerDeploymentSettings = settings.createGameServerDeploymentSettings.toBuilder(); + createGameServerDeploymentOperationSettings = + settings.createGameServerDeploymentOperationSettings.toBuilder(); + deleteGameServerDeploymentSettings = settings.deleteGameServerDeploymentSettings.toBuilder(); + deleteGameServerDeploymentOperationSettings = + settings.deleteGameServerDeploymentOperationSettings.toBuilder(); + updateGameServerDeploymentSettings = settings.updateGameServerDeploymentSettings.toBuilder(); + updateGameServerDeploymentOperationSettings = + settings.updateGameServerDeploymentOperationSettings.toBuilder(); + startRolloutSettings = settings.startRolloutSettings.toBuilder(); + startRolloutOperationSettings = settings.startRolloutOperationSettings.toBuilder(); + setRolloutTargetSettings = settings.setRolloutTargetSettings.toBuilder(); + setRolloutTargetOperationSettings = settings.setRolloutTargetOperationSettings.toBuilder(); + commitRolloutSettings = settings.commitRolloutSettings.toBuilder(); + commitRolloutOperationSettings = settings.commitRolloutOperationSettings.toBuilder(); + revertRolloutSettings = settings.revertRolloutSettings.toBuilder(); + revertRolloutOperationSettings = settings.revertRolloutOperationSettings.toBuilder(); + getDeploymentTargetSettings = settings.getDeploymentTargetSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listGameServerDeploymentsSettings, + getGameServerDeploymentSettings, + createGameServerDeploymentSettings, + deleteGameServerDeploymentSettings, + updateGameServerDeploymentSettings, + startRolloutSettings, + setRolloutTargetSettings, + commitRolloutSettings, + revertRolloutSettings, + getDeploymentTargetSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listGameServerDeployments. */ + public PagedCallSettings.Builder< + ListGameServerDeploymentsRequest, + ListGameServerDeploymentsResponse, + ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsSettings() { + return listGameServerDeploymentsSettings; + } + + /** Returns the builder for the settings used for calls to getGameServerDeployment. */ + public UnaryCallSettings.Builder + getGameServerDeploymentSettings() { + return getGameServerDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to createGameServerDeployment. */ + public UnaryCallSettings.Builder + createGameServerDeploymentSettings() { + return createGameServerDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to createGameServerDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateGameServerDeploymentRequest, GameServerDeployment, Empty> + createGameServerDeploymentOperationSettings() { + return createGameServerDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteGameServerDeployment. */ + public UnaryCallSettings.Builder + deleteGameServerDeploymentSettings() { + return deleteGameServerDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to deleteGameServerDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteGameServerDeploymentOperationSettings() { + return deleteGameServerDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateGameServerDeployment. */ + public UnaryCallSettings.Builder + updateGameServerDeploymentSettings() { + return updateGameServerDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to updateGameServerDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdateGameServerDeploymentRequest, GameServerDeployment, Empty> + updateGameServerDeploymentOperationSettings() { + return updateGameServerDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to startRollout. */ + public UnaryCallSettings.Builder startRolloutSettings() { + return startRolloutSettings; + } + + /** Returns the builder for the settings used for calls to startRollout. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + startRolloutOperationSettings() { + return startRolloutOperationSettings; + } + + /** Returns the builder for the settings used for calls to setRolloutTarget. */ + public UnaryCallSettings.Builder + setRolloutTargetSettings() { + return setRolloutTargetSettings; + } + + /** Returns the builder for the settings used for calls to setRolloutTarget. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + setRolloutTargetOperationSettings() { + return setRolloutTargetOperationSettings; + } + + /** Returns the builder for the settings used for calls to commitRollout. */ + public UnaryCallSettings.Builder commitRolloutSettings() { + return commitRolloutSettings; + } + + /** Returns the builder for the settings used for calls to commitRollout. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + commitRolloutOperationSettings() { + return commitRolloutOperationSettings; + } + + /** Returns the builder for the settings used for calls to revertRollout. */ + public UnaryCallSettings.Builder revertRolloutSettings() { + return revertRolloutSettings; + } + + /** Returns the builder for the settings used for calls to revertRollout. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + revertRolloutOperationSettings() { + return revertRolloutOperationSettings; + } + + /** Returns the builder for the settings used for calls to getDeploymentTarget. */ + public UnaryCallSettings.Builder + getDeploymentTargetSettings() { + return getDeploymentTargetSettings; + } + + @Override + public GameServerDeploymentsServiceStubSettings build() throws IOException { + return new GameServerDeploymentsServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceCallableFactory.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceCallableFactory.java new file mode 100644 index 000000000000..2d6d393c4ce4 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for gameservices API (prod). + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcAllocationPoliciesServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceStub.java new file mode 100644 index 000000000000..63483856a5cb --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcAllocationPoliciesServiceStub.java @@ -0,0 +1,380 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.AllocationPolicy; +import com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse; +import com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcAllocationPoliciesServiceStub extends AllocationPoliciesServiceStub { + + private static final MethodDescriptor< + ListAllocationPoliciesRequest, ListAllocationPoliciesResponse> + listAllocationPoliciesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService/ListAllocationPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAllocationPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAllocationPoliciesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getAllocationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService/GetAllocationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAllocationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AllocationPolicy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createAllocationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService/CreateAllocationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAllocationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteAllocationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService/DeleteAllocationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAllocationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateAllocationPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.AllocationPoliciesService/UpdateAllocationPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAllocationPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + listAllocationPoliciesCallable; + private final UnaryCallable + listAllocationPoliciesPagedCallable; + private final UnaryCallable + getAllocationPolicyCallable; + private final UnaryCallable + createAllocationPolicyCallable; + private final OperationCallable + createAllocationPolicyOperationCallable; + private final UnaryCallable + deleteAllocationPolicyCallable; + private final OperationCallable + deleteAllocationPolicyOperationCallable; + private final UnaryCallable + updateAllocationPolicyCallable; + private final OperationCallable + updateAllocationPolicyOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAllocationPoliciesServiceStub create( + AllocationPoliciesServiceStubSettings settings) throws IOException { + return new GrpcAllocationPoliciesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAllocationPoliciesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAllocationPoliciesServiceStub( + AllocationPoliciesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAllocationPoliciesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAllocationPoliciesServiceStub( + AllocationPoliciesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAllocationPoliciesServiceStub, 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 GrpcAllocationPoliciesServiceStub( + AllocationPoliciesServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAllocationPoliciesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAllocationPoliciesServiceStub, 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 GrpcAllocationPoliciesServiceStub( + AllocationPoliciesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listAllocationPoliciesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listAllocationPoliciesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAllocationPoliciesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getAllocationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAllocationPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetAllocationPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createAllocationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAllocationPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateAllocationPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteAllocationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAllocationPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteAllocationPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateAllocationPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAllocationPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateAllocationPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "allocation_policy.name", + String.valueOf(request.getAllocationPolicy().getName())); + return params.build(); + } + }) + .build(); + + this.listAllocationPoliciesCallable = + callableFactory.createUnaryCallable( + listAllocationPoliciesTransportSettings, + settings.listAllocationPoliciesSettings(), + clientContext); + this.listAllocationPoliciesPagedCallable = + callableFactory.createPagedCallable( + listAllocationPoliciesTransportSettings, + settings.listAllocationPoliciesSettings(), + clientContext); + this.getAllocationPolicyCallable = + callableFactory.createUnaryCallable( + getAllocationPolicyTransportSettings, + settings.getAllocationPolicySettings(), + clientContext); + this.createAllocationPolicyCallable = + callableFactory.createUnaryCallable( + createAllocationPolicyTransportSettings, + settings.createAllocationPolicySettings(), + clientContext); + this.createAllocationPolicyOperationCallable = + callableFactory.createOperationCallable( + createAllocationPolicyTransportSettings, + settings.createAllocationPolicyOperationSettings(), + clientContext, + this.operationsStub); + this.deleteAllocationPolicyCallable = + callableFactory.createUnaryCallable( + deleteAllocationPolicyTransportSettings, + settings.deleteAllocationPolicySettings(), + clientContext); + this.deleteAllocationPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteAllocationPolicyTransportSettings, + settings.deleteAllocationPolicyOperationSettings(), + clientContext, + this.operationsStub); + this.updateAllocationPolicyCallable = + callableFactory.createUnaryCallable( + updateAllocationPolicyTransportSettings, + settings.updateAllocationPolicySettings(), + clientContext); + this.updateAllocationPolicyOperationCallable = + callableFactory.createOperationCallable( + updateAllocationPolicyTransportSettings, + settings.updateAllocationPolicyOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listAllocationPoliciesPagedCallable() { + return listAllocationPoliciesPagedCallable; + } + + public UnaryCallable + listAllocationPoliciesCallable() { + return listAllocationPoliciesCallable; + } + + public UnaryCallable getAllocationPolicyCallable() { + return getAllocationPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createAllocationPolicyOperationCallable() { + return createAllocationPolicyOperationCallable; + } + + public UnaryCallable createAllocationPolicyCallable() { + return createAllocationPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteAllocationPolicyOperationCallable() { + return deleteAllocationPolicyOperationCallable; + } + + public UnaryCallable deleteAllocationPolicyCallable() { + return deleteAllocationPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateAllocationPolicyOperationCallable() { + return updateAllocationPolicyOperationCallable; + } + + public UnaryCallable updateAllocationPolicyCallable() { + return updateAllocationPolicyCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceCallableFactory.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceCallableFactory.java new file mode 100644 index 000000000000..69f0da21d448 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for gameservices API (prod). + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcGameServerClustersServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceStub.java new file mode 100644 index 000000000000..342bbfc6a7ba --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerClustersServiceStub.java @@ -0,0 +1,384 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerClustersServiceClient.ListGameServerClustersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.GameServerCluster; +import com.google.cloud.gaming.v1alpha.GetGameServerClusterRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerClustersResponse; +import com.google.cloud.gaming.v1alpha.UpdateGameServerClusterRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcGameServerClustersServiceStub extends GameServerClustersServiceStub { + + private static final MethodDescriptor< + ListGameServerClustersRequest, ListGameServerClustersResponse> + listGameServerClustersMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService/ListGameServerClusters") + .setRequestMarshaller( + ProtoUtils.marshaller(ListGameServerClustersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListGameServerClustersResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getGameServerClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService/GetGameServerCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(GetGameServerClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(GameServerCluster.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createGameServerClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService/CreateGameServerCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateGameServerClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteGameServerClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService/DeleteGameServerCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteGameServerClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateGameServerClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerClustersService/UpdateGameServerCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateGameServerClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + listGameServerClustersCallable; + private final UnaryCallable + listGameServerClustersPagedCallable; + private final UnaryCallable + getGameServerClusterCallable; + private final UnaryCallable + createGameServerClusterCallable; + private final OperationCallable + createGameServerClusterOperationCallable; + private final UnaryCallable + deleteGameServerClusterCallable; + private final OperationCallable + deleteGameServerClusterOperationCallable; + private final UnaryCallable + updateGameServerClusterCallable; + private final OperationCallable + updateGameServerClusterOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcGameServerClustersServiceStub create( + GameServerClustersServiceStubSettings settings) throws IOException { + return new GrpcGameServerClustersServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcGameServerClustersServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcGameServerClustersServiceStub( + GameServerClustersServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcGameServerClustersServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcGameServerClustersServiceStub( + GameServerClustersServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcGameServerClustersServiceStub, 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 GrpcGameServerClustersServiceStub( + GameServerClustersServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcGameServerClustersServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcGameServerClustersServiceStub, 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 GrpcGameServerClustersServiceStub( + GameServerClustersServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listGameServerClustersTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listGameServerClustersMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListGameServerClustersRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getGameServerClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getGameServerClusterMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetGameServerClusterRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createGameServerClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createGameServerClusterMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateGameServerClusterRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteGameServerClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteGameServerClusterMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteGameServerClusterRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateGameServerClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateGameServerClusterMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateGameServerClusterRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "game_server_cluster.name", + String.valueOf(request.getGameServerCluster().getName())); + return params.build(); + } + }) + .build(); + + this.listGameServerClustersCallable = + callableFactory.createUnaryCallable( + listGameServerClustersTransportSettings, + settings.listGameServerClustersSettings(), + clientContext); + this.listGameServerClustersPagedCallable = + callableFactory.createPagedCallable( + listGameServerClustersTransportSettings, + settings.listGameServerClustersSettings(), + clientContext); + this.getGameServerClusterCallable = + callableFactory.createUnaryCallable( + getGameServerClusterTransportSettings, + settings.getGameServerClusterSettings(), + clientContext); + this.createGameServerClusterCallable = + callableFactory.createUnaryCallable( + createGameServerClusterTransportSettings, + settings.createGameServerClusterSettings(), + clientContext); + this.createGameServerClusterOperationCallable = + callableFactory.createOperationCallable( + createGameServerClusterTransportSettings, + settings.createGameServerClusterOperationSettings(), + clientContext, + this.operationsStub); + this.deleteGameServerClusterCallable = + callableFactory.createUnaryCallable( + deleteGameServerClusterTransportSettings, + settings.deleteGameServerClusterSettings(), + clientContext); + this.deleteGameServerClusterOperationCallable = + callableFactory.createOperationCallable( + deleteGameServerClusterTransportSettings, + settings.deleteGameServerClusterOperationSettings(), + clientContext, + this.operationsStub); + this.updateGameServerClusterCallable = + callableFactory.createUnaryCallable( + updateGameServerClusterTransportSettings, + settings.updateGameServerClusterSettings(), + clientContext); + this.updateGameServerClusterOperationCallable = + callableFactory.createOperationCallable( + updateGameServerClusterTransportSettings, + settings.updateGameServerClusterOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listGameServerClustersPagedCallable() { + return listGameServerClustersPagedCallable; + } + + public UnaryCallable + listGameServerClustersCallable() { + return listGameServerClustersCallable; + } + + public UnaryCallable + getGameServerClusterCallable() { + return getGameServerClusterCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createGameServerClusterOperationCallable() { + return createGameServerClusterOperationCallable; + } + + public UnaryCallable + createGameServerClusterCallable() { + return createGameServerClusterCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteGameServerClusterOperationCallable() { + return deleteGameServerClusterOperationCallable; + } + + public UnaryCallable + deleteGameServerClusterCallable() { + return deleteGameServerClusterCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateGameServerClusterOperationCallable() { + return updateGameServerClusterOperationCallable; + } + + public UnaryCallable + updateGameServerClusterCallable() { + return updateGameServerClusterCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceCallableFactory.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceCallableFactory.java new file mode 100644 index 000000000000..5f139cdd0b4d --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for gameservices API (prod). + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcGameServerDeploymentsServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceStub.java new file mode 100644 index 000000000000..ab62c221f151 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcGameServerDeploymentsServiceStub.java @@ -0,0 +1,611 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CommitRolloutRequest; +import com.google.cloud.gaming.v1alpha.CreateGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeleteGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.DeploymentTarget; +import com.google.cloud.gaming.v1alpha.GameServerDeployment; +import com.google.cloud.gaming.v1alpha.GetDeploymentTargetRequest; +import com.google.cloud.gaming.v1alpha.GetGameServerDeploymentRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsRequest; +import com.google.cloud.gaming.v1alpha.ListGameServerDeploymentsResponse; +import com.google.cloud.gaming.v1alpha.RevertRolloutRequest; +import com.google.cloud.gaming.v1alpha.SetRolloutTargetRequest; +import com.google.cloud.gaming.v1alpha.StartRolloutRequest; +import com.google.cloud.gaming.v1alpha.UpdateGameServerDeploymentRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcGameServerDeploymentsServiceStub extends GameServerDeploymentsServiceStub { + + private static final MethodDescriptor< + ListGameServerDeploymentsRequest, ListGameServerDeploymentsResponse> + listGameServerDeploymentsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/ListGameServerDeployments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListGameServerDeploymentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListGameServerDeploymentsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getGameServerDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/GetGameServerDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetGameServerDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GameServerDeployment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createGameServerDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/CreateGameServerDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateGameServerDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteGameServerDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/DeleteGameServerDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteGameServerDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateGameServerDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/UpdateGameServerDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateGameServerDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + startRolloutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/StartRollout") + .setRequestMarshaller(ProtoUtils.marshaller(StartRolloutRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + setRolloutTargetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/SetRolloutTarget") + .setRequestMarshaller( + ProtoUtils.marshaller(SetRolloutTargetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + commitRolloutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/CommitRollout") + .setRequestMarshaller( + ProtoUtils.marshaller(CommitRolloutRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + revertRolloutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/RevertRollout") + .setRequestMarshaller( + ProtoUtils.marshaller(RevertRolloutRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getDeploymentTargetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.GameServerDeploymentsService/GetDeploymentTarget") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDeploymentTargetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DeploymentTarget.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + listGameServerDeploymentsCallable; + private final UnaryCallable< + ListGameServerDeploymentsRequest, ListGameServerDeploymentsPagedResponse> + listGameServerDeploymentsPagedCallable; + private final UnaryCallable + getGameServerDeploymentCallable; + private final UnaryCallable + createGameServerDeploymentCallable; + private final OperationCallable + createGameServerDeploymentOperationCallable; + private final UnaryCallable + deleteGameServerDeploymentCallable; + private final OperationCallable + deleteGameServerDeploymentOperationCallable; + private final UnaryCallable + updateGameServerDeploymentCallable; + private final OperationCallable + updateGameServerDeploymentOperationCallable; + private final UnaryCallable startRolloutCallable; + private final OperationCallable + startRolloutOperationCallable; + private final UnaryCallable setRolloutTargetCallable; + private final OperationCallable + setRolloutTargetOperationCallable; + private final UnaryCallable commitRolloutCallable; + private final OperationCallable + commitRolloutOperationCallable; + private final UnaryCallable revertRolloutCallable; + private final OperationCallable + revertRolloutOperationCallable; + private final UnaryCallable + getDeploymentTargetCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcGameServerDeploymentsServiceStub create( + GameServerDeploymentsServiceStubSettings settings) throws IOException { + return new GrpcGameServerDeploymentsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcGameServerDeploymentsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcGameServerDeploymentsServiceStub( + GameServerDeploymentsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcGameServerDeploymentsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcGameServerDeploymentsServiceStub( + GameServerDeploymentsServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcGameServerDeploymentsServiceStub, 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 GrpcGameServerDeploymentsServiceStub( + GameServerDeploymentsServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcGameServerDeploymentsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcGameServerDeploymentsServiceStub, 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 GrpcGameServerDeploymentsServiceStub( + GameServerDeploymentsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listGameServerDeploymentsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listGameServerDeploymentsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListGameServerDeploymentsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getGameServerDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getGameServerDeploymentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetGameServerDeploymentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + createGameServerDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createGameServerDeploymentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + CreateGameServerDeploymentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + deleteGameServerDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteGameServerDeploymentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + DeleteGameServerDeploymentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + updateGameServerDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateGameServerDeploymentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + UpdateGameServerDeploymentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "game_server_deployment.name", + String.valueOf(request.getGameServerDeployment().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings startRolloutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startRolloutMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StartRolloutRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setRolloutTargetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setRolloutTargetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetRolloutTargetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings commitRolloutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(commitRolloutMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CommitRolloutRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings revertRolloutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(revertRolloutMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RevertRolloutRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + getDeploymentTargetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDeploymentTargetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDeploymentTargetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listGameServerDeploymentsCallable = + callableFactory.createUnaryCallable( + listGameServerDeploymentsTransportSettings, + settings.listGameServerDeploymentsSettings(), + clientContext); + this.listGameServerDeploymentsPagedCallable = + callableFactory.createPagedCallable( + listGameServerDeploymentsTransportSettings, + settings.listGameServerDeploymentsSettings(), + clientContext); + this.getGameServerDeploymentCallable = + callableFactory.createUnaryCallable( + getGameServerDeploymentTransportSettings, + settings.getGameServerDeploymentSettings(), + clientContext); + this.createGameServerDeploymentCallable = + callableFactory.createUnaryCallable( + createGameServerDeploymentTransportSettings, + settings.createGameServerDeploymentSettings(), + clientContext); + this.createGameServerDeploymentOperationCallable = + callableFactory.createOperationCallable( + createGameServerDeploymentTransportSettings, + settings.createGameServerDeploymentOperationSettings(), + clientContext, + this.operationsStub); + this.deleteGameServerDeploymentCallable = + callableFactory.createUnaryCallable( + deleteGameServerDeploymentTransportSettings, + settings.deleteGameServerDeploymentSettings(), + clientContext); + this.deleteGameServerDeploymentOperationCallable = + callableFactory.createOperationCallable( + deleteGameServerDeploymentTransportSettings, + settings.deleteGameServerDeploymentOperationSettings(), + clientContext, + this.operationsStub); + this.updateGameServerDeploymentCallable = + callableFactory.createUnaryCallable( + updateGameServerDeploymentTransportSettings, + settings.updateGameServerDeploymentSettings(), + clientContext); + this.updateGameServerDeploymentOperationCallable = + callableFactory.createOperationCallable( + updateGameServerDeploymentTransportSettings, + settings.updateGameServerDeploymentOperationSettings(), + clientContext, + this.operationsStub); + this.startRolloutCallable = + callableFactory.createUnaryCallable( + startRolloutTransportSettings, settings.startRolloutSettings(), clientContext); + this.startRolloutOperationCallable = + callableFactory.createOperationCallable( + startRolloutTransportSettings, + settings.startRolloutOperationSettings(), + clientContext, + this.operationsStub); + this.setRolloutTargetCallable = + callableFactory.createUnaryCallable( + setRolloutTargetTransportSettings, settings.setRolloutTargetSettings(), clientContext); + this.setRolloutTargetOperationCallable = + callableFactory.createOperationCallable( + setRolloutTargetTransportSettings, + settings.setRolloutTargetOperationSettings(), + clientContext, + this.operationsStub); + this.commitRolloutCallable = + callableFactory.createUnaryCallable( + commitRolloutTransportSettings, settings.commitRolloutSettings(), clientContext); + this.commitRolloutOperationCallable = + callableFactory.createOperationCallable( + commitRolloutTransportSettings, + settings.commitRolloutOperationSettings(), + clientContext, + this.operationsStub); + this.revertRolloutCallable = + callableFactory.createUnaryCallable( + revertRolloutTransportSettings, settings.revertRolloutSettings(), clientContext); + this.revertRolloutOperationCallable = + callableFactory.createOperationCallable( + revertRolloutTransportSettings, + settings.revertRolloutOperationSettings(), + clientContext, + this.operationsStub); + this.getDeploymentTargetCallable = + callableFactory.createUnaryCallable( + getDeploymentTargetTransportSettings, + settings.getDeploymentTargetSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listGameServerDeploymentsPagedCallable() { + return listGameServerDeploymentsPagedCallable; + } + + public UnaryCallable + listGameServerDeploymentsCallable() { + return listGameServerDeploymentsCallable; + } + + public UnaryCallable + getGameServerDeploymentCallable() { + return getGameServerDeploymentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createGameServerDeploymentOperationCallable() { + return createGameServerDeploymentOperationCallable; + } + + public UnaryCallable + createGameServerDeploymentCallable() { + return createGameServerDeploymentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteGameServerDeploymentOperationCallable() { + return deleteGameServerDeploymentOperationCallable; + } + + public UnaryCallable + deleteGameServerDeploymentCallable() { + return deleteGameServerDeploymentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateGameServerDeploymentOperationCallable() { + return updateGameServerDeploymentOperationCallable; + } + + public UnaryCallable + updateGameServerDeploymentCallable() { + return updateGameServerDeploymentCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + startRolloutOperationCallable() { + return startRolloutOperationCallable; + } + + public UnaryCallable startRolloutCallable() { + return startRolloutCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + setRolloutTargetOperationCallable() { + return setRolloutTargetOperationCallable; + } + + public UnaryCallable setRolloutTargetCallable() { + return setRolloutTargetCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + commitRolloutOperationCallable() { + return commitRolloutOperationCallable; + } + + public UnaryCallable commitRolloutCallable() { + return commitRolloutCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + revertRolloutOperationCallable() { + return revertRolloutOperationCallable; + } + + public UnaryCallable revertRolloutCallable() { + return revertRolloutCallable; + } + + public UnaryCallable getDeploymentTargetCallable() { + return getDeploymentTargetCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceCallableFactory.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceCallableFactory.java new file mode 100644 index 000000000000..3e55a4458e5f --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for gameservices API (prod). + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcRealmsServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceStub.java new file mode 100644 index 000000000000..d6ea640cf915 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcRealmsServiceStub.java @@ -0,0 +1,326 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.RealmsServiceClient.ListRealmsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateRealmRequest; +import com.google.cloud.gaming.v1alpha.DeleteRealmRequest; +import com.google.cloud.gaming.v1alpha.GetRealmRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsResponse; +import com.google.cloud.gaming.v1alpha.Realm; +import com.google.cloud.gaming.v1alpha.UpdateRealmRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcRealmsServiceStub extends RealmsServiceStub { + + private static final MethodDescriptor + listRealmsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.gaming.v1alpha.RealmsService/ListRealms") + .setRequestMarshaller(ProtoUtils.marshaller(ListRealmsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListRealmsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getRealmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.gaming.v1alpha.RealmsService/GetRealm") + .setRequestMarshaller(ProtoUtils.marshaller(GetRealmRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Realm.getDefaultInstance())) + .build(); + private static final MethodDescriptor createRealmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.gaming.v1alpha.RealmsService/CreateRealm") + .setRequestMarshaller(ProtoUtils.marshaller(CreateRealmRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteRealmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.gaming.v1alpha.RealmsService/DeleteRealm") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRealmRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateRealmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.gaming.v1alpha.RealmsService/UpdateRealm") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateRealmRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable listRealmsCallable; + private final UnaryCallable listRealmsPagedCallable; + private final UnaryCallable getRealmCallable; + private final UnaryCallable createRealmCallable; + private final OperationCallable createRealmOperationCallable; + private final UnaryCallable deleteRealmCallable; + private final OperationCallable deleteRealmOperationCallable; + private final UnaryCallable updateRealmCallable; + private final OperationCallable updateRealmOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRealmsServiceStub create(RealmsServiceStubSettings settings) + throws IOException { + return new GrpcRealmsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRealmsServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcRealmsServiceStub(RealmsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRealmsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRealmsServiceStub( + RealmsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRealmsServiceStub, 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 GrpcRealmsServiceStub(RealmsServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRealmsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRealmsServiceStub, 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 GrpcRealmsServiceStub( + RealmsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listRealmsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRealmsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListRealmsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getRealmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRealmMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetRealmRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createRealmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRealmMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateRealmRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteRealmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRealmMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteRealmRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateRealmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRealmMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateRealmRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("realm.name", String.valueOf(request.getRealm().getName())); + return params.build(); + } + }) + .build(); + + this.listRealmsCallable = + callableFactory.createUnaryCallable( + listRealmsTransportSettings, settings.listRealmsSettings(), clientContext); + this.listRealmsPagedCallable = + callableFactory.createPagedCallable( + listRealmsTransportSettings, settings.listRealmsSettings(), clientContext); + this.getRealmCallable = + callableFactory.createUnaryCallable( + getRealmTransportSettings, settings.getRealmSettings(), clientContext); + this.createRealmCallable = + callableFactory.createUnaryCallable( + createRealmTransportSettings, settings.createRealmSettings(), clientContext); + this.createRealmOperationCallable = + callableFactory.createOperationCallable( + createRealmTransportSettings, + settings.createRealmOperationSettings(), + clientContext, + this.operationsStub); + this.deleteRealmCallable = + callableFactory.createUnaryCallable( + deleteRealmTransportSettings, settings.deleteRealmSettings(), clientContext); + this.deleteRealmOperationCallable = + callableFactory.createOperationCallable( + deleteRealmTransportSettings, + settings.deleteRealmOperationSettings(), + clientContext, + this.operationsStub); + this.updateRealmCallable = + callableFactory.createUnaryCallable( + updateRealmTransportSettings, settings.updateRealmSettings(), clientContext); + this.updateRealmOperationCallable = + callableFactory.createOperationCallable( + updateRealmTransportSettings, + settings.updateRealmOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable listRealmsPagedCallable() { + return listRealmsPagedCallable; + } + + public UnaryCallable listRealmsCallable() { + return listRealmsCallable; + } + + public UnaryCallable getRealmCallable() { + return getRealmCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable createRealmOperationCallable() { + return createRealmOperationCallable; + } + + public UnaryCallable createRealmCallable() { + return createRealmCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable deleteRealmOperationCallable() { + return deleteRealmOperationCallable; + } + + public UnaryCallable deleteRealmCallable() { + return deleteRealmCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable updateRealmOperationCallable() { + return updateRealmOperationCallable; + } + + public UnaryCallable updateRealmCallable() { + return updateRealmCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceCallableFactory.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceCallableFactory.java new file mode 100644 index 000000000000..6443a186ca0b --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for gameservices API (prod). + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcScalingPoliciesServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceStub.java new file mode 100644 index 000000000000..60dc671e3d14 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/GrpcScalingPoliciesServiceStub.java @@ -0,0 +1,366 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceClient.ListScalingPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse; +import com.google.cloud.gaming.v1alpha.ScalingPolicy; +import com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcScalingPoliciesServiceStub extends ScalingPoliciesServiceStub { + + private static final MethodDescriptor + listScalingPoliciesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService/ListScalingPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(ListScalingPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListScalingPoliciesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getScalingPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService/GetScalingPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(GetScalingPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScalingPolicy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createScalingPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService/CreateScalingPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateScalingPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteScalingPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService/DeleteScalingPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteScalingPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateScalingPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.gaming.v1alpha.ScalingPoliciesService/UpdateScalingPolicy") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateScalingPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable + listScalingPoliciesCallable; + private final UnaryCallable + listScalingPoliciesPagedCallable; + private final UnaryCallable getScalingPolicyCallable; + private final UnaryCallable createScalingPolicyCallable; + private final OperationCallable + createScalingPolicyOperationCallable; + private final UnaryCallable deleteScalingPolicyCallable; + private final OperationCallable + deleteScalingPolicyOperationCallable; + private final UnaryCallable updateScalingPolicyCallable; + private final OperationCallable + updateScalingPolicyOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcScalingPoliciesServiceStub create( + ScalingPoliciesServiceStubSettings settings) throws IOException { + return new GrpcScalingPoliciesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcScalingPoliciesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcScalingPoliciesServiceStub( + ScalingPoliciesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcScalingPoliciesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcScalingPoliciesServiceStub( + ScalingPoliciesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcScalingPoliciesServiceStub, 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 GrpcScalingPoliciesServiceStub( + ScalingPoliciesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcScalingPoliciesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcScalingPoliciesServiceStub, 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 GrpcScalingPoliciesServiceStub( + ScalingPoliciesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listScalingPoliciesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listScalingPoliciesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListScalingPoliciesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getScalingPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getScalingPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetScalingPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createScalingPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createScalingPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateScalingPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteScalingPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteScalingPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteScalingPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateScalingPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateScalingPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateScalingPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "scaling_policy.name", + String.valueOf(request.getScalingPolicy().getName())); + return params.build(); + } + }) + .build(); + + this.listScalingPoliciesCallable = + callableFactory.createUnaryCallable( + listScalingPoliciesTransportSettings, + settings.listScalingPoliciesSettings(), + clientContext); + this.listScalingPoliciesPagedCallable = + callableFactory.createPagedCallable( + listScalingPoliciesTransportSettings, + settings.listScalingPoliciesSettings(), + clientContext); + this.getScalingPolicyCallable = + callableFactory.createUnaryCallable( + getScalingPolicyTransportSettings, settings.getScalingPolicySettings(), clientContext); + this.createScalingPolicyCallable = + callableFactory.createUnaryCallable( + createScalingPolicyTransportSettings, + settings.createScalingPolicySettings(), + clientContext); + this.createScalingPolicyOperationCallable = + callableFactory.createOperationCallable( + createScalingPolicyTransportSettings, + settings.createScalingPolicyOperationSettings(), + clientContext, + this.operationsStub); + this.deleteScalingPolicyCallable = + callableFactory.createUnaryCallable( + deleteScalingPolicyTransportSettings, + settings.deleteScalingPolicySettings(), + clientContext); + this.deleteScalingPolicyOperationCallable = + callableFactory.createOperationCallable( + deleteScalingPolicyTransportSettings, + settings.deleteScalingPolicyOperationSettings(), + clientContext, + this.operationsStub); + this.updateScalingPolicyCallable = + callableFactory.createUnaryCallable( + updateScalingPolicyTransportSettings, + settings.updateScalingPolicySettings(), + clientContext); + this.updateScalingPolicyOperationCallable = + callableFactory.createOperationCallable( + updateScalingPolicyTransportSettings, + settings.updateScalingPolicyOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listScalingPoliciesPagedCallable() { + return listScalingPoliciesPagedCallable; + } + + public UnaryCallable + listScalingPoliciesCallable() { + return listScalingPoliciesCallable; + } + + public UnaryCallable getScalingPolicyCallable() { + return getScalingPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createScalingPolicyOperationCallable() { + return createScalingPolicyOperationCallable; + } + + public UnaryCallable createScalingPolicyCallable() { + return createScalingPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteScalingPolicyOperationCallable() { + return deleteScalingPolicyOperationCallable; + } + + public UnaryCallable deleteScalingPolicyCallable() { + return deleteScalingPolicyCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateScalingPolicyOperationCallable() { + return updateScalingPolicyOperationCallable; + } + + public UnaryCallable updateScalingPolicyCallable() { + return updateScalingPolicyCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStub.java new file mode 100644 index 000000000000..7f0f76b5475a --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStub.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.RealmsServiceClient.ListRealmsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateRealmRequest; +import com.google.cloud.gaming.v1alpha.DeleteRealmRequest; +import com.google.cloud.gaming.v1alpha.GetRealmRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsResponse; +import com.google.cloud.gaming.v1alpha.Realm; +import com.google.cloud.gaming.v1alpha.UpdateRealmRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RealmsServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listRealmsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRealmsPagedCallable()"); + } + + public UnaryCallable listRealmsCallable() { + throw new UnsupportedOperationException("Not implemented: listRealmsCallable()"); + } + + public UnaryCallable getRealmCallable() { + throw new UnsupportedOperationException("Not implemented: getRealmCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable createRealmOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createRealmOperationCallable()"); + } + + public UnaryCallable createRealmCallable() { + throw new UnsupportedOperationException("Not implemented: createRealmCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable deleteRealmOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRealmOperationCallable()"); + } + + public UnaryCallable deleteRealmCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRealmCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable updateRealmOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateRealmOperationCallable()"); + } + + public UnaryCallable updateRealmCallable() { + throw new UnsupportedOperationException("Not implemented: updateRealmCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStubSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStubSettings.java new file mode 100644 index 000000000000..15344ff764eb --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/RealmsServiceStubSettings.java @@ -0,0 +1,568 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.RealmsServiceClient.ListRealmsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateRealmRequest; +import com.google.cloud.gaming.v1alpha.DeleteRealmRequest; +import com.google.cloud.gaming.v1alpha.GetRealmRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsRequest; +import com.google.cloud.gaming.v1alpha.ListRealmsResponse; +import com.google.cloud.gaming.v1alpha.Realm; +import com.google.cloud.gaming.v1alpha.UpdateRealmRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RealmsServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getRealm to 30 seconds: + * + *

+ * 
+ * RealmsServiceStubSettings.Builder realmsServiceSettingsBuilder =
+ *     RealmsServiceStubSettings.newBuilder();
+ * realmsServiceSettingsBuilder.getRealmSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RealmsServiceStubSettings realmsServiceSettings = realmsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RealmsServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings + listRealmsSettings; + private final UnaryCallSettings getRealmSettings; + private final UnaryCallSettings createRealmSettings; + private final OperationCallSettings + createRealmOperationSettings; + private final UnaryCallSettings deleteRealmSettings; + private final OperationCallSettings + deleteRealmOperationSettings; + private final UnaryCallSettings updateRealmSettings; + private final OperationCallSettings + updateRealmOperationSettings; + + /** Returns the object with the settings used for calls to listRealms. */ + public PagedCallSettings + listRealmsSettings() { + return listRealmsSettings; + } + + /** Returns the object with the settings used for calls to getRealm. */ + public UnaryCallSettings getRealmSettings() { + return getRealmSettings; + } + + /** Returns the object with the settings used for calls to createRealm. */ + public UnaryCallSettings createRealmSettings() { + return createRealmSettings; + } + + /** Returns the object with the settings used for calls to createRealm. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings createRealmOperationSettings() { + return createRealmOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteRealm. */ + public UnaryCallSettings deleteRealmSettings() { + return deleteRealmSettings; + } + + /** Returns the object with the settings used for calls to deleteRealm. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings deleteRealmOperationSettings() { + return deleteRealmOperationSettings; + } + + /** Returns the object with the settings used for calls to updateRealm. */ + public UnaryCallSettings updateRealmSettings() { + return updateRealmSettings; + } + + /** Returns the object with the settings used for calls to updateRealm. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings updateRealmOperationSettings() { + return updateRealmOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RealmsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRealmsServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "gameservices.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RealmsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RealmsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listRealmsSettings = settingsBuilder.listRealmsSettings().build(); + getRealmSettings = settingsBuilder.getRealmSettings().build(); + createRealmSettings = settingsBuilder.createRealmSettings().build(); + createRealmOperationSettings = settingsBuilder.createRealmOperationSettings().build(); + deleteRealmSettings = settingsBuilder.deleteRealmSettings().build(); + deleteRealmOperationSettings = settingsBuilder.deleteRealmOperationSettings().build(); + updateRealmSettings = settingsBuilder.updateRealmSettings().build(); + updateRealmOperationSettings = settingsBuilder.updateRealmOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_REALMS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRealmsRequest injectToken(ListRealmsRequest payload, String token) { + return ListRealmsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRealmsRequest injectPageSize(ListRealmsRequest payload, int pageSize) { + return ListRealmsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRealmsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRealmsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRealmsResponse payload) { + return payload.getRealmsList() != null + ? payload.getRealmsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListRealmsRequest, ListRealmsResponse, ListRealmsPagedResponse> + LIST_REALMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRealmsRequest, ListRealmsResponse, ListRealmsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRealmsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_REALMS_PAGE_STR_DESC, request, context); + return ListRealmsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for RealmsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListRealmsRequest, ListRealmsResponse, ListRealmsPagedResponse> + listRealmsSettings; + private final UnaryCallSettings.Builder getRealmSettings; + private final UnaryCallSettings.Builder createRealmSettings; + private final OperationCallSettings.Builder + createRealmOperationSettings; + private final UnaryCallSettings.Builder deleteRealmSettings; + private final OperationCallSettings.Builder + deleteRealmOperationSettings; + private final UnaryCallSettings.Builder updateRealmSettings; + private final OperationCallSettings.Builder + updateRealmOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listRealmsSettings = PagedCallSettings.newBuilder(LIST_REALMS_PAGE_STR_FACT); + + getRealmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createRealmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createRealmOperationSettings = OperationCallSettings.newBuilder(); + + deleteRealmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteRealmOperationSettings = OperationCallSettings.newBuilder(); + + updateRealmSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateRealmOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listRealmsSettings, + getRealmSettings, + createRealmSettings, + deleteRealmSettings, + updateRealmSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listRealmsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getRealmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createRealmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteRealmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateRealmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createRealmOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Realm.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteRealmOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateRealmOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Realm.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(RealmsServiceStubSettings settings) { + super(settings); + + listRealmsSettings = settings.listRealmsSettings.toBuilder(); + getRealmSettings = settings.getRealmSettings.toBuilder(); + createRealmSettings = settings.createRealmSettings.toBuilder(); + createRealmOperationSettings = settings.createRealmOperationSettings.toBuilder(); + deleteRealmSettings = settings.deleteRealmSettings.toBuilder(); + deleteRealmOperationSettings = settings.deleteRealmOperationSettings.toBuilder(); + updateRealmSettings = settings.updateRealmSettings.toBuilder(); + updateRealmOperationSettings = settings.updateRealmOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listRealmsSettings, + getRealmSettings, + createRealmSettings, + deleteRealmSettings, + updateRealmSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listRealms. */ + public PagedCallSettings.Builder + listRealmsSettings() { + return listRealmsSettings; + } + + /** Returns the builder for the settings used for calls to getRealm. */ + public UnaryCallSettings.Builder getRealmSettings() { + return getRealmSettings; + } + + /** Returns the builder for the settings used for calls to createRealm. */ + public UnaryCallSettings.Builder createRealmSettings() { + return createRealmSettings; + } + + /** Returns the builder for the settings used for calls to createRealm. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createRealmOperationSettings() { + return createRealmOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteRealm. */ + public UnaryCallSettings.Builder deleteRealmSettings() { + return deleteRealmSettings; + } + + /** Returns the builder for the settings used for calls to deleteRealm. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteRealmOperationSettings() { + return deleteRealmOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateRealm. */ + public UnaryCallSettings.Builder updateRealmSettings() { + return updateRealmSettings; + } + + /** Returns the builder for the settings used for calls to updateRealm. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateRealmOperationSettings() { + return updateRealmOperationSettings; + } + + @Override + public RealmsServiceStubSettings build() throws IOException { + return new RealmsServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStub.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStub.java new file mode 100644 index 000000000000..85e9c30e74dd --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStub.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceClient.ListScalingPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse; +import com.google.cloud.gaming.v1alpha.ScalingPolicy; +import com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for gameservices API (prod). + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ScalingPoliciesServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listScalingPoliciesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listScalingPoliciesPagedCallable()"); + } + + public UnaryCallable + listScalingPoliciesCallable() { + throw new UnsupportedOperationException("Not implemented: listScalingPoliciesCallable()"); + } + + public UnaryCallable getScalingPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getScalingPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createScalingPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createScalingPolicyOperationCallable()"); + } + + public UnaryCallable createScalingPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: createScalingPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteScalingPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteScalingPolicyOperationCallable()"); + } + + public UnaryCallable deleteScalingPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteScalingPolicyCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateScalingPolicyOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateScalingPolicyOperationCallable()"); + } + + public UnaryCallable updateScalingPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: updateScalingPolicyCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStubSettings.java b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStubSettings.java new file mode 100644 index 000000000000..e240a05e0a2f --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/ScalingPoliciesServiceStubSettings.java @@ -0,0 +1,609 @@ +/* + * Copyright 2019 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.gaming.v1alpha.stub; + +import static com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceClient.ListScalingPoliciesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.gaming.v1alpha.CreateScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.DeleteScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.GetScalingPolicyRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesRequest; +import com.google.cloud.gaming.v1alpha.ListScalingPoliciesResponse; +import com.google.cloud.gaming.v1alpha.ScalingPolicy; +import com.google.cloud.gaming.v1alpha.UpdateScalingPolicyRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ScalingPoliciesServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (gameservices.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getScalingPolicy to 30 seconds: + * + *

+ * 
+ * ScalingPoliciesServiceStubSettings.Builder scalingPoliciesServiceSettingsBuilder =
+ *     ScalingPoliciesServiceStubSettings.newBuilder();
+ * scalingPoliciesServiceSettingsBuilder.getScalingPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ScalingPoliciesServiceStubSettings scalingPoliciesServiceSettings = scalingPoliciesServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ScalingPoliciesServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings; + private final UnaryCallSettings getScalingPolicySettings; + private final UnaryCallSettings + createScalingPolicySettings; + private final OperationCallSettings + createScalingPolicyOperationSettings; + private final UnaryCallSettings + deleteScalingPolicySettings; + private final OperationCallSettings + deleteScalingPolicyOperationSettings; + private final UnaryCallSettings + updateScalingPolicySettings; + private final OperationCallSettings + updateScalingPolicyOperationSettings; + + /** Returns the object with the settings used for calls to listScalingPolicies. */ + public PagedCallSettings< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings() { + return listScalingPoliciesSettings; + } + + /** Returns the object with the settings used for calls to getScalingPolicy. */ + public UnaryCallSettings getScalingPolicySettings() { + return getScalingPolicySettings; + } + + /** Returns the object with the settings used for calls to createScalingPolicy. */ + public UnaryCallSettings createScalingPolicySettings() { + return createScalingPolicySettings; + } + + /** Returns the object with the settings used for calls to createScalingPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createScalingPolicyOperationSettings() { + return createScalingPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteScalingPolicy. */ + public UnaryCallSettings deleteScalingPolicySettings() { + return deleteScalingPolicySettings; + } + + /** Returns the object with the settings used for calls to deleteScalingPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteScalingPolicyOperationSettings() { + return deleteScalingPolicyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateScalingPolicy. */ + public UnaryCallSettings updateScalingPolicySettings() { + return updateScalingPolicySettings; + } + + /** Returns the object with the settings used for calls to updateScalingPolicy. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateScalingPolicyOperationSettings() { + return updateScalingPolicyOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ScalingPoliciesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcScalingPoliciesServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "gameservices.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ScalingPoliciesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ScalingPoliciesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listScalingPoliciesSettings = settingsBuilder.listScalingPoliciesSettings().build(); + getScalingPolicySettings = settingsBuilder.getScalingPolicySettings().build(); + createScalingPolicySettings = settingsBuilder.createScalingPolicySettings().build(); + createScalingPolicyOperationSettings = + settingsBuilder.createScalingPolicyOperationSettings().build(); + deleteScalingPolicySettings = settingsBuilder.deleteScalingPolicySettings().build(); + deleteScalingPolicyOperationSettings = + settingsBuilder.deleteScalingPolicyOperationSettings().build(); + updateScalingPolicySettings = settingsBuilder.updateScalingPolicySettings().build(); + updateScalingPolicyOperationSettings = + settingsBuilder.updateScalingPolicyOperationSettings().build(); + } + + private static final PagedListDescriptor< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ScalingPolicy> + LIST_SCALING_POLICIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ScalingPolicy>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListScalingPoliciesRequest injectToken( + ListScalingPoliciesRequest payload, String token) { + return ListScalingPoliciesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListScalingPoliciesRequest injectPageSize( + ListScalingPoliciesRequest payload, int pageSize) { + return ListScalingPoliciesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListScalingPoliciesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListScalingPoliciesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListScalingPoliciesResponse payload) { + return payload.getScalingPoliciesList() != null + ? payload.getScalingPoliciesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListScalingPoliciesRequest, ListScalingPoliciesResponse, ListScalingPoliciesPagedResponse> + LIST_SCALING_POLICIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ListScalingPoliciesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListScalingPoliciesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SCALING_POLICIES_PAGE_STR_DESC, request, context); + return ListScalingPoliciesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ScalingPoliciesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings; + private final UnaryCallSettings.Builder + getScalingPolicySettings; + private final UnaryCallSettings.Builder + createScalingPolicySettings; + private final OperationCallSettings.Builder + createScalingPolicyOperationSettings; + private final UnaryCallSettings.Builder + deleteScalingPolicySettings; + private final OperationCallSettings.Builder + deleteScalingPolicyOperationSettings; + private final UnaryCallSettings.Builder + updateScalingPolicySettings; + private final OperationCallSettings.Builder + updateScalingPolicyOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listScalingPoliciesSettings = + PagedCallSettings.newBuilder(LIST_SCALING_POLICIES_PAGE_STR_FACT); + + getScalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createScalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createScalingPolicyOperationSettings = OperationCallSettings.newBuilder(); + + deleteScalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteScalingPolicyOperationSettings = OperationCallSettings.newBuilder(); + + updateScalingPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateScalingPolicyOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listScalingPoliciesSettings, + getScalingPolicySettings, + createScalingPolicySettings, + deleteScalingPolicySettings, + updateScalingPolicySettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listScalingPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getScalingPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createScalingPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteScalingPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateScalingPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createScalingPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ScalingPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteScalingPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateScalingPolicyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ScalingPolicy.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(ScalingPoliciesServiceStubSettings settings) { + super(settings); + + listScalingPoliciesSettings = settings.listScalingPoliciesSettings.toBuilder(); + getScalingPolicySettings = settings.getScalingPolicySettings.toBuilder(); + createScalingPolicySettings = settings.createScalingPolicySettings.toBuilder(); + createScalingPolicyOperationSettings = + settings.createScalingPolicyOperationSettings.toBuilder(); + deleteScalingPolicySettings = settings.deleteScalingPolicySettings.toBuilder(); + deleteScalingPolicyOperationSettings = + settings.deleteScalingPolicyOperationSettings.toBuilder(); + updateScalingPolicySettings = settings.updateScalingPolicySettings.toBuilder(); + updateScalingPolicyOperationSettings = + settings.updateScalingPolicyOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listScalingPoliciesSettings, + getScalingPolicySettings, + createScalingPolicySettings, + deleteScalingPolicySettings, + updateScalingPolicySettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listScalingPolicies. */ + public PagedCallSettings.Builder< + ListScalingPoliciesRequest, + ListScalingPoliciesResponse, + ListScalingPoliciesPagedResponse> + listScalingPoliciesSettings() { + return listScalingPoliciesSettings; + } + + /** Returns the builder for the settings used for calls to getScalingPolicy. */ + public UnaryCallSettings.Builder + getScalingPolicySettings() { + return getScalingPolicySettings; + } + + /** Returns the builder for the settings used for calls to createScalingPolicy. */ + public UnaryCallSettings.Builder + createScalingPolicySettings() { + return createScalingPolicySettings; + } + + /** Returns the builder for the settings used for calls to createScalingPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createScalingPolicyOperationSettings() { + return createScalingPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteScalingPolicy. */ + public UnaryCallSettings.Builder + deleteScalingPolicySettings() { + return deleteScalingPolicySettings; + } + + /** Returns the builder for the settings used for calls to deleteScalingPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteScalingPolicyOperationSettings() { + return deleteScalingPolicyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateScalingPolicy. */ + public UnaryCallSettings.Builder + updateScalingPolicySettings() { + return updateScalingPolicySettings; + } + + /** Returns the builder for the settings used for calls to updateScalingPolicy. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateScalingPolicyOperationSettings() { + return updateScalingPolicyOperationSettings; + } + + @Override + public ScalingPoliciesServiceStubSettings build() throws IOException { + return new ScalingPoliciesServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClientTest.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClientTest.java new file mode 100644 index 000000000000..7a81b14b4c95 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/AllocationPoliciesServiceClientTest.java @@ -0,0 +1,363 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AllocationPoliciesServiceClientTest { + private static MockAllocationPoliciesService mockAllocationPoliciesService; + private static MockGameServerClustersService mockGameServerClustersService; + private static MockGameServerDeploymentsService mockGameServerDeploymentsService; + private static MockRealmsService mockRealmsService; + private static MockScalingPoliciesService mockScalingPoliciesService; + private static MockServiceHelper serviceHelper; + private AllocationPoliciesServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAllocationPoliciesService = new MockAllocationPoliciesService(); + mockGameServerClustersService = new MockGameServerClustersService(); + mockGameServerDeploymentsService = new MockGameServerDeploymentsService(); + mockRealmsService = new MockRealmsService(); + mockScalingPoliciesService = new MockScalingPoliciesService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAllocationPoliciesService, + mockGameServerClustersService, + mockGameServerDeploymentsService, + mockRealmsService, + mockScalingPoliciesService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AllocationPoliciesServiceSettings settings = + AllocationPoliciesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AllocationPoliciesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listAllocationPoliciesTest() { + String nextPageToken = ""; + AllocationPolicy allocationPoliciesElement = AllocationPolicy.newBuilder().build(); + List allocationPolicies = Arrays.asList(allocationPoliciesElement); + ListAllocationPoliciesResponse expectedResponse = + ListAllocationPoliciesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllAllocationPolicies(allocationPolicies) + .build(); + mockAllocationPoliciesService.addResponse(expectedResponse); + + String formattedParent = + AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListAllocationPoliciesPagedResponse pagedListResponse = + client.listAllocationPolicies(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAllocationPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockAllocationPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAllocationPoliciesRequest actualRequest = + (ListAllocationPoliciesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listAllocationPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAllocationPoliciesService.addException(exception); + + try { + String formattedParent = + AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listAllocationPolicies(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getAllocationPolicyTest() { + String name2 = "name2-1052831874"; + int weight = 791592328; + AllocationPolicy expectedResponse = + AllocationPolicy.newBuilder().setName(name2).setWeight(weight).build(); + mockAllocationPoliciesService.addResponse(expectedResponse); + + String formattedName = + AllocationPoliciesServiceClient.formatAllocationPolicyName( + "[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]"); + + AllocationPolicy actualResponse = client.getAllocationPolicy(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAllocationPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAllocationPolicyRequest actualRequest = (GetAllocationPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getAllocationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAllocationPoliciesService.addException(exception); + + try { + String formattedName = + AllocationPoliciesServiceClient.formatAllocationPolicyName( + "[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]"); + + client.getAllocationPolicy(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createAllocationPolicyTest() throws Exception { + String name = "name3373707"; + int weight = 791592328; + AllocationPolicy expectedResponse = + AllocationPolicy.newBuilder().setName(name).setWeight(weight).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAllocationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAllocationPoliciesService.addResponse(resultOperation); + + String formattedParent = + AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String allocationPolicyId = "allocationPolicyId-850912599"; + AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build(); + + AllocationPolicy actualResponse = + client + .createAllocationPolicyAsync(formattedParent, allocationPolicyId, allocationPolicy) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAllocationPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAllocationPolicyRequest actualRequest = + (CreateAllocationPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(allocationPolicyId, actualRequest.getAllocationPolicyId()); + Assert.assertEquals(allocationPolicy, actualRequest.getAllocationPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createAllocationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAllocationPoliciesService.addException(exception); + + try { + String formattedParent = + AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String allocationPolicyId = "allocationPolicyId-850912599"; + AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build(); + + client + .createAllocationPolicyAsync(formattedParent, allocationPolicyId, allocationPolicy) + .get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteAllocationPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteAllocationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAllocationPoliciesService.addResponse(resultOperation); + + String formattedName = + AllocationPoliciesServiceClient.formatAllocationPolicyName( + "[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]"); + + Empty actualResponse = client.deleteAllocationPolicyAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAllocationPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAllocationPolicyRequest actualRequest = + (DeleteAllocationPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteAllocationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAllocationPoliciesService.addException(exception); + + try { + String formattedName = + AllocationPoliciesServiceClient.formatAllocationPolicyName( + "[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]"); + + client.deleteAllocationPolicyAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateAllocationPolicyTest() throws Exception { + String name = "name3373707"; + int weight = 791592328; + AllocationPolicy expectedResponse = + AllocationPolicy.newBuilder().setName(name).setWeight(weight).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAllocationPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAllocationPoliciesService.addResponse(resultOperation); + + AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AllocationPolicy actualResponse = + client.updateAllocationPolicyAsync(allocationPolicy, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAllocationPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAllocationPolicyRequest actualRequest = + (UpdateAllocationPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(allocationPolicy, actualRequest.getAllocationPolicy()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateAllocationPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAllocationPoliciesService.addException(exception); + + try { + AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateAllocationPolicyAsync(allocationPolicy, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClientTest.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClientTest.java new file mode 100644 index 000000000000..408edb14ebeb --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceClientTest.java @@ -0,0 +1,357 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.GameServerClustersServiceClient.ListGameServerClustersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class GameServerClustersServiceClientTest { + private static MockAllocationPoliciesService mockAllocationPoliciesService; + private static MockGameServerClustersService mockGameServerClustersService; + private static MockGameServerDeploymentsService mockGameServerDeploymentsService; + private static MockRealmsService mockRealmsService; + private static MockScalingPoliciesService mockScalingPoliciesService; + private static MockServiceHelper serviceHelper; + private GameServerClustersServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAllocationPoliciesService = new MockAllocationPoliciesService(); + mockGameServerClustersService = new MockGameServerClustersService(); + mockGameServerDeploymentsService = new MockGameServerDeploymentsService(); + mockRealmsService = new MockRealmsService(); + mockScalingPoliciesService = new MockScalingPoliciesService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAllocationPoliciesService, + mockGameServerClustersService, + mockGameServerDeploymentsService, + mockRealmsService, + mockScalingPoliciesService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + GameServerClustersServiceSettings settings = + GameServerClustersServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GameServerClustersServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listGameServerClustersTest() { + String nextPageToken = ""; + GameServerCluster gameServerClustersElement = GameServerCluster.newBuilder().build(); + List gameServerClusters = Arrays.asList(gameServerClustersElement); + ListGameServerClustersResponse expectedResponse = + ListGameServerClustersResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllGameServerClusters(gameServerClusters) + .build(); + mockGameServerClustersService.addResponse(expectedResponse); + + String formattedParent = + GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + ListGameServerClustersPagedResponse pagedListResponse = + client.listGameServerClusters(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getGameServerClustersList().get(0), resources.get(0)); + + List actualRequests = mockGameServerClustersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListGameServerClustersRequest actualRequest = + (ListGameServerClustersRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listGameServerClustersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerClustersService.addException(exception); + + try { + String formattedParent = + GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + client.listGameServerClusters(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getGameServerClusterTest() { + String name2 = "name2-1052831874"; + GameServerCluster expectedResponse = GameServerCluster.newBuilder().setName(name2).build(); + mockGameServerClustersService.addResponse(expectedResponse); + + String formattedName = + GameServerClustersServiceClient.formatGameServerClusterName( + "[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]"); + + GameServerCluster actualResponse = client.getGameServerCluster(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerClustersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetGameServerClusterRequest actualRequest = (GetGameServerClusterRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getGameServerClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerClustersService.addException(exception); + + try { + String formattedName = + GameServerClustersServiceClient.formatGameServerClusterName( + "[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]"); + + client.getGameServerCluster(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createGameServerClusterTest() throws Exception { + String name = "name3373707"; + GameServerCluster expectedResponse = GameServerCluster.newBuilder().setName(name).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createGameServerClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerClustersService.addResponse(resultOperation); + + String formattedParent = + GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + String gameServerClusterId = "gameServerClusterId-858763025"; + GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build(); + + GameServerCluster actualResponse = + client + .createGameServerClusterAsync(formattedParent, gameServerClusterId, gameServerCluster) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerClustersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateGameServerClusterRequest actualRequest = + (CreateGameServerClusterRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(gameServerClusterId, actualRequest.getGameServerClusterId()); + Assert.assertEquals(gameServerCluster, actualRequest.getGameServerCluster()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createGameServerClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerClustersService.addException(exception); + + try { + String formattedParent = + GameServerClustersServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + String gameServerClusterId = "gameServerClusterId-858763025"; + GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build(); + + client + .createGameServerClusterAsync(formattedParent, gameServerClusterId, gameServerCluster) + .get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteGameServerClusterTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteGameServerClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerClustersService.addResponse(resultOperation); + + String formattedName = + GameServerClustersServiceClient.formatGameServerClusterName( + "[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]"); + + Empty actualResponse = client.deleteGameServerClusterAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerClustersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteGameServerClusterRequest actualRequest = + (DeleteGameServerClusterRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteGameServerClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerClustersService.addException(exception); + + try { + String formattedName = + GameServerClustersServiceClient.formatGameServerClusterName( + "[PROJECT]", "[LOCATION]", "[REALM]", "[GAME_SERVER_CLUSTER]"); + + client.deleteGameServerClusterAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateGameServerClusterTest() throws Exception { + String name = "name3373707"; + GameServerCluster expectedResponse = GameServerCluster.newBuilder().setName(name).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateGameServerClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerClustersService.addResponse(resultOperation); + + GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + GameServerCluster actualResponse = + client.updateGameServerClusterAsync(gameServerCluster, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerClustersService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateGameServerClusterRequest actualRequest = + (UpdateGameServerClusterRequest) actualRequests.get(0); + + Assert.assertEquals(gameServerCluster, actualRequest.getGameServerCluster()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateGameServerClusterExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerClustersService.addException(exception); + + try { + GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateGameServerClusterAsync(gameServerCluster, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClientTest.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClientTest.java new file mode 100644 index 000000000000..85006a543385 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClientTest.java @@ -0,0 +1,619 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class GameServerDeploymentsServiceClientTest { + private static MockAllocationPoliciesService mockAllocationPoliciesService; + private static MockGameServerClustersService mockGameServerClustersService; + private static MockGameServerDeploymentsService mockGameServerDeploymentsService; + private static MockRealmsService mockRealmsService; + private static MockScalingPoliciesService mockScalingPoliciesService; + private static MockServiceHelper serviceHelper; + private GameServerDeploymentsServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAllocationPoliciesService = new MockAllocationPoliciesService(); + mockGameServerClustersService = new MockGameServerClustersService(); + mockGameServerDeploymentsService = new MockGameServerDeploymentsService(); + mockRealmsService = new MockRealmsService(); + mockScalingPoliciesService = new MockScalingPoliciesService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAllocationPoliciesService, + mockGameServerClustersService, + mockGameServerDeploymentsService, + mockRealmsService, + mockScalingPoliciesService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + GameServerDeploymentsServiceSettings settings = + GameServerDeploymentsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GameServerDeploymentsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listGameServerDeploymentsTest() { + String nextPageToken = ""; + GameServerDeployment gameServerDeploymentsElement = GameServerDeployment.newBuilder().build(); + List gameServerDeployments = Arrays.asList(gameServerDeploymentsElement); + ListGameServerDeploymentsResponse expectedResponse = + ListGameServerDeploymentsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllGameServerDeployments(gameServerDeployments) + .build(); + mockGameServerDeploymentsService.addResponse(expectedResponse); + + String formattedParent = + GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListGameServerDeploymentsPagedResponse pagedListResponse = + client.listGameServerDeployments(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getGameServerDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListGameServerDeploymentsRequest actualRequest = + (ListGameServerDeploymentsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listGameServerDeploymentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedParent = + GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listGameServerDeployments(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getGameServerDeploymentTest() { + String name2 = "name2-1052831874"; + GameServerDeployment expectedResponse = + GameServerDeployment.newBuilder().setName(name2).build(); + mockGameServerDeploymentsService.addResponse(expectedResponse); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + GameServerDeployment actualResponse = client.getGameServerDeployment(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetGameServerDeploymentRequest actualRequest = + (GetGameServerDeploymentRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getGameServerDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + client.getGameServerDeployment(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createGameServerDeploymentTest() throws Exception { + String name = "name3373707"; + GameServerDeployment expectedResponse = GameServerDeployment.newBuilder().setName(name).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createGameServerDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedParent = + GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String deploymentId = "deploymentId51250389"; + GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build(); + + GameServerDeployment actualResponse = + client + .createGameServerDeploymentAsync(formattedParent, deploymentId, gameServerDeployment) + .get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateGameServerDeploymentRequest actualRequest = + (CreateGameServerDeploymentRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(deploymentId, actualRequest.getDeploymentId()); + Assert.assertEquals(gameServerDeployment, actualRequest.getGameServerDeployment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createGameServerDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedParent = + GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String deploymentId = "deploymentId51250389"; + GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build(); + + client + .createGameServerDeploymentAsync(formattedParent, deploymentId, gameServerDeployment) + .get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteGameServerDeploymentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteGameServerDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + Empty actualResponse = client.deleteGameServerDeploymentAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteGameServerDeploymentRequest actualRequest = + (DeleteGameServerDeploymentRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteGameServerDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + client.deleteGameServerDeploymentAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateGameServerDeploymentTest() throws Exception { + String name = "name3373707"; + GameServerDeployment expectedResponse = GameServerDeployment.newBuilder().setName(name).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateGameServerDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + GameServerDeployment actualResponse = + client.updateGameServerDeploymentAsync(gameServerDeployment, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateGameServerDeploymentRequest actualRequest = + (UpdateGameServerDeploymentRequest) actualRequests.get(0); + + Assert.assertEquals(gameServerDeployment, actualRequest.getGameServerDeployment()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateGameServerDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateGameServerDeploymentAsync(gameServerDeployment, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void startRolloutTest() throws Exception { + String name2 = "name2-1052831874"; + GameServerDeployment expectedResponse = + GameServerDeployment.newBuilder().setName(name2).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("startRolloutTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build(); + + GameServerDeployment actualResponse = + client.startRolloutAsync(formattedName, newGameServerTemplate).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartRolloutRequest actualRequest = (StartRolloutRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(newGameServerTemplate, actualRequest.getNewGameServerTemplate()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void startRolloutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build(); + + client.startRolloutAsync(formattedName, newGameServerTemplate).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void setRolloutTargetTest() throws Exception { + String name2 = "name2-1052831874"; + GameServerDeployment expectedResponse = + GameServerDeployment.newBuilder().setName(name2).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("setRolloutTargetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + List clusterPercentageSelector = new ArrayList<>(); + + GameServerDeployment actualResponse = + client.setRolloutTargetAsync(formattedName, clusterPercentageSelector).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetRolloutTargetRequest actualRequest = (SetRolloutTargetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals( + clusterPercentageSelector, actualRequest.getClusterPercentageSelectorList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setRolloutTargetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + List clusterPercentageSelector = new ArrayList<>(); + + client.setRolloutTargetAsync(formattedName, clusterPercentageSelector).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void commitRolloutTest() throws Exception { + String name2 = "name2-1052831874"; + GameServerDeployment expectedResponse = + GameServerDeployment.newBuilder().setName(name2).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("commitRolloutTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + GameServerDeployment actualResponse = client.commitRolloutAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CommitRolloutRequest actualRequest = (CommitRolloutRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void commitRolloutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + client.commitRolloutAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void revertRolloutTest() throws Exception { + String name2 = "name2-1052831874"; + GameServerDeployment expectedResponse = + GameServerDeployment.newBuilder().setName(name2).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("revertRolloutTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockGameServerDeploymentsService.addResponse(resultOperation); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + GameServerDeployment actualResponse = client.revertRolloutAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RevertRolloutRequest actualRequest = (RevertRolloutRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void revertRolloutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + client.revertRolloutAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void getDeploymentTargetTest() { + DeploymentTarget expectedResponse = DeploymentTarget.newBuilder().build(); + mockGameServerDeploymentsService.addResponse(expectedResponse); + + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + DeploymentTarget actualResponse = client.getDeploymentTarget(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGameServerDeploymentsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDeploymentTargetRequest actualRequest = (GetDeploymentTargetRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getDeploymentTargetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGameServerDeploymentsService.addException(exception); + + try { + String formattedName = + GameServerDeploymentsServiceClient.formatGameServerDeploymentName( + "[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]"); + + client.getDeploymentTarget(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesService.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesService.java new file mode 100644 index 000000000000..9af14d6c3db3 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAllocationPoliciesService implements MockGrpcService { + private final MockAllocationPoliciesServiceImpl serviceImpl; + + public MockAllocationPoliciesService() { + serviceImpl = new MockAllocationPoliciesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesServiceImpl.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesServiceImpl.java new file mode 100644 index 000000000000..7e8b0e8cd1dc --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockAllocationPoliciesServiceImpl.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceGrpc.AllocationPoliciesServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockAllocationPoliciesServiceImpl extends AllocationPoliciesServiceImplBase { + private List requests; + private Queue responses; + + public MockAllocationPoliciesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listAllocationPolicies( + ListAllocationPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAllocationPoliciesResponse) { + requests.add(request); + responseObserver.onNext((ListAllocationPoliciesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getAllocationPolicy( + GetAllocationPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AllocationPolicy) { + requests.add(request); + responseObserver.onNext((AllocationPolicy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createAllocationPolicy( + CreateAllocationPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteAllocationPolicy( + DeleteAllocationPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateAllocationPolicy( + UpdateAllocationPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersService.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersService.java new file mode 100644 index 000000000000..2f92f4b1c59b --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockGameServerClustersService implements MockGrpcService { + private final MockGameServerClustersServiceImpl serviceImpl; + + public MockGameServerClustersService() { + serviceImpl = new MockGameServerClustersServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersServiceImpl.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersServiceImpl.java new file mode 100644 index 000000000000..27ab3f0a1f2b --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerClustersServiceImpl.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.gaming.v1alpha.GameServerClustersServiceGrpc.GameServerClustersServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockGameServerClustersServiceImpl extends GameServerClustersServiceImplBase { + private List requests; + private Queue responses; + + public MockGameServerClustersServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listGameServerClusters( + ListGameServerClustersRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListGameServerClustersResponse) { + requests.add(request); + responseObserver.onNext((ListGameServerClustersResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getGameServerCluster( + GetGameServerClusterRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GameServerCluster) { + requests.add(request); + responseObserver.onNext((GameServerCluster) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createGameServerCluster( + CreateGameServerClusterRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteGameServerCluster( + DeleteGameServerClusterRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateGameServerCluster( + UpdateGameServerClusterRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsService.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsService.java new file mode 100644 index 000000000000..08d817681d03 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockGameServerDeploymentsService implements MockGrpcService { + private final MockGameServerDeploymentsServiceImpl serviceImpl; + + public MockGameServerDeploymentsService() { + serviceImpl = new MockGameServerDeploymentsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsServiceImpl.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsServiceImpl.java new file mode 100644 index 000000000000..0f0ce9f73872 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockGameServerDeploymentsServiceImpl.java @@ -0,0 +1,211 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.gaming.v1alpha.GameServerDeploymentsServiceGrpc.GameServerDeploymentsServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockGameServerDeploymentsServiceImpl extends GameServerDeploymentsServiceImplBase { + private List requests; + private Queue responses; + + public MockGameServerDeploymentsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listGameServerDeployments( + ListGameServerDeploymentsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListGameServerDeploymentsResponse) { + requests.add(request); + responseObserver.onNext((ListGameServerDeploymentsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getGameServerDeployment( + GetGameServerDeploymentRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GameServerDeployment) { + requests.add(request); + responseObserver.onNext((GameServerDeployment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createGameServerDeployment( + CreateGameServerDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteGameServerDeployment( + DeleteGameServerDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateGameServerDeployment( + UpdateGameServerDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void startRollout( + StartRolloutRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setRolloutTarget( + SetRolloutTargetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void commitRollout( + CommitRolloutRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void revertRollout( + RevertRolloutRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getDeploymentTarget( + GetDeploymentTargetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof DeploymentTarget) { + requests.add(request); + responseObserver.onNext((DeploymentTarget) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsService.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsService.java new file mode 100644 index 000000000000..bce493eca8bc --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRealmsService implements MockGrpcService { + private final MockRealmsServiceImpl serviceImpl; + + public MockRealmsService() { + serviceImpl = new MockRealmsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsServiceImpl.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsServiceImpl.java new file mode 100644 index 000000000000..d4a1d17c0c4d --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockRealmsServiceImpl.java @@ -0,0 +1,130 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.gaming.v1alpha.RealmsServiceGrpc.RealmsServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRealmsServiceImpl extends RealmsServiceImplBase { + private List requests; + private Queue responses; + + public MockRealmsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listRealms( + ListRealmsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListRealmsResponse) { + requests.add(request); + responseObserver.onNext((ListRealmsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getRealm(GetRealmRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Realm) { + requests.add(request); + responseObserver.onNext((Realm) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createRealm(CreateRealmRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteRealm(DeleteRealmRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateRealm(UpdateRealmRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesService.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesService.java new file mode 100644 index 000000000000..d30386d6e231 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockScalingPoliciesService implements MockGrpcService { + private final MockScalingPoliciesServiceImpl serviceImpl; + + public MockScalingPoliciesService() { + serviceImpl = new MockScalingPoliciesServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesServiceImpl.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesServiceImpl.java new file mode 100644 index 000000000000..bac8f0c9f537 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/MockScalingPoliciesServiceImpl.java @@ -0,0 +1,135 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceGrpc.ScalingPoliciesServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockScalingPoliciesServiceImpl extends ScalingPoliciesServiceImplBase { + private List requests; + private Queue responses; + + public MockScalingPoliciesServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listScalingPolicies( + ListScalingPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListScalingPoliciesResponse) { + requests.add(request); + responseObserver.onNext((ListScalingPoliciesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getScalingPolicy( + GetScalingPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScalingPolicy) { + requests.add(request); + responseObserver.onNext((ScalingPolicy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createScalingPolicy( + CreateScalingPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteScalingPolicy( + DeleteScalingPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateScalingPolicy( + UpdateScalingPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/RealmsServiceClientTest.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/RealmsServiceClientTest.java new file mode 100644 index 000000000000..25414e4bd65f --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/RealmsServiceClientTest.java @@ -0,0 +1,341 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.RealmsServiceClient.ListRealmsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RealmsServiceClientTest { + private static MockAllocationPoliciesService mockAllocationPoliciesService; + private static MockGameServerClustersService mockGameServerClustersService; + private static MockGameServerDeploymentsService mockGameServerDeploymentsService; + private static MockRealmsService mockRealmsService; + private static MockScalingPoliciesService mockScalingPoliciesService; + private static MockServiceHelper serviceHelper; + private RealmsServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAllocationPoliciesService = new MockAllocationPoliciesService(); + mockGameServerClustersService = new MockGameServerClustersService(); + mockGameServerDeploymentsService = new MockGameServerDeploymentsService(); + mockRealmsService = new MockRealmsService(); + mockScalingPoliciesService = new MockScalingPoliciesService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAllocationPoliciesService, + mockGameServerClustersService, + mockGameServerDeploymentsService, + mockRealmsService, + mockScalingPoliciesService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + RealmsServiceSettings settings = + RealmsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RealmsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listRealmsTest() { + String nextPageToken = ""; + Realm realmsElement = Realm.newBuilder().build(); + List realms = Arrays.asList(realmsElement); + ListRealmsResponse expectedResponse = + ListRealmsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllRealms(realms) + .build(); + mockRealmsService.addResponse(expectedResponse); + + String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListRealmsPagedResponse pagedListResponse = client.listRealms(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRealmsList().get(0), resources.get(0)); + + List actualRequests = mockRealmsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRealmsRequest actualRequest = (ListRealmsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listRealmsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRealmsService.addException(exception); + + try { + String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listRealms(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getRealmTest() { + String name2 = "name2-1052831874"; + String timeZone = "timeZone36848094"; + Realm expectedResponse = Realm.newBuilder().setName(name2).setTimeZone(timeZone).build(); + mockRealmsService.addResponse(expectedResponse); + + String formattedName = + RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + Realm actualResponse = client.getRealm(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRealmsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRealmRequest actualRequest = (GetRealmRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getRealmExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRealmsService.addException(exception); + + try { + String formattedName = + RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + client.getRealm(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createRealmTest() throws Exception { + String name = "name3373707"; + String timeZone = "timeZone36848094"; + Realm expectedResponse = Realm.newBuilder().setName(name).setTimeZone(timeZone).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createRealmTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRealmsService.addResponse(resultOperation); + + String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String realmId = "realmId-859416373"; + Realm realm = Realm.newBuilder().build(); + + Realm actualResponse = client.createRealmAsync(formattedParent, realmId, realm).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRealmsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRealmRequest actualRequest = (CreateRealmRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(realmId, actualRequest.getRealmId()); + Assert.assertEquals(realm, actualRequest.getRealm()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createRealmExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRealmsService.addException(exception); + + try { + String formattedParent = RealmsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String realmId = "realmId-859416373"; + Realm realm = Realm.newBuilder().build(); + + client.createRealmAsync(formattedParent, realmId, realm).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteRealmTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteRealmTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRealmsService.addResponse(resultOperation); + + String formattedName = + RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + Empty actualResponse = client.deleteRealmAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRealmsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRealmRequest actualRequest = (DeleteRealmRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteRealmExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRealmsService.addException(exception); + + try { + String formattedName = + RealmsServiceClient.formatRealmName("[PROJECT]", "[LOCATION]", "[REALM]"); + + client.deleteRealmAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateRealmTest() throws Exception { + String name = "name3373707"; + String timeZone = "timeZone36848094"; + Realm expectedResponse = Realm.newBuilder().setName(name).setTimeZone(timeZone).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateRealmTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRealmsService.addResponse(resultOperation); + + Realm realm = Realm.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Realm actualResponse = client.updateRealmAsync(realm, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRealmsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRealmRequest actualRequest = (UpdateRealmRequest) actualRequests.get(0); + + Assert.assertEquals(realm, actualRequest.getRealm()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateRealmExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRealmsService.addException(exception); + + try { + Realm realm = Realm.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateRealmAsync(realm, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClientTest.java b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClientTest.java new file mode 100644 index 000000000000..221f11134952 --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/src/test/java/com/google/cloud/gaming/v1alpha/ScalingPoliciesServiceClientTest.java @@ -0,0 +1,363 @@ +/* + * Copyright 2019 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.gaming.v1alpha; + +import static com.google.cloud.gaming.v1alpha.ScalingPoliciesServiceClient.ListScalingPoliciesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ScalingPoliciesServiceClientTest { + private static MockAllocationPoliciesService mockAllocationPoliciesService; + private static MockGameServerClustersService mockGameServerClustersService; + private static MockGameServerDeploymentsService mockGameServerDeploymentsService; + private static MockRealmsService mockRealmsService; + private static MockScalingPoliciesService mockScalingPoliciesService; + private static MockServiceHelper serviceHelper; + private ScalingPoliciesServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAllocationPoliciesService = new MockAllocationPoliciesService(); + mockGameServerClustersService = new MockGameServerClustersService(); + mockGameServerDeploymentsService = new MockGameServerDeploymentsService(); + mockRealmsService = new MockRealmsService(); + mockScalingPoliciesService = new MockScalingPoliciesService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList( + mockAllocationPoliciesService, + mockGameServerClustersService, + mockGameServerDeploymentsService, + mockRealmsService, + mockScalingPoliciesService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ScalingPoliciesServiceSettings settings = + ScalingPoliciesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ScalingPoliciesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listScalingPoliciesTest() { + String nextPageToken = ""; + ScalingPolicy scalingPoliciesElement = ScalingPolicy.newBuilder().build(); + List scalingPolicies = Arrays.asList(scalingPoliciesElement); + ListScalingPoliciesResponse expectedResponse = + ListScalingPoliciesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllScalingPolicies(scalingPolicies) + .build(); + mockScalingPoliciesService.addResponse(expectedResponse); + + String formattedParent = + ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListScalingPoliciesPagedResponse pagedListResponse = + client.listScalingPolicies(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getScalingPoliciesList().get(0), resources.get(0)); + + List actualRequests = mockScalingPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListScalingPoliciesRequest actualRequest = (ListScalingPoliciesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listScalingPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockScalingPoliciesService.addException(exception); + + try { + String formattedParent = + ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listScalingPolicies(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getScalingPolicyTest() { + String name2 = "name2-1052831874"; + String gameServerDeployment = "gameServerDeployment840476212"; + ScalingPolicy expectedResponse = + ScalingPolicy.newBuilder() + .setName(name2) + .setGameServerDeployment(gameServerDeployment) + .build(); + mockScalingPoliciesService.addResponse(expectedResponse); + + String formattedName = + ScalingPoliciesServiceClient.formatScalingPolicyName( + "[PROJECT]", "[LOCATION]", "[SCALING_POLICY]"); + + ScalingPolicy actualResponse = client.getScalingPolicy(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockScalingPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetScalingPolicyRequest actualRequest = (GetScalingPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getScalingPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockScalingPoliciesService.addException(exception); + + try { + String formattedName = + ScalingPoliciesServiceClient.formatScalingPolicyName( + "[PROJECT]", "[LOCATION]", "[SCALING_POLICY]"); + + client.getScalingPolicy(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createScalingPolicyTest() throws Exception { + String name = "name3373707"; + String gameServerDeployment = "gameServerDeployment840476212"; + ScalingPolicy expectedResponse = + ScalingPolicy.newBuilder() + .setName(name) + .setGameServerDeployment(gameServerDeployment) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createScalingPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockScalingPoliciesService.addResponse(resultOperation); + + String formattedParent = + ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String scalingPolicyId = "scalingPolicyId1901060240"; + ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build(); + + ScalingPolicy actualResponse = + client.createScalingPolicyAsync(formattedParent, scalingPolicyId, scalingPolicy).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockScalingPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateScalingPolicyRequest actualRequest = (CreateScalingPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(scalingPolicyId, actualRequest.getScalingPolicyId()); + Assert.assertEquals(scalingPolicy, actualRequest.getScalingPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createScalingPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockScalingPoliciesService.addException(exception); + + try { + String formattedParent = + ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); + String scalingPolicyId = "scalingPolicyId1901060240"; + ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build(); + + client.createScalingPolicyAsync(formattedParent, scalingPolicyId, scalingPolicy).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteScalingPolicyTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteScalingPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockScalingPoliciesService.addResponse(resultOperation); + + String formattedName = + ScalingPoliciesServiceClient.formatScalingPolicyName( + "[PROJECT]", "[LOCATION]", "[SCALING_POLICY]"); + + Empty actualResponse = client.deleteScalingPolicyAsync(formattedName).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockScalingPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteScalingPolicyRequest actualRequest = (DeleteScalingPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteScalingPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockScalingPoliciesService.addException(exception); + + try { + String formattedName = + ScalingPoliciesServiceClient.formatScalingPolicyName( + "[PROJECT]", "[LOCATION]", "[SCALING_POLICY]"); + + client.deleteScalingPolicyAsync(formattedName).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateScalingPolicyTest() throws Exception { + String name = "name3373707"; + String gameServerDeployment = "gameServerDeployment840476212"; + ScalingPolicy expectedResponse = + ScalingPolicy.newBuilder() + .setName(name) + .setGameServerDeployment(gameServerDeployment) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateScalingPolicyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockScalingPoliciesService.addResponse(resultOperation); + + ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ScalingPolicy actualResponse = client.updateScalingPolicyAsync(scalingPolicy, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockScalingPoliciesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateScalingPolicyRequest actualRequest = (UpdateScalingPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(scalingPolicy, actualRequest.getScalingPolicy()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateScalingPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockScalingPoliciesService.addException(exception); + + try { + ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateScalingPolicyAsync(scalingPolicy, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-gameservices/synth.py b/google-cloud-clients/google-cloud-gameservices/synth.py new file mode 100644 index 000000000000..d4e838c82d0e --- /dev/null +++ b/google-cloud-clients/google-cloud-gameservices/synth.py @@ -0,0 +1,42 @@ +# Copyright 2019 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 +# +# http://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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() + +versions = ['v1alpha'] +service = 'gameservices' +config_pattern = "/google/cloud/gaming/artman_gameservices_{version}.yaml" + +for version in versions: + library = gapic.java_library( + service=service, + version=version, + config_path=config_pattern.format(version=version), + artman_output_name='', + private=True) + + s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') + s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + + java.format_code('./src') + java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') \ No newline at end of file diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 9f83052cfcb2..391d3f2f30bb 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -448,6 +448,7 @@ google-cloud-dns google-cloud-errorreporting google-cloud-firestore + google-cloud-gameservices google-cloud-iamcredentials google-cloud-iot google-cloud-kms @@ -770,7 +771,7 @@ Stub packages - com.google.cloud.asset.v1.stub:com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.datacatalog.v1beta1.stub:com.google.cloud.datalabeling.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore-admin.v1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.phishingprotection.v1beta1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.recaptchaenterprise.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner-admin-database.v1.stub:com.google.cloud.spanner-admin-instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.talent.v4beta1.stub:com.google.cloud.tasks.v2.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.translate.v3beta1.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.stub:com.google.cloud.video-intelligence.v1p3beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.vision.v1p4beta1.stub:com.google.cloud.webrisk.v1beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1.stub:com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.datacatalog.v1beta1.stub:com.google.cloud.datalabeling.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore-admin.v1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.gameservices.v1alpha.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.phishingprotection.v1beta1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.recaptchaenterprise.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner-admin-database.v1.stub:com.google.cloud.spanner-admin-instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.talent.v4beta1.stub:com.google.cloud.tasks.v2.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.translate.v3beta1.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.stub:com.google.cloud.video-intelligence.v1p3beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.vision.v1p4beta1.stub:com.google.cloud.webrisk.v1beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub:com.google.cloud.websecurityscanner.v1beta.stub Deprecated packages diff --git a/versions.txt b/versions.txt index 85c264ec73f9..6e52cbf8df37 100644 --- a/versions.txt +++ b/versions.txt @@ -34,6 +34,7 @@ google-cloud-dns:0.99.0-alpha:0.99.1-alpha-SNAPSHOT google-cloud-errorreporting:0.99.0-beta:0.99.1-beta-SNAPSHOT google-cloud-examples:0.99.0-alpha:0.99.1-alpha-SNAPSHOT google-cloud-firestore:1.11.0:1.11.1-SNAPSHOT +google-cloud-gameservices:0.0.0:0.0.1-SNAPSHOT google-cloud-gcloud-maven-plugin:0.99.0-alpha:0.99.1-alpha-SNAPSHOT google-cloud-iamcredentials:0.26.0-alpha:0.26.1-alpha-SNAPSHOT google-cloud-iot:0.99.0-beta:0.99.1-beta-SNAPSHOT @@ -90,6 +91,7 @@ grpc-google-cloud-error-reporting-v1beta1:0.64.0:0.64.1-SNAPSHOT grpc-google-cloud-firestore-admin-v1:1.11.0:1.11.1-SNAPSHOT grpc-google-cloud-firestore-v1:1.11.0:1.11.1-SNAPSHOT grpc-google-cloud-firestore-v1beta1:0.64.0:0.64.1-SNAPSHOT +grpc-google-cloud-gameservices-v1alpha:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-iamcredentials-v1:0.26.0-alpha:0.26.1-alpha-SNAPSHOT grpc-google-cloud-iot-v1:0.64.0:0.64.1-SNAPSHOT grpc-google-cloud-kms-v1:0.64.0:0.64.1-SNAPSHOT @@ -158,6 +160,7 @@ proto-google-cloud-error-reporting-v1beta1:0.64.0:0.64.1-SNAPSHOT proto-google-cloud-firestore-admin-v1:1.11.0:1.11.1-SNAPSHOT proto-google-cloud-firestore-v1:1.11.0:1.11.1-SNAPSHOT proto-google-cloud-firestore-v1beta1:0.64.0:0.64.1-SNAPSHOT +proto-google-cloud-gameservices-v1alpha:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-iamcredentials-v1:0.26.0-alpha:0.26.1-alpha-SNAPSHOT proto-google-cloud-iot-v1:0.64.0:0.64.1-SNAPSHOT proto-google-cloud-kms-v1:0.64.0:0.64.1-SNAPSHOT