From 7e635696cb6d04aca1aa81016c8c934d4daa80ce Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 7 Nov 2018 12:44:56 -0800 Subject: [PATCH] New Client: Cloud Scheduler (#3913) * Add synth.py for generating cloud scheduler client * Add generated cloud scheduler code * Fix proto/grpc artifact names * Add versions and pom.xml files * Update list of stub packages in google-cloud-clients * Add README --- .../pom.xml | 31 + .../scheduler/v1beta1/CloudSchedulerGrpc.java | 1030 +++++ google-api-grpc/pom.xml | 64 +- .../pom.xml | 31 + .../v1beta1/AppEngineHttpTarget.java | 1645 ++++++++ .../v1beta1/AppEngineHttpTargetOrBuilder.java | 265 ++ .../scheduler/v1beta1/AppEngineRouting.java | 1409 +++++++ .../v1beta1/AppEngineRoutingOrBuilder.java | 183 + .../scheduler/v1beta1/CreateJobRequest.java | 880 ++++ .../v1beta1/CreateJobRequestOrBuilder.java | 71 + .../scheduler/v1beta1/DeleteJobRequest.java | 593 +++ .../v1beta1/DeleteJobRequestOrBuilder.java | 31 + .../scheduler/v1beta1/GetJobRequest.java | 591 +++ .../v1beta1/GetJobRequestOrBuilder.java | 31 + .../cloud/scheduler/v1beta1/HttpMethod.java | 225 ++ .../cloud/scheduler/v1beta1/HttpTarget.java | 1292 ++++++ .../v1beta1/HttpTargetOrBuilder.java | 186 + .../google/cloud/scheduler/v1beta1/Job.java | 3574 +++++++++++++++++ .../cloud/scheduler/v1beta1/JobName.java | 212 + .../cloud/scheduler/v1beta1/JobOrBuilder.java | 376 ++ .../cloud/scheduler/v1beta1/JobProto.java | 108 + .../scheduler/v1beta1/ListJobsRequest.java | 878 ++++ .../v1beta1/ListJobsRequestOrBuilder.java | 74 + .../scheduler/v1beta1/ListJobsResponse.java | 1052 +++++ .../v1beta1/ListJobsResponseOrBuilder.java | 81 + .../cloud/scheduler/v1beta1/LocationName.java | 189 + .../scheduler/v1beta1/PauseJobRequest.java | 591 +++ .../v1beta1/PauseJobRequestOrBuilder.java | 31 + .../cloud/scheduler/v1beta1/ProjectName.java | 166 + .../cloud/scheduler/v1beta1/PubsubTarget.java | 1050 +++++ .../v1beta1/PubsubTargetOrBuilder.java | 114 + .../scheduler/v1beta1/ResumeJobRequest.java | 591 +++ .../v1beta1/ResumeJobRequestOrBuilder.java | 31 + .../cloud/scheduler/v1beta1/RetryConfig.java | 1475 +++++++ .../v1beta1/RetryConfigOrBuilder.java | 155 + .../scheduler/v1beta1/RunJobRequest.java | 593 +++ .../v1beta1/RunJobRequestOrBuilder.java | 31 + .../scheduler/v1beta1/SchedulerProto.java | 209 + .../cloud/scheduler/v1beta1/TargetProto.java | 154 + .../scheduler/v1beta1/UpdateJobRequest.java | 916 +++++ .../v1beta1/UpdateJobRequestOrBuilder.java | 68 + .../scheduler/v1beta1/cloudscheduler.proto | 236 ++ .../google/cloud/scheduler/v1beta1/job.proto | 212 + .../cloud/scheduler/v1beta1/target.proto | 285 ++ google-cloud-bom/pom.xml | 10 + .../google-cloud-scheduler/README.md | 114 + .../google-cloud-scheduler/pom.xml | 92 + .../v1beta1/CloudSchedulerClient.java | 987 +++++ .../v1beta1/CloudSchedulerSettings.java | 251 ++ .../cloud/scheduler/v1beta1/package-info.java | 38 + .../v1beta1/stub/CloudSchedulerStub.java | 84 + .../stub/CloudSchedulerStubSettings.java | 501 +++ .../GrpcCloudSchedulerCallableFactory.java | 116 + .../v1beta1/stub/GrpcCloudSchedulerStub.java | 294 ++ .../v1beta1/CloudSchedulerClientTest.java | 455 +++ .../scheduler/v1beta1/MockCloudScheduler.java | 57 + .../v1beta1/MockCloudSchedulerImpl.java | 171 + .../google-cloud-scheduler/synth.py | 32 + google-cloud-clients/pom.xml | 5 +- versions.txt | 3 + 60 files changed, 25192 insertions(+), 28 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-scheduler-v1beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTarget.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTargetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRouting.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRoutingOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpMethod.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTarget.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTargetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/Job.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobName.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobProto.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ProjectName.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTarget.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTargetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfig.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/SchedulerProto.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/TargetProto.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequest.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/cloudscheduler.proto create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/job.proto create mode 100644 google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/target.proto create mode 100644 google-cloud-clients/google-cloud-scheduler/README.md create mode 100644 google-cloud-clients/google-cloud-scheduler/pom.xml create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerSettings.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStub.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStubSettings.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerStub.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClientTest.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudScheduler.java create mode 100644 google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudSchedulerImpl.java create mode 100644 google-cloud-clients/google-cloud-scheduler/synth.py diff --git a/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/pom.xml new file mode 100644 index 000000000000..d2742a56836d --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + grpc-google-cloud-scheduler-v1beta1 + GRPC library for grpc-google-cloud-scheduler-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.34.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-scheduler-v1beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerGrpc.java b/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerGrpc.java new file mode 100644 index 000000000000..3558235ecac1 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerGrpc.java @@ -0,0 +1,1030 @@ +package com.google.cloud.scheduler.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * The Cloud Scheduler API allows external entities to reliably
+ * schedule asynchronous jobs.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/scheduler/v1beta1/cloudscheduler.proto") +public final class CloudSchedulerGrpc { + + private CloudSchedulerGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.scheduler.v1beta1.CloudScheduler"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListJobsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_JOBS = getListJobsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListJobsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListJobsMethod() { + return getListJobsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListJobsMethodHelper() { + io.grpc.MethodDescriptor getListJobsMethod; + if ((getListJobsMethod = CloudSchedulerGrpc.getListJobsMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getListJobsMethod = CloudSchedulerGrpc.getListJobsMethod) == null) { + CloudSchedulerGrpc.getListJobsMethod = getListJobsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "ListJobs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.ListJobsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.ListJobsResponse.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("ListJobs")) + .build(); + } + } + } + return getListJobsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_JOB = getGetJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetJobMethod() { + return getGetJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetJobMethodHelper() { + io.grpc.MethodDescriptor getGetJobMethod; + if ((getGetJobMethod = CloudSchedulerGrpc.getGetJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getGetJobMethod = CloudSchedulerGrpc.getGetJobMethod) == null) { + CloudSchedulerGrpc.getGetJobMethod = getGetJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "GetJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.GetJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("GetJob")) + .build(); + } + } + } + return getGetJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_JOB = getCreateJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateJobMethod() { + return getCreateJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateJobMethodHelper() { + io.grpc.MethodDescriptor getCreateJobMethod; + if ((getCreateJobMethod = CloudSchedulerGrpc.getCreateJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getCreateJobMethod = CloudSchedulerGrpc.getCreateJobMethod) == null) { + CloudSchedulerGrpc.getCreateJobMethod = getCreateJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "CreateJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.CreateJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("CreateJob")) + .build(); + } + } + } + return getCreateJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_JOB = getUpdateJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateJobMethod() { + return getUpdateJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateJobMethodHelper() { + io.grpc.MethodDescriptor getUpdateJobMethod; + if ((getUpdateJobMethod = CloudSchedulerGrpc.getUpdateJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getUpdateJobMethod = CloudSchedulerGrpc.getUpdateJobMethod) == null) { + CloudSchedulerGrpc.getUpdateJobMethod = getUpdateJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "UpdateJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.UpdateJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("UpdateJob")) + .build(); + } + } + } + return getUpdateJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_JOB = getDeleteJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteJobMethod() { + return getDeleteJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteJobMethodHelper() { + io.grpc.MethodDescriptor getDeleteJobMethod; + if ((getDeleteJobMethod = CloudSchedulerGrpc.getDeleteJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getDeleteJobMethod = CloudSchedulerGrpc.getDeleteJobMethod) == null) { + CloudSchedulerGrpc.getDeleteJobMethod = getDeleteJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "DeleteJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.DeleteJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("DeleteJob")) + .build(); + } + } + } + return getDeleteJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getPauseJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_PAUSE_JOB = getPauseJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getPauseJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getPauseJobMethod() { + return getPauseJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getPauseJobMethodHelper() { + io.grpc.MethodDescriptor getPauseJobMethod; + if ((getPauseJobMethod = CloudSchedulerGrpc.getPauseJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getPauseJobMethod = CloudSchedulerGrpc.getPauseJobMethod) == null) { + CloudSchedulerGrpc.getPauseJobMethod = getPauseJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "PauseJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.PauseJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("PauseJob")) + .build(); + } + } + } + return getPauseJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getResumeJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_RESUME_JOB = getResumeJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getResumeJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getResumeJobMethod() { + return getResumeJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getResumeJobMethodHelper() { + io.grpc.MethodDescriptor getResumeJobMethod; + if ((getResumeJobMethod = CloudSchedulerGrpc.getResumeJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getResumeJobMethod = CloudSchedulerGrpc.getResumeJobMethod) == null) { + CloudSchedulerGrpc.getResumeJobMethod = getResumeJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "ResumeJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.ResumeJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("ResumeJob")) + .build(); + } + } + } + return getResumeJobMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRunJobMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_RUN_JOB = getRunJobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getRunJobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getRunJobMethod() { + return getRunJobMethodHelper(); + } + + private static io.grpc.MethodDescriptor getRunJobMethodHelper() { + io.grpc.MethodDescriptor getRunJobMethod; + if ((getRunJobMethod = CloudSchedulerGrpc.getRunJobMethod) == null) { + synchronized (CloudSchedulerGrpc.class) { + if ((getRunJobMethod = CloudSchedulerGrpc.getRunJobMethod) == null) { + CloudSchedulerGrpc.getRunJobMethod = getRunJobMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.scheduler.v1beta1.CloudScheduler", "RunJob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.RunJobRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance())) + .setSchemaDescriptor(new CloudSchedulerMethodDescriptorSupplier("RunJob")) + .build(); + } + } + } + return getRunJobMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static CloudSchedulerStub newStub(io.grpc.Channel channel) { + return new CloudSchedulerStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudSchedulerBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new CloudSchedulerBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static CloudSchedulerFutureStub newFutureStub( + io.grpc.Channel channel) { + return new CloudSchedulerFutureStub(channel); + } + + /** + *
+   * The Cloud Scheduler API allows external entities to reliably
+   * schedule asynchronous jobs.
+   * 
+ */ + public static abstract class CloudSchedulerImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists jobs.
+     * 
+ */ + public void listJobs(com.google.cloud.scheduler.v1beta1.ListJobsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListJobsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a job.
+     * 
+ */ + public void getJob(com.google.cloud.scheduler.v1beta1.GetJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetJobMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a job.
+     * 
+ */ + public void createJob(com.google.cloud.scheduler.v1beta1.CreateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateJobMethodHelper(), responseObserver); + } + + /** + *
+     * Updates a job.
+     * If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
+     * not exist, `NOT_FOUND` is returned.
+     * If UpdateJob does not successfully return, it is possible for the
+     * job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
+     * not be executed. If this happens, retry the UpdateJob request
+     * until a successful response is received.
+     * 
+ */ + public void updateJob(com.google.cloud.scheduler.v1beta1.UpdateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateJobMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a job.
+     * 
+ */ + public void deleteJob(com.google.cloud.scheduler.v1beta1.DeleteJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteJobMethodHelper(), responseObserver); + } + + /** + *
+     * Pauses a job.
+     * If a job is paused then the system will stop executing the job
+     * until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
+     * state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
+     * will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
+     * to be paused.
+     * 
+ */ + public void pauseJob(com.google.cloud.scheduler.v1beta1.PauseJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getPauseJobMethodHelper(), responseObserver); + } + + /** + *
+     * Resume a job.
+     * This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
+     * state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
+     * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
+     * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
+     * 
+ */ + public void resumeJob(com.google.cloud.scheduler.v1beta1.ResumeJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getResumeJobMethodHelper(), responseObserver); + } + + /** + *
+     * Forces a job to run now.
+     * When this method is called, Cloud Scheduler will dispatch the job, even
+     * if the job is already running.
+     * 
+ */ + public void runJob(com.google.cloud.scheduler.v1beta1.RunJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRunJobMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListJobsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.ListJobsRequest, + com.google.cloud.scheduler.v1beta1.ListJobsResponse>( + this, METHODID_LIST_JOBS))) + .addMethod( + getGetJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.GetJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_GET_JOB))) + .addMethod( + getCreateJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.CreateJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_CREATE_JOB))) + .addMethod( + getUpdateJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.UpdateJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_UPDATE_JOB))) + .addMethod( + getDeleteJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.DeleteJobRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_JOB))) + .addMethod( + getPauseJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.PauseJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_PAUSE_JOB))) + .addMethod( + getResumeJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.ResumeJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_RESUME_JOB))) + .addMethod( + getRunJobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.scheduler.v1beta1.RunJobRequest, + com.google.cloud.scheduler.v1beta1.Job>( + this, METHODID_RUN_JOB))) + .build(); + } + } + + /** + *
+   * The Cloud Scheduler API allows external entities to reliably
+   * schedule asynchronous jobs.
+   * 
+ */ + public static final class CloudSchedulerStub extends io.grpc.stub.AbstractStub { + private CloudSchedulerStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudSchedulerStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudSchedulerStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudSchedulerStub(channel, callOptions); + } + + /** + *
+     * Lists jobs.
+     * 
+ */ + public void listJobs(com.google.cloud.scheduler.v1beta1.ListJobsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListJobsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a job.
+     * 
+ */ + public void getJob(com.google.cloud.scheduler.v1beta1.GetJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a job.
+     * 
+ */ + public void createJob(com.google.cloud.scheduler.v1beta1.CreateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates a job.
+     * If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
+     * not exist, `NOT_FOUND` is returned.
+     * If UpdateJob does not successfully return, it is possible for the
+     * job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
+     * not be executed. If this happens, retry the UpdateJob request
+     * until a successful response is received.
+     * 
+ */ + public void updateJob(com.google.cloud.scheduler.v1beta1.UpdateJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a job.
+     * 
+ */ + public void deleteJob(com.google.cloud.scheduler.v1beta1.DeleteJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Pauses a job.
+     * If a job is paused then the system will stop executing the job
+     * until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
+     * state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
+     * will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
+     * to be paused.
+     * 
+ */ + public void pauseJob(com.google.cloud.scheduler.v1beta1.PauseJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPauseJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Resume a job.
+     * This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
+     * state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
+     * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
+     * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
+     * 
+ */ + public void resumeJob(com.google.cloud.scheduler.v1beta1.ResumeJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getResumeJobMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Forces a job to run now.
+     * When this method is called, Cloud Scheduler will dispatch the job, even
+     * if the job is already running.
+     * 
+ */ + public void runJob(com.google.cloud.scheduler.v1beta1.RunJobRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRunJobMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * The Cloud Scheduler API allows external entities to reliably
+   * schedule asynchronous jobs.
+   * 
+ */ + public static final class CloudSchedulerBlockingStub extends io.grpc.stub.AbstractStub { + private CloudSchedulerBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudSchedulerBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudSchedulerBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudSchedulerBlockingStub(channel, callOptions); + } + + /** + *
+     * Lists jobs.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.ListJobsResponse listJobs(com.google.cloud.scheduler.v1beta1.ListJobsRequest request) { + return blockingUnaryCall( + getChannel(), getListJobsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a job.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job getJob(com.google.cloud.scheduler.v1beta1.GetJobRequest request) { + return blockingUnaryCall( + getChannel(), getGetJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a job.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job createJob(com.google.cloud.scheduler.v1beta1.CreateJobRequest request) { + return blockingUnaryCall( + getChannel(), getCreateJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates a job.
+     * If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
+     * not exist, `NOT_FOUND` is returned.
+     * If UpdateJob does not successfully return, it is possible for the
+     * job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
+     * not be executed. If this happens, retry the UpdateJob request
+     * until a successful response is received.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job updateJob(com.google.cloud.scheduler.v1beta1.UpdateJobRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a job.
+     * 
+ */ + public com.google.protobuf.Empty deleteJob(com.google.cloud.scheduler.v1beta1.DeleteJobRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Pauses a job.
+     * If a job is paused then the system will stop executing the job
+     * until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
+     * state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
+     * will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
+     * to be paused.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job pauseJob(com.google.cloud.scheduler.v1beta1.PauseJobRequest request) { + return blockingUnaryCall( + getChannel(), getPauseJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Resume a job.
+     * This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
+     * state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
+     * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
+     * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job resumeJob(com.google.cloud.scheduler.v1beta1.ResumeJobRequest request) { + return blockingUnaryCall( + getChannel(), getResumeJobMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Forces a job to run now.
+     * When this method is called, Cloud Scheduler will dispatch the job, even
+     * if the job is already running.
+     * 
+ */ + public com.google.cloud.scheduler.v1beta1.Job runJob(com.google.cloud.scheduler.v1beta1.RunJobRequest request) { + return blockingUnaryCall( + getChannel(), getRunJobMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * The Cloud Scheduler API allows external entities to reliably
+   * schedule asynchronous jobs.
+   * 
+ */ + public static final class CloudSchedulerFutureStub extends io.grpc.stub.AbstractStub { + private CloudSchedulerFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudSchedulerFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudSchedulerFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudSchedulerFutureStub(channel, callOptions); + } + + /** + *
+     * Lists jobs.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listJobs( + com.google.cloud.scheduler.v1beta1.ListJobsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListJobsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getJob( + com.google.cloud.scheduler.v1beta1.GetJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createJob( + com.google.cloud.scheduler.v1beta1.CreateJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates a job.
+     * If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
+     * not exist, `NOT_FOUND` is returned.
+     * If UpdateJob does not successfully return, it is possible for the
+     * job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
+     * not be executed. If this happens, retry the UpdateJob request
+     * until a successful response is received.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateJob( + com.google.cloud.scheduler.v1beta1.UpdateJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a job.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteJob( + com.google.cloud.scheduler.v1beta1.DeleteJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Pauses a job.
+     * If a job is paused then the system will stop executing the job
+     * until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
+     * state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
+     * will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
+     * to be paused.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture pauseJob( + com.google.cloud.scheduler.v1beta1.PauseJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getPauseJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Resume a job.
+     * This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
+     * state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
+     * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
+     * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture resumeJob( + com.google.cloud.scheduler.v1beta1.ResumeJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getResumeJobMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Forces a job to run now.
+     * When this method is called, Cloud Scheduler will dispatch the job, even
+     * if the job is already running.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture runJob( + com.google.cloud.scheduler.v1beta1.RunJobRequest request) { + return futureUnaryCall( + getChannel().newCall(getRunJobMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_JOBS = 0; + private static final int METHODID_GET_JOB = 1; + private static final int METHODID_CREATE_JOB = 2; + private static final int METHODID_UPDATE_JOB = 3; + private static final int METHODID_DELETE_JOB = 4; + private static final int METHODID_PAUSE_JOB = 5; + private static final int METHODID_RESUME_JOB = 6; + private static final int METHODID_RUN_JOB = 7; + + 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 CloudSchedulerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudSchedulerImplBase 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_JOBS: + serviceImpl.listJobs((com.google.cloud.scheduler.v1beta1.ListJobsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_JOB: + serviceImpl.getJob((com.google.cloud.scheduler.v1beta1.GetJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_JOB: + serviceImpl.createJob((com.google.cloud.scheduler.v1beta1.CreateJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_JOB: + serviceImpl.updateJob((com.google.cloud.scheduler.v1beta1.UpdateJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_JOB: + serviceImpl.deleteJob((com.google.cloud.scheduler.v1beta1.DeleteJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAUSE_JOB: + serviceImpl.pauseJob((com.google.cloud.scheduler.v1beta1.PauseJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESUME_JOB: + serviceImpl.resumeJob((com.google.cloud.scheduler.v1beta1.ResumeJobRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RUN_JOB: + serviceImpl.runJob((com.google.cloud.scheduler.v1beta1.RunJobRequest) 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 static abstract class CloudSchedulerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudSchedulerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudScheduler"); + } + } + + private static final class CloudSchedulerFileDescriptorSupplier + extends CloudSchedulerBaseDescriptorSupplier { + CloudSchedulerFileDescriptorSupplier() {} + } + + private static final class CloudSchedulerMethodDescriptorSupplier + extends CloudSchedulerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudSchedulerMethodDescriptorSupplier(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 (CloudSchedulerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudSchedulerFileDescriptorSupplier()) + .addMethod(getListJobsMethodHelper()) + .addMethod(getGetJobMethodHelper()) + .addMethod(getCreateJobMethodHelper()) + .addMethod(getUpdateJobMethodHelper()) + .addMethod(getDeleteJobMethodHelper()) + .addMethod(getPauseJobMethodHelper()) + .addMethod(getResumeJobMethodHelper()) + .addMethod(getRunJobMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 89ef416359b5..8b5f0ec2c1aa 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -346,6 +346,36 @@ grpc-google-cloud-pubsub-v1 1.33.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-redis-v1beta1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-v1beta1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-redis-v1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-v1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-spanner-v1 @@ -566,26 +596,6 @@ grpc-google-cloud-iot-v1 0.34.1-SNAPSHOT - - com.google.api.grpc - proto-google-cloud-redis-v1beta1 - 0.34.1-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-redis-v1beta1 - 0.34.1-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-redis-v1 - 0.34.1-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-redis-v1 - 0.34.1-SNAPSHOT - com.google.api.grpc proto-google-cloud-websecurityscanner-v1alpha @@ -614,6 +624,7 @@ grpc-google-cloud-dlp-v2 grpc-google-cloud-error-reporting-v1beta1 grpc-google-cloud-firestore-v1beta1 + grpc-google-cloud-iot-v1 grpc-google-cloud-kms-v1 grpc-google-cloud-language-v1 grpc-google-cloud-language-v1beta2 @@ -621,6 +632,9 @@ grpc-google-cloud-monitoring-v3 grpc-google-cloud-os-login-v1 grpc-google-cloud-pubsub-v1 + grpc-google-cloud-redis-v1beta1 + grpc-google-cloud-redis-v1 + grpc-google-cloud-scheduler-v1beta1 grpc-google-cloud-spanner-admin-database-v1 grpc-google-cloud-spanner-admin-instance-v1 grpc-google-cloud-spanner-v1 @@ -642,9 +656,6 @@ grpc-google-cloud-vision-v1p1beta1 grpc-google-cloud-vision-v1p2beta1 grpc-google-cloud-vision-v1p3beta1 - grpc-google-cloud-iot-v1 - grpc-google-cloud-redis-v1beta1 - grpc-google-cloud-redis-v1 grpc-google-cloud-websecurityscanner-v1alpha proto-google-cloud-asset-v1beta1 @@ -662,6 +673,7 @@ proto-google-cloud-dlp-v2 proto-google-cloud-error-reporting-v1beta1 proto-google-cloud-firestore-v1beta1 + proto-google-cloud-iot-v1 proto-google-cloud-kms-v1 proto-google-cloud-language-v1 proto-google-cloud-language-v1beta2 @@ -669,6 +681,9 @@ proto-google-cloud-monitoring-v3 proto-google-cloud-os-login-v1 proto-google-cloud-pubsub-v1 + proto-google-cloud-redis-v1beta1 + proto-google-cloud-redis-v1 + proto-google-cloud-scheduler-v1beta1 proto-google-cloud-spanner-admin-database-v1 proto-google-cloud-spanner-admin-instance-v1 proto-google-cloud-spanner-v1 @@ -690,9 +705,6 @@ proto-google-cloud-vision-v1p1beta1 proto-google-cloud-vision-v1p2beta1 proto-google-cloud-vision-v1p3beta1 - proto-google-cloud-iot-v1 - proto-google-cloud-redis-v1beta1 - proto-google-cloud-redis-v1 proto-google-cloud-websecurityscanner-v1alpha diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/pom.xml new file mode 100644 index 000000000000..7f7f9de11e8a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + proto-google-cloud-scheduler-v1beta1 + PROTO library for proto-google-cloud-redis-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.34.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTarget.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTarget.java new file mode 100644 index 000000000000..76916b84240d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTarget.java @@ -0,0 +1,1645 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * App Engine target. The job will be pushed to a job handler by means
+ * of an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.http_method] such
+ * as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an
+ * HTTP response code in the range [200 - 299]. Error 503 is
+ * considered an App Engine system error instead of an application
+ * error. Requests returning error 503 will be retried regardless of
+ * retry configuration and not counted against retry counts. Any other
+ * response code, or a failure to receive a response before the
+ * deadline, constitutes a failed attempt.
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.AppEngineHttpTarget} + */ +public final class AppEngineHttpTarget extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.AppEngineHttpTarget) + AppEngineHttpTargetOrBuilder { +private static final long serialVersionUID = 0L; + // Use AppEngineHttpTarget.newBuilder() to construct. + private AppEngineHttpTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AppEngineHttpTarget() { + httpMethod_ = 0; + relativeUri_ = ""; + body_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AppEngineHttpTarget( + 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: { + int rawValue = input.readEnum(); + + httpMethod_ = rawValue; + break; + } + case 18: { + com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder subBuilder = null; + if (appEngineRouting_ != null) { + subBuilder = appEngineRouting_.toBuilder(); + } + appEngineRouting_ = input.readMessage(com.google.cloud.scheduler.v1beta1.AppEngineRouting.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(appEngineRouting_); + appEngineRouting_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + relativeUri_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + headers_ = com.google.protobuf.MapField.newMapField( + HeadersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry + headers__ = input.readMessage( + HeadersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + headers_.getMutableMap().put( + headers__.getKey(), headers__.getValue()); + break; + } + case 42: { + + body_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.class, com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder.class); + } + + private int bitField0_; + public static final int HTTP_METHOD_FIELD_NUMBER = 1; + private int httpMethod_; + /** + *
+   * The HTTP method to use for the request. PATCH and OPTIONS are not
+   * permitted.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public int getHttpMethodValue() { + return httpMethod_; + } + /** + *
+   * The HTTP method to use for the request. PATCH and OPTIONS are not
+   * permitted.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.HttpMethod result = com.google.cloud.scheduler.v1beta1.HttpMethod.valueOf(httpMethod_); + return result == null ? com.google.cloud.scheduler.v1beta1.HttpMethod.UNRECOGNIZED : result; + } + + public static final int APP_ENGINE_ROUTING_FIELD_NUMBER = 2; + private com.google.cloud.scheduler.v1beta1.AppEngineRouting appEngineRouting_; + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public boolean hasAppEngineRouting() { + return appEngineRouting_ != null; + } + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineRouting getAppEngineRouting() { + return appEngineRouting_ == null ? com.google.cloud.scheduler.v1beta1.AppEngineRouting.getDefaultInstance() : appEngineRouting_; + } + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder getAppEngineRoutingOrBuilder() { + return getAppEngineRouting(); + } + + public static final int RELATIVE_URI_FIELD_NUMBER = 3; + private volatile java.lang.Object relativeUri_; + /** + *
+   * The relative URI.
+   * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+   * It can contain a path, query string arguments, and `#` fragments.
+   * If the relative URL is empty, then the root path "/" will be used.
+   * No spaces are allowed, and the maximum length allowed is 2083 characters.
+   * 
+ * + * string relative_uri = 3; + */ + public java.lang.String getRelativeUri() { + java.lang.Object ref = relativeUri_; + 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(); + relativeUri_ = s; + return s; + } + } + /** + *
+   * The relative URI.
+   * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+   * It can contain a path, query string arguments, and `#` fragments.
+   * If the relative URL is empty, then the root path "/" will be used.
+   * No spaces are allowed, and the maximum length allowed is 2083 characters.
+   * 
+ * + * string relative_uri = 3; + */ + public com.google.protobuf.ByteString + getRelativeUriBytes() { + java.lang.Object ref = relativeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + relativeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADERS_FIELD_NUMBER = 4; + private static final class HeadersDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headers_; + private com.google.protobuf.MapField + internalGetHeaders() { + if (headers_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + return headers_; + } + + public int getHeadersCount() { + return internalGetHeaders().getMap().size(); + } + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + public boolean containsHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetHeaders().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getHeaders() { + return getHeadersMap(); + } + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + public java.util.Map getHeadersMap() { + return internalGetHeaders().getMap(); + } + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + public java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + public java.lang.String getHeadersOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BODY_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString body_; + /** + *
+   * Body.
+   * HTTP request body. A request body is allowed only if the HTTP method is
+   * POST or PUT. It will result in invalid argument error to set a body on a
+   * job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+   * 
+ * + * bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + + 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 (httpMethod_ != com.google.cloud.scheduler.v1beta1.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { + output.writeEnum(1, httpMethod_); + } + if (appEngineRouting_ != null) { + output.writeMessage(2, getAppEngineRouting()); + } + if (!getRelativeUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, relativeUri_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetHeaders(), + HeadersDefaultEntryHolder.defaultEntry, + 4); + if (!body_.isEmpty()) { + output.writeBytes(5, body_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (httpMethod_ != com.google.cloud.scheduler.v1beta1.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, httpMethod_); + } + if (appEngineRouting_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAppEngineRouting()); + } + if (!getRelativeUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, relativeUri_); + } + for (java.util.Map.Entry entry + : internalGetHeaders().getMap().entrySet()) { + com.google.protobuf.MapEntry + headers__ = HeadersDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, headers__); + } + if (!body_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, body_); + } + 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.scheduler.v1beta1.AppEngineHttpTarget)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget other = (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) obj; + + boolean result = true; + result = result && httpMethod_ == other.httpMethod_; + result = result && (hasAppEngineRouting() == other.hasAppEngineRouting()); + if (hasAppEngineRouting()) { + result = result && getAppEngineRouting() + .equals(other.getAppEngineRouting()); + } + result = result && getRelativeUri() + .equals(other.getRelativeUri()); + result = result && internalGetHeaders().equals( + other.internalGetHeaders()); + result = result && getBody() + .equals(other.getBody()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HTTP_METHOD_FIELD_NUMBER; + hash = (53 * hash) + httpMethod_; + if (hasAppEngineRouting()) { + hash = (37 * hash) + APP_ENGINE_ROUTING_FIELD_NUMBER; + hash = (53 * hash) + getAppEngineRouting().hashCode(); + } + hash = (37 * hash) + RELATIVE_URI_FIELD_NUMBER; + hash = (53 * hash) + getRelativeUri().hashCode(); + if (!internalGetHeaders().getMap().isEmpty()) { + hash = (37 * hash) + HEADERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetHeaders().hashCode(); + } + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget 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.scheduler.v1beta1.AppEngineHttpTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget 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.scheduler.v1beta1.AppEngineHttpTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget 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.scheduler.v1beta1.AppEngineHttpTarget parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget 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.scheduler.v1beta1.AppEngineHttpTarget parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget 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.scheduler.v1beta1.AppEngineHttpTarget 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; + } + /** + *
+   * App Engine target. The job will be pushed to a job handler by means
+   * of an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.http_method] such
+   * as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an
+   * HTTP response code in the range [200 - 299]. Error 503 is
+   * considered an App Engine system error instead of an application
+   * error. Requests returning error 503 will be retried regardless of
+   * retry configuration and not counted against retry counts. Any other
+   * response code, or a failure to receive a response before the
+   * deadline, constitutes a failed attempt.
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.AppEngineHttpTarget} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.AppEngineHttpTarget) + com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.class, com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.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(); + httpMethod_ = 0; + + if (appEngineRoutingBuilder_ == null) { + appEngineRouting_ = null; + } else { + appEngineRouting_ = null; + appEngineRoutingBuilder_ = null; + } + relativeUri_ = ""; + + internalGetMutableHeaders().clear(); + body_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget build() { + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget buildPartial() { + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget result = new com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.httpMethod_ = httpMethod_; + if (appEngineRoutingBuilder_ == null) { + result.appEngineRouting_ = appEngineRouting_; + } else { + result.appEngineRouting_ = appEngineRoutingBuilder_.build(); + } + result.relativeUri_ = relativeUri_; + result.headers_ = internalGetHeaders(); + result.headers_.makeImmutable(); + result.body_ = body_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget other) { + if (other == com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance()) return this; + if (other.httpMethod_ != 0) { + setHttpMethodValue(other.getHttpMethodValue()); + } + if (other.hasAppEngineRouting()) { + mergeAppEngineRouting(other.getAppEngineRouting()); + } + if (!other.getRelativeUri().isEmpty()) { + relativeUri_ = other.relativeUri_; + onChanged(); + } + internalGetMutableHeaders().mergeFrom( + other.internalGetHeaders()); + if (other.getBody() != com.google.protobuf.ByteString.EMPTY) { + setBody(other.getBody()); + } + 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.scheduler.v1beta1.AppEngineHttpTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int httpMethod_ = 0; + /** + *
+     * The HTTP method to use for the request. PATCH and OPTIONS are not
+     * permitted.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public int getHttpMethodValue() { + return httpMethod_; + } + /** + *
+     * The HTTP method to use for the request. PATCH and OPTIONS are not
+     * permitted.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public Builder setHttpMethodValue(int value) { + httpMethod_ = value; + onChanged(); + return this; + } + /** + *
+     * The HTTP method to use for the request. PATCH and OPTIONS are not
+     * permitted.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.HttpMethod result = com.google.cloud.scheduler.v1beta1.HttpMethod.valueOf(httpMethod_); + return result == null ? com.google.cloud.scheduler.v1beta1.HttpMethod.UNRECOGNIZED : result; + } + /** + *
+     * The HTTP method to use for the request. PATCH and OPTIONS are not
+     * permitted.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public Builder setHttpMethod(com.google.cloud.scheduler.v1beta1.HttpMethod value) { + if (value == null) { + throw new NullPointerException(); + } + + httpMethod_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The HTTP method to use for the request. PATCH and OPTIONS are not
+     * permitted.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + public Builder clearHttpMethod() { + + httpMethod_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.scheduler.v1beta1.AppEngineRouting appEngineRouting_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineRouting, com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder, com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder> appEngineRoutingBuilder_; + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public boolean hasAppEngineRouting() { + return appEngineRoutingBuilder_ != null || appEngineRouting_ != null; + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineRouting getAppEngineRouting() { + if (appEngineRoutingBuilder_ == null) { + return appEngineRouting_ == null ? com.google.cloud.scheduler.v1beta1.AppEngineRouting.getDefaultInstance() : appEngineRouting_; + } else { + return appEngineRoutingBuilder_.getMessage(); + } + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public Builder setAppEngineRouting(com.google.cloud.scheduler.v1beta1.AppEngineRouting value) { + if (appEngineRoutingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + appEngineRouting_ = value; + onChanged(); + } else { + appEngineRoutingBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public Builder setAppEngineRouting( + com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder builderForValue) { + if (appEngineRoutingBuilder_ == null) { + appEngineRouting_ = builderForValue.build(); + onChanged(); + } else { + appEngineRoutingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public Builder mergeAppEngineRouting(com.google.cloud.scheduler.v1beta1.AppEngineRouting value) { + if (appEngineRoutingBuilder_ == null) { + if (appEngineRouting_ != null) { + appEngineRouting_ = + com.google.cloud.scheduler.v1beta1.AppEngineRouting.newBuilder(appEngineRouting_).mergeFrom(value).buildPartial(); + } else { + appEngineRouting_ = value; + } + onChanged(); + } else { + appEngineRoutingBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public Builder clearAppEngineRouting() { + if (appEngineRoutingBuilder_ == null) { + appEngineRouting_ = null; + onChanged(); + } else { + appEngineRouting_ = null; + appEngineRoutingBuilder_ = null; + } + + return this; + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder getAppEngineRoutingBuilder() { + + onChanged(); + return getAppEngineRoutingFieldBuilder().getBuilder(); + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder getAppEngineRoutingOrBuilder() { + if (appEngineRoutingBuilder_ != null) { + return appEngineRoutingBuilder_.getMessageOrBuilder(); + } else { + return appEngineRouting_ == null ? + com.google.cloud.scheduler.v1beta1.AppEngineRouting.getDefaultInstance() : appEngineRouting_; + } + } + /** + *
+     * App Engine Routing setting for the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineRouting, com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder, com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder> + getAppEngineRoutingFieldBuilder() { + if (appEngineRoutingBuilder_ == null) { + appEngineRoutingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineRouting, com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder, com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder>( + getAppEngineRouting(), + getParentForChildren(), + isClean()); + appEngineRouting_ = null; + } + return appEngineRoutingBuilder_; + } + + private java.lang.Object relativeUri_ = ""; + /** + *
+     * The relative URI.
+     * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+     * It can contain a path, query string arguments, and `#` fragments.
+     * If the relative URL is empty, then the root path "/" will be used.
+     * No spaces are allowed, and the maximum length allowed is 2083 characters.
+     * 
+ * + * string relative_uri = 3; + */ + public java.lang.String getRelativeUri() { + java.lang.Object ref = relativeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + relativeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The relative URI.
+     * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+     * It can contain a path, query string arguments, and `#` fragments.
+     * If the relative URL is empty, then the root path "/" will be used.
+     * No spaces are allowed, and the maximum length allowed is 2083 characters.
+     * 
+ * + * string relative_uri = 3; + */ + public com.google.protobuf.ByteString + getRelativeUriBytes() { + java.lang.Object ref = relativeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + relativeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The relative URI.
+     * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+     * It can contain a path, query string arguments, and `#` fragments.
+     * If the relative URL is empty, then the root path "/" will be used.
+     * No spaces are allowed, and the maximum length allowed is 2083 characters.
+     * 
+ * + * string relative_uri = 3; + */ + public Builder setRelativeUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + relativeUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The relative URI.
+     * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+     * It can contain a path, query string arguments, and `#` fragments.
+     * If the relative URL is empty, then the root path "/" will be used.
+     * No spaces are allowed, and the maximum length allowed is 2083 characters.
+     * 
+ * + * string relative_uri = 3; + */ + public Builder clearRelativeUri() { + + relativeUri_ = getDefaultInstance().getRelativeUri(); + onChanged(); + return this; + } + /** + *
+     * The relative URI.
+     * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+     * It can contain a path, query string arguments, and `#` fragments.
+     * If the relative URL is empty, then the root path "/" will be used.
+     * No spaces are allowed, and the maximum length allowed is 2083 characters.
+     * 
+ * + * string relative_uri = 3; + */ + public Builder setRelativeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + relativeUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headers_; + private com.google.protobuf.MapField + internalGetHeaders() { + if (headers_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + return headers_; + } + private com.google.protobuf.MapField + internalGetMutableHeaders() { + onChanged();; + if (headers_ == null) { + headers_ = com.google.protobuf.MapField.newMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + if (!headers_.isMutable()) { + headers_ = headers_.copy(); + } + return headers_; + } + + public int getHeadersCount() { + return internalGetHeaders().getMap().size(); + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public boolean containsHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetHeaders().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getHeaders() { + return getHeadersMap(); + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public java.util.Map getHeadersMap() { + return internalGetHeaders().getMap(); + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public java.lang.String getHeadersOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearHeaders() { + internalGetMutableHeaders().getMutableMap() + .clear(); + return this; + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public Builder removeHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableHeaders().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableHeaders() { + return internalGetMutableHeaders().getMutableMap(); + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + public Builder putHeaders( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableHeaders().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * HTTP request headers.
+     * This map contains the header field names and values. Headers can be set
+     * when the job is created.
+     * Cloud Scheduler sets some headers to default values:
+     * * `User-Agent`: By default, this header is
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+     *   This header can be modified, but Cloud Scheduler will append
+     *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+     *   modified `User-Agent`.
+     * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+     * following headers:
+     * * `Content-Type`: By default, the `Content-Type` header is set to
+     *   `"application/octet-stream"`. The default can be overridden by explictly
+     *   setting `Content-Type` to a particular media type when the job is
+     *   created.
+     *   For example, `Content-Type` can be set to `"application/json"`.
+     * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+     *   output only. It cannot be changed.
+     * The headers below are output only. They cannot be set or overridden:
+     * * `X-Google-*`: For Google internal use only.
+     * * `X-AppEngine-*`: For Google internal use only. See
+     *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+     * In addition, some App Engine headers, which contain
+     * job-specific information, are also be sent to the job handler; see
+     * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+     * 
+ * + * map<string, string> headers = 4; + */ + + public Builder putAllHeaders( + java.util.Map values) { + internalGetMutableHeaders().getMutableMap() + .putAll(values); + return this; + } + + private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * Body.
+     * HTTP request body. A request body is allowed only if the HTTP method is
+     * POST or PUT. It will result in invalid argument error to set a body on a
+     * job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + /** + *
+     * Body.
+     * HTTP request body. A request body is allowed only if the HTTP method is
+     * POST or PUT. It will result in invalid argument error to set a body on a
+     * job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 5; + */ + public Builder setBody(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + *
+     * Body.
+     * HTTP request body. A request body is allowed only if the HTTP method is
+     * POST or PUT. It will result in invalid argument error to set a body on a
+     * job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 5; + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.AppEngineHttpTarget) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.AppEngineHttpTarget) + private static final com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget(); + } + + public static com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppEngineHttpTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppEngineHttpTarget(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.scheduler.v1beta1.AppEngineHttpTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTargetOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTargetOrBuilder.java new file mode 100644 index 000000000000..4b03b1c5e4de --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineHttpTargetOrBuilder.java @@ -0,0 +1,265 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface AppEngineHttpTargetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.AppEngineHttpTarget) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The HTTP method to use for the request. PATCH and OPTIONS are not
+   * permitted.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + int getHttpMethodValue(); + /** + *
+   * The HTTP method to use for the request. PATCH and OPTIONS are not
+   * permitted.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 1; + */ + com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod(); + + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + boolean hasAppEngineRouting(); + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + com.google.cloud.scheduler.v1beta1.AppEngineRouting getAppEngineRouting(); + /** + *
+   * App Engine Routing setting for the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineRouting app_engine_routing = 2; + */ + com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder getAppEngineRoutingOrBuilder(); + + /** + *
+   * The relative URI.
+   * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+   * It can contain a path, query string arguments, and `#` fragments.
+   * If the relative URL is empty, then the root path "/" will be used.
+   * No spaces are allowed, and the maximum length allowed is 2083 characters.
+   * 
+ * + * string relative_uri = 3; + */ + java.lang.String getRelativeUri(); + /** + *
+   * The relative URI.
+   * The relative URL must begin with "/" and must be a valid HTTP relative URL.
+   * It can contain a path, query string arguments, and `#` fragments.
+   * If the relative URL is empty, then the root path "/" will be used.
+   * No spaces are allowed, and the maximum length allowed is 2083 characters.
+   * 
+ * + * string relative_uri = 3; + */ + com.google.protobuf.ByteString + getRelativeUriBytes(); + + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + int getHeadersCount(); + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + boolean containsHeaders( + java.lang.String key); + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getHeaders(); + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + java.util.Map + getHeadersMap(); + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * HTTP request headers.
+   * This map contains the header field names and values. Headers can be set
+   * when the job is created.
+   * Cloud Scheduler sets some headers to default values:
+   * * `User-Agent`: By default, this header is
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"`.
+   *   This header can be modified, but Cloud Scheduler will append
+   *   `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
+   *   modified `User-Agent`.
+   * If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the
+   * following headers:
+   * * `Content-Type`: By default, the `Content-Type` header is set to
+   *   `"application/octet-stream"`. The default can be overridden by explictly
+   *   setting `Content-Type` to a particular media type when the job is
+   *   created.
+   *   For example, `Content-Type` can be set to `"application/json"`.
+   * * `Content-Length`: This is computed by Cloud Scheduler. This value is
+   *   output only. It cannot be changed.
+   * The headers below are output only. They cannot be set or overridden:
+   * * `X-Google-*`: For Google internal use only.
+   * * `X-AppEngine-*`: For Google internal use only. See
+   *   [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
+   * In addition, some App Engine headers, which contain
+   * job-specific information, are also be sent to the job handler; see
+   * [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron).
+   * 
+ * + * map<string, string> headers = 4; + */ + + java.lang.String getHeadersOrThrow( + java.lang.String key); + + /** + *
+   * Body.
+   * HTTP request body. A request body is allowed only if the HTTP method is
+   * POST or PUT. It will result in invalid argument error to set a body on a
+   * job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+   * 
+ * + * bytes body = 5; + */ + com.google.protobuf.ByteString getBody(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRouting.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRouting.java new file mode 100644 index 000000000000..5e36c2082f86 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRouting.java @@ -0,0 +1,1409 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * App Engine Routing.
+ * For more information about services, versions, and instances see
+ * [An Overview of App Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
+ * [Microservices Architecture on Google App Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
+ * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), and
+ * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.AppEngineRouting} + */ +public final class AppEngineRouting extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.AppEngineRouting) + AppEngineRoutingOrBuilder { +private static final long serialVersionUID = 0L; + // Use AppEngineRouting.newBuilder() to construct. + private AppEngineRouting(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AppEngineRouting() { + service_ = ""; + version_ = ""; + instance_ = ""; + host_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AppEngineRouting( + 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(); + + service_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + instance_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + host_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.AppEngineRouting.class, com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + *
+   * App service.
+   * By default, the job is sent to the service which is the default
+   * service when the job is attempted.
+   * 
+ * + * string service = 1; + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + *
+   * App service.
+   * By default, the job is sent to the service which is the default
+   * service when the job is attempted.
+   * 
+ * + * string service = 1; + */ + public com.google.protobuf.ByteString + getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object version_; + /** + *
+   * App version.
+   * By default, the job is sent to the version which is the default
+   * version when the job is attempted.
+   * 
+ * + * string version = 2; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + *
+   * App version.
+   * By default, the job is sent to the version which is the default
+   * version when the job is attempted.
+   * 
+ * + * string version = 2; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private volatile java.lang.Object instance_; + /** + *
+   * App instance.
+   * By default, the job is sent to an instance which is available when
+   * the job is attempted.
+   * Requests can only be sent to a specific instance if
+   * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+   * App Engine Flex does not support instances. For more information, see
+   * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+   * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+   * 
+ * + * string instance = 3; + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + 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(); + instance_ = s; + return s; + } + } + /** + *
+   * App instance.
+   * By default, the job is sent to an instance which is available when
+   * the job is attempted.
+   * Requests can only be sent to a specific instance if
+   * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+   * App Engine Flex does not support instances. For more information, see
+   * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+   * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+   * 
+ * + * string instance = 3; + */ + public com.google.protobuf.ByteString + getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_FIELD_NUMBER = 4; + private volatile java.lang.Object host_; + /** + *
+   * Output only. The host that the job is sent to.
+   * For more information about how App Engine requests are routed, see
+   * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+   * The host is constructed as:
+   * * `host = [application_domain_name]`</br>
+   *   `| [service] + '.' + [application_domain_name]`</br>
+   *   `| [version] + '.' + [application_domain_name]`</br>
+   *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+   *   `| [instance] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+   * * `application_domain_name` = The domain name of the app, for
+   *   example <app-id>.appspot.com, which is associated with the
+   *   job's project ID.
+   * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `version_dot_service =`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+   * * `instance_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance_dot_version =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `instance_dot_version_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+   * to the service which is the default service when the job is attempted.
+   * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+   * to the version which is the default version when the job is attempted.
+   * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+   * sent to an instance which is available when the job is attempted.
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+   * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+   * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+   * to the default version of the default service when the job is attempted.
+   * 
+ * + * string host = 4; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + 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(); + host_ = s; + return s; + } + } + /** + *
+   * Output only. The host that the job is sent to.
+   * For more information about how App Engine requests are routed, see
+   * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+   * The host is constructed as:
+   * * `host = [application_domain_name]`</br>
+   *   `| [service] + '.' + [application_domain_name]`</br>
+   *   `| [version] + '.' + [application_domain_name]`</br>
+   *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+   *   `| [instance] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+   * * `application_domain_name` = The domain name of the app, for
+   *   example <app-id>.appspot.com, which is associated with the
+   *   job's project ID.
+   * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `version_dot_service =`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+   * * `instance_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance_dot_version =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `instance_dot_version_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+   * to the service which is the default service when the job is attempted.
+   * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+   * to the version which is the default version when the job is attempted.
+   * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+   * sent to an instance which is available when the job is attempted.
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+   * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+   * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+   * to the default version of the default service when the job is attempted.
+   * 
+ * + * string host = 4; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = 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 (!getServiceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + if (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + if (!getInstanceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, instance_); + } + if (!getHostBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, host_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + if (!getInstanceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, instance_); + } + if (!getHostBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, host_); + } + 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.scheduler.v1beta1.AppEngineRouting)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.AppEngineRouting other = (com.google.cloud.scheduler.v1beta1.AppEngineRouting) obj; + + boolean result = true; + result = result && getService() + .equals(other.getService()); + result = result && getVersion() + .equals(other.getVersion()); + result = result && getInstance() + .equals(other.getInstance()); + result = result && getHost() + .equals(other.getHost()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting 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.scheduler.v1beta1.AppEngineRouting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting 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.scheduler.v1beta1.AppEngineRouting parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting 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.scheduler.v1beta1.AppEngineRouting parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting 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.scheduler.v1beta1.AppEngineRouting parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting 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.scheduler.v1beta1.AppEngineRouting 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; + } + /** + *
+   * App Engine Routing.
+   * For more information about services, versions, and instances see
+   * [An Overview of App Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
+   * [Microservices Architecture on Google App Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
+   * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), and
+   * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.AppEngineRouting} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.AppEngineRouting) + com.google.cloud.scheduler.v1beta1.AppEngineRoutingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.AppEngineRouting.class, com.google.cloud.scheduler.v1beta1.AppEngineRouting.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.AppEngineRouting.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(); + service_ = ""; + + version_ = ""; + + instance_ = ""; + + host_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineRouting getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.AppEngineRouting.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineRouting build() { + com.google.cloud.scheduler.v1beta1.AppEngineRouting result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.AppEngineRouting buildPartial() { + com.google.cloud.scheduler.v1beta1.AppEngineRouting result = new com.google.cloud.scheduler.v1beta1.AppEngineRouting(this); + result.service_ = service_; + result.version_ = version_; + result.instance_ = instance_; + result.host_ = host_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.AppEngineRouting) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.AppEngineRouting)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.AppEngineRouting other) { + if (other == com.google.cloud.scheduler.v1beta1.AppEngineRouting.getDefaultInstance()) return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getInstance().isEmpty()) { + instance_ = other.instance_; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + 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.scheduler.v1beta1.AppEngineRouting parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.AppEngineRouting) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object service_ = ""; + /** + *
+     * App service.
+     * By default, the job is sent to the service which is the default
+     * service when the job is attempted.
+     * 
+ * + * string service = 1; + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * App service.
+     * By default, the job is sent to the service which is the default
+     * service when the job is attempted.
+     * 
+ * + * string service = 1; + */ + public com.google.protobuf.ByteString + getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * App service.
+     * By default, the job is sent to the service which is the default
+     * service when the job is attempted.
+     * 
+ * + * string service = 1; + */ + public Builder setService( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + *
+     * App service.
+     * By default, the job is sent to the service which is the default
+     * service when the job is attempted.
+     * 
+ * + * string service = 1; + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + *
+     * App service.
+     * By default, the job is sent to the service which is the default
+     * service when the job is attempted.
+     * 
+ * + * string service = 1; + */ + public Builder setServiceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + *
+     * App version.
+     * By default, the job is sent to the version which is the default
+     * version when the job is attempted.
+     * 
+ * + * string version = 2; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * App version.
+     * By default, the job is sent to the version which is the default
+     * version when the job is attempted.
+     * 
+ * + * string version = 2; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * App version.
+     * By default, the job is sent to the version which is the default
+     * version when the job is attempted.
+     * 
+ * + * string version = 2; + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + *
+     * App version.
+     * By default, the job is sent to the version which is the default
+     * version when the job is attempted.
+     * 
+ * + * string version = 2; + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + *
+     * App version.
+     * By default, the job is sent to the version which is the default
+     * version when the job is attempted.
+     * 
+ * + * string version = 2; + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object instance_ = ""; + /** + *
+     * App instance.
+     * By default, the job is sent to an instance which is available when
+     * the job is attempted.
+     * Requests can only be sent to a specific instance if
+     * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+     * App Engine Flex does not support instances. For more information, see
+     * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+     * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+     * 
+ * + * string instance = 3; + */ + public java.lang.String getInstance() { + java.lang.Object ref = instance_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instance_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * App instance.
+     * By default, the job is sent to an instance which is available when
+     * the job is attempted.
+     * Requests can only be sent to a specific instance if
+     * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+     * App Engine Flex does not support instances. For more information, see
+     * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+     * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+     * 
+ * + * string instance = 3; + */ + public com.google.protobuf.ByteString + getInstanceBytes() { + java.lang.Object ref = instance_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instance_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * App instance.
+     * By default, the job is sent to an instance which is available when
+     * the job is attempted.
+     * Requests can only be sent to a specific instance if
+     * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+     * App Engine Flex does not support instances. For more information, see
+     * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+     * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+     * 
+ * + * string instance = 3; + */ + public Builder setInstance( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instance_ = value; + onChanged(); + return this; + } + /** + *
+     * App instance.
+     * By default, the job is sent to an instance which is available when
+     * the job is attempted.
+     * Requests can only be sent to a specific instance if
+     * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+     * App Engine Flex does not support instances. For more information, see
+     * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+     * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+     * 
+ * + * string instance = 3; + */ + public Builder clearInstance() { + + instance_ = getDefaultInstance().getInstance(); + onChanged(); + return this; + } + /** + *
+     * App instance.
+     * By default, the job is sent to an instance which is available when
+     * the job is attempted.
+     * Requests can only be sent to a specific instance if
+     * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+     * App Engine Flex does not support instances. For more information, see
+     * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+     * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+     * 
+ * + * string instance = 3; + */ + public Builder setInstanceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instance_ = value; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + /** + *
+     * Output only. The host that the job is sent to.
+     * For more information about how App Engine requests are routed, see
+     * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+     * The host is constructed as:
+     * * `host = [application_domain_name]`</br>
+     *   `| [service] + '.' + [application_domain_name]`</br>
+     *   `| [version] + '.' + [application_domain_name]`</br>
+     *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+     *   `| [instance] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+     * * `application_domain_name` = The domain name of the app, for
+     *   example <app-id>.appspot.com, which is associated with the
+     *   job's project ID.
+     * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `version_dot_service =`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+     * * `instance_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance_dot_version =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `instance_dot_version_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+     * to the service which is the default service when the job is attempted.
+     * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+     * to the version which is the default version when the job is attempted.
+     * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+     * sent to an instance which is available when the job is attempted.
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+     * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+     * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+     * to the default version of the default service when the job is attempted.
+     * 
+ * + * string host = 4; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The host that the job is sent to.
+     * For more information about how App Engine requests are routed, see
+     * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+     * The host is constructed as:
+     * * `host = [application_domain_name]`</br>
+     *   `| [service] + '.' + [application_domain_name]`</br>
+     *   `| [version] + '.' + [application_domain_name]`</br>
+     *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+     *   `| [instance] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+     * * `application_domain_name` = The domain name of the app, for
+     *   example <app-id>.appspot.com, which is associated with the
+     *   job's project ID.
+     * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `version_dot_service =`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+     * * `instance_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance_dot_version =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `instance_dot_version_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+     * to the service which is the default service when the job is attempted.
+     * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+     * to the version which is the default version when the job is attempted.
+     * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+     * sent to an instance which is available when the job is attempted.
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+     * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+     * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+     * to the default version of the default service when the job is attempted.
+     * 
+ * + * string host = 4; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The host that the job is sent to.
+     * For more information about how App Engine requests are routed, see
+     * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+     * The host is constructed as:
+     * * `host = [application_domain_name]`</br>
+     *   `| [service] + '.' + [application_domain_name]`</br>
+     *   `| [version] + '.' + [application_domain_name]`</br>
+     *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+     *   `| [instance] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+     * * `application_domain_name` = The domain name of the app, for
+     *   example <app-id>.appspot.com, which is associated with the
+     *   job's project ID.
+     * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `version_dot_service =`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+     * * `instance_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance_dot_version =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `instance_dot_version_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+     * to the service which is the default service when the job is attempted.
+     * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+     * to the version which is the default version when the job is attempted.
+     * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+     * sent to an instance which is available when the job is attempted.
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+     * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+     * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+     * to the default version of the default service when the job is attempted.
+     * 
+ * + * string host = 4; + */ + public Builder setHost( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + host_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The host that the job is sent to.
+     * For more information about how App Engine requests are routed, see
+     * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+     * The host is constructed as:
+     * * `host = [application_domain_name]`</br>
+     *   `| [service] + '.' + [application_domain_name]`</br>
+     *   `| [version] + '.' + [application_domain_name]`</br>
+     *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+     *   `| [instance] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+     * * `application_domain_name` = The domain name of the app, for
+     *   example <app-id>.appspot.com, which is associated with the
+     *   job's project ID.
+     * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `version_dot_service =`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+     * * `instance_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance_dot_version =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `instance_dot_version_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+     * to the service which is the default service when the job is attempted.
+     * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+     * to the version which is the default version when the job is attempted.
+     * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+     * sent to an instance which is available when the job is attempted.
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+     * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+     * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+     * to the default version of the default service when the job is attempted.
+     * 
+ * + * string host = 4; + */ + public Builder clearHost() { + + host_ = getDefaultInstance().getHost(); + onChanged(); + return this; + } + /** + *
+     * Output only. The host that the job is sent to.
+     * For more information about how App Engine requests are routed, see
+     * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+     * The host is constructed as:
+     * * `host = [application_domain_name]`</br>
+     *   `| [service] + '.' + [application_domain_name]`</br>
+     *   `| [version] + '.' + [application_domain_name]`</br>
+     *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+     *   `| [instance] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+     *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+     * * `application_domain_name` = The domain name of the app, for
+     *   example <app-id>.appspot.com, which is associated with the
+     *   job's project ID.
+     * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `version_dot_service =`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+     * * `instance_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * * `instance_dot_version =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+     * * `instance_dot_version_dot_service =`
+     *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+     *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+     *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+     * to the service which is the default service when the job is attempted.
+     * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+     * to the version which is the default version when the job is attempted.
+     * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+     * sent to an instance which is available when the job is attempted.
+     * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+     * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+     * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+     * to the default version of the default service when the job is attempted.
+     * 
+ * + * string host = 4; + */ + public Builder setHostBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + host_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.AppEngineRouting) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.AppEngineRouting) + private static final com.google.cloud.scheduler.v1beta1.AppEngineRouting DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.AppEngineRouting(); + } + + public static com.google.cloud.scheduler.v1beta1.AppEngineRouting getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppEngineRouting parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AppEngineRouting(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.scheduler.v1beta1.AppEngineRouting getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRoutingOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRoutingOrBuilder.java new file mode 100644 index 000000000000..48cbff84c530 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/AppEngineRoutingOrBuilder.java @@ -0,0 +1,183 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface AppEngineRoutingOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.AppEngineRouting) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * App service.
+   * By default, the job is sent to the service which is the default
+   * service when the job is attempted.
+   * 
+ * + * string service = 1; + */ + java.lang.String getService(); + /** + *
+   * App service.
+   * By default, the job is sent to the service which is the default
+   * service when the job is attempted.
+   * 
+ * + * string service = 1; + */ + com.google.protobuf.ByteString + getServiceBytes(); + + /** + *
+   * App version.
+   * By default, the job is sent to the version which is the default
+   * version when the job is attempted.
+   * 
+ * + * string version = 2; + */ + java.lang.String getVersion(); + /** + *
+   * App version.
+   * By default, the job is sent to the version which is the default
+   * version when the job is attempted.
+   * 
+ * + * string version = 2; + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+   * App instance.
+   * By default, the job is sent to an instance which is available when
+   * the job is attempted.
+   * Requests can only be sent to a specific instance if
+   * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+   * App Engine Flex does not support instances. For more information, see
+   * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+   * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+   * 
+ * + * string instance = 3; + */ + java.lang.String getInstance(); + /** + *
+   * App instance.
+   * By default, the job is sent to an instance which is available when
+   * the job is attempted.
+   * Requests can only be sent to a specific instance if
+   * [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
+   * App Engine Flex does not support instances. For more information, see
+   * [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and
+   * [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
+   * 
+ * + * string instance = 3; + */ + com.google.protobuf.ByteString + getInstanceBytes(); + + /** + *
+   * Output only. The host that the job is sent to.
+   * For more information about how App Engine requests are routed, see
+   * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+   * The host is constructed as:
+   * * `host = [application_domain_name]`</br>
+   *   `| [service] + '.' + [application_domain_name]`</br>
+   *   `| [version] + '.' + [application_domain_name]`</br>
+   *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+   *   `| [instance] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+   * * `application_domain_name` = The domain name of the app, for
+   *   example <app-id>.appspot.com, which is associated with the
+   *   job's project ID.
+   * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `version_dot_service =`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+   * * `instance_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance_dot_version =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `instance_dot_version_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+   * to the service which is the default service when the job is attempted.
+   * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+   * to the version which is the default version when the job is attempted.
+   * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+   * sent to an instance which is available when the job is attempted.
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+   * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+   * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+   * to the default version of the default service when the job is attempted.
+   * 
+ * + * string host = 4; + */ + java.lang.String getHost(); + /** + *
+   * Output only. The host that the job is sent to.
+   * For more information about how App Engine requests are routed, see
+   * [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
+   * The host is constructed as:
+   * * `host = [application_domain_name]`</br>
+   *   `| [service] + '.' + [application_domain_name]`</br>
+   *   `| [version] + '.' + [application_domain_name]`</br>
+   *   `| [version_dot_service]+ '.' + [application_domain_name]`</br>
+   *   `| [instance] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_service] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version] + '.' + [application_domain_name]`</br>
+   *   `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
+   * * `application_domain_name` = The domain name of the app, for
+   *   example <app-id>.appspot.com, which is associated with the
+   *   job's project ID.
+   * * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `version_dot_service =`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance]
+   * * `instance_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * * `instance_dot_version =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version]
+   * * `instance_dot_version_dot_service =`
+   *   [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +`
+   *   [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +`
+   *   [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service]
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent
+   * to the service which is the default service when the job is attempted.
+   * If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent
+   * to the version which is the default version when the job is attempted.
+   * If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be
+   * sent to an instance which is available when the job is attempted.
+   * If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service],
+   * [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or
+   * [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent
+   * to the default version of the default service when the job is attempted.
+   * 
+ * + * string host = 4; + */ + com.google.protobuf.ByteString + getHostBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequest.java new file mode 100644 index 000000000000..de28463143cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequest.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.CreateJobRequest} + */ +public final class CreateJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.CreateJobRequest) + CreateJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateJobRequest.newBuilder() to construct. + private CreateJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateJobRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateJobRequest( + 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: { + com.google.cloud.scheduler.v1beta1.Job.Builder subBuilder = null; + if (job_ != null) { + subBuilder = job_.toBuilder(); + } + job_ = input.readMessage(com.google.cloud.scheduler.v1beta1.Job.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(job_); + job_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.CreateJobRequest.class, com.google.cloud.scheduler.v1beta1.CreateJobRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_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 JOB_FIELD_NUMBER = 2; + private com.google.cloud.scheduler.v1beta1.Job job_; + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public boolean hasJob() { + return job_ != null; + } + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public com.google.cloud.scheduler.v1beta1.Job getJob() { + return job_ == null ? com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder() { + return getJob(); + } + + 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 (job_ != null) { + output.writeMessage(2, getJob()); + } + 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 (job_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getJob()); + } + 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.scheduler.v1beta1.CreateJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.CreateJobRequest other = (com.google.cloud.scheduler.v1beta1.CreateJobRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasJob() == other.hasJob()); + if (hasJob()) { + result = result && getJob() + .equals(other.getJob()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (hasJob()) { + hash = (37 * hash) + JOB_FIELD_NUMBER; + hash = (53 * hash) + getJob().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest 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.scheduler.v1beta1.CreateJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest 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.scheduler.v1beta1.CreateJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest 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.scheduler.v1beta1.CreateJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest 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.scheduler.v1beta1.CreateJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest 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.scheduler.v1beta1.CreateJobRequest 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 [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.CreateJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.CreateJobRequest) + com.google.cloud.scheduler.v1beta1.CreateJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.CreateJobRequest.class, com.google.cloud.scheduler.v1beta1.CreateJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.CreateJobRequest.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_ = ""; + + if (jobBuilder_ == null) { + job_ = null; + } else { + job_ = null; + jobBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.CreateJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.CreateJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.CreateJobRequest build() { + com.google.cloud.scheduler.v1beta1.CreateJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.CreateJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.CreateJobRequest result = new com.google.cloud.scheduler.v1beta1.CreateJobRequest(this); + result.parent_ = parent_; + if (jobBuilder_ == null) { + result.job_ = job_; + } else { + result.job_ = jobBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.CreateJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.CreateJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.CreateJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.CreateJobRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasJob()) { + mergeJob(other.getJob()); + } + 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.scheduler.v1beta1.CreateJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.CreateJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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 com.google.cloud.scheduler.v1beta1.Job job_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> jobBuilder_; + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public boolean hasJob() { + return jobBuilder_ != null || job_ != null; + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public com.google.cloud.scheduler.v1beta1.Job getJob() { + if (jobBuilder_ == null) { + return job_ == null ? com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } else { + return jobBuilder_.getMessage(); + } + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public Builder setJob(com.google.cloud.scheduler.v1beta1.Job value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + job_ = value; + onChanged(); + } else { + jobBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public Builder setJob( + com.google.cloud.scheduler.v1beta1.Job.Builder builderForValue) { + if (jobBuilder_ == null) { + job_ = builderForValue.build(); + onChanged(); + } else { + jobBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public Builder mergeJob(com.google.cloud.scheduler.v1beta1.Job value) { + if (jobBuilder_ == null) { + if (job_ != null) { + job_ = + com.google.cloud.scheduler.v1beta1.Job.newBuilder(job_).mergeFrom(value).buildPartial(); + } else { + job_ = value; + } + onChanged(); + } else { + jobBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public Builder clearJob() { + if (jobBuilder_ == null) { + job_ = null; + onChanged(); + } else { + job_ = null; + jobBuilder_ = null; + } + + return this; + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public com.google.cloud.scheduler.v1beta1.Job.Builder getJobBuilder() { + + onChanged(); + return getJobFieldBuilder().getBuilder(); + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder() { + if (jobBuilder_ != null) { + return jobBuilder_.getMessageOrBuilder(); + } else { + return job_ == null ? + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } + } + /** + *
+     * Required.
+     * The job to add. The user can optionally specify a name for the
+     * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+     * existing job. If a name is not specified then the system will
+     * generate a random unique name that will be returned
+     * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> + getJobFieldBuilder() { + if (jobBuilder_ == null) { + jobBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder>( + getJob(), + getParentForChildren(), + isClean()); + job_ = null; + } + return jobBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.CreateJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.CreateJobRequest) + private static final com.google.cloud.scheduler.v1beta1.CreateJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.CreateJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.CreateJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateJobRequest(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.scheduler.v1beta1.CreateJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequestOrBuilder.java new file mode 100644 index 000000000000..ec80aa7f8f07 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/CreateJobRequestOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface CreateJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.CreateJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + boolean hasJob(); + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + com.google.cloud.scheduler.v1beta1.Job getJob(); + /** + *
+   * Required.
+   * The job to add. The user can optionally specify a name for the
+   * job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
+   * existing job. If a name is not specified then the system will
+   * generate a random unique name that will be returned
+   * ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 2; + */ + com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequest.java new file mode 100644 index 000000000000..220f64b8d4d7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequest.java @@ -0,0 +1,593 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for deleting a job using
+ * [DeleteJob][google.cloud.scheduler.v1beta1.CloudScheduler.DeleteJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.DeleteJobRequest} + */ +public final class DeleteJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.DeleteJobRequest) + DeleteJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteJobRequest.newBuilder() to construct. + private DeleteJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteJobRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteJobRequest( + 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.DeleteJobRequest.class, com.google.cloud.scheduler.v1beta1.DeleteJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.scheduler.v1beta1.DeleteJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.DeleteJobRequest other = (com.google.cloud.scheduler.v1beta1.DeleteJobRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.scheduler.v1beta1.DeleteJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest 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.scheduler.v1beta1.DeleteJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest 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.scheduler.v1beta1.DeleteJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest 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.scheduler.v1beta1.DeleteJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest 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.scheduler.v1beta1.DeleteJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest 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.scheduler.v1beta1.DeleteJobRequest 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 deleting a job using
+   * [DeleteJob][google.cloud.scheduler.v1beta1.CloudScheduler.DeleteJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.DeleteJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.DeleteJobRequest) + com.google.cloud.scheduler.v1beta1.DeleteJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.DeleteJobRequest.class, com.google.cloud.scheduler.v1beta1.DeleteJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.DeleteJobRequest.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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.DeleteJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.DeleteJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.DeleteJobRequest build() { + com.google.cloud.scheduler.v1beta1.DeleteJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.DeleteJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.DeleteJobRequest result = new com.google.cloud.scheduler.v1beta1.DeleteJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.DeleteJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.DeleteJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.DeleteJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.DeleteJobRequest.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.scheduler.v1beta1.DeleteJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.DeleteJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.setUnknownFieldsProto3(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.scheduler.v1beta1.DeleteJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.DeleteJobRequest) + private static final com.google.cloud.scheduler.v1beta1.DeleteJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.DeleteJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.DeleteJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteJobRequest(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.scheduler.v1beta1.DeleteJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequestOrBuilder.java new file mode 100644 index 000000000000..2f7f3e12660b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/DeleteJobRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface DeleteJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.DeleteJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequest.java new file mode 100644 index 000000000000..b4aa93f3baf8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.GetJobRequest} + */ +public final class GetJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.GetJobRequest) + GetJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetJobRequest.newBuilder() to construct. + private GetJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetJobRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetJobRequest( + 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.GetJobRequest.class, com.google.cloud.scheduler.v1beta1.GetJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.scheduler.v1beta1.GetJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.GetJobRequest other = (com.google.cloud.scheduler.v1beta1.GetJobRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.scheduler.v1beta1.GetJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest 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.scheduler.v1beta1.GetJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest 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.scheduler.v1beta1.GetJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest 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.scheduler.v1beta1.GetJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest 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.scheduler.v1beta1.GetJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.GetJobRequest 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.scheduler.v1beta1.GetJobRequest 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 [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.GetJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.GetJobRequest) + com.google.cloud.scheduler.v1beta1.GetJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.GetJobRequest.class, com.google.cloud.scheduler.v1beta1.GetJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.GetJobRequest.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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.GetJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.GetJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.GetJobRequest build() { + com.google.cloud.scheduler.v1beta1.GetJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.GetJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.GetJobRequest result = new com.google.cloud.scheduler.v1beta1.GetJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.GetJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.GetJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.GetJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.GetJobRequest.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.scheduler.v1beta1.GetJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.GetJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.setUnknownFieldsProto3(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.scheduler.v1beta1.GetJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.GetJobRequest) + private static final com.google.cloud.scheduler.v1beta1.GetJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.GetJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.GetJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetJobRequest(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.scheduler.v1beta1.GetJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequestOrBuilder.java new file mode 100644 index 000000000000..31d66f433bb3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/GetJobRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface GetJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.GetJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpMethod.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpMethod.java new file mode 100644 index 000000000000..2e2c53317be5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpMethod.java @@ -0,0 +1,225 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * The HTTP method used to execute the job.
+ * 
+ * + * Protobuf enum {@code google.cloud.scheduler.v1beta1.HttpMethod} + */ +public enum HttpMethod + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * HTTP method unspecified. Defaults to POST.
+   * 
+ * + * HTTP_METHOD_UNSPECIFIED = 0; + */ + HTTP_METHOD_UNSPECIFIED(0), + /** + *
+   * HTTP POST
+   * 
+ * + * POST = 1; + */ + POST(1), + /** + *
+   * HTTP GET
+   * 
+ * + * GET = 2; + */ + GET(2), + /** + *
+   * HTTP HEAD
+   * 
+ * + * HEAD = 3; + */ + HEAD(3), + /** + *
+   * HTTP PUT
+   * 
+ * + * PUT = 4; + */ + PUT(4), + /** + *
+   * HTTP DELETE
+   * 
+ * + * DELETE = 5; + */ + DELETE(5), + /** + *
+   * HTTP PATCH
+   * 
+ * + * PATCH = 6; + */ + PATCH(6), + /** + *
+   * HTTP OPTIONS
+   * 
+ * + * OPTIONS = 7; + */ + OPTIONS(7), + UNRECOGNIZED(-1), + ; + + /** + *
+   * HTTP method unspecified. Defaults to POST.
+   * 
+ * + * HTTP_METHOD_UNSPECIFIED = 0; + */ + public static final int HTTP_METHOD_UNSPECIFIED_VALUE = 0; + /** + *
+   * HTTP POST
+   * 
+ * + * POST = 1; + */ + public static final int POST_VALUE = 1; + /** + *
+   * HTTP GET
+   * 
+ * + * GET = 2; + */ + public static final int GET_VALUE = 2; + /** + *
+   * HTTP HEAD
+   * 
+ * + * HEAD = 3; + */ + public static final int HEAD_VALUE = 3; + /** + *
+   * HTTP PUT
+   * 
+ * + * PUT = 4; + */ + public static final int PUT_VALUE = 4; + /** + *
+   * HTTP DELETE
+   * 
+ * + * DELETE = 5; + */ + public static final int DELETE_VALUE = 5; + /** + *
+   * HTTP PATCH
+   * 
+ * + * PATCH = 6; + */ + public static final int PATCH_VALUE = 6; + /** + *
+   * HTTP OPTIONS
+   * 
+ * + * OPTIONS = 7; + */ + public static final int OPTIONS_VALUE = 7; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HttpMethod valueOf(int value) { + return forNumber(value); + } + + public static HttpMethod forNumber(int value) { + switch (value) { + case 0: return HTTP_METHOD_UNSPECIFIED; + case 1: return POST; + case 2: return GET; + case 3: return HEAD; + case 4: return PUT; + case 5: return DELETE; + case 6: return PATCH; + case 7: return OPTIONS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + HttpMethod> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HttpMethod findValueByNumber(int number) { + return HttpMethod.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.TargetProto.getDescriptor().getEnumTypes().get(0); + } + + private static final HttpMethod[] VALUES = values(); + + public static HttpMethod valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HttpMethod(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.scheduler.v1beta1.HttpMethod) +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTarget.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTarget.java new file mode 100644 index 000000000000..4ec00339cd53 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTarget.java @@ -0,0 +1,1292 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Http target. The job will be pushed to the job handler by means of
+ * an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.HttpTarget.http_method] such as HTTP
+ * POST, HTTP GET, etc. The job is acknowledged by means of an HTTP
+ * response code in the range [200 - 299]. A failure to receive a response
+ * constitutes a failed execution. For a redirected request, the response
+ * returned by the redirected request is considered.
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.HttpTarget} + */ +public final class HttpTarget extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.HttpTarget) + HttpTargetOrBuilder { +private static final long serialVersionUID = 0L; + // Use HttpTarget.newBuilder() to construct. + private HttpTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HttpTarget() { + uri_ = ""; + httpMethod_ = 0; + body_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HttpTarget( + 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(); + + uri_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + httpMethod_ = rawValue; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + headers_ = com.google.protobuf.MapField.newMapField( + HeadersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + headers__ = input.readMessage( + HeadersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + headers_.getMutableMap().put( + headers__.getKey(), headers__.getValue()); + break; + } + case 34: { + + body_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.HttpTarget.class, com.google.cloud.scheduler.v1beta1.HttpTarget.Builder.class); + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + *
+   * Required.
+   * The full URI path that the request will be sent to. This string
+   * must begin with either "http://" or "https://". Some examples of
+   * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+   * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+   * encode some characters for safety and compatibility. The maximum allowed
+   * URL length is 2083 characters after encoding.
+   * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * Required.
+   * The full URI path that the request will be sent to. This string
+   * must begin with either "http://" or "https://". Some examples of
+   * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+   * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+   * encode some characters for safety and compatibility. The maximum allowed
+   * URL length is 2083 characters after encoding.
+   * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTP_METHOD_FIELD_NUMBER = 2; + private int httpMethod_; + /** + *
+   * Which HTTP method to use for the request.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public int getHttpMethodValue() { + return httpMethod_; + } + /** + *
+   * Which HTTP method to use for the request.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.HttpMethod result = com.google.cloud.scheduler.v1beta1.HttpMethod.valueOf(httpMethod_); + return result == null ? com.google.cloud.scheduler.v1beta1.HttpMethod.UNRECOGNIZED : result; + } + + public static final int HEADERS_FIELD_NUMBER = 3; + private static final class HeadersDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headers_; + private com.google.protobuf.MapField + internalGetHeaders() { + if (headers_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + return headers_; + } + + public int getHeadersCount() { + return internalGetHeaders().getMap().size(); + } + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + public boolean containsHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetHeaders().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getHeaders() { + return getHeadersMap(); + } + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + public java.util.Map getHeadersMap() { + return internalGetHeaders().getMap(); + } + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + public java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + public java.lang.String getHeadersOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BODY_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString body_; + /** + *
+   * HTTP request body. A request body is allowed only if the HTTP
+   * method is POST, PUT, or PATCH. It is an error to set body on a job with an
+   * incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+   * 
+ * + * bytes body = 4; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + + 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 (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (httpMethod_ != com.google.cloud.scheduler.v1beta1.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { + output.writeEnum(2, httpMethod_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetHeaders(), + HeadersDefaultEntryHolder.defaultEntry, + 3); + if (!body_.isEmpty()) { + output.writeBytes(4, body_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (httpMethod_ != com.google.cloud.scheduler.v1beta1.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, httpMethod_); + } + for (java.util.Map.Entry entry + : internalGetHeaders().getMap().entrySet()) { + com.google.protobuf.MapEntry + headers__ = HeadersDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, headers__); + } + if (!body_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, body_); + } + 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.scheduler.v1beta1.HttpTarget)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.HttpTarget other = (com.google.cloud.scheduler.v1beta1.HttpTarget) obj; + + boolean result = true; + result = result && getUri() + .equals(other.getUri()); + result = result && httpMethod_ == other.httpMethod_; + result = result && internalGetHeaders().equals( + other.internalGetHeaders()); + result = result && getBody() + .equals(other.getBody()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + HTTP_METHOD_FIELD_NUMBER; + hash = (53 * hash) + httpMethod_; + if (!internalGetHeaders().getMap().isEmpty()) { + hash = (37 * hash) + HEADERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetHeaders().hashCode(); + } + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.HttpTarget parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget 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.scheduler.v1beta1.HttpTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget 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.scheduler.v1beta1.HttpTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget 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.scheduler.v1beta1.HttpTarget parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget 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.scheduler.v1beta1.HttpTarget parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.HttpTarget 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.scheduler.v1beta1.HttpTarget 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; + } + /** + *
+   * Http target. The job will be pushed to the job handler by means of
+   * an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.HttpTarget.http_method] such as HTTP
+   * POST, HTTP GET, etc. The job is acknowledged by means of an HTTP
+   * response code in the range [200 - 299]. A failure to receive a response
+   * constitutes a failed execution. For a redirected request, the response
+   * returned by the redirected request is considered.
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.HttpTarget} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.HttpTarget) + com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableHeaders(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.HttpTarget.class, com.google.cloud.scheduler.v1beta1.HttpTarget.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.HttpTarget.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(); + uri_ = ""; + + httpMethod_ = 0; + + internalGetMutableHeaders().clear(); + body_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.HttpTarget getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.HttpTarget build() { + com.google.cloud.scheduler.v1beta1.HttpTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.HttpTarget buildPartial() { + com.google.cloud.scheduler.v1beta1.HttpTarget result = new com.google.cloud.scheduler.v1beta1.HttpTarget(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.uri_ = uri_; + result.httpMethod_ = httpMethod_; + result.headers_ = internalGetHeaders(); + result.headers_.makeImmutable(); + result.body_ = body_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.HttpTarget) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.HttpTarget)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.HttpTarget other) { + if (other == com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.httpMethod_ != 0) { + setHttpMethodValue(other.getHttpMethodValue()); + } + internalGetMutableHeaders().mergeFrom( + other.internalGetHeaders()); + if (other.getBody() != com.google.protobuf.ByteString.EMPTY) { + setBody(other.getBody()); + } + 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.scheduler.v1beta1.HttpTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.HttpTarget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + *
+     * Required.
+     * The full URI path that the request will be sent to. This string
+     * must begin with either "http://" or "https://". Some examples of
+     * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+     * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+     * encode some characters for safety and compatibility. The maximum allowed
+     * URL length is 2083 characters after encoding.
+     * 
+ * + * string uri = 1; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required.
+     * The full URI path that the request will be sent to. This string
+     * must begin with either "http://" or "https://". Some examples of
+     * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+     * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+     * encode some characters for safety and compatibility. The maximum allowed
+     * URL length is 2083 characters after encoding.
+     * 
+ * + * string uri = 1; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required.
+     * The full URI path that the request will be sent to. This string
+     * must begin with either "http://" or "https://". Some examples of
+     * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+     * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+     * encode some characters for safety and compatibility. The maximum allowed
+     * URL length is 2083 characters after encoding.
+     * 
+ * + * string uri = 1; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The full URI path that the request will be sent to. This string
+     * must begin with either "http://" or "https://". Some examples of
+     * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+     * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+     * encode some characters for safety and compatibility. The maximum allowed
+     * URL length is 2083 characters after encoding.
+     * 
+ * + * string uri = 1; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The full URI path that the request will be sent to. This string
+     * must begin with either "http://" or "https://". Some examples of
+     * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+     * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+     * encode some characters for safety and compatibility. The maximum allowed
+     * URL length is 2083 characters after encoding.
+     * 
+ * + * string uri = 1; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private int httpMethod_ = 0; + /** + *
+     * Which HTTP method to use for the request.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public int getHttpMethodValue() { + return httpMethod_; + } + /** + *
+     * Which HTTP method to use for the request.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public Builder setHttpMethodValue(int value) { + httpMethod_ = value; + onChanged(); + return this; + } + /** + *
+     * Which HTTP method to use for the request.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.HttpMethod result = com.google.cloud.scheduler.v1beta1.HttpMethod.valueOf(httpMethod_); + return result == null ? com.google.cloud.scheduler.v1beta1.HttpMethod.UNRECOGNIZED : result; + } + /** + *
+     * Which HTTP method to use for the request.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public Builder setHttpMethod(com.google.cloud.scheduler.v1beta1.HttpMethod value) { + if (value == null) { + throw new NullPointerException(); + } + + httpMethod_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Which HTTP method to use for the request.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + public Builder clearHttpMethod() { + + httpMethod_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> headers_; + private com.google.protobuf.MapField + internalGetHeaders() { + if (headers_ == null) { + return com.google.protobuf.MapField.emptyMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + return headers_; + } + private com.google.protobuf.MapField + internalGetMutableHeaders() { + onChanged();; + if (headers_ == null) { + headers_ = com.google.protobuf.MapField.newMapField( + HeadersDefaultEntryHolder.defaultEntry); + } + if (!headers_.isMutable()) { + headers_ = headers_.copy(); + } + return headers_; + } + + public int getHeadersCount() { + return internalGetHeaders().getMap().size(); + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public boolean containsHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetHeaders().getMap().containsKey(key); + } + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getHeaders() { + return getHeadersMap(); + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public java.util.Map getHeadersMap() { + return internalGetHeaders().getMap(); + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public java.lang.String getHeadersOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearHeaders() { + internalGetMutableHeaders().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public Builder removeHeaders( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableHeaders().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableHeaders() { + return internalGetMutableHeaders().getMutableMap(); + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + public Builder putHeaders( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableHeaders().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * The user can specify HTTP request headers to send with the job's
+     * HTTP request. This map contains the header field names and
+     * values. Repeated headers are not supported, but a header value can
+     * contain commas. These headers represent a subset of the headers
+     * that will accompany the job's HTTP request. Some HTTP request
+     * headers will be ignored or replaced. A partial list of headers that
+     * will be ignored or replaced is below:
+     * - Host: This will be computed by Cloud Scheduler and derived from
+     * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+     * * `Content-Length`: This will be computed by Cloud Scheduler.
+     * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+     * * `X-Google-*`: Google internal use only.
+     * * `X-AppEngine-*`: Google internal use only.
+     * The total size of headers must be less than 80KB.
+     * 
+ * + * map<string, string> headers = 3; + */ + + public Builder putAllHeaders( + java.util.Map values) { + internalGetMutableHeaders().getMutableMap() + .putAll(values); + return this; + } + + private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * HTTP request body. A request body is allowed only if the HTTP
+     * method is POST, PUT, or PATCH. It is an error to set body on a job with an
+     * incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 4; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + /** + *
+     * HTTP request body. A request body is allowed only if the HTTP
+     * method is POST, PUT, or PATCH. It is an error to set body on a job with an
+     * incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 4; + */ + public Builder setBody(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + *
+     * HTTP request body. A request body is allowed only if the HTTP
+     * method is POST, PUT, or PATCH. It is an error to set body on a job with an
+     * incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+     * 
+ * + * bytes body = 4; + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.HttpTarget) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.HttpTarget) + private static final com.google.cloud.scheduler.v1beta1.HttpTarget DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.HttpTarget(); + } + + public static com.google.cloud.scheduler.v1beta1.HttpTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpTarget(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.scheduler.v1beta1.HttpTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTargetOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTargetOrBuilder.java new file mode 100644 index 000000000000..33e7e9496025 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/HttpTargetOrBuilder.java @@ -0,0 +1,186 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface HttpTargetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.HttpTarget) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The full URI path that the request will be sent to. This string
+   * must begin with either "http://" or "https://". Some examples of
+   * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+   * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+   * encode some characters for safety and compatibility. The maximum allowed
+   * URL length is 2083 characters after encoding.
+   * 
+ * + * string uri = 1; + */ + java.lang.String getUri(); + /** + *
+   * Required.
+   * The full URI path that the request will be sent to. This string
+   * must begin with either "http://" or "https://". Some examples of
+   * valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are:
+   * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will
+   * encode some characters for safety and compatibility. The maximum allowed
+   * URL length is 2083 characters after encoding.
+   * 
+ * + * string uri = 1; + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * Which HTTP method to use for the request.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + int getHttpMethodValue(); + /** + *
+   * Which HTTP method to use for the request.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpMethod http_method = 2; + */ + com.google.cloud.scheduler.v1beta1.HttpMethod getHttpMethod(); + + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + int getHeadersCount(); + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + boolean containsHeaders( + java.lang.String key); + /** + * Use {@link #getHeadersMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getHeaders(); + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + java.util.Map + getHeadersMap(); + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + java.lang.String getHeadersOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * The user can specify HTTP request headers to send with the job's
+   * HTTP request. This map contains the header field names and
+   * values. Repeated headers are not supported, but a header value can
+   * contain commas. These headers represent a subset of the headers
+   * that will accompany the job's HTTP request. Some HTTP request
+   * headers will be ignored or replaced. A partial list of headers that
+   * will be ignored or replaced is below:
+   * - Host: This will be computed by Cloud Scheduler and derived from
+   * [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri].
+   * * `Content-Length`: This will be computed by Cloud Scheduler.
+   * * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`.
+   * * `X-Google-*`: Google internal use only.
+   * * `X-AppEngine-*`: Google internal use only.
+   * The total size of headers must be less than 80KB.
+   * 
+ * + * map<string, string> headers = 3; + */ + + java.lang.String getHeadersOrThrow( + java.lang.String key); + + /** + *
+   * HTTP request body. A request body is allowed only if the HTTP
+   * method is POST, PUT, or PATCH. It is an error to set body on a job with an
+   * incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod].
+   * 
+ * + * bytes body = 4; + */ + com.google.protobuf.ByteString getBody(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/Job.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/Job.java new file mode 100644 index 000000000000..ad589f207535 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/Job.java @@ -0,0 +1,3574 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/job.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Configuration for a job.
+ * The maximum allowed size for a job is 100KB.
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.Job} + */ +public final class Job extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.Job) + JobOrBuilder { +private static final long serialVersionUID = 0L; + // Use Job.newBuilder() to construct. + private Job(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Job() { + name_ = ""; + description_ = ""; + schedule_ = ""; + timeZone_ = ""; + state_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Job( + 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: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: { + com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder subBuilder = null; + if (targetCase_ == 4) { + subBuilder = ((com.google.cloud.scheduler.v1beta1.PubsubTarget) target_).toBuilder(); + } + target_ = + input.readMessage(com.google.cloud.scheduler.v1beta1.PubsubTarget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.scheduler.v1beta1.PubsubTarget) target_); + target_ = subBuilder.buildPartial(); + } + targetCase_ = 4; + break; + } + case 42: { + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder subBuilder = null; + if (targetCase_ == 5) { + subBuilder = ((com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_).toBuilder(); + } + target_ = + input.readMessage(com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_); + target_ = subBuilder.buildPartial(); + } + targetCase_ = 5; + break; + } + case 50: { + com.google.cloud.scheduler.v1beta1.HttpTarget.Builder subBuilder = null; + if (targetCase_ == 6) { + subBuilder = ((com.google.cloud.scheduler.v1beta1.HttpTarget) target_).toBuilder(); + } + target_ = + input.readMessage(com.google.cloud.scheduler.v1beta1.HttpTarget.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.scheduler.v1beta1.HttpTarget) target_); + target_ = subBuilder.buildPartial(); + } + targetCase_ = 6; + break; + } + case 74: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (userUpdateTime_ != null) { + subBuilder = userUpdateTime_.toBuilder(); + } + userUpdateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(userUpdateTime_); + userUpdateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 80: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 90: { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 138: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (scheduleTime_ != null) { + subBuilder = scheduleTime_.toBuilder(); + } + scheduleTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scheduleTime_); + scheduleTime_ = subBuilder.buildPartial(); + } + + break; + } + case 146: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastAttemptTime_ != null) { + subBuilder = lastAttemptTime_.toBuilder(); + } + lastAttemptTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastAttemptTime_); + lastAttemptTime_ = subBuilder.buildPartial(); + } + + break; + } + case 154: { + com.google.cloud.scheduler.v1beta1.RetryConfig.Builder subBuilder = null; + if (retryConfig_ != null) { + subBuilder = retryConfig_.toBuilder(); + } + retryConfig_ = input.readMessage(com.google.cloud.scheduler.v1beta1.RetryConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retryConfig_); + retryConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 162: { + java.lang.String s = input.readStringRequireUtf8(); + + schedule_ = s; + break; + } + case 170: { + java.lang.String s = input.readStringRequireUtf8(); + + timeZone_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_Job_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.Job.class, com.google.cloud.scheduler.v1beta1.Job.Builder.class); + } + + /** + *
+   * State of the job.
+   * 
+ * + * Protobuf enum {@code google.cloud.scheduler.v1beta1.Job.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * The job is executing normally.
+     * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + *
+     * The job is paused by the user. It will not execute. A user can
+     * intentionally pause the job using
+     * [PauseJobRequest][google.cloud.scheduler.v1beta1.PauseJobRequest].
+     * 
+ * + * PAUSED = 2; + */ + PAUSED(2), + /** + *
+     * The job is disabled by the system due to error. The user
+     * cannot directly set a job to be disabled.
+     * 
+ * + * DISABLED = 3; + */ + DISABLED(3), + /** + *
+     * The job state resulting from a failed [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]
+     * operation. To recover a job from this state, retry
+     * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] until a successful response is received.
+     * 
+ * + * UPDATE_FAILED = 4; + */ + UPDATE_FAILED(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The job is executing normally.
+     * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + /** + *
+     * The job is paused by the user. It will not execute. A user can
+     * intentionally pause the job using
+     * [PauseJobRequest][google.cloud.scheduler.v1beta1.PauseJobRequest].
+     * 
+ * + * PAUSED = 2; + */ + public static final int PAUSED_VALUE = 2; + /** + *
+     * The job is disabled by the system due to error. The user
+     * cannot directly set a job to be disabled.
+     * 
+ * + * DISABLED = 3; + */ + public static final int DISABLED_VALUE = 3; + /** + *
+     * The job state resulting from a failed [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]
+     * operation. To recover a job from this state, retry
+     * [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] until a successful response is received.
+     * 
+ * + * UPDATE_FAILED = 4; + */ + public static final int UPDATE_FAILED_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return ENABLED; + case 2: return PAUSED; + case 3: return DISABLED; + case 4: return UPDATE_FAILED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.Job.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.scheduler.v1beta1.Job.State) + } + + private int targetCase_ = 0; + private java.lang.Object target_; + public enum TargetCase + implements com.google.protobuf.Internal.EnumLite { + PUBSUB_TARGET(4), + APP_ENGINE_HTTP_TARGET(5), + HTTP_TARGET(6), + TARGET_NOT_SET(0); + private final int value; + private TargetCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 4: return PUBSUB_TARGET; + case 5: return APP_ENGINE_HTTP_TARGET; + case 6: return HTTP_TARGET; + case 0: return TARGET_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public TargetCase + getTargetCase() { + return TargetCase.forNumber( + targetCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), colons (:), or periods (.).
+   *    For more information, see
+   *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+   * * `LOCATION_ID` is the canonical ID for the job's location.
+   *    The list of available locations can be obtained by calling
+   *    [ListLocations][google.cloud.location.Locations.ListLocations].
+   *    For more information, see https://cloud.google.com/about/locations/.
+   * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+   * 
+ * + * 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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), colons (:), or periods (.).
+   *    For more information, see
+   *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+   * * `LOCATION_ID` is the canonical ID for the job's location.
+   *    The list of available locations can be obtained by calling
+   *    [ListLocations][google.cloud.location.Locations.ListLocations].
+   *    For more information, see https://cloud.google.com/about/locations/.
+   * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+   * 
+ * + * 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * A human-readable description for the job. This string must not contain
+   * more than 500 characters.
+   * 
+ * + * string description = 2; + */ + 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; + } + } + /** + *
+   * A human-readable description for the job. This string must not contain
+   * more than 500 characters.
+   * 
+ * + * string description = 2; + */ + 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 PUBSUB_TARGET_FIELD_NUMBER = 4; + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public boolean hasPubsubTarget() { + return targetCase_ == 4; + } + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public com.google.cloud.scheduler.v1beta1.PubsubTarget getPubsubTarget() { + if (targetCase_ == 4) { + return (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder getPubsubTargetOrBuilder() { + if (targetCase_ == 4) { + return (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + + public static final int APP_ENGINE_HTTP_TARGET_FIELD_NUMBER = 5; + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public boolean hasAppEngineHttpTarget() { + return targetCase_ == 5; + } + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget getAppEngineHttpTarget() { + if (targetCase_ == 5) { + return (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder getAppEngineHttpTargetOrBuilder() { + if (targetCase_ == 5) { + return (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + + public static final int HTTP_TARGET_FIELD_NUMBER = 6; + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public boolean hasHttpTarget() { + return targetCase_ == 6; + } + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public com.google.cloud.scheduler.v1beta1.HttpTarget getHttpTarget() { + if (targetCase_ == 6) { + return (com.google.cloud.scheduler.v1beta1.HttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder getHttpTargetOrBuilder() { + if (targetCase_ == 6) { + return (com.google.cloud.scheduler.v1beta1.HttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + + public static final int SCHEDULE_FIELD_NUMBER = 20; + private volatile java.lang.Object schedule_; + /** + *
+   * Required.
+   * Describes the schedule on which the job will be executed.
+   * As a general rule, execution `n + 1` of a job will not begin
+   * until execution `n` has finished. Cloud Scheduler will never
+   * allow two simultaneously outstanding executions. For example,
+   * this implies that if the `n+1`th execution is scheduled to run at
+   * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+   * execution will not start until `16:15`.
+   * A scheduled start time will be delayed if the previous
+   * execution has not ended when its scheduled time occurs.
+   * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+   * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+   * times, with exponential backoff, until the next scheduled start
+   * time.
+   * The schedule can be either of the following types:
+   * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+   * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+   * 
+ * + * string schedule = 20; + */ + public java.lang.String getSchedule() { + java.lang.Object ref = schedule_; + 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(); + schedule_ = s; + return s; + } + } + /** + *
+   * Required.
+   * Describes the schedule on which the job will be executed.
+   * As a general rule, execution `n + 1` of a job will not begin
+   * until execution `n` has finished. Cloud Scheduler will never
+   * allow two simultaneously outstanding executions. For example,
+   * this implies that if the `n+1`th execution is scheduled to run at
+   * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+   * execution will not start until `16:15`.
+   * A scheduled start time will be delayed if the previous
+   * execution has not ended when its scheduled time occurs.
+   * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+   * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+   * times, with exponential backoff, until the next scheduled start
+   * time.
+   * The schedule can be either of the following types:
+   * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+   * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+   * 
+ * + * string schedule = 20; + */ + public com.google.protobuf.ByteString + getScheduleBytes() { + java.lang.Object ref = schedule_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + schedule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIME_ZONE_FIELD_NUMBER = 21; + private volatile java.lang.Object timeZone_; + /** + *
+   * Specifies the time zone to be used in interpreting
+   * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+   * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+   * Note that some time zones include a provision for
+   * daylight savings time. The rules for daylight saving time are
+   * determined by the chosen tz. For UTC use the string "utc". If a
+   * time zone is not specified, the default will be in UTC (also known
+   * as GMT).
+   * 
+ * + * string time_zone = 21; + */ + 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; + } + } + /** + *
+   * Specifies the time zone to be used in interpreting
+   * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+   * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+   * Note that some time zones include a provision for
+   * daylight savings time. The rules for daylight saving time are
+   * determined by the chosen tz. For UTC use the string "utc". If a
+   * time zone is not specified, the default will be in UTC (also known
+   * as GMT).
+   * 
+ * + * string time_zone = 21; + */ + 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; + } + } + + public static final int USER_UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp userUpdateTime_; + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public boolean hasUserUpdateTime() { + return userUpdateTime_ != null; + } + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public com.google.protobuf.Timestamp getUserUpdateTime() { + return userUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : userUpdateTime_; + } + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getUserUpdateTimeOrBuilder() { + return getUserUpdateTime(); + } + + public static final int STATE_FIELD_NUMBER = 10; + private int state_; + /** + *
+   * Output only. State of the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * Output only. State of the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public com.google.cloud.scheduler.v1beta1.Job.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.Job.State result = com.google.cloud.scheduler.v1beta1.Job.State.valueOf(state_); + return result == null ? com.google.cloud.scheduler.v1beta1.Job.State.UNRECOGNIZED : result; + } + + public static final int STATUS_FIELD_NUMBER = 11; + private com.google.rpc.Status status_; + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + public boolean hasStatus() { + return status_ != null; + } + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int SCHEDULE_TIME_FIELD_NUMBER = 17; + private com.google.protobuf.Timestamp scheduleTime_; + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public boolean hasScheduleTime() { + return scheduleTime_ != null; + } + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public com.google.protobuf.Timestamp getScheduleTime() { + return scheduleTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_; + } + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + return getScheduleTime(); + } + + public static final int LAST_ATTEMPT_TIME_FIELD_NUMBER = 18; + private com.google.protobuf.Timestamp lastAttemptTime_; + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public boolean hasLastAttemptTime() { + return lastAttemptTime_ != null; + } + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public com.google.protobuf.Timestamp getLastAttemptTime() { + return lastAttemptTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastAttemptTime_; + } + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public com.google.protobuf.TimestampOrBuilder getLastAttemptTimeOrBuilder() { + return getLastAttemptTime(); + } + + public static final int RETRY_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.scheduler.v1beta1.RetryConfig retryConfig_; + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public boolean hasRetryConfig() { + return retryConfig_ != null; + } + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public com.google.cloud.scheduler.v1beta1.RetryConfig getRetryConfig() { + return retryConfig_ == null ? com.google.cloud.scheduler.v1beta1.RetryConfig.getDefaultInstance() : retryConfig_; + } + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder getRetryConfigOrBuilder() { + return getRetryConfig(); + } + + 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 (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (targetCase_ == 4) { + output.writeMessage(4, (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_); + } + if (targetCase_ == 5) { + output.writeMessage(5, (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_); + } + if (targetCase_ == 6) { + output.writeMessage(6, (com.google.cloud.scheduler.v1beta1.HttpTarget) target_); + } + if (userUpdateTime_ != null) { + output.writeMessage(9, getUserUpdateTime()); + } + if (state_ != com.google.cloud.scheduler.v1beta1.Job.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(10, state_); + } + if (status_ != null) { + output.writeMessage(11, getStatus()); + } + if (scheduleTime_ != null) { + output.writeMessage(17, getScheduleTime()); + } + if (lastAttemptTime_ != null) { + output.writeMessage(18, getLastAttemptTime()); + } + if (retryConfig_ != null) { + output.writeMessage(19, getRetryConfig()); + } + if (!getScheduleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 20, schedule_); + } + if (!getTimeZoneBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 21, 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 (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (targetCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_); + } + if (targetCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_); + } + if (targetCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (com.google.cloud.scheduler.v1beta1.HttpTarget) target_); + } + if (userUpdateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getUserUpdateTime()); + } + if (state_ != com.google.cloud.scheduler.v1beta1.Job.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, state_); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getStatus()); + } + if (scheduleTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getScheduleTime()); + } + if (lastAttemptTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, getLastAttemptTime()); + } + if (retryConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getRetryConfig()); + } + if (!getScheduleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, schedule_); + } + if (!getTimeZoneBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, 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.scheduler.v1beta1.Job)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.Job other = (com.google.cloud.scheduler.v1beta1.Job) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getSchedule() + .equals(other.getSchedule()); + result = result && getTimeZone() + .equals(other.getTimeZone()); + result = result && (hasUserUpdateTime() == other.hasUserUpdateTime()); + if (hasUserUpdateTime()) { + result = result && getUserUpdateTime() + .equals(other.getUserUpdateTime()); + } + result = result && state_ == other.state_; + result = result && (hasStatus() == other.hasStatus()); + if (hasStatus()) { + result = result && getStatus() + .equals(other.getStatus()); + } + result = result && (hasScheduleTime() == other.hasScheduleTime()); + if (hasScheduleTime()) { + result = result && getScheduleTime() + .equals(other.getScheduleTime()); + } + result = result && (hasLastAttemptTime() == other.hasLastAttemptTime()); + if (hasLastAttemptTime()) { + result = result && getLastAttemptTime() + .equals(other.getLastAttemptTime()); + } + result = result && (hasRetryConfig() == other.hasRetryConfig()); + if (hasRetryConfig()) { + result = result && getRetryConfig() + .equals(other.getRetryConfig()); + } + result = result && getTargetCase().equals( + other.getTargetCase()); + if (!result) return false; + switch (targetCase_) { + case 4: + result = result && getPubsubTarget() + .equals(other.getPubsubTarget()); + break; + case 5: + result = result && getAppEngineHttpTarget() + .equals(other.getAppEngineHttpTarget()); + break; + case 6: + result = result && getHttpTarget() + .equals(other.getHttpTarget()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().hashCode(); + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + if (hasUserUpdateTime()) { + hash = (37 * hash) + USER_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUserUpdateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasScheduleTime()) { + hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleTime().hashCode(); + } + if (hasLastAttemptTime()) { + hash = (37 * hash) + LAST_ATTEMPT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastAttemptTime().hashCode(); + } + if (hasRetryConfig()) { + hash = (37 * hash) + RETRY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getRetryConfig().hashCode(); + } + switch (targetCase_) { + case 4: + hash = (37 * hash) + PUBSUB_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTarget().hashCode(); + break; + case 5: + hash = (37 * hash) + APP_ENGINE_HTTP_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getAppEngineHttpTarget().hashCode(); + break; + case 6: + hash = (37 * hash) + HTTP_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getHttpTarget().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.Job parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.Job 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.scheduler.v1beta1.Job parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.Job 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.scheduler.v1beta1.Job parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.Job parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.Job parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.Job 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.scheduler.v1beta1.Job parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.Job 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.scheduler.v1beta1.Job parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.Job 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.scheduler.v1beta1.Job 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; + } + /** + *
+   * Configuration for a job.
+   * The maximum allowed size for a job is 100KB.
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.Job} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.Job) + com.google.cloud.scheduler.v1beta1.JobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_Job_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_Job_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.Job.class, com.google.cloud.scheduler.v1beta1.Job.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.Job.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_ = ""; + + description_ = ""; + + schedule_ = ""; + + timeZone_ = ""; + + if (userUpdateTimeBuilder_ == null) { + userUpdateTime_ = null; + } else { + userUpdateTime_ = null; + userUpdateTimeBuilder_ = null; + } + state_ = 0; + + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = null; + } else { + scheduleTime_ = null; + scheduleTimeBuilder_ = null; + } + if (lastAttemptTimeBuilder_ == null) { + lastAttemptTime_ = null; + } else { + lastAttemptTime_ = null; + lastAttemptTimeBuilder_ = null; + } + if (retryConfigBuilder_ == null) { + retryConfig_ = null; + } else { + retryConfig_ = null; + retryConfigBuilder_ = null; + } + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_Job_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.Job getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.Job build() { + com.google.cloud.scheduler.v1beta1.Job result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.Job buildPartial() { + com.google.cloud.scheduler.v1beta1.Job result = new com.google.cloud.scheduler.v1beta1.Job(this); + result.name_ = name_; + result.description_ = description_; + if (targetCase_ == 4) { + if (pubsubTargetBuilder_ == null) { + result.target_ = target_; + } else { + result.target_ = pubsubTargetBuilder_.build(); + } + } + if (targetCase_ == 5) { + if (appEngineHttpTargetBuilder_ == null) { + result.target_ = target_; + } else { + result.target_ = appEngineHttpTargetBuilder_.build(); + } + } + if (targetCase_ == 6) { + if (httpTargetBuilder_ == null) { + result.target_ = target_; + } else { + result.target_ = httpTargetBuilder_.build(); + } + } + result.schedule_ = schedule_; + result.timeZone_ = timeZone_; + if (userUpdateTimeBuilder_ == null) { + result.userUpdateTime_ = userUpdateTime_; + } else { + result.userUpdateTime_ = userUpdateTimeBuilder_.build(); + } + result.state_ = state_; + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (scheduleTimeBuilder_ == null) { + result.scheduleTime_ = scheduleTime_; + } else { + result.scheduleTime_ = scheduleTimeBuilder_.build(); + } + if (lastAttemptTimeBuilder_ == null) { + result.lastAttemptTime_ = lastAttemptTime_; + } else { + result.lastAttemptTime_ = lastAttemptTimeBuilder_.build(); + } + if (retryConfigBuilder_ == null) { + result.retryConfig_ = retryConfig_; + } else { + result.retryConfig_ = retryConfigBuilder_.build(); + } + result.targetCase_ = targetCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.Job) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.Job)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.Job other) { + if (other == com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getSchedule().isEmpty()) { + schedule_ = other.schedule_; + onChanged(); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + onChanged(); + } + if (other.hasUserUpdateTime()) { + mergeUserUpdateTime(other.getUserUpdateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasScheduleTime()) { + mergeScheduleTime(other.getScheduleTime()); + } + if (other.hasLastAttemptTime()) { + mergeLastAttemptTime(other.getLastAttemptTime()); + } + if (other.hasRetryConfig()) { + mergeRetryConfig(other.getRetryConfig()); + } + switch (other.getTargetCase()) { + case PUBSUB_TARGET: { + mergePubsubTarget(other.getPubsubTarget()); + break; + } + case APP_ENGINE_HTTP_TARGET: { + mergeAppEngineHttpTarget(other.getAppEngineHttpTarget()); + break; + } + case HTTP_TARGET: { + mergeHttpTarget(other.getHttpTarget()); + break; + } + case TARGET_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.scheduler.v1beta1.Job parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.Job) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int targetCase_ = 0; + private java.lang.Object target_; + public TargetCase + getTargetCase() { + return TargetCase.forNumber( + targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + + private java.lang.Object name_ = ""; + /** + *
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), colons (:), or periods (.).
+     *    For more information, see
+     *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+     * * `LOCATION_ID` is the canonical ID for the job's location.
+     *    The list of available locations can be obtained by calling
+     *    [ListLocations][google.cloud.location.Locations.ListLocations].
+     *    For more information, see https://cloud.google.com/about/locations/.
+     * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+     * 
+ * + * 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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), colons (:), or periods (.).
+     *    For more information, see
+     *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+     * * `LOCATION_ID` is the canonical ID for the job's location.
+     *    The list of available locations can be obtained by calling
+     *    [ListLocations][google.cloud.location.Locations.ListLocations].
+     *    For more information, see https://cloud.google.com/about/locations/.
+     * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+     * 
+ * + * 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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), colons (:), or periods (.).
+     *    For more information, see
+     *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+     * * `LOCATION_ID` is the canonical ID for the job's location.
+     *    The list of available locations can be obtained by calling
+     *    [ListLocations][google.cloud.location.Locations.ListLocations].
+     *    For more information, see https://cloud.google.com/about/locations/.
+     * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), colons (:), or periods (.).
+     *    For more information, see
+     *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+     * * `LOCATION_ID` is the canonical ID for the job's location.
+     *    The list of available locations can be obtained by calling
+     *    [ListLocations][google.cloud.location.Locations.ListLocations].
+     *    For more information, see https://cloud.google.com/about/locations/.
+     * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), colons (:), or periods (.).
+     *    For more information, see
+     *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+     * * `LOCATION_ID` is the canonical ID for the job's location.
+     *    The list of available locations can be obtained by calling
+     *    [ListLocations][google.cloud.location.Locations.ListLocations].
+     *    For more information, see https://cloud.google.com/about/locations/.
+     * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+     *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+     * 
+ * + * 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.lang.Object description_ = ""; + /** + *
+     * A human-readable description for the job. This string must not contain
+     * more than 500 characters.
+     * 
+ * + * string description = 2; + */ + 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; + } + } + /** + *
+     * A human-readable description for the job. This string must not contain
+     * more than 500 characters.
+     * 
+ * + * string description = 2; + */ + 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; + } + } + /** + *
+     * A human-readable description for the job. This string must not contain
+     * more than 500 characters.
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * A human-readable description for the job. This string must not contain
+     * more than 500 characters.
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * A human-readable description for the job. This string must not contain
+     * more than 500 characters.
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.PubsubTarget, com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder, com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder> pubsubTargetBuilder_; + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public boolean hasPubsubTarget() { + return targetCase_ == 4; + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public com.google.cloud.scheduler.v1beta1.PubsubTarget getPubsubTarget() { + if (pubsubTargetBuilder_ == null) { + if (targetCase_ == 4) { + return (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } else { + if (targetCase_ == 4) { + return pubsubTargetBuilder_.getMessage(); + } + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public Builder setPubsubTarget(com.google.cloud.scheduler.v1beta1.PubsubTarget value) { + if (pubsubTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + onChanged(); + } else { + pubsubTargetBuilder_.setMessage(value); + } + targetCase_ = 4; + return this; + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public Builder setPubsubTarget( + com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder builderForValue) { + if (pubsubTargetBuilder_ == null) { + target_ = builderForValue.build(); + onChanged(); + } else { + pubsubTargetBuilder_.setMessage(builderForValue.build()); + } + targetCase_ = 4; + return this; + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public Builder mergePubsubTarget(com.google.cloud.scheduler.v1beta1.PubsubTarget value) { + if (pubsubTargetBuilder_ == null) { + if (targetCase_ == 4 && + target_ != com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance()) { + target_ = com.google.cloud.scheduler.v1beta1.PubsubTarget.newBuilder((com.google.cloud.scheduler.v1beta1.PubsubTarget) target_) + .mergeFrom(value).buildPartial(); + } else { + target_ = value; + } + onChanged(); + } else { + if (targetCase_ == 4) { + pubsubTargetBuilder_.mergeFrom(value); + } + pubsubTargetBuilder_.setMessage(value); + } + targetCase_ = 4; + return this; + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public Builder clearPubsubTarget() { + if (pubsubTargetBuilder_ == null) { + if (targetCase_ == 4) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + } else { + if (targetCase_ == 4) { + targetCase_ = 0; + target_ = null; + } + pubsubTargetBuilder_.clear(); + } + return this; + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder getPubsubTargetBuilder() { + return getPubsubTargetFieldBuilder().getBuilder(); + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + public com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder getPubsubTargetOrBuilder() { + if ((targetCase_ == 4) && (pubsubTargetBuilder_ != null)) { + return pubsubTargetBuilder_.getMessageOrBuilder(); + } else { + if (targetCase_ == 4) { + return (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + } + /** + *
+     * Pub/Sub target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.PubsubTarget, com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder, com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder> + getPubsubTargetFieldBuilder() { + if (pubsubTargetBuilder_ == null) { + if (!(targetCase_ == 4)) { + target_ = com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + pubsubTargetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.PubsubTarget, com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder, com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder>( + (com.google.cloud.scheduler.v1beta1.PubsubTarget) target_, + getParentForChildren(), + isClean()); + target_ = null; + } + targetCase_ = 4; + onChanged();; + return pubsubTargetBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget, com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder, com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder> appEngineHttpTargetBuilder_; + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public boolean hasAppEngineHttpTarget() { + return targetCase_ == 5; + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget getAppEngineHttpTarget() { + if (appEngineHttpTargetBuilder_ == null) { + if (targetCase_ == 5) { + return (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } else { + if (targetCase_ == 5) { + return appEngineHttpTargetBuilder_.getMessage(); + } + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public Builder setAppEngineHttpTarget(com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget value) { + if (appEngineHttpTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + onChanged(); + } else { + appEngineHttpTargetBuilder_.setMessage(value); + } + targetCase_ = 5; + return this; + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public Builder setAppEngineHttpTarget( + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder builderForValue) { + if (appEngineHttpTargetBuilder_ == null) { + target_ = builderForValue.build(); + onChanged(); + } else { + appEngineHttpTargetBuilder_.setMessage(builderForValue.build()); + } + targetCase_ = 5; + return this; + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public Builder mergeAppEngineHttpTarget(com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget value) { + if (appEngineHttpTargetBuilder_ == null) { + if (targetCase_ == 5 && + target_ != com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance()) { + target_ = com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.newBuilder((com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_) + .mergeFrom(value).buildPartial(); + } else { + target_ = value; + } + onChanged(); + } else { + if (targetCase_ == 5) { + appEngineHttpTargetBuilder_.mergeFrom(value); + } + appEngineHttpTargetBuilder_.setMessage(value); + } + targetCase_ = 5; + return this; + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public Builder clearAppEngineHttpTarget() { + if (appEngineHttpTargetBuilder_ == null) { + if (targetCase_ == 5) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + } else { + if (targetCase_ == 5) { + targetCase_ = 0; + target_ = null; + } + appEngineHttpTargetBuilder_.clear(); + } + return this; + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder getAppEngineHttpTargetBuilder() { + return getAppEngineHttpTargetFieldBuilder().getBuilder(); + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + public com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder getAppEngineHttpTargetOrBuilder() { + if ((targetCase_ == 5) && (appEngineHttpTargetBuilder_ != null)) { + return appEngineHttpTargetBuilder_.getMessageOrBuilder(); + } else { + if (targetCase_ == 5) { + return (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + } + /** + *
+     * App Engine HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget, com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder, com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder> + getAppEngineHttpTargetFieldBuilder() { + if (appEngineHttpTargetBuilder_ == null) { + if (!(targetCase_ == 5)) { + target_ = com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.getDefaultInstance(); + } + appEngineHttpTargetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget, com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget.Builder, com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder>( + (com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget) target_, + getParentForChildren(), + isClean()); + target_ = null; + } + targetCase_ = 5; + onChanged();; + return appEngineHttpTargetBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.HttpTarget, com.google.cloud.scheduler.v1beta1.HttpTarget.Builder, com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder> httpTargetBuilder_; + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public boolean hasHttpTarget() { + return targetCase_ == 6; + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public com.google.cloud.scheduler.v1beta1.HttpTarget getHttpTarget() { + if (httpTargetBuilder_ == null) { + if (targetCase_ == 6) { + return (com.google.cloud.scheduler.v1beta1.HttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } else { + if (targetCase_ == 6) { + return httpTargetBuilder_.getMessage(); + } + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public Builder setHttpTarget(com.google.cloud.scheduler.v1beta1.HttpTarget value) { + if (httpTargetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + onChanged(); + } else { + httpTargetBuilder_.setMessage(value); + } + targetCase_ = 6; + return this; + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public Builder setHttpTarget( + com.google.cloud.scheduler.v1beta1.HttpTarget.Builder builderForValue) { + if (httpTargetBuilder_ == null) { + target_ = builderForValue.build(); + onChanged(); + } else { + httpTargetBuilder_.setMessage(builderForValue.build()); + } + targetCase_ = 6; + return this; + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public Builder mergeHttpTarget(com.google.cloud.scheduler.v1beta1.HttpTarget value) { + if (httpTargetBuilder_ == null) { + if (targetCase_ == 6 && + target_ != com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance()) { + target_ = com.google.cloud.scheduler.v1beta1.HttpTarget.newBuilder((com.google.cloud.scheduler.v1beta1.HttpTarget) target_) + .mergeFrom(value).buildPartial(); + } else { + target_ = value; + } + onChanged(); + } else { + if (targetCase_ == 6) { + httpTargetBuilder_.mergeFrom(value); + } + httpTargetBuilder_.setMessage(value); + } + targetCase_ = 6; + return this; + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public Builder clearHttpTarget() { + if (httpTargetBuilder_ == null) { + if (targetCase_ == 6) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + } else { + if (targetCase_ == 6) { + targetCase_ = 0; + target_ = null; + } + httpTargetBuilder_.clear(); + } + return this; + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public com.google.cloud.scheduler.v1beta1.HttpTarget.Builder getHttpTargetBuilder() { + return getHttpTargetFieldBuilder().getBuilder(); + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + public com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder getHttpTargetOrBuilder() { + if ((targetCase_ == 6) && (httpTargetBuilder_ != null)) { + return httpTargetBuilder_.getMessageOrBuilder(); + } else { + if (targetCase_ == 6) { + return (com.google.cloud.scheduler.v1beta1.HttpTarget) target_; + } + return com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + } + /** + *
+     * HTTP target.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.HttpTarget, com.google.cloud.scheduler.v1beta1.HttpTarget.Builder, com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder> + getHttpTargetFieldBuilder() { + if (httpTargetBuilder_ == null) { + if (!(targetCase_ == 6)) { + target_ = com.google.cloud.scheduler.v1beta1.HttpTarget.getDefaultInstance(); + } + httpTargetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.HttpTarget, com.google.cloud.scheduler.v1beta1.HttpTarget.Builder, com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder>( + (com.google.cloud.scheduler.v1beta1.HttpTarget) target_, + getParentForChildren(), + isClean()); + target_ = null; + } + targetCase_ = 6; + onChanged();; + return httpTargetBuilder_; + } + + private java.lang.Object schedule_ = ""; + /** + *
+     * Required.
+     * Describes the schedule on which the job will be executed.
+     * As a general rule, execution `n + 1` of a job will not begin
+     * until execution `n` has finished. Cloud Scheduler will never
+     * allow two simultaneously outstanding executions. For example,
+     * this implies that if the `n+1`th execution is scheduled to run at
+     * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+     * execution will not start until `16:15`.
+     * A scheduled start time will be delayed if the previous
+     * execution has not ended when its scheduled time occurs.
+     * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+     * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+     * times, with exponential backoff, until the next scheduled start
+     * time.
+     * The schedule can be either of the following types:
+     * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+     * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+     * 
+ * + * string schedule = 20; + */ + public java.lang.String getSchedule() { + java.lang.Object ref = schedule_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schedule_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required.
+     * Describes the schedule on which the job will be executed.
+     * As a general rule, execution `n + 1` of a job will not begin
+     * until execution `n` has finished. Cloud Scheduler will never
+     * allow two simultaneously outstanding executions. For example,
+     * this implies that if the `n+1`th execution is scheduled to run at
+     * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+     * execution will not start until `16:15`.
+     * A scheduled start time will be delayed if the previous
+     * execution has not ended when its scheduled time occurs.
+     * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+     * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+     * times, with exponential backoff, until the next scheduled start
+     * time.
+     * The schedule can be either of the following types:
+     * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+     * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+     * 
+ * + * string schedule = 20; + */ + public com.google.protobuf.ByteString + getScheduleBytes() { + java.lang.Object ref = schedule_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + schedule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required.
+     * Describes the schedule on which the job will be executed.
+     * As a general rule, execution `n + 1` of a job will not begin
+     * until execution `n` has finished. Cloud Scheduler will never
+     * allow two simultaneously outstanding executions. For example,
+     * this implies that if the `n+1`th execution is scheduled to run at
+     * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+     * execution will not start until `16:15`.
+     * A scheduled start time will be delayed if the previous
+     * execution has not ended when its scheduled time occurs.
+     * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+     * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+     * times, with exponential backoff, until the next scheduled start
+     * time.
+     * The schedule can be either of the following types:
+     * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+     * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+     * 
+ * + * string schedule = 20; + */ + public Builder setSchedule( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + schedule_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Describes the schedule on which the job will be executed.
+     * As a general rule, execution `n + 1` of a job will not begin
+     * until execution `n` has finished. Cloud Scheduler will never
+     * allow two simultaneously outstanding executions. For example,
+     * this implies that if the `n+1`th execution is scheduled to run at
+     * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+     * execution will not start until `16:15`.
+     * A scheduled start time will be delayed if the previous
+     * execution has not ended when its scheduled time occurs.
+     * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+     * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+     * times, with exponential backoff, until the next scheduled start
+     * time.
+     * The schedule can be either of the following types:
+     * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+     * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+     * 
+ * + * string schedule = 20; + */ + public Builder clearSchedule() { + + schedule_ = getDefaultInstance().getSchedule(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * Describes the schedule on which the job will be executed.
+     * As a general rule, execution `n + 1` of a job will not begin
+     * until execution `n` has finished. Cloud Scheduler will never
+     * allow two simultaneously outstanding executions. For example,
+     * this implies that if the `n+1`th execution is scheduled to run at
+     * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+     * execution will not start until `16:15`.
+     * A scheduled start time will be delayed if the previous
+     * execution has not ended when its scheduled time occurs.
+     * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+     * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+     * times, with exponential backoff, until the next scheduled start
+     * time.
+     * The schedule can be either of the following types:
+     * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+     * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+     * 
+ * + * string schedule = 20; + */ + public Builder setScheduleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + schedule_ = value; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + /** + *
+     * Specifies the time zone to be used in interpreting
+     * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+     * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+     * Note that some time zones include a provision for
+     * daylight savings time. The rules for daylight saving time are
+     * determined by the chosen tz. For UTC use the string "utc". If a
+     * time zone is not specified, the default will be in UTC (also known
+     * as GMT).
+     * 
+ * + * string time_zone = 21; + */ + 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; + } + } + /** + *
+     * Specifies the time zone to be used in interpreting
+     * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+     * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+     * Note that some time zones include a provision for
+     * daylight savings time. The rules for daylight saving time are
+     * determined by the chosen tz. For UTC use the string "utc". If a
+     * time zone is not specified, the default will be in UTC (also known
+     * as GMT).
+     * 
+ * + * string time_zone = 21; + */ + 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; + } + } + /** + *
+     * Specifies the time zone to be used in interpreting
+     * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+     * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+     * Note that some time zones include a provision for
+     * daylight savings time. The rules for daylight saving time are
+     * determined by the chosen tz. For UTC use the string "utc". If a
+     * time zone is not specified, the default will be in UTC (also known
+     * as GMT).
+     * 
+ * + * string time_zone = 21; + */ + public Builder setTimeZone( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timeZone_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies the time zone to be used in interpreting
+     * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+     * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+     * Note that some time zones include a provision for
+     * daylight savings time. The rules for daylight saving time are
+     * determined by the chosen tz. For UTC use the string "utc". If a
+     * time zone is not specified, the default will be in UTC (also known
+     * as GMT).
+     * 
+ * + * string time_zone = 21; + */ + public Builder clearTimeZone() { + + timeZone_ = getDefaultInstance().getTimeZone(); + onChanged(); + return this; + } + /** + *
+     * Specifies the time zone to be used in interpreting
+     * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+     * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+     * Note that some time zones include a provision for
+     * daylight savings time. The rules for daylight saving time are
+     * determined by the chosen tz. For UTC use the string "utc". If a
+     * time zone is not specified, the default will be in UTC (also known
+     * as GMT).
+     * 
+ * + * string time_zone = 21; + */ + public Builder setTimeZoneBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timeZone_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp userUpdateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> userUpdateTimeBuilder_; + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public boolean hasUserUpdateTime() { + return userUpdateTimeBuilder_ != null || userUpdateTime_ != null; + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public com.google.protobuf.Timestamp getUserUpdateTime() { + if (userUpdateTimeBuilder_ == null) { + return userUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : userUpdateTime_; + } else { + return userUpdateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public Builder setUserUpdateTime(com.google.protobuf.Timestamp value) { + if (userUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userUpdateTime_ = value; + onChanged(); + } else { + userUpdateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public Builder setUserUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (userUpdateTimeBuilder_ == null) { + userUpdateTime_ = builderForValue.build(); + onChanged(); + } else { + userUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public Builder mergeUserUpdateTime(com.google.protobuf.Timestamp value) { + if (userUpdateTimeBuilder_ == null) { + if (userUpdateTime_ != null) { + userUpdateTime_ = + com.google.protobuf.Timestamp.newBuilder(userUpdateTime_).mergeFrom(value).buildPartial(); + } else { + userUpdateTime_ = value; + } + onChanged(); + } else { + userUpdateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public Builder clearUserUpdateTime() { + if (userUpdateTimeBuilder_ == null) { + userUpdateTime_ = null; + onChanged(); + } else { + userUpdateTime_ = null; + userUpdateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getUserUpdateTimeBuilder() { + + onChanged(); + return getUserUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getUserUpdateTimeOrBuilder() { + if (userUpdateTimeBuilder_ != null) { + return userUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return userUpdateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : userUpdateTime_; + } + } + /** + *
+     * Output only. The creation time of the job.
+     * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUserUpdateTimeFieldBuilder() { + if (userUpdateTimeBuilder_ == null) { + userUpdateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUserUpdateTime(), + getParentForChildren(), + isClean()); + userUpdateTime_ = null; + } + return userUpdateTimeBuilder_; + } + + private int state_ = 0; + /** + *
+     * Output only. State of the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * Output only. State of the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. State of the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public com.google.cloud.scheduler.v1beta1.Job.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.scheduler.v1beta1.Job.State result = com.google.cloud.scheduler.v1beta1.Job.State.valueOf(state_); + return result == null ? com.google.cloud.scheduler.v1beta1.Job.State.UNRECOGNIZED : result; + } + /** + *
+     * Output only. State of the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public Builder setState(com.google.cloud.scheduler.v1beta1.Job.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. State of the job.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.rpc.Status status_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public Builder setStatus( + com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = + com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? + com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + *
+     * Output only. The response from the target for the last attempted execution.
+     * 
+ * + * .google.rpc.Status status = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getStatus(), + getParentForChildren(), + isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Timestamp scheduleTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> scheduleTimeBuilder_; + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public boolean hasScheduleTime() { + return scheduleTimeBuilder_ != null || scheduleTime_ != null; + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public com.google.protobuf.Timestamp getScheduleTime() { + if (scheduleTimeBuilder_ == null) { + return scheduleTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_; + } else { + return scheduleTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleTime_ = value; + onChanged(); + } else { + scheduleTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public Builder setScheduleTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = builderForValue.build(); + onChanged(); + } else { + scheduleTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public Builder mergeScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (scheduleTime_ != null) { + scheduleTime_ = + com.google.protobuf.Timestamp.newBuilder(scheduleTime_).mergeFrom(value).buildPartial(); + } else { + scheduleTime_ = value; + } + onChanged(); + } else { + scheduleTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public Builder clearScheduleTime() { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = null; + onChanged(); + } else { + scheduleTime_ = null; + scheduleTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() { + + onChanged(); + return getScheduleTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + if (scheduleTimeBuilder_ != null) { + return scheduleTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_; + } + } + /** + *
+     * Output only. The next time the job is scheduled. Note that this may be a
+     * retry of a previously failed attempt or the next execution time
+     * according to the schedule.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getScheduleTimeFieldBuilder() { + if (scheduleTimeBuilder_ == null) { + scheduleTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getScheduleTime(), + getParentForChildren(), + isClean()); + scheduleTime_ = null; + } + return scheduleTimeBuilder_; + } + + private com.google.protobuf.Timestamp lastAttemptTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastAttemptTimeBuilder_; + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public boolean hasLastAttemptTime() { + return lastAttemptTimeBuilder_ != null || lastAttemptTime_ != null; + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public com.google.protobuf.Timestamp getLastAttemptTime() { + if (lastAttemptTimeBuilder_ == null) { + return lastAttemptTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastAttemptTime_; + } else { + return lastAttemptTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public Builder setLastAttemptTime(com.google.protobuf.Timestamp value) { + if (lastAttemptTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastAttemptTime_ = value; + onChanged(); + } else { + lastAttemptTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public Builder setLastAttemptTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastAttemptTimeBuilder_ == null) { + lastAttemptTime_ = builderForValue.build(); + onChanged(); + } else { + lastAttemptTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public Builder mergeLastAttemptTime(com.google.protobuf.Timestamp value) { + if (lastAttemptTimeBuilder_ == null) { + if (lastAttemptTime_ != null) { + lastAttemptTime_ = + com.google.protobuf.Timestamp.newBuilder(lastAttemptTime_).mergeFrom(value).buildPartial(); + } else { + lastAttemptTime_ = value; + } + onChanged(); + } else { + lastAttemptTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public Builder clearLastAttemptTime() { + if (lastAttemptTimeBuilder_ == null) { + lastAttemptTime_ = null; + onChanged(); + } else { + lastAttemptTime_ = null; + lastAttemptTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public com.google.protobuf.Timestamp.Builder getLastAttemptTimeBuilder() { + + onChanged(); + return getLastAttemptTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + public com.google.protobuf.TimestampOrBuilder getLastAttemptTimeOrBuilder() { + if (lastAttemptTimeBuilder_ != null) { + return lastAttemptTimeBuilder_.getMessageOrBuilder(); + } else { + return lastAttemptTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : lastAttemptTime_; + } + } + /** + *
+     * Output only. The time the last job attempt started.
+     * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getLastAttemptTimeFieldBuilder() { + if (lastAttemptTimeBuilder_ == null) { + lastAttemptTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getLastAttemptTime(), + getParentForChildren(), + isClean()); + lastAttemptTime_ = null; + } + return lastAttemptTimeBuilder_; + } + + private com.google.cloud.scheduler.v1beta1.RetryConfig retryConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.RetryConfig, com.google.cloud.scheduler.v1beta1.RetryConfig.Builder, com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder> retryConfigBuilder_; + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public boolean hasRetryConfig() { + return retryConfigBuilder_ != null || retryConfig_ != null; + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public com.google.cloud.scheduler.v1beta1.RetryConfig getRetryConfig() { + if (retryConfigBuilder_ == null) { + return retryConfig_ == null ? com.google.cloud.scheduler.v1beta1.RetryConfig.getDefaultInstance() : retryConfig_; + } else { + return retryConfigBuilder_.getMessage(); + } + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public Builder setRetryConfig(com.google.cloud.scheduler.v1beta1.RetryConfig value) { + if (retryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryConfig_ = value; + onChanged(); + } else { + retryConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public Builder setRetryConfig( + com.google.cloud.scheduler.v1beta1.RetryConfig.Builder builderForValue) { + if (retryConfigBuilder_ == null) { + retryConfig_ = builderForValue.build(); + onChanged(); + } else { + retryConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public Builder mergeRetryConfig(com.google.cloud.scheduler.v1beta1.RetryConfig value) { + if (retryConfigBuilder_ == null) { + if (retryConfig_ != null) { + retryConfig_ = + com.google.cloud.scheduler.v1beta1.RetryConfig.newBuilder(retryConfig_).mergeFrom(value).buildPartial(); + } else { + retryConfig_ = value; + } + onChanged(); + } else { + retryConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public Builder clearRetryConfig() { + if (retryConfigBuilder_ == null) { + retryConfig_ = null; + onChanged(); + } else { + retryConfig_ = null; + retryConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public com.google.cloud.scheduler.v1beta1.RetryConfig.Builder getRetryConfigBuilder() { + + onChanged(); + return getRetryConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + public com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder getRetryConfigOrBuilder() { + if (retryConfigBuilder_ != null) { + return retryConfigBuilder_.getMessageOrBuilder(); + } else { + return retryConfig_ == null ? + com.google.cloud.scheduler.v1beta1.RetryConfig.getDefaultInstance() : retryConfig_; + } + } + /** + *
+     * Settings that determine the retry behavior.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.RetryConfig, com.google.cloud.scheduler.v1beta1.RetryConfig.Builder, com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder> + getRetryConfigFieldBuilder() { + if (retryConfigBuilder_ == null) { + retryConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.RetryConfig, com.google.cloud.scheduler.v1beta1.RetryConfig.Builder, com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder>( + getRetryConfig(), + getParentForChildren(), + isClean()); + retryConfig_ = null; + } + return retryConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.Job) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.Job) + private static final com.google.cloud.scheduler.v1beta1.Job DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.Job(); + } + + public static com.google.cloud.scheduler.v1beta1.Job getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Job parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Job(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.scheduler.v1beta1.Job getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobName.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobName.java new file mode 100644 index 000000000000..b4186836c2b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobName.java @@ -0,0 +1,212 @@ +/* + * 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.scheduler.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class JobName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/jobs/{job}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String job; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getJob() { + return job; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private JobName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + job = Preconditions.checkNotNull(builder.getJob()); + } + + public static JobName of(String project, String location, String job) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setJob(job) + .build(); + } + + public static String format(String project, String location, String job) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setJob(job) + .build() + .toString(); + } + + public static JobName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "JobName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("job")); + } + + 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 (JobName 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("job", job); + 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, "job", job); + } + + /** Builder for JobName. */ + public static class Builder { + + private String project; + private String location; + private String job; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getJob() { + return job; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setJob(String job) { + this.job = job; + return this; + } + + private Builder() { + } + + private Builder(JobName jobName) { + project = jobName.project; + location = jobName.location; + job = jobName.job; + } + + public JobName build() { + return new JobName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof JobName) { + JobName that = (JobName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.job.equals(that.job)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= job.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobOrBuilder.java new file mode 100644 index 000000000000..df2c843cf532 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobOrBuilder.java @@ -0,0 +1,376 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/job.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface JobOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.Job) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), colons (:), or periods (.).
+   *    For more information, see
+   *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+   * * `LOCATION_ID` is the canonical ID for the job's location.
+   *    The list of available locations can be obtained by calling
+   *    [ListLocations][google.cloud.location.Locations.ListLocations].
+   *    For more information, see https://cloud.google.com/about/locations/.
+   * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), colons (:), or periods (.).
+   *    For more information, see
+   *    [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
+   * * `LOCATION_ID` is the canonical ID for the job's location.
+   *    The list of available locations can be obtained by calling
+   *    [ListLocations][google.cloud.location.Locations.ListLocations].
+   *    For more information, see https://cloud.google.com/about/locations/.
+   * * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
+   *    hyphens (-), or underscores (_). The maximum length is 500 characters.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A human-readable description for the job. This string must not contain
+   * more than 500 characters.
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * A human-readable description for the job. This string must not contain
+   * more than 500 characters.
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + boolean hasPubsubTarget(); + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + com.google.cloud.scheduler.v1beta1.PubsubTarget getPubsubTarget(); + /** + *
+   * Pub/Sub target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.PubsubTarget pubsub_target = 4; + */ + com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder getPubsubTargetOrBuilder(); + + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + boolean hasAppEngineHttpTarget(); + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + com.google.cloud.scheduler.v1beta1.AppEngineHttpTarget getAppEngineHttpTarget(); + /** + *
+   * App Engine HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.AppEngineHttpTarget app_engine_http_target = 5; + */ + com.google.cloud.scheduler.v1beta1.AppEngineHttpTargetOrBuilder getAppEngineHttpTargetOrBuilder(); + + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + boolean hasHttpTarget(); + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + com.google.cloud.scheduler.v1beta1.HttpTarget getHttpTarget(); + /** + *
+   * HTTP target.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.HttpTarget http_target = 6; + */ + com.google.cloud.scheduler.v1beta1.HttpTargetOrBuilder getHttpTargetOrBuilder(); + + /** + *
+   * Required.
+   * Describes the schedule on which the job will be executed.
+   * As a general rule, execution `n + 1` of a job will not begin
+   * until execution `n` has finished. Cloud Scheduler will never
+   * allow two simultaneously outstanding executions. For example,
+   * this implies that if the `n+1`th execution is scheduled to run at
+   * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+   * execution will not start until `16:15`.
+   * A scheduled start time will be delayed if the previous
+   * execution has not ended when its scheduled time occurs.
+   * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+   * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+   * times, with exponential backoff, until the next scheduled start
+   * time.
+   * The schedule can be either of the following types:
+   * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+   * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+   * 
+ * + * string schedule = 20; + */ + java.lang.String getSchedule(); + /** + *
+   * Required.
+   * Describes the schedule on which the job will be executed.
+   * As a general rule, execution `n + 1` of a job will not begin
+   * until execution `n` has finished. Cloud Scheduler will never
+   * allow two simultaneously outstanding executions. For example,
+   * this implies that if the `n+1`th execution is scheduled to run at
+   * 16:00 but the `n`th execution takes until 16:15, the `n+1`th
+   * execution will not start until `16:15`.
+   * A scheduled start time will be delayed if the previous
+   * execution has not ended when its scheduled time occurs.
+   * If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails,
+   * the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count]
+   * times, with exponential backoff, until the next scheduled start
+   * time.
+   * The schedule can be either of the following types:
+   * * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
+   * * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
+   * 
+ * + * string schedule = 20; + */ + com.google.protobuf.ByteString + getScheduleBytes(); + + /** + *
+   * Specifies the time zone to be used in interpreting
+   * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+   * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+   * Note that some time zones include a provision for
+   * daylight savings time. The rules for daylight saving time are
+   * determined by the chosen tz. For UTC use the string "utc". If a
+   * time zone is not specified, the default will be in UTC (also known
+   * as GMT).
+   * 
+ * + * string time_zone = 21; + */ + java.lang.String getTimeZone(); + /** + *
+   * Specifies the time zone to be used in interpreting
+   * [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time
+   * zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
+   * Note that some time zones include a provision for
+   * daylight savings time. The rules for daylight saving time are
+   * determined by the chosen tz. For UTC use the string "utc". If a
+   * time zone is not specified, the default will be in UTC (also known
+   * as GMT).
+   * 
+ * + * string time_zone = 21; + */ + com.google.protobuf.ByteString + getTimeZoneBytes(); + + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + boolean hasUserUpdateTime(); + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + com.google.protobuf.Timestamp getUserUpdateTime(); + /** + *
+   * Output only. The creation time of the job.
+   * 
+ * + * .google.protobuf.Timestamp user_update_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getUserUpdateTimeOrBuilder(); + + /** + *
+   * Output only. State of the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + int getStateValue(); + /** + *
+   * Output only. State of the job.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job.State state = 10; + */ + com.google.cloud.scheduler.v1beta1.Job.State getState(); + + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + boolean hasStatus(); + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + com.google.rpc.Status getStatus(); + /** + *
+   * Output only. The response from the target for the last attempted execution.
+   * 
+ * + * .google.rpc.Status status = 11; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + boolean hasScheduleTime(); + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + com.google.protobuf.Timestamp getScheduleTime(); + /** + *
+   * Output only. The next time the job is scheduled. Note that this may be a
+   * retry of a previously failed attempt or the next execution time
+   * according to the schedule.
+   * 
+ * + * .google.protobuf.Timestamp schedule_time = 17; + */ + com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder(); + + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + boolean hasLastAttemptTime(); + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + com.google.protobuf.Timestamp getLastAttemptTime(); + /** + *
+   * Output only. The time the last job attempt started.
+   * 
+ * + * .google.protobuf.Timestamp last_attempt_time = 18; + */ + com.google.protobuf.TimestampOrBuilder getLastAttemptTimeOrBuilder(); + + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + boolean hasRetryConfig(); + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + com.google.cloud.scheduler.v1beta1.RetryConfig getRetryConfig(); + /** + *
+   * Settings that determine the retry behavior.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.RetryConfig retry_config = 19; + */ + com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder getRetryConfigOrBuilder(); + + public com.google.cloud.scheduler.v1beta1.Job.TargetCase getTargetCase(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobProto.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobProto.java new file mode 100644 index 000000000000..5e8e714be621 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/JobProto.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/job.proto + +package com.google.cloud.scheduler.v1beta1; + +public final class JobProto { + private JobProto() {} + 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_scheduler_v1beta1_Job_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_Job_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_RetryConfig_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/scheduler/v1beta1/job.pro" + + "to\022\036google.cloud.scheduler.v1beta1\032\034goog" + + "le/api/annotations.proto\032+google/cloud/s" + + "cheduler/v1beta1/target.proto\032\036google/pr" + + "otobuf/duration.proto\032\037google/protobuf/t" + + "imestamp.proto\032\027google/rpc/status.proto\"" + + "\323\005\n\003Job\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 \001" + + "(\t\022E\n\rpubsub_target\030\004 \001(\0132,.google.cloud" + + ".scheduler.v1beta1.PubsubTargetH\000\022U\n\026app" + + "_engine_http_target\030\005 \001(\01323.google.cloud" + + ".scheduler.v1beta1.AppEngineHttpTargetH\000" + + "\022A\n\013http_target\030\006 \001(\0132*.google.cloud.sch" + + "eduler.v1beta1.HttpTargetH\000\022\020\n\010schedule\030" + + "\024 \001(\t\022\021\n\ttime_zone\030\025 \001(\t\0224\n\020user_update_" + + "time\030\t \001(\0132\032.google.protobuf.Timestamp\0228" + + "\n\005state\030\n \001(\0162).google.cloud.scheduler.v" + + "1beta1.Job.State\022\"\n\006status\030\013 \001(\0132\022.googl" + + "e.rpc.Status\0221\n\rschedule_time\030\021 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\0225\n\021last_attempt_" + + "time\030\022 \001(\0132\032.google.protobuf.Timestamp\022A" + + "\n\014retry_config\030\023 \001(\0132+.google.cloud.sche" + + "duler.v1beta1.RetryConfig\"X\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\n\n\006PAUSED" + + "\020\002\022\014\n\010DISABLED\020\003\022\021\n\rUPDATE_FAILED\020\004B\010\n\006t" + + "arget\"\342\001\n\013RetryConfig\022\023\n\013retry_count\030\001 \001" + + "(\005\0225\n\022max_retry_duration\030\002 \001(\0132\031.google." + + "protobuf.Duration\0227\n\024min_backoff_duratio" + + "n\030\003 \001(\0132\031.google.protobuf.Duration\0227\n\024ma" + + "x_backoff_duration\030\004 \001(\0132\031.google.protob" + + "uf.Duration\022\025\n\rmax_doublings\030\005 \001(\005By\n\"co" + + "m.google.cloud.scheduler.v1beta1B\010JobPro" + + "toP\001ZGgoogle.golang.org/genproto/googlea" + + "pis/cloud/scheduler/v1beta1;schedulerb\006p" + + "roto3" + }; + 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.scheduler.v1beta1.TargetProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_scheduler_v1beta1_Job_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_Job_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_Job_descriptor, + new java.lang.String[] { "Name", "Description", "PubsubTarget", "AppEngineHttpTarget", "HttpTarget", "Schedule", "TimeZone", "UserUpdateTime", "State", "Status", "ScheduleTime", "LastAttemptTime", "RetryConfig", "Target", }); + internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_scheduler_v1beta1_RetryConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor, + new java.lang.String[] { "RetryCount", "MaxRetryDuration", "MinBackoffDuration", "MaxBackoffDuration", "MaxDoublings", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.scheduler.v1beta1.TargetProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequest.java new file mode 100644 index 000000000000..1dd146fa8883 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequest.java @@ -0,0 +1,878 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ListJobsRequest} + */ +public final class ListJobsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.ListJobsRequest) + ListJobsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListJobsRequest.newBuilder() to construct. + private ListJobsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListJobsRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListJobsRequest( + 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 40: { + + pageSize_ = input.readInt32(); + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ListJobsRequest.class, com.google.cloud.scheduler.v1beta1.ListJobsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_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 = 5; + private int pageSize_; + /** + *
+   * Requested page size.
+   * The maximum page size is 500. If unspecified, the page size will
+   * be the maximum. Fewer jobs than requested might be returned,
+   * even if more jobs exist; use next_page_token to determine if more
+   * jobs exist.
+   * 
+ * + * int32 page_size = 5; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object pageToken_; + /** + *
+   * A token identifying a page of results the server will return. To
+   * request the first page results, page_token must be empty. To
+   * request the next page of results, page_token must be the value of
+   * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+   * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+   * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+   * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+   * 
+ * + * string page_token = 6; + */ + 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; + } + } + /** + *
+   * A token identifying a page of results the server will return. To
+   * request the first page results, page_token must be empty. To
+   * request the next page of results, page_token must be the value of
+   * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+   * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+   * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+   * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+   * 
+ * + * string page_token = 6; + */ + 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; + } + } + + 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(5, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pageToken_); + } + 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(5, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pageToken_); + } + 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.scheduler.v1beta1.ListJobsRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.ListJobsRequest other = (com.google.cloud.scheduler.v1beta1.ListJobsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest 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.scheduler.v1beta1.ListJobsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest 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.scheduler.v1beta1.ListJobsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest 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.scheduler.v1beta1.ListJobsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest 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.scheduler.v1beta1.ListJobsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest 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.scheduler.v1beta1.ListJobsRequest 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 listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ListJobsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.ListJobsRequest) + com.google.cloud.scheduler.v1beta1.ListJobsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ListJobsRequest.class, com.google.cloud.scheduler.v1beta1.ListJobsRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.ListJobsRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.ListJobsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsRequest build() { + com.google.cloud.scheduler.v1beta1.ListJobsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.ListJobsRequest result = new com.google.cloud.scheduler.v1beta1.ListJobsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.ListJobsRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.ListJobsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.ListJobsRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.ListJobsRequest.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(); + } + 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.scheduler.v1beta1.ListJobsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.ListJobsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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 location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The location name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_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_ ; + /** + *
+     * Requested page size.
+     * The maximum page size is 500. If unspecified, the page size will
+     * be the maximum. Fewer jobs than requested might be returned,
+     * even if more jobs exist; use next_page_token to determine if more
+     * jobs exist.
+     * 
+ * + * int32 page_size = 5; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Requested page size.
+     * The maximum page size is 500. If unspecified, the page size will
+     * be the maximum. Fewer jobs than requested might be returned,
+     * even if more jobs exist; use next_page_token to determine if more
+     * jobs exist.
+     * 
+ * + * int32 page_size = 5; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Requested page size.
+     * The maximum page size is 500. If unspecified, the page size will
+     * be the maximum. Fewer jobs than requested might be returned,
+     * even if more jobs exist; use next_page_token to determine if more
+     * jobs exist.
+     * 
+ * + * int32 page_size = 5; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A token identifying a page of results the server will return. To
+     * request the first page results, page_token must be empty. To
+     * request the next page of results, page_token must be the value of
+     * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+     * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+     * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+     * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+     * 
+ * + * string page_token = 6; + */ + 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; + } + } + /** + *
+     * A token identifying a page of results the server will return. To
+     * request the first page results, page_token must be empty. To
+     * request the next page of results, page_token must be the value of
+     * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+     * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+     * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+     * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+     * 
+ * + * string page_token = 6; + */ + 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; + } + } + /** + *
+     * A token identifying a page of results the server will return. To
+     * request the first page results, page_token must be empty. To
+     * request the next page of results, page_token must be the value of
+     * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+     * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+     * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+     * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token identifying a page of results the server will return. To
+     * request the first page results, page_token must be empty. To
+     * request the next page of results, page_token must be the value of
+     * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+     * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+     * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+     * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+     * 
+ * + * string page_token = 6; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token identifying a page of results the server will return. To
+     * request the first page results, page_token must be empty. To
+     * request the next page of results, page_token must be the value of
+     * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+     * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+     * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+     * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+     * 
+ * + * string page_token = 6; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.ListJobsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.ListJobsRequest) + private static final com.google.cloud.scheduler.v1beta1.ListJobsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.ListJobsRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.ListJobsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListJobsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListJobsRequest(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.scheduler.v1beta1.ListJobsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequestOrBuilder.java new file mode 100644 index 000000000000..365b15928a1c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface ListJobsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.ListJobsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required.
+   * The location name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Requested page size.
+   * The maximum page size is 500. If unspecified, the page size will
+   * be the maximum. Fewer jobs than requested might be returned,
+   * even if more jobs exist; use next_page_token to determine if more
+   * jobs exist.
+   * 
+ * + * int32 page_size = 5; + */ + int getPageSize(); + + /** + *
+   * A token identifying a page of results the server will return. To
+   * request the first page results, page_token must be empty. To
+   * request the next page of results, page_token must be the value of
+   * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+   * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+   * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+   * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+   * 
+ * + * string page_token = 6; + */ + java.lang.String getPageToken(); + /** + *
+   * A token identifying a page of results the server will return. To
+   * request the first page results, page_token must be empty. To
+   * request the next page of results, page_token must be the value of
+   * [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
+   * the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
+   * switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
+   * [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
+   * 
+ * + * string page_token = 6; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponse.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponse.java new file mode 100644 index 000000000000..dba1113195a6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponse.java @@ -0,0 +1,1052 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Response message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ListJobsResponse} + */ +public final class ListJobsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.ListJobsResponse) + ListJobsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListJobsResponse.newBuilder() to construct. + private ListJobsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListJobsResponse() { + jobs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListJobsResponse( + 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) == 0x00000001)) { + jobs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + jobs_.add( + input.readMessage(com.google.cloud.scheduler.v1beta1.Job.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + 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) == 0x00000001)) { + jobs_ = java.util.Collections.unmodifiableList(jobs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ListJobsResponse.class, com.google.cloud.scheduler.v1beta1.ListJobsResponse.Builder.class); + } + + private int bitField0_; + public static final int JOBS_FIELD_NUMBER = 1; + private java.util.List jobs_; + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public java.util.List getJobsList() { + return jobs_; + } + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public java.util.List + getJobsOrBuilderList() { + return jobs_; + } + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public int getJobsCount() { + return jobs_.size(); + } + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job getJobs(int index) { + return jobs_.get(index); + } + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobsOrBuilder( + int index) { + return jobs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token to retrieve next page of results. Pass this value in the
+   * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+   * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+   * If this is empty it indicates that there are no more results
+   * through which to paginate.
+   * The page token is valid for only 2 hours.
+   * 
+ * + * 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; + } + } + /** + *
+   * A token to retrieve next page of results. Pass this value in the
+   * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+   * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+   * If this is empty it indicates that there are no more results
+   * through which to paginate.
+   * The page token is valid for only 2 hours.
+   * 
+ * + * 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 < jobs_.size(); i++) { + output.writeMessage(1, jobs_.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 < jobs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, jobs_.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.scheduler.v1beta1.ListJobsResponse)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.ListJobsResponse other = (com.google.cloud.scheduler.v1beta1.ListJobsResponse) obj; + + boolean result = true; + result = result && getJobsList() + .equals(other.getJobsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getJobsCount() > 0) { + hash = (37 * hash) + JOBS_FIELD_NUMBER; + hash = (53 * hash) + getJobsList().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.scheduler.v1beta1.ListJobsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse 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.scheduler.v1beta1.ListJobsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse 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.scheduler.v1beta1.ListJobsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse 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.scheduler.v1beta1.ListJobsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse 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.scheduler.v1beta1.ListJobsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse 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.scheduler.v1beta1.ListJobsResponse 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 listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ListJobsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.ListJobsResponse) + com.google.cloud.scheduler.v1beta1.ListJobsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ListJobsResponse.class, com.google.cloud.scheduler.v1beta1.ListJobsResponse.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.ListJobsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getJobsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + jobsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsResponse getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.ListJobsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsResponse build() { + com.google.cloud.scheduler.v1beta1.ListJobsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ListJobsResponse buildPartial() { + com.google.cloud.scheduler.v1beta1.ListJobsResponse result = new com.google.cloud.scheduler.v1beta1.ListJobsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (jobsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + jobs_ = java.util.Collections.unmodifiableList(jobs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.jobs_ = jobs_; + } else { + result.jobs_ = jobsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.ListJobsResponse) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.ListJobsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.ListJobsResponse other) { + if (other == com.google.cloud.scheduler.v1beta1.ListJobsResponse.getDefaultInstance()) return this; + if (jobsBuilder_ == null) { + if (!other.jobs_.isEmpty()) { + if (jobs_.isEmpty()) { + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureJobsIsMutable(); + jobs_.addAll(other.jobs_); + } + onChanged(); + } + } else { + if (!other.jobs_.isEmpty()) { + if (jobsBuilder_.isEmpty()) { + jobsBuilder_.dispose(); + jobsBuilder_ = null; + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + jobsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getJobsFieldBuilder() : null; + } else { + jobsBuilder_.addAllMessages(other.jobs_); + } + } + } + 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.scheduler.v1beta1.ListJobsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.ListJobsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List jobs_ = + java.util.Collections.emptyList(); + private void ensureJobsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + jobs_ = new java.util.ArrayList(jobs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> jobsBuilder_; + + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public java.util.List getJobsList() { + if (jobsBuilder_ == null) { + return java.util.Collections.unmodifiableList(jobs_); + } else { + return jobsBuilder_.getMessageList(); + } + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public int getJobsCount() { + if (jobsBuilder_ == null) { + return jobs_.size(); + } else { + return jobsBuilder_.getCount(); + } + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job getJobs(int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); + } else { + return jobsBuilder_.getMessage(index); + } + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder setJobs( + int index, com.google.cloud.scheduler.v1beta1.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.set(index, value); + onChanged(); + } else { + jobsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder setJobs( + int index, com.google.cloud.scheduler.v1beta1.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.set(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder addJobs(com.google.cloud.scheduler.v1beta1.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(value); + onChanged(); + } else { + jobsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder addJobs( + int index, com.google.cloud.scheduler.v1beta1.Job value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(index, value); + onChanged(); + } else { + jobsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder addJobs( + com.google.cloud.scheduler.v1beta1.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder addJobs( + int index, com.google.cloud.scheduler.v1beta1.Job.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder addAllJobs( + java.lang.Iterable values) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, jobs_); + onChanged(); + } else { + jobsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder clearJobs() { + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + jobsBuilder_.clear(); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public Builder removeJobs(int index) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.remove(index); + onChanged(); + } else { + jobsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job.Builder getJobsBuilder( + int index) { + return getJobsFieldBuilder().getBuilder(index); + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobsOrBuilder( + int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); } else { + return jobsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public java.util.List + getJobsOrBuilderList() { + if (jobsBuilder_ != null) { + return jobsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(jobs_); + } + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job.Builder addJobsBuilder() { + return getJobsFieldBuilder().addBuilder( + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance()); + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job.Builder addJobsBuilder( + int index) { + return getJobsFieldBuilder().addBuilder( + index, com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance()); + } + /** + *
+     * The list of jobs.
+     * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + public java.util.List + getJobsBuilderList() { + return getJobsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> + getJobsFieldBuilder() { + if (jobsBuilder_ == null) { + jobsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder>( + jobs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + jobs_ = null; + } + return jobsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token to retrieve next page of results. Pass this value in the
+     * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+     * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+     * If this is empty it indicates that there are no more results
+     * through which to paginate.
+     * The page token is valid for only 2 hours.
+     * 
+ * + * 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; + } + } + /** + *
+     * A token to retrieve next page of results. Pass this value in the
+     * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+     * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+     * If this is empty it indicates that there are no more results
+     * through which to paginate.
+     * The page token is valid for only 2 hours.
+     * 
+ * + * 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; + } + } + /** + *
+     * A token to retrieve next page of results. Pass this value in the
+     * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+     * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+     * If this is empty it indicates that there are no more results
+     * through which to paginate.
+     * The page token is valid for only 2 hours.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results. Pass this value in the
+     * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+     * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+     * If this is empty it indicates that there are no more results
+     * through which to paginate.
+     * The page token is valid for only 2 hours.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token to retrieve next page of results. Pass this value in the
+     * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+     * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+     * If this is empty it indicates that there are no more results
+     * through which to paginate.
+     * The page token is valid for only 2 hours.
+     * 
+ * + * 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.setUnknownFieldsProto3(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.scheduler.v1beta1.ListJobsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.ListJobsResponse) + private static final com.google.cloud.scheduler.v1beta1.ListJobsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.ListJobsResponse(); + } + + public static com.google.cloud.scheduler.v1beta1.ListJobsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListJobsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListJobsResponse(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.scheduler.v1beta1.ListJobsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponseOrBuilder.java new file mode 100644 index 000000000000..bbce06d3d619 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ListJobsResponseOrBuilder.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface ListJobsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.ListJobsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + java.util.List + getJobsList(); + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + com.google.cloud.scheduler.v1beta1.Job getJobs(int index); + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + int getJobsCount(); + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + java.util.List + getJobsOrBuilderList(); + /** + *
+   * The list of jobs.
+   * 
+ * + * repeated .google.cloud.scheduler.v1beta1.Job jobs = 1; + */ + com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobsOrBuilder( + int index); + + /** + *
+   * A token to retrieve next page of results. Pass this value in the
+   * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+   * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+   * If this is empty it indicates that there are no more results
+   * through which to paginate.
+   * The page token is valid for only 2 hours.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token to retrieve next page of results. Pass this value in the
+   * [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
+   * [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
+   * If this is empty it indicates that there are no more results
+   * through which to paginate.
+   * The page token is valid for only 2 hours.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/LocationName.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/LocationName.java new file mode 100644 index 000000000000..0ec185fa9780 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/LocationName.java @@ -0,0 +1,189 @@ +/* + * 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.scheduler.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequest.java new file mode 100644 index 000000000000..53c9eaf06135 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.PauseJobRequest} + */ +public final class PauseJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.PauseJobRequest) + PauseJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use PauseJobRequest.newBuilder() to construct. + private PauseJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PauseJobRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PauseJobRequest( + 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.PauseJobRequest.class, com.google.cloud.scheduler.v1beta1.PauseJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.scheduler.v1beta1.PauseJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.PauseJobRequest other = (com.google.cloud.scheduler.v1beta1.PauseJobRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.scheduler.v1beta1.PauseJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest 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.scheduler.v1beta1.PauseJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest 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.scheduler.v1beta1.PauseJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest 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.scheduler.v1beta1.PauseJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest 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.scheduler.v1beta1.PauseJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest 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.scheduler.v1beta1.PauseJobRequest 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 [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.PauseJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.PauseJobRequest) + com.google.cloud.scheduler.v1beta1.PauseJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.PauseJobRequest.class, com.google.cloud.scheduler.v1beta1.PauseJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.PauseJobRequest.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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PauseJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.PauseJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PauseJobRequest build() { + com.google.cloud.scheduler.v1beta1.PauseJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PauseJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.PauseJobRequest result = new com.google.cloud.scheduler.v1beta1.PauseJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.PauseJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.PauseJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.PauseJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.PauseJobRequest.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.scheduler.v1beta1.PauseJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.PauseJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.setUnknownFieldsProto3(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.scheduler.v1beta1.PauseJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.PauseJobRequest) + private static final com.google.cloud.scheduler.v1beta1.PauseJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.PauseJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.PauseJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PauseJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PauseJobRequest(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.scheduler.v1beta1.PauseJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequestOrBuilder.java new file mode 100644 index 000000000000..d742039e5b2c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PauseJobRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface PauseJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.PauseJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ProjectName.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ProjectName.java new file mode 100644 index 000000000000..74fa772f2313 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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.scheduler.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private volatile Map fieldValuesMap; + + private final String project; + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectName of(String project) { + return newBuilder() + .setProject(project) + .build(); + } + + public static String format(String project) { + return newBuilder() + .setProject(project) + .build() + .toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + 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 (ProjectName 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); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project); + } + + /** Builder for ProjectName. */ + public static class Builder { + + private String project; + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() { + } + + private Builder(ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectName) { + ProjectName that = (ProjectName) o; + return (this.project.equals(that.project)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTarget.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTarget.java new file mode 100644 index 000000000000..fc9bb23a5a3b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTarget.java @@ -0,0 +1,1050 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Pub/Sub target. The job will be delivered by publishing a message to
+ * the given Pub/Sub topic.
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.PubsubTarget} + */ +public final class PubsubTarget extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.PubsubTarget) + PubsubTargetOrBuilder { +private static final long serialVersionUID = 0L; + // Use PubsubTarget.newBuilder() to construct. + private PubsubTarget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PubsubTarget() { + topicName_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PubsubTarget( + 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(); + + topicName_ = s; + break; + } + case 26: { + + data_ = input.readBytes(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.PubsubTarget.class, com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder.class); + } + + private int bitField0_; + public static final int TOPIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object topicName_; + /** + *
+   * Required.
+   * The name of the Cloud Pub/Sub topic to which messages will
+   * be published when a job is delivered. The topic name must be in the
+   * same format as required by PubSub's
+   * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+   * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+   * The topic must be in the same project as the Cloud Scheduler job.
+   * 
+ * + * string topic_name = 1; + */ + public java.lang.String getTopicName() { + java.lang.Object ref = topicName_; + 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(); + topicName_ = s; + return s; + } + } + /** + *
+   * Required.
+   * The name of the Cloud Pub/Sub topic to which messages will
+   * be published when a job is delivered. The topic name must be in the
+   * same format as required by PubSub's
+   * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+   * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+   * The topic must be in the same project as the Cloud Scheduler job.
+   * 
+ * + * string topic_name = 1; + */ + public com.google.protobuf.ByteString + getTopicNameBytes() { + java.lang.Object ref = topicName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topicName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString data_; + /** + *
+   * The message payload for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * bytes data = 3; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().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 { + if (!getTopicNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topicName_); + } + if (!data_.isEmpty()) { + output.writeBytes(3, data_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topicName_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, data_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + 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.scheduler.v1beta1.PubsubTarget)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.PubsubTarget other = (com.google.cloud.scheduler.v1beta1.PubsubTarget) obj; + + boolean result = true; + result = result && getTopicName() + .equals(other.getTopicName()); + result = result && getData() + .equals(other.getData()); + result = result && internalGetAttributes().equals( + other.internalGetAttributes()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOPIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTopicName().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.PubsubTarget parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget 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.scheduler.v1beta1.PubsubTarget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget 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.scheduler.v1beta1.PubsubTarget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget 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.scheduler.v1beta1.PubsubTarget parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget 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.scheduler.v1beta1.PubsubTarget parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.PubsubTarget 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.scheduler.v1beta1.PubsubTarget 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; + } + /** + *
+   * Pub/Sub target. The job will be delivered by publishing a message to
+   * the given Pub/Sub topic.
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.PubsubTarget} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.PubsubTarget) + com.google.cloud.scheduler.v1beta1.PubsubTargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.PubsubTarget.class, com.google.cloud.scheduler.v1beta1.PubsubTarget.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.PubsubTarget.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(); + topicName_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableAttributes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.TargetProto.internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PubsubTarget getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PubsubTarget build() { + com.google.cloud.scheduler.v1beta1.PubsubTarget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.PubsubTarget buildPartial() { + com.google.cloud.scheduler.v1beta1.PubsubTarget result = new com.google.cloud.scheduler.v1beta1.PubsubTarget(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.topicName_ = topicName_; + result.data_ = data_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.PubsubTarget) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.PubsubTarget)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.PubsubTarget other) { + if (other == com.google.cloud.scheduler.v1beta1.PubsubTarget.getDefaultInstance()) return this; + if (!other.getTopicName().isEmpty()) { + topicName_ = other.topicName_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + 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.scheduler.v1beta1.PubsubTarget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.PubsubTarget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object topicName_ = ""; + /** + *
+     * Required.
+     * The name of the Cloud Pub/Sub topic to which messages will
+     * be published when a job is delivered. The topic name must be in the
+     * same format as required by PubSub's
+     * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+     * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+     * The topic must be in the same project as the Cloud Scheduler job.
+     * 
+ * + * string topic_name = 1; + */ + public java.lang.String getTopicName() { + java.lang.Object ref = topicName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topicName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required.
+     * The name of the Cloud Pub/Sub topic to which messages will
+     * be published when a job is delivered. The topic name must be in the
+     * same format as required by PubSub's
+     * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+     * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+     * The topic must be in the same project as the Cloud Scheduler job.
+     * 
+ * + * string topic_name = 1; + */ + public com.google.protobuf.ByteString + getTopicNameBytes() { + java.lang.Object ref = topicName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topicName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required.
+     * The name of the Cloud Pub/Sub topic to which messages will
+     * be published when a job is delivered. The topic name must be in the
+     * same format as required by PubSub's
+     * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+     * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+     * The topic must be in the same project as the Cloud Scheduler job.
+     * 
+ * + * string topic_name = 1; + */ + public Builder setTopicName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topicName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The name of the Cloud Pub/Sub topic to which messages will
+     * be published when a job is delivered. The topic name must be in the
+     * same format as required by PubSub's
+     * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+     * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+     * The topic must be in the same project as the Cloud Scheduler job.
+     * 
+ * + * string topic_name = 1; + */ + public Builder clearTopicName() { + + topicName_ = getDefaultInstance().getTopicName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The name of the Cloud Pub/Sub topic to which messages will
+     * be published when a job is delivered. The topic name must be in the
+     * same format as required by PubSub's
+     * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+     * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+     * The topic must be in the same project as the Cloud Scheduler job.
+     * 
+ * + * string topic_name = 1; + */ + public Builder setTopicNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topicName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The message payload for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * bytes data = 3; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+     * The message payload for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * bytes data = 3; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+     * The message payload for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * bytes data = 3; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public Builder removeAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + public Builder putAttributes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Attributes for PubsubMessage.
+     * Pubsub message must contain either non-empty data, or at least one
+     * attribute.
+     * 
+ * + * map<string, string> attributes = 4; + */ + + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.PubsubTarget) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.PubsubTarget) + private static final com.google.cloud.scheduler.v1beta1.PubsubTarget DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.PubsubTarget(); + } + + public static com.google.cloud.scheduler.v1beta1.PubsubTarget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PubsubTarget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PubsubTarget(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.scheduler.v1beta1.PubsubTarget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTargetOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTargetOrBuilder.java new file mode 100644 index 000000000000..070b23409c55 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/PubsubTargetOrBuilder.java @@ -0,0 +1,114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface PubsubTargetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.PubsubTarget) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The name of the Cloud Pub/Sub topic to which messages will
+   * be published when a job is delivered. The topic name must be in the
+   * same format as required by PubSub's
+   * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+   * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+   * The topic must be in the same project as the Cloud Scheduler job.
+   * 
+ * + * string topic_name = 1; + */ + java.lang.String getTopicName(); + /** + *
+   * Required.
+   * The name of the Cloud Pub/Sub topic to which messages will
+   * be published when a job is delivered. The topic name must be in the
+   * same format as required by PubSub's
+   * [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest),
+   * for example `projects/PROJECT_ID/topics/TOPIC_ID`.
+   * The topic must be in the same project as the Cloud Scheduler job.
+   * 
+ * + * string topic_name = 1; + */ + com.google.protobuf.ByteString + getTopicNameBytes(); + + /** + *
+   * The message payload for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * bytes data = 3; + */ + com.google.protobuf.ByteString getData(); + + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + int getAttributesCount(); + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + boolean containsAttributes( + java.lang.String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttributes(); + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + java.util.Map + getAttributesMap(); + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Attributes for PubsubMessage.
+   * Pubsub message must contain either non-empty data, or at least one
+   * attribute.
+   * 
+ * + * map<string, string> attributes = 4; + */ + + java.lang.String getAttributesOrThrow( + java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequest.java new file mode 100644 index 000000000000..9c0c0a58a2eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ResumeJobRequest} + */ +public final class ResumeJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.ResumeJobRequest) + ResumeJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ResumeJobRequest.newBuilder() to construct. + private ResumeJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ResumeJobRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ResumeJobRequest( + 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ResumeJobRequest.class, com.google.cloud.scheduler.v1beta1.ResumeJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.scheduler.v1beta1.ResumeJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.ResumeJobRequest other = (com.google.cloud.scheduler.v1beta1.ResumeJobRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.scheduler.v1beta1.ResumeJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest 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.scheduler.v1beta1.ResumeJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest 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.scheduler.v1beta1.ResumeJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest 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.scheduler.v1beta1.ResumeJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest 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.scheduler.v1beta1.ResumeJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest 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.scheduler.v1beta1.ResumeJobRequest 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 [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.ResumeJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.ResumeJobRequest) + com.google.cloud.scheduler.v1beta1.ResumeJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.ResumeJobRequest.class, com.google.cloud.scheduler.v1beta1.ResumeJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.ResumeJobRequest.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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ResumeJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.ResumeJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ResumeJobRequest build() { + com.google.cloud.scheduler.v1beta1.ResumeJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.ResumeJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.ResumeJobRequest result = new com.google.cloud.scheduler.v1beta1.ResumeJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.ResumeJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.ResumeJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.ResumeJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.ResumeJobRequest.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.scheduler.v1beta1.ResumeJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.ResumeJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.setUnknownFieldsProto3(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.scheduler.v1beta1.ResumeJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.ResumeJobRequest) + private static final com.google.cloud.scheduler.v1beta1.ResumeJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.ResumeJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.ResumeJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResumeJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResumeJobRequest(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.scheduler.v1beta1.ResumeJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequestOrBuilder.java new file mode 100644 index 000000000000..7257e9aee4c0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ResumeJobRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface ResumeJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.ResumeJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfig.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfig.java new file mode 100644 index 000000000000..3b787f16be72 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfig.java @@ -0,0 +1,1475 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/job.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Settings that determine the retry behavior.
+ * By default, if a job does not complete successfully (meaning that
+ * an acknowledgement is not received from the handler, then it will be retried
+ * with exponential backoff according to the settings in [RetryConfig][google.cloud.scheduler.v1beta1.RetryConfig].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.RetryConfig} + */ +public final class RetryConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.RetryConfig) + RetryConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use RetryConfig.newBuilder() to construct. + private RetryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RetryConfig() { + retryCount_ = 0; + maxDoublings_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RetryConfig( + 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: { + + retryCount_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (maxRetryDuration_ != null) { + subBuilder = maxRetryDuration_.toBuilder(); + } + maxRetryDuration_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maxRetryDuration_); + maxRetryDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (minBackoffDuration_ != null) { + subBuilder = minBackoffDuration_.toBuilder(); + } + minBackoffDuration_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minBackoffDuration_); + minBackoffDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (maxBackoffDuration_ != null) { + subBuilder = maxBackoffDuration_.toBuilder(); + } + maxBackoffDuration_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maxBackoffDuration_); + maxBackoffDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 40: { + + maxDoublings_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_RetryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.RetryConfig.class, com.google.cloud.scheduler.v1beta1.RetryConfig.Builder.class); + } + + public static final int RETRY_COUNT_FIELD_NUMBER = 1; + private int retryCount_; + /** + *
+   * The number of attempts that the system will make to run a job using the
+   * exponential backoff procedure described by
+   * [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings].
+   * The default value of retry_count is zero.
+   * If retry_count is zero, a job attempt will *not* be retried if
+   * it fails. Instead the Cloud Scheduler system will wait for the
+   * next scheduled execution time.
+   * If retry_count is set to a non-zero number then Cloud Scheduler
+   * will retry failed attempts, using exponential backoff,
+   * retry_count times, or until the next scheduled execution time,
+   * whichever comes first.
+   * Values greater than 5 and negative values are not allowed.
+   * 
+ * + * int32 retry_count = 1; + */ + public int getRetryCount() { + return retryCount_; + } + + public static final int MAX_RETRY_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration maxRetryDuration_; + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public boolean hasMaxRetryDuration() { + return maxRetryDuration_ != null; + } + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public com.google.protobuf.Duration getMaxRetryDuration() { + return maxRetryDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxRetryDuration_; + } + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getMaxRetryDurationOrBuilder() { + return getMaxRetryDuration(); + } + + public static final int MIN_BACKOFF_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration minBackoffDuration_; + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public boolean hasMinBackoffDuration() { + return minBackoffDuration_ != null; + } + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public com.google.protobuf.Duration getMinBackoffDuration() { + return minBackoffDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : minBackoffDuration_; + } + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getMinBackoffDurationOrBuilder() { + return getMinBackoffDuration(); + } + + public static final int MAX_BACKOFF_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration maxBackoffDuration_; + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public boolean hasMaxBackoffDuration() { + return maxBackoffDuration_ != null; + } + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public com.google.protobuf.Duration getMaxBackoffDuration() { + return maxBackoffDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxBackoffDuration_; + } + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getMaxBackoffDurationOrBuilder() { + return getMaxBackoffDuration(); + } + + public static final int MAX_DOUBLINGS_FIELD_NUMBER = 5; + private int maxDoublings_; + /** + *
+   * The time between retries will double `max_doublings` times.
+   * A job's retry interval starts at
+   * [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles
+   * `max_doublings` times, then increases linearly, and finally
+   * retries retries at intervals of
+   * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times.
+   * For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is
+   * 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and
+   * `max_doublings` is 3, then the a job will first be retried in 10s. The
+   * retry interval will double three times, and then increase linearly by
+   * 2^3 * 10s.  Finally, the job will retry at intervals of
+   * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has
+   * been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the
+   * requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
+   * The default value of this field is 5.
+   * 
+ * + * int32 max_doublings = 5; + */ + public int getMaxDoublings() { + return maxDoublings_; + } + + 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 (retryCount_ != 0) { + output.writeInt32(1, retryCount_); + } + if (maxRetryDuration_ != null) { + output.writeMessage(2, getMaxRetryDuration()); + } + if (minBackoffDuration_ != null) { + output.writeMessage(3, getMinBackoffDuration()); + } + if (maxBackoffDuration_ != null) { + output.writeMessage(4, getMaxBackoffDuration()); + } + if (maxDoublings_ != 0) { + output.writeInt32(5, maxDoublings_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retryCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, retryCount_); + } + if (maxRetryDuration_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMaxRetryDuration()); + } + if (minBackoffDuration_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMinBackoffDuration()); + } + if (maxBackoffDuration_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getMaxBackoffDuration()); + } + if (maxDoublings_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, maxDoublings_); + } + 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.scheduler.v1beta1.RetryConfig)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.RetryConfig other = (com.google.cloud.scheduler.v1beta1.RetryConfig) obj; + + boolean result = true; + result = result && (getRetryCount() + == other.getRetryCount()); + result = result && (hasMaxRetryDuration() == other.hasMaxRetryDuration()); + if (hasMaxRetryDuration()) { + result = result && getMaxRetryDuration() + .equals(other.getMaxRetryDuration()); + } + result = result && (hasMinBackoffDuration() == other.hasMinBackoffDuration()); + if (hasMinBackoffDuration()) { + result = result && getMinBackoffDuration() + .equals(other.getMinBackoffDuration()); + } + result = result && (hasMaxBackoffDuration() == other.hasMaxBackoffDuration()); + if (hasMaxBackoffDuration()) { + result = result && getMaxBackoffDuration() + .equals(other.getMaxBackoffDuration()); + } + result = result && (getMaxDoublings() + == other.getMaxDoublings()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RETRY_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getRetryCount(); + if (hasMaxRetryDuration()) { + hash = (37 * hash) + MAX_RETRY_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMaxRetryDuration().hashCode(); + } + if (hasMinBackoffDuration()) { + hash = (37 * hash) + MIN_BACKOFF_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMinBackoffDuration().hashCode(); + } + if (hasMaxBackoffDuration()) { + hash = (37 * hash) + MAX_BACKOFF_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMaxBackoffDuration().hashCode(); + } + hash = (37 * hash) + MAX_DOUBLINGS_FIELD_NUMBER; + hash = (53 * hash) + getMaxDoublings(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.scheduler.v1beta1.RetryConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig 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.scheduler.v1beta1.RetryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig 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.scheduler.v1beta1.RetryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig 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.scheduler.v1beta1.RetryConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig 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.scheduler.v1beta1.RetryConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RetryConfig 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.scheduler.v1beta1.RetryConfig 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; + } + /** + *
+   * Settings that determine the retry behavior.
+   * By default, if a job does not complete successfully (meaning that
+   * an acknowledgement is not received from the handler, then it will be retried
+   * with exponential backoff according to the settings in [RetryConfig][google.cloud.scheduler.v1beta1.RetryConfig].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.RetryConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.RetryConfig) + com.google.cloud.scheduler.v1beta1.RetryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_RetryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.RetryConfig.class, com.google.cloud.scheduler.v1beta1.RetryConfig.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.RetryConfig.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(); + retryCount_ = 0; + + if (maxRetryDurationBuilder_ == null) { + maxRetryDuration_ = null; + } else { + maxRetryDuration_ = null; + maxRetryDurationBuilder_ = null; + } + if (minBackoffDurationBuilder_ == null) { + minBackoffDuration_ = null; + } else { + minBackoffDuration_ = null; + minBackoffDurationBuilder_ = null; + } + if (maxBackoffDurationBuilder_ == null) { + maxBackoffDuration_ = null; + } else { + maxBackoffDuration_ = null; + maxBackoffDurationBuilder_ = null; + } + maxDoublings_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.scheduler.v1beta1.JobProto.internal_static_google_cloud_scheduler_v1beta1_RetryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RetryConfig getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.RetryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RetryConfig build() { + com.google.cloud.scheduler.v1beta1.RetryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RetryConfig buildPartial() { + com.google.cloud.scheduler.v1beta1.RetryConfig result = new com.google.cloud.scheduler.v1beta1.RetryConfig(this); + result.retryCount_ = retryCount_; + if (maxRetryDurationBuilder_ == null) { + result.maxRetryDuration_ = maxRetryDuration_; + } else { + result.maxRetryDuration_ = maxRetryDurationBuilder_.build(); + } + if (minBackoffDurationBuilder_ == null) { + result.minBackoffDuration_ = minBackoffDuration_; + } else { + result.minBackoffDuration_ = minBackoffDurationBuilder_.build(); + } + if (maxBackoffDurationBuilder_ == null) { + result.maxBackoffDuration_ = maxBackoffDuration_; + } else { + result.maxBackoffDuration_ = maxBackoffDurationBuilder_.build(); + } + result.maxDoublings_ = maxDoublings_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.RetryConfig) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.RetryConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.RetryConfig other) { + if (other == com.google.cloud.scheduler.v1beta1.RetryConfig.getDefaultInstance()) return this; + if (other.getRetryCount() != 0) { + setRetryCount(other.getRetryCount()); + } + if (other.hasMaxRetryDuration()) { + mergeMaxRetryDuration(other.getMaxRetryDuration()); + } + if (other.hasMinBackoffDuration()) { + mergeMinBackoffDuration(other.getMinBackoffDuration()); + } + if (other.hasMaxBackoffDuration()) { + mergeMaxBackoffDuration(other.getMaxBackoffDuration()); + } + if (other.getMaxDoublings() != 0) { + setMaxDoublings(other.getMaxDoublings()); + } + 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.scheduler.v1beta1.RetryConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.RetryConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int retryCount_ ; + /** + *
+     * The number of attempts that the system will make to run a job using the
+     * exponential backoff procedure described by
+     * [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings].
+     * The default value of retry_count is zero.
+     * If retry_count is zero, a job attempt will *not* be retried if
+     * it fails. Instead the Cloud Scheduler system will wait for the
+     * next scheduled execution time.
+     * If retry_count is set to a non-zero number then Cloud Scheduler
+     * will retry failed attempts, using exponential backoff,
+     * retry_count times, or until the next scheduled execution time,
+     * whichever comes first.
+     * Values greater than 5 and negative values are not allowed.
+     * 
+ * + * int32 retry_count = 1; + */ + public int getRetryCount() { + return retryCount_; + } + /** + *
+     * The number of attempts that the system will make to run a job using the
+     * exponential backoff procedure described by
+     * [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings].
+     * The default value of retry_count is zero.
+     * If retry_count is zero, a job attempt will *not* be retried if
+     * it fails. Instead the Cloud Scheduler system will wait for the
+     * next scheduled execution time.
+     * If retry_count is set to a non-zero number then Cloud Scheduler
+     * will retry failed attempts, using exponential backoff,
+     * retry_count times, or until the next scheduled execution time,
+     * whichever comes first.
+     * Values greater than 5 and negative values are not allowed.
+     * 
+ * + * int32 retry_count = 1; + */ + public Builder setRetryCount(int value) { + + retryCount_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of attempts that the system will make to run a job using the
+     * exponential backoff procedure described by
+     * [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings].
+     * The default value of retry_count is zero.
+     * If retry_count is zero, a job attempt will *not* be retried if
+     * it fails. Instead the Cloud Scheduler system will wait for the
+     * next scheduled execution time.
+     * If retry_count is set to a non-zero number then Cloud Scheduler
+     * will retry failed attempts, using exponential backoff,
+     * retry_count times, or until the next scheduled execution time,
+     * whichever comes first.
+     * Values greater than 5 and negative values are not allowed.
+     * 
+ * + * int32 retry_count = 1; + */ + public Builder clearRetryCount() { + + retryCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration maxRetryDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> maxRetryDurationBuilder_; + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public boolean hasMaxRetryDuration() { + return maxRetryDurationBuilder_ != null || maxRetryDuration_ != null; + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public com.google.protobuf.Duration getMaxRetryDuration() { + if (maxRetryDurationBuilder_ == null) { + return maxRetryDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxRetryDuration_; + } else { + return maxRetryDurationBuilder_.getMessage(); + } + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public Builder setMaxRetryDuration(com.google.protobuf.Duration value) { + if (maxRetryDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxRetryDuration_ = value; + onChanged(); + } else { + maxRetryDurationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public Builder setMaxRetryDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (maxRetryDurationBuilder_ == null) { + maxRetryDuration_ = builderForValue.build(); + onChanged(); + } else { + maxRetryDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public Builder mergeMaxRetryDuration(com.google.protobuf.Duration value) { + if (maxRetryDurationBuilder_ == null) { + if (maxRetryDuration_ != null) { + maxRetryDuration_ = + com.google.protobuf.Duration.newBuilder(maxRetryDuration_).mergeFrom(value).buildPartial(); + } else { + maxRetryDuration_ = value; + } + onChanged(); + } else { + maxRetryDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public Builder clearMaxRetryDuration() { + if (maxRetryDurationBuilder_ == null) { + maxRetryDuration_ = null; + onChanged(); + } else { + maxRetryDuration_ = null; + maxRetryDurationBuilder_ = null; + } + + return this; + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public com.google.protobuf.Duration.Builder getMaxRetryDurationBuilder() { + + onChanged(); + return getMaxRetryDurationFieldBuilder().getBuilder(); + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getMaxRetryDurationOrBuilder() { + if (maxRetryDurationBuilder_ != null) { + return maxRetryDurationBuilder_.getMessageOrBuilder(); + } else { + return maxRetryDuration_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : maxRetryDuration_; + } + } + /** + *
+     * The time limit for retrying a failed job, measured from time when an
+     * execution was first attempted. If specified with
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+     * reached.
+     * The default value for max_retry_duration is zero, which means retry
+     * duration is unlimited.
+     * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getMaxRetryDurationFieldBuilder() { + if (maxRetryDurationBuilder_ == null) { + maxRetryDurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getMaxRetryDuration(), + getParentForChildren(), + isClean()); + maxRetryDuration_ = null; + } + return maxRetryDurationBuilder_; + } + + private com.google.protobuf.Duration minBackoffDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> minBackoffDurationBuilder_; + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public boolean hasMinBackoffDuration() { + return minBackoffDurationBuilder_ != null || minBackoffDuration_ != null; + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public com.google.protobuf.Duration getMinBackoffDuration() { + if (minBackoffDurationBuilder_ == null) { + return minBackoffDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : minBackoffDuration_; + } else { + return minBackoffDurationBuilder_.getMessage(); + } + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public Builder setMinBackoffDuration(com.google.protobuf.Duration value) { + if (minBackoffDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minBackoffDuration_ = value; + onChanged(); + } else { + minBackoffDurationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public Builder setMinBackoffDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (minBackoffDurationBuilder_ == null) { + minBackoffDuration_ = builderForValue.build(); + onChanged(); + } else { + minBackoffDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public Builder mergeMinBackoffDuration(com.google.protobuf.Duration value) { + if (minBackoffDurationBuilder_ == null) { + if (minBackoffDuration_ != null) { + minBackoffDuration_ = + com.google.protobuf.Duration.newBuilder(minBackoffDuration_).mergeFrom(value).buildPartial(); + } else { + minBackoffDuration_ = value; + } + onChanged(); + } else { + minBackoffDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public Builder clearMinBackoffDuration() { + if (minBackoffDurationBuilder_ == null) { + minBackoffDuration_ = null; + onChanged(); + } else { + minBackoffDuration_ = null; + minBackoffDurationBuilder_ = null; + } + + return this; + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public com.google.protobuf.Duration.Builder getMinBackoffDurationBuilder() { + + onChanged(); + return getMinBackoffDurationFieldBuilder().getBuilder(); + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getMinBackoffDurationOrBuilder() { + if (minBackoffDurationBuilder_ != null) { + return minBackoffDurationBuilder_.getMessageOrBuilder(); + } else { + return minBackoffDuration_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : minBackoffDuration_; + } + } + /** + *
+     * The minimum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 5 seconds.
+     * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getMinBackoffDurationFieldBuilder() { + if (minBackoffDurationBuilder_ == null) { + minBackoffDurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getMinBackoffDuration(), + getParentForChildren(), + isClean()); + minBackoffDuration_ = null; + } + return minBackoffDurationBuilder_; + } + + private com.google.protobuf.Duration maxBackoffDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> maxBackoffDurationBuilder_; + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public boolean hasMaxBackoffDuration() { + return maxBackoffDurationBuilder_ != null || maxBackoffDuration_ != null; + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public com.google.protobuf.Duration getMaxBackoffDuration() { + if (maxBackoffDurationBuilder_ == null) { + return maxBackoffDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxBackoffDuration_; + } else { + return maxBackoffDurationBuilder_.getMessage(); + } + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public Builder setMaxBackoffDuration(com.google.protobuf.Duration value) { + if (maxBackoffDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxBackoffDuration_ = value; + onChanged(); + } else { + maxBackoffDurationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public Builder setMaxBackoffDuration( + com.google.protobuf.Duration.Builder builderForValue) { + if (maxBackoffDurationBuilder_ == null) { + maxBackoffDuration_ = builderForValue.build(); + onChanged(); + } else { + maxBackoffDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public Builder mergeMaxBackoffDuration(com.google.protobuf.Duration value) { + if (maxBackoffDurationBuilder_ == null) { + if (maxBackoffDuration_ != null) { + maxBackoffDuration_ = + com.google.protobuf.Duration.newBuilder(maxBackoffDuration_).mergeFrom(value).buildPartial(); + } else { + maxBackoffDuration_ = value; + } + onChanged(); + } else { + maxBackoffDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public Builder clearMaxBackoffDuration() { + if (maxBackoffDurationBuilder_ == null) { + maxBackoffDuration_ = null; + onChanged(); + } else { + maxBackoffDuration_ = null; + maxBackoffDurationBuilder_ = null; + } + + return this; + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public com.google.protobuf.Duration.Builder getMaxBackoffDurationBuilder() { + + onChanged(); + return getMaxBackoffDurationFieldBuilder().getBuilder(); + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getMaxBackoffDurationOrBuilder() { + if (maxBackoffDurationBuilder_ != null) { + return maxBackoffDurationBuilder_.getMessageOrBuilder(); + } else { + return maxBackoffDuration_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : maxBackoffDuration_; + } + } + /** + *
+     * The maximum amount of time to wait before retrying a job after
+     * it fails.
+     * The default value of this field is 1 hour.
+     * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getMaxBackoffDurationFieldBuilder() { + if (maxBackoffDurationBuilder_ == null) { + maxBackoffDurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getMaxBackoffDuration(), + getParentForChildren(), + isClean()); + maxBackoffDuration_ = null; + } + return maxBackoffDurationBuilder_; + } + + private int maxDoublings_ ; + /** + *
+     * The time between retries will double `max_doublings` times.
+     * A job's retry interval starts at
+     * [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles
+     * `max_doublings` times, then increases linearly, and finally
+     * retries retries at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times.
+     * For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is
+     * 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and
+     * `max_doublings` is 3, then the a job will first be retried in 10s. The
+     * retry interval will double three times, and then increase linearly by
+     * 2^3 * 10s.  Finally, the job will retry at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has
+     * been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the
+     * requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
+     * The default value of this field is 5.
+     * 
+ * + * int32 max_doublings = 5; + */ + public int getMaxDoublings() { + return maxDoublings_; + } + /** + *
+     * The time between retries will double `max_doublings` times.
+     * A job's retry interval starts at
+     * [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles
+     * `max_doublings` times, then increases linearly, and finally
+     * retries retries at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times.
+     * For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is
+     * 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and
+     * `max_doublings` is 3, then the a job will first be retried in 10s. The
+     * retry interval will double three times, and then increase linearly by
+     * 2^3 * 10s.  Finally, the job will retry at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has
+     * been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the
+     * requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
+     * The default value of this field is 5.
+     * 
+ * + * int32 max_doublings = 5; + */ + public Builder setMaxDoublings(int value) { + + maxDoublings_ = value; + onChanged(); + return this; + } + /** + *
+     * The time between retries will double `max_doublings` times.
+     * A job's retry interval starts at
+     * [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles
+     * `max_doublings` times, then increases linearly, and finally
+     * retries retries at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to
+     * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times.
+     * For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is
+     * 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and
+     * `max_doublings` is 3, then the a job will first be retried in 10s. The
+     * retry interval will double three times, and then increase linearly by
+     * 2^3 * 10s.  Finally, the job will retry at intervals of
+     * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has
+     * been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the
+     * requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
+     * The default value of this field is 5.
+     * 
+ * + * int32 max_doublings = 5; + */ + public Builder clearMaxDoublings() { + + maxDoublings_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.scheduler.v1beta1.RetryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.RetryConfig) + private static final com.google.cloud.scheduler.v1beta1.RetryConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.RetryConfig(); + } + + public static com.google.cloud.scheduler.v1beta1.RetryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RetryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RetryConfig(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.scheduler.v1beta1.RetryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfigOrBuilder.java new file mode 100644 index 000000000000..c46dcdfdce6e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RetryConfigOrBuilder.java @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/job.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface RetryConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.RetryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The number of attempts that the system will make to run a job using the
+   * exponential backoff procedure described by
+   * [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings].
+   * The default value of retry_count is zero.
+   * If retry_count is zero, a job attempt will *not* be retried if
+   * it fails. Instead the Cloud Scheduler system will wait for the
+   * next scheduled execution time.
+   * If retry_count is set to a non-zero number then Cloud Scheduler
+   * will retry failed attempts, using exponential backoff,
+   * retry_count times, or until the next scheduled execution time,
+   * whichever comes first.
+   * Values greater than 5 and negative values are not allowed.
+   * 
+ * + * int32 retry_count = 1; + */ + int getRetryCount(); + + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + boolean hasMaxRetryDuration(); + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + com.google.protobuf.Duration getMaxRetryDuration(); + /** + *
+   * The time limit for retrying a failed job, measured from time when an
+   * execution was first attempted. If specified with
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are
+   * reached.
+   * The default value for max_retry_duration is zero, which means retry
+   * duration is unlimited.
+   * 
+ * + * .google.protobuf.Duration max_retry_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getMaxRetryDurationOrBuilder(); + + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + boolean hasMinBackoffDuration(); + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + com.google.protobuf.Duration getMinBackoffDuration(); + /** + *
+   * The minimum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 5 seconds.
+   * 
+ * + * .google.protobuf.Duration min_backoff_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getMinBackoffDurationOrBuilder(); + + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + boolean hasMaxBackoffDuration(); + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + com.google.protobuf.Duration getMaxBackoffDuration(); + /** + *
+   * The maximum amount of time to wait before retrying a job after
+   * it fails.
+   * The default value of this field is 1 hour.
+   * 
+ * + * .google.protobuf.Duration max_backoff_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getMaxBackoffDurationOrBuilder(); + + /** + *
+   * The time between retries will double `max_doublings` times.
+   * A job's retry interval starts at
+   * [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles
+   * `max_doublings` times, then increases linearly, and finally
+   * retries retries at intervals of
+   * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to
+   * [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times.
+   * For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is
+   * 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and
+   * `max_doublings` is 3, then the a job will first be retried in 10s. The
+   * retry interval will double three times, and then increase linearly by
+   * 2^3 * 10s.  Finally, the job will retry at intervals of
+   * [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has
+   * been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the
+   * requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
+   * The default value of this field is 5.
+   * 
+ * + * int32 max_doublings = 5; + */ + int getMaxDoublings(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequest.java new file mode 100644 index 000000000000..2ea229fddc59 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequest.java @@ -0,0 +1,593 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for forcing a job to run now using
+ * [RunJob][google.cloud.scheduler.v1beta1.CloudScheduler.RunJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.RunJobRequest} + */ +public final class RunJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.RunJobRequest) + RunJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use RunJobRequest.newBuilder() to construct. + private RunJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RunJobRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RunJobRequest( + 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.RunJobRequest.class, com.google.cloud.scheduler.v1beta1.RunJobRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.scheduler.v1beta1.RunJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.RunJobRequest other = (com.google.cloud.scheduler.v1beta1.RunJobRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.scheduler.v1beta1.RunJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest 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.scheduler.v1beta1.RunJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest 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.scheduler.v1beta1.RunJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest 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.scheduler.v1beta1.RunJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest 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.scheduler.v1beta1.RunJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.RunJobRequest 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.scheduler.v1beta1.RunJobRequest 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 forcing a job to run now using
+   * [RunJob][google.cloud.scheduler.v1beta1.CloudScheduler.RunJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.RunJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.RunJobRequest) + com.google.cloud.scheduler.v1beta1.RunJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.RunJobRequest.class, com.google.cloud.scheduler.v1beta1.RunJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.RunJobRequest.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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RunJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.RunJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RunJobRequest build() { + com.google.cloud.scheduler.v1beta1.RunJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.RunJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.RunJobRequest result = new com.google.cloud.scheduler.v1beta1.RunJobRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.RunJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.RunJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.RunJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.RunJobRequest.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.scheduler.v1beta1.RunJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.RunJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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 job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required.
+     * The job name. For example:
+     * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_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.setUnknownFieldsProto3(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.scheduler.v1beta1.RunJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.RunJobRequest) + private static final com.google.cloud.scheduler.v1beta1.RunJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.RunJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.RunJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunJobRequest(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.scheduler.v1beta1.RunJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequestOrBuilder.java new file mode 100644 index 000000000000..7f7c5644b876 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/RunJobRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface RunJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.RunJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required.
+   * The job name. For example:
+   * `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/SchedulerProto.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/SchedulerProto.java new file mode 100644 index 000000000000..a2664ab7c682 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/SchedulerProto.java @@ -0,0 +1,209 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public final class SchedulerProto { + private SchedulerProto() {} + 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_scheduler_v1beta1_ListJobsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/scheduler/v1beta1/cloudsc" + + "heduler.proto\022\036google.cloud.scheduler.v1" + + "beta1\032\034google/api/annotations.proto\032(goo" + + "gle/cloud/scheduler/v1beta1/job.proto\032\033g" + + "oogle/protobuf/empty.proto\032 google/proto" + + "buf/field_mask.proto\"H\n\017ListJobsRequest\022" + + "\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\005 \001(\005\022\022\n\npa" + + "ge_token\030\006 \001(\t\"^\n\020ListJobsResponse\0221\n\004jo" + + "bs\030\001 \003(\0132#.google.cloud.scheduler.v1beta" + + "1.Job\022\027\n\017next_page_token\030\002 \001(\t\"\035\n\rGetJob" + + "Request\022\014\n\004name\030\001 \001(\t\"T\n\020CreateJobReques" + + "t\022\016\n\006parent\030\001 \001(\t\0220\n\003job\030\002 \001(\0132#.google." + + "cloud.scheduler.v1beta1.Job\"u\n\020UpdateJob" + + "Request\0220\n\003job\030\001 \001(\0132#.google.cloud.sche" + + "duler.v1beta1.Job\022/\n\013update_mask\030\002 \001(\0132\032" + + ".google.protobuf.FieldMask\" \n\020DeleteJobR" + + "equest\022\014\n\004name\030\001 \001(\t\"\037\n\017PauseJobRequest\022" + + "\014\n\004name\030\001 \001(\t\" \n\020ResumeJobRequest\022\014\n\004nam" + + "e\030\001 \001(\t\"\035\n\rRunJobRequest\022\014\n\004name\030\001 \001(\t2\210" + + "\n\n\016CloudScheduler\022\244\001\n\010ListJobs\022/.google." + + "cloud.scheduler.v1beta1.ListJobsRequest\032" + + "0.google.cloud.scheduler.v1beta1.ListJob" + + "sResponse\"5\202\323\344\223\002/\022-/v1beta1/{parent=proj" + + "ects/*/locations/*}/jobs\022\223\001\n\006GetJob\022-.go" + + "ogle.cloud.scheduler.v1beta1.GetJobReque" + + "st\032#.google.cloud.scheduler.v1beta1.Job\"" + + "5\202\323\344\223\002/\022-/v1beta1/{name=projects/*/locat" + + "ions/*/jobs/*}\022\236\001\n\tCreateJob\0220.google.cl" + + "oud.scheduler.v1beta1.CreateJobRequest\032#" + + ".google.cloud.scheduler.v1beta1.Job\":\202\323\344" + + "\223\0024\"-/v1beta1/{parent=projects/*/locatio" + + "ns/*}/jobs:\003job\022\242\001\n\tUpdateJob\0220.google.c" + + "loud.scheduler.v1beta1.UpdateJobRequest\032" + + "#.google.cloud.scheduler.v1beta1.Job\">\202\323" + + "\344\223\002821/v1beta1/{job.name=projects/*/loca" + + "tions/*/jobs/*}:\003job\022\214\001\n\tDeleteJob\0220.goo" + + "gle.cloud.scheduler.v1beta1.DeleteJobReq" + + "uest\032\026.google.protobuf.Empty\"5\202\323\344\223\002/*-/v" + + "1beta1/{name=projects/*/locations/*/jobs" + + "/*}\022\240\001\n\010PauseJob\022/.google.cloud.schedule" + + "r.v1beta1.PauseJobRequest\032#.google.cloud" + + ".scheduler.v1beta1.Job\">\202\323\344\223\0028\"3/v1beta1" + + "/{name=projects/*/locations/*/jobs/*}:pa" + + "use:\001*\022\243\001\n\tResumeJob\0220.google.cloud.sche" + + "duler.v1beta1.ResumeJobRequest\032#.google." + + "cloud.scheduler.v1beta1.Job\"?\202\323\344\223\0029\"4/v1" + + "beta1/{name=projects/*/locations/*/jobs/" + + "*}:resume:\001*\022\232\001\n\006RunJob\022-.google.cloud.s" + + "cheduler.v1beta1.RunJobRequest\032#.google." + + "cloud.scheduler.v1beta1.Job\"<\202\323\344\223\0026\"1/v1" + + "beta1/{name=projects/*/locations/*/jobs/" + + "*}:run:\001*B\177\n\"com.google.cloud.scheduler." + + "v1beta1B\016SchedulerProtoP\001ZGgoogle.golang" + + ".org/genproto/googleapis/cloud/scheduler" + + "/v1beta1;schedulerb\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.scheduler.v1beta1.JobProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_ListJobsRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_ListJobsResponse_descriptor, + new java.lang.String[] { "Jobs", "NextPageToken", }); + internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_GetJobRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_CreateJobRequest_descriptor, + new java.lang.String[] { "Parent", "Job", }); + internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor, + new java.lang.String[] { "Job", "UpdateMask", }); + internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_DeleteJobRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_PauseJobRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_ResumeJobRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_RunJobRequest_descriptor, + new java.lang.String[] { "Name", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.scheduler.v1beta1.JobProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/TargetProto.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/TargetProto.java new file mode 100644 index 000000000000..96dc186465c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/TargetProto.java @@ -0,0 +1,154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/target.proto + +package com.google.cloud.scheduler.v1beta1; + +public final class TargetProto { + private TargetProto() {} + 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_scheduler_v1beta1_HttpTarget_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_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/scheduler/v1beta1/target." + + "proto\022\036google.cloud.scheduler.v1beta1\032\034g" + + "oogle/api/annotations.proto\032\031google/prot" + + "obuf/any.proto\"\342\001\n\nHttpTarget\022\013\n\003uri\030\001 \001" + + "(\t\022?\n\013http_method\030\002 \001(\0162*.google.cloud.s" + + "cheduler.v1beta1.HttpMethod\022H\n\007headers\030\003" + + " \003(\01327.google.cloud.scheduler.v1beta1.Ht" + + "tpTarget.HeadersEntry\022\014\n\004body\030\004 \001(\014\032.\n\014H" + + "eadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\"\313\002\n\023AppEngineHttpTarget\022?\n\013http_meth" + + "od\030\001 \001(\0162*.google.cloud.scheduler.v1beta" + + "1.HttpMethod\022L\n\022app_engine_routing\030\002 \001(\013" + + "20.google.cloud.scheduler.v1beta1.AppEng" + + "ineRouting\022\024\n\014relative_uri\030\003 \001(\t\022Q\n\007head" + + "ers\030\004 \003(\0132@.google.cloud.scheduler.v1bet" + + "a1.AppEngineHttpTarget.HeadersEntry\022\014\n\004b" + + "ody\030\005 \001(\014\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"\265\001\n\014PubsubTarget\022\022\n\nto" + + "pic_name\030\001 \001(\t\022\014\n\004data\030\003 \001(\014\022P\n\nattribut" + + "es\030\004 \003(\0132<.google.cloud.scheduler.v1beta" + + "1.PubsubTarget.AttributesEntry\0321\n\017Attrib" + + "utesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"T\n\020AppEngineRouting\022\017\n\007service\030\001 \001(\t\022\017" + + "\n\007version\030\002 \001(\t\022\020\n\010instance\030\003 \001(\t\022\014\n\004hos" + + "t\030\004 \001(\t*s\n\nHttpMethod\022\033\n\027HTTP_METHOD_UNS" + + "PECIFIED\020\000\022\010\n\004POST\020\001\022\007\n\003GET\020\002\022\010\n\004HEAD\020\003\022" + + "\007\n\003PUT\020\004\022\n\n\006DELETE\020\005\022\t\n\005PATCH\020\006\022\013\n\007OPTIO" + + "NS\020\007B|\n\"com.google.cloud.scheduler.v1bet" + + "a1B\013TargetProtoP\001ZGgoogle.golang.org/gen" + + "proto/googleapis/cloud/scheduler/v1beta1" + + ";schedulerb\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.protobuf.AnyProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor, + new java.lang.String[] { "Uri", "HttpMethod", "Headers", "Body", }); + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_descriptor = + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_HttpTarget_HeadersEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor, + new java.lang.String[] { "HttpMethod", "AppEngineRouting", "RelativeUri", "Headers", "Body", }); + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_descriptor = + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_AppEngineHttpTarget_HeadersEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor, + new java.lang.String[] { "TopicName", "Data", "Attributes", }); + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_descriptor = + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_PubsubTarget_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_scheduler_v1beta1_AppEngineRouting_descriptor, + new java.lang.String[] { "Service", "Version", "Instance", "Host", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequest.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequest.java new file mode 100644 index 000000000000..f843ff1d8cf4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +/** + *
+ * Request message for [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob].
+ * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.UpdateJobRequest} + */ +public final class UpdateJobRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.scheduler.v1beta1.UpdateJobRequest) + UpdateJobRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateJobRequest.newBuilder() to construct. + private UpdateJobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateJobRequest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateJobRequest( + 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.scheduler.v1beta1.Job.Builder subBuilder = null; + if (job_ != null) { + subBuilder = job_.toBuilder(); + } + job_ = input.readMessage(com.google.cloud.scheduler.v1beta1.Job.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(job_); + job_ = 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 (!parseUnknownFieldProto3( + 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.UpdateJobRequest.class, com.google.cloud.scheduler.v1beta1.UpdateJobRequest.Builder.class); + } + + public static final int JOB_FIELD_NUMBER = 1; + private com.google.cloud.scheduler.v1beta1.Job job_; + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public boolean hasJob() { + return job_ != null; + } + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job getJob() { + return job_ == null ? com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder() { + return getJob(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .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 (job_ != null) { + output.writeMessage(1, getJob()); + } + 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 (job_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getJob()); + } + 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.scheduler.v1beta1.UpdateJobRequest)) { + return super.equals(obj); + } + com.google.cloud.scheduler.v1beta1.UpdateJobRequest other = (com.google.cloud.scheduler.v1beta1.UpdateJobRequest) obj; + + boolean result = true; + result = result && (hasJob() == other.hasJob()); + if (hasJob()) { + result = result && getJob() + .equals(other.getJob()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasJob()) { + hash = (37 * hash) + JOB_FIELD_NUMBER; + hash = (53 * hash) + getJob().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.scheduler.v1beta1.UpdateJobRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest 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.scheduler.v1beta1.UpdateJobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest 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.scheduler.v1beta1.UpdateJobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest 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.scheduler.v1beta1.UpdateJobRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest 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.scheduler.v1beta1.UpdateJobRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest 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.scheduler.v1beta1.UpdateJobRequest 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 [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob].
+   * 
+ * + * Protobuf type {@code google.cloud.scheduler.v1beta1.UpdateJobRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.scheduler.v1beta1.UpdateJobRequest) + com.google.cloud.scheduler.v1beta1.UpdateJobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.scheduler.v1beta1.UpdateJobRequest.class, com.google.cloud.scheduler.v1beta1.UpdateJobRequest.Builder.class); + } + + // Construct using com.google.cloud.scheduler.v1beta1.UpdateJobRequest.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 (jobBuilder_ == null) { + job_ = null; + } else { + job_ = null; + jobBuilder_ = 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.scheduler.v1beta1.SchedulerProto.internal_static_google_cloud_scheduler_v1beta1_UpdateJobRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.UpdateJobRequest getDefaultInstanceForType() { + return com.google.cloud.scheduler.v1beta1.UpdateJobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.UpdateJobRequest build() { + com.google.cloud.scheduler.v1beta1.UpdateJobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.scheduler.v1beta1.UpdateJobRequest buildPartial() { + com.google.cloud.scheduler.v1beta1.UpdateJobRequest result = new com.google.cloud.scheduler.v1beta1.UpdateJobRequest(this); + if (jobBuilder_ == null) { + result.job_ = job_; + } else { + result.job_ = jobBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.scheduler.v1beta1.UpdateJobRequest) { + return mergeFrom((com.google.cloud.scheduler.v1beta1.UpdateJobRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.scheduler.v1beta1.UpdateJobRequest other) { + if (other == com.google.cloud.scheduler.v1beta1.UpdateJobRequest.getDefaultInstance()) return this; + if (other.hasJob()) { + mergeJob(other.getJob()); + } + 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.scheduler.v1beta1.UpdateJobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.scheduler.v1beta1.UpdateJobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.scheduler.v1beta1.Job job_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> jobBuilder_; + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public boolean hasJob() { + return jobBuilder_ != null || job_ != null; + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job getJob() { + if (jobBuilder_ == null) { + return job_ == null ? com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } else { + return jobBuilder_.getMessage(); + } + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public Builder setJob(com.google.cloud.scheduler.v1beta1.Job value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + job_ = value; + onChanged(); + } else { + jobBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public Builder setJob( + com.google.cloud.scheduler.v1beta1.Job.Builder builderForValue) { + if (jobBuilder_ == null) { + job_ = builderForValue.build(); + onChanged(); + } else { + jobBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public Builder mergeJob(com.google.cloud.scheduler.v1beta1.Job value) { + if (jobBuilder_ == null) { + if (job_ != null) { + job_ = + com.google.cloud.scheduler.v1beta1.Job.newBuilder(job_).mergeFrom(value).buildPartial(); + } else { + job_ = value; + } + onChanged(); + } else { + jobBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public Builder clearJob() { + if (jobBuilder_ == null) { + job_ = null; + onChanged(); + } else { + job_ = null; + jobBuilder_ = null; + } + + return this; + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public com.google.cloud.scheduler.v1beta1.Job.Builder getJobBuilder() { + + onChanged(); + return getJobFieldBuilder().getBuilder(); + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + public com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder() { + if (jobBuilder_ != null) { + return jobBuilder_.getMessageOrBuilder(); + } else { + return job_ == null ? + com.google.cloud.scheduler.v1beta1.Job.getDefaultInstance() : job_; + } + } + /** + *
+     * Required.
+     * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+     * Output only fields cannot be modified using UpdateJob.
+     * Any value specified for an output only field will be ignored.
+     * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder> + getJobFieldBuilder() { + if (jobBuilder_ == null) { + jobBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.scheduler.v1beta1.Job, com.google.cloud.scheduler.v1beta1.Job.Builder, com.google.cloud.scheduler.v1beta1.JobOrBuilder>( + getJob(), + getParentForChildren(), + isClean()); + job_ = null; + } + return jobBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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(); + } + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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; + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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; + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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; + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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_; + } + } + /** + *
+     * A  mask used to specify which fields of the job are being updated.
+     * 
+ * + * .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.setUnknownFieldsProto3(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.scheduler.v1beta1.UpdateJobRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.scheduler.v1beta1.UpdateJobRequest) + private static final com.google.cloud.scheduler.v1beta1.UpdateJobRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.scheduler.v1beta1.UpdateJobRequest(); + } + + public static com.google.cloud.scheduler.v1beta1.UpdateJobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateJobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateJobRequest(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.scheduler.v1beta1.UpdateJobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequestOrBuilder.java new file mode 100644 index 000000000000..7201b3977b4a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/UpdateJobRequestOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/scheduler/v1beta1/cloudscheduler.proto + +package com.google.cloud.scheduler.v1beta1; + +public interface UpdateJobRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.scheduler.v1beta1.UpdateJobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + boolean hasJob(); + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + com.google.cloud.scheduler.v1beta1.Job getJob(); + /** + *
+   * Required.
+   * The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
+   * Output only fields cannot be modified using UpdateJob.
+   * Any value specified for an output only field will be ignored.
+   * 
+ * + * .google.cloud.scheduler.v1beta1.Job job = 1; + */ + com.google.cloud.scheduler.v1beta1.JobOrBuilder getJobOrBuilder(); + + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * A  mask used to specify which fields of the job are being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/cloudscheduler.proto b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/cloudscheduler.proto new file mode 100644 index 000000000000..56390c9df173 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/cloudscheduler.proto @@ -0,0 +1,236 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.scheduler.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/scheduler/v1beta1/job.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/scheduler/v1beta1;scheduler"; +option java_multiple_files = true; +option java_outer_classname = "SchedulerProto"; +option java_package = "com.google.cloud.scheduler.v1beta1"; + + +// The Cloud Scheduler API allows external entities to reliably +// schedule asynchronous jobs. +service CloudScheduler { + // Lists jobs. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/jobs" + }; + } + + // Gets a job. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/jobs/*}" + }; + } + + // Creates a job. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + } + + // Updates a job. + // + // If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does + // not exist, `NOT_FOUND` is returned. + // + // If UpdateJob does not successfully return, it is possible for the + // job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may + // not be executed. If this happens, retry the UpdateJob request + // until a successful response is received. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v1beta1/{job.name=projects/*/locations/*/jobs/*}" + body: "job" + }; + } + + // Deletes a job. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/jobs/*}" + }; + } + + // Pauses a job. + // + // If a job is paused then the system will stop executing the job + // until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The + // state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it + // will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] + // to be paused. + rpc PauseJob(PauseJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/jobs/*}:pause" + body: "*" + }; + } + + // Resume a job. + // + // This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The + // state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it + // will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in + // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed. + rpc ResumeJob(ResumeJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/jobs/*}:resume" + body: "*" + }; + } + + // Forces a job to run now. + // + // When this method is called, Cloud Scheduler will dispatch the job, even + // if the job is already running. + rpc RunJob(RunJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/jobs/*}:run" + body: "*" + }; + } +} + +// Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. +message ListJobsRequest { + // Required. + // + // The location name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID`. + string parent = 1; + + // Requested page size. + // + // The maximum page size is 500. If unspecified, the page size will + // be the maximum. Fewer jobs than requested might be returned, + // even if more jobs exist; use next_page_token to determine if more + // jobs exist. + int32 page_size = 5; + + // A token identifying a page of results the server will return. To + // request the first page results, page_token must be empty. To + // request the next page of results, page_token must be the value of + // [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from + // the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to + // switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or + // [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages. + string page_token = 6; +} + +// Response message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. +message ListJobsResponse { + // The list of jobs. + repeated Job jobs = 1; + + // A token to retrieve next page of results. Pass this value in the + // [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to + // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results. + // If this is empty it indicates that there are no more results + // through which to paginate. + // + // The page token is valid for only 2 hours. + string next_page_token = 2; +} + +// Request message for [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob]. +message GetJobRequest { + // Required. + // + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + string name = 1; +} + +// Request message for [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob]. +message CreateJobRequest { + // Required. + // + // The location name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID`. + string parent = 1; + + // Required. + // + // The job to add. The user can optionally specify a name for the + // job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an + // existing job. If a name is not specified then the system will + // generate a random unique name that will be returned + // ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response. + Job job = 2; +} + +// Request message for [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. +message UpdateJobRequest { + // Required. + // + // The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified. + // + // Output only fields cannot be modified using UpdateJob. + // Any value specified for an output only field will be ignored. + Job job = 1; + + // A mask used to specify which fields of the job are being updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for deleting a job using +// [DeleteJob][google.cloud.scheduler.v1beta1.CloudScheduler.DeleteJob]. +message DeleteJobRequest { + // Required. + // + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + string name = 1; +} + +// Request message for [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob]. +message PauseJobRequest { + // Required. + // + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + string name = 1; +} + +// Request message for [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. +message ResumeJobRequest { + // Required. + // + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + string name = 1; +} + +// Request message for forcing a job to run now using +// [RunJob][google.cloud.scheduler.v1beta1.CloudScheduler.RunJob]. +message RunJobRequest { + // Required. + // + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + string name = 1; +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/job.proto b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/job.proto new file mode 100644 index 000000000000..32fea587bc4e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/job.proto @@ -0,0 +1,212 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.scheduler.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/scheduler/v1beta1/target.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/scheduler/v1beta1;scheduler"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.scheduler.v1beta1"; + + +// Configuration for a job. +// The maximum allowed size for a job is 100KB. +message Job { + // State of the job. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The job is executing normally. + ENABLED = 1; + + // The job is paused by the user. It will not execute. A user can + // intentionally pause the job using + // [PauseJobRequest][google.cloud.scheduler.v1beta1.PauseJobRequest]. + PAUSED = 2; + + // The job is disabled by the system due to error. The user + // cannot directly set a job to be disabled. + DISABLED = 3; + + // The job state resulting from a failed [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] + // operation. To recover a job from this state, retry + // [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] until a successful response is received. + UPDATE_FAILED = 4; + } + + // The job name. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + // + // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + // hyphens (-), colons (:), or periods (.). + // For more information, see + // [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + // * `LOCATION_ID` is the canonical ID for the job's location. + // The list of available locations can be obtained by calling + // [ListLocations][google.cloud.location.Locations.ListLocations]. + // For more information, see https://cloud.google.com/about/locations/. + // * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + // hyphens (-), or underscores (_). The maximum length is 500 characters. + string name = 1; + + // A human-readable description for the job. This string must not contain + // more than 500 characters. + string description = 2; + + // Required. + // + // Delivery settings containing destination and parameters. + oneof target { + // Pub/Sub target. + PubsubTarget pubsub_target = 4; + + // App Engine HTTP target. + AppEngineHttpTarget app_engine_http_target = 5; + + // HTTP target. + HttpTarget http_target = 6; + } + + // Required. + // + // Describes the schedule on which the job will be executed. + // + // As a general rule, execution `n + 1` of a job will not begin + // until execution `n` has finished. Cloud Scheduler will never + // allow two simultaneously outstanding executions. For example, + // this implies that if the `n+1`th execution is scheduled to run at + // 16:00 but the `n`th execution takes until 16:15, the `n+1`th + // execution will not start until `16:15`. + // A scheduled start time will be delayed if the previous + // execution has not ended when its scheduled time occurs. + // + // If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails, + // the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] + // times, with exponential backoff, until the next scheduled start + // time. + // + // The schedule can be either of the following types: + // + // * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview) + // * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + string schedule = 20; + + // Specifies the time zone to be used in interpreting + // [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time + // zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database). + // + // Note that some time zones include a provision for + // daylight savings time. The rules for daylight saving time are + // determined by the chosen tz. For UTC use the string "utc". If a + // time zone is not specified, the default will be in UTC (also known + // as GMT). + string time_zone = 21; + + // Output only. The creation time of the job. + google.protobuf.Timestamp user_update_time = 9; + + // Output only. State of the job. + State state = 10; + + // Output only. The response from the target for the last attempted execution. + google.rpc.Status status = 11; + + // Output only. The next time the job is scheduled. Note that this may be a + // retry of a previously failed attempt or the next execution time + // according to the schedule. + google.protobuf.Timestamp schedule_time = 17; + + // Output only. The time the last job attempt started. + google.protobuf.Timestamp last_attempt_time = 18; + + // Settings that determine the retry behavior. + RetryConfig retry_config = 19; +} + +// Settings that determine the retry behavior. +// +// By default, if a job does not complete successfully (meaning that +// an acknowledgement is not received from the handler, then it will be retried +// with exponential backoff according to the settings in [RetryConfig][google.cloud.scheduler.v1beta1.RetryConfig]. +message RetryConfig { + // The number of attempts that the system will make to run a job using the + // exponential backoff procedure described by + // [max_doublings][google.cloud.scheduler.v1beta1.RetryConfig.max_doublings]. + // + // The default value of retry_count is zero. + // + // If retry_count is zero, a job attempt will *not* be retried if + // it fails. Instead the Cloud Scheduler system will wait for the + // next scheduled execution time. + // + // If retry_count is set to a non-zero number then Cloud Scheduler + // will retry failed attempts, using exponential backoff, + // retry_count times, or until the next scheduled execution time, + // whichever comes first. + // + // Values greater than 5 and negative values are not allowed. + int32 retry_count = 1; + + // The time limit for retrying a failed job, measured from time when an + // execution was first attempted. If specified with + // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both limits are + // reached. + // + // The default value for max_retry_duration is zero, which means retry + // duration is unlimited. + google.protobuf.Duration max_retry_duration = 2; + + // The minimum amount of time to wait before retrying a job after + // it fails. + // + // The default value of this field is 5 seconds. + google.protobuf.Duration min_backoff_duration = 3; + + // The maximum amount of time to wait before retrying a job after + // it fails. + // + // The default value of this field is 1 hour. + google.protobuf.Duration max_backoff_duration = 4; + + // The time between retries will double `max_doublings` times. + // + // A job's retry interval starts at + // [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles + // `max_doublings` times, then increases linearly, and finally + // retries retries at intervals of + // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to + // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. + // + // For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is + // 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and + // `max_doublings` is 3, then the a job will first be retried in 10s. The + // retry interval will double three times, and then increase linearly by + // 2^3 * 10s. Finally, the job will retry at intervals of + // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has + // been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the + // requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + // + // The default value of this field is 5. + int32 max_doublings = 5; +} diff --git a/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/target.proto b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/target.proto new file mode 100644 index 000000000000..a3fc6426cfe6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-scheduler-v1beta1/src/main/proto/google/cloud/scheduler/v1beta1/target.proto @@ -0,0 +1,285 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.scheduler.v1beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/scheduler/v1beta1;scheduler"; +option java_multiple_files = true; +option java_outer_classname = "TargetProto"; +option java_package = "com.google.cloud.scheduler.v1beta1"; + + +// Http target. The job will be pushed to the job handler by means of +// an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.HttpTarget.http_method] such as HTTP +// POST, HTTP GET, etc. The job is acknowledged by means of an HTTP +// response code in the range [200 - 299]. A failure to receive a response +// constitutes a failed execution. For a redirected request, the response +// returned by the redirected request is considered. +message HttpTarget { + // Required. + // + // The full URI path that the request will be sent to. This string + // must begin with either "http://" or "https://". Some examples of + // valid values for [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri] are: + // `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + // encode some characters for safety and compatibility. The maximum allowed + // URL length is 2083 characters after encoding. + string uri = 1; + + // Which HTTP method to use for the request. + HttpMethod http_method = 2; + + // The user can specify HTTP request headers to send with the job's + // HTTP request. This map contains the header field names and + // values. Repeated headers are not supported, but a header value can + // contain commas. These headers represent a subset of the headers + // that will accompany the job's HTTP request. Some HTTP request + // headers will be ignored or replaced. A partial list of headers that + // will be ignored or replaced is below: + // - Host: This will be computed by Cloud Scheduler and derived from + // [uri][google.cloud.scheduler.v1beta1.HttpTarget.uri]. + // * `Content-Length`: This will be computed by Cloud Scheduler. + // * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + // * `X-Google-*`: Google internal use only. + // * `X-AppEngine-*`: Google internal use only. + // + // The total size of headers must be less than 80KB. + map headers = 3; + + // HTTP request body. A request body is allowed only if the HTTP + // method is POST, PUT, or PATCH. It is an error to set body on a job with an + // incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod]. + bytes body = 4; +} + +// App Engine target. The job will be pushed to a job handler by means +// of an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.http_method] such +// as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an +// HTTP response code in the range [200 - 299]. Error 503 is +// considered an App Engine system error instead of an application +// error. Requests returning error 503 will be retried regardless of +// retry configuration and not counted against retry counts. Any other +// response code, or a failure to receive a response before the +// deadline, constitutes a failed attempt. +message AppEngineHttpTarget { + // The HTTP method to use for the request. PATCH and OPTIONS are not + // permitted. + HttpMethod http_method = 1; + + // App Engine Routing setting for the job. + AppEngineRouting app_engine_routing = 2; + + // The relative URI. + // + // The relative URL must begin with "/" and must be a valid HTTP relative URL. + // It can contain a path, query string arguments, and `#` fragments. + // If the relative URL is empty, then the root path "/" will be used. + // No spaces are allowed, and the maximum length allowed is 2083 characters. + string relative_uri = 3; + + // HTTP request headers. + // + // This map contains the header field names and values. Headers can be set + // when the job is created. + // + // Cloud Scheduler sets some headers to default values: + // + // * `User-Agent`: By default, this header is + // `"AppEngine-Google; (+http://code.google.com/appengine)"`. + // This header can be modified, but Cloud Scheduler will append + // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + // modified `User-Agent`. + // + // If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets the + // following headers: + // + // * `Content-Type`: By default, the `Content-Type` header is set to + // `"application/octet-stream"`. The default can be overridden by explictly + // setting `Content-Type` to a particular media type when the job is + // created. + // For example, `Content-Type` can be set to `"application/json"`. + // * `Content-Length`: This is computed by Cloud Scheduler. This value is + // output only. It cannot be changed. + // + // The headers below are output only. They cannot be set or overridden: + // + // * `X-Google-*`: For Google internal use only. + // * `X-AppEngine-*`: For Google internal use only. See + // [Reading request headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + // + // In addition, some App Engine headers, which contain + // job-specific information, are also be sent to the job handler; see + // [request headers](https://cloud.google.comappengine/docs/standard/python/config/cron#securing_urls_for_cron). + map headers = 4; + + // Body. + // + // HTTP request body. A request body is allowed only if the HTTP method is + // POST or PUT. It will result in invalid argument error to set a body on a + // job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod]. + bytes body = 5; +} + +// Pub/Sub target. The job will be delivered by publishing a message to +// the given Pub/Sub topic. +message PubsubTarget { + // Required. + // + // The name of the Cloud Pub/Sub topic to which messages will + // be published when a job is delivered. The topic name must be in the + // same format as required by PubSub's + // [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + // for example `projects/PROJECT_ID/topics/TOPIC_ID`. + // + // The topic must be in the same project as the Cloud Scheduler job. + string topic_name = 1; + + // The message payload for PubsubMessage. + // + // Pubsub message must contain either non-empty data, or at least one + // attribute. + bytes data = 3; + + // Attributes for PubsubMessage. + // + // Pubsub message must contain either non-empty data, or at least one + // attribute. + map attributes = 4; +} + +// App Engine Routing. +// +// For more information about services, versions, and instances see +// [An Overview of App Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), +// [Microservices Architecture on Google App Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), +// [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), and +// [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). +message AppEngineRouting { + // App service. + // + // By default, the job is sent to the service which is the default + // service when the job is attempted. + string service = 1; + + // App version. + // + // By default, the job is sent to the version which is the default + // version when the job is attempted. + string version = 2; + + // App instance. + // + // By default, the job is sent to an instance which is available when + // the job is attempted. + // + // Requests can only be sent to a specific instance if + // [manual scaling is used in App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + // App Engine Flex does not support instances. For more information, see + // [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and + // [App Engine Flex request routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + string instance = 3; + + // Output only. The host that the job is sent to. + // + // For more information about how App Engine requests are routed, see + // [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + // + // The host is constructed as: + // + // + // * `host = [application_domain_name]`
+ // `| [service] + '.' + [application_domain_name]`
+ // `| [version] + '.' + [application_domain_name]`
+ // `| [version_dot_service]+ '.' + [application_domain_name]`
+ // `| [instance] + '.' + [application_domain_name]`
+ // `| [instance_dot_service] + '.' + [application_domain_name]`
+ // `| [instance_dot_version] + '.' + [application_domain_name]`
+ // `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + // + // * `application_domain_name` = The domain name of the app, for + // example .appspot.com, which is associated with the + // job's project ID. + // + // * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // + // * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + // + // * `version_dot_service =` + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +` + // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // + // * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] + // + // * `instance_dot_service =` + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` + // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // + // * `instance_dot_version =` + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + // + // * `instance_dot_version_dot_service =` + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +` + // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // + // + // If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent + // to the service which is the default service when the job is attempted. + // + // If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent + // to the version which is the default version when the job is attempted. + // + // If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be + // sent to an instance which is available when the job is attempted. + // + // If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service], + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent + // to the default version of the default service when the job is attempted. + string host = 4; +} + +// The HTTP method used to execute the job. +enum HttpMethod { + // HTTP method unspecified. Defaults to POST. + HTTP_METHOD_UNSPECIFIED = 0; + + // HTTP POST + POST = 1; + + // HTTP GET + GET = 2; + + // HTTP HEAD + HEAD = 3; + + // HTTP PUT + PUT = 4; + + // HTTP DELETE + DELETE = 5; + + // HTTP PATCH + PATCH = 6; + + // HTTP OPTIONS + OPTIONS = 7; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 95c39eb0adb1..345d7cdb97b4 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -586,6 +586,16 @@ google-cloud-resourcemanager 0.69.1-alpha-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-scheduler-v1beta1 + 0.34.1-SNAPSHOT + com.google.cloud google-cloud-spanner diff --git a/google-cloud-clients/google-cloud-scheduler/README.md b/google-cloud-clients/google-cloud-scheduler/README.md new file mode 100644 index 000000000000..e01411c2f2aa --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/README.md @@ -0,0 +1,114 @@ +Google Cloud Scheduler Java Client +================================== + +Java idiomatic client for [Cloud Scheduler][cloud-scheduler]. + +[![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-scheduler.svg)]( https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-scheduler.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) + +- [Product Documentation][scheduler-product-docs] +- [Client Library Documentation][scheduler-client-lib-docs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-scheduler:released}) +Add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-scheduler + 0.69.0-alpha + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-scheduler:0.69.0-alpha' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-scheduler" % "0.69.0-alpha" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) section in the base directory's README. + +About Cloud Scheduler +--------------------- + +[Cloud Scheduler][cloud-scheduler] is a fully managed, enterprise-grade scheduler. + +See the [Cloud Scheduler client library docs][scheduler-client-lib-docs] to learn how to interact with the +Cloud Scheduler using this Client Library. + +Getting Started +--------------- +#### Prerequisites +For this tutorial, you will need a +[Google Developers Console](https://console.developers.google.com/) project with the Cloud Scheduler API +enabled. You will need to [enable billing](https://support.google.com/cloud/answer/6158867?hl=en) to +use Google Cloud Scheduler. +[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-scheduler` library. See the [Quickstart](#quickstart) section +to add `google-cloud-scheduler` as a dependency in your code. + +Transport +--------- +Cloud Scheduler uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Testing +------- + +This library has tools to help make tests for code using Cloud Scheduler. + +See [TESTING] to read more about testing. + +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 +[TESTING]: https://github.com/googleapis/google-cloud-java/blob/master/TESTING.md#testing-code-that-uses-scheduler + +[cloud-scheduler]: https://cloud.google.com/scheduler/ +[scheduler-product-docs]: https://cloud.google.com/scheduler/docs/quickstart +[scheduler-client-lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/scheduler/v1/package-summary.html diff --git a/google-cloud-clients/google-cloud-scheduler/pom.xml b/google-cloud-clients/google-cloud-scheduler/pom.xml new file mode 100644 index 000000000000..59c7f93433d0 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + google-cloud-scheduler + 0.69.1-alpha-SNAPSHOT + jar + Google Cloud Scheduler + https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-scheduler + + Fully managed cron job service. + + + com.google.cloud + google-cloud-clients + 0.69.1-alpha-SNAPSHOT + + + google-cloud-scheduler + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-scheduler-v1beta1 + + + com.google.api.grpc + grpc-google-cloud-scheduler-v1beta1 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + com.google.auto.value + auto-value + compile + + + ${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 + + + diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java new file mode 100644 index 000000000000..7ca5c961f6ab --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java @@ -0,0 +1,987 @@ +/* + * 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 + * + * 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.scheduler.v1beta1; + +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.scheduler.v1beta1.stub.CloudSchedulerStub; +import com.google.cloud.scheduler.v1beta1.stub.CloudSchedulerStubSettings; +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 Scheduler API allows external entities to reliably schedule + * asynchronous jobs. + * + *

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 (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+ *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+ *   Job response = cloudSchedulerClient.getJob(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the cloudSchedulerClient 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 CloudSchedulerSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * CloudSchedulerSettings cloudSchedulerSettings =
+ *     CloudSchedulerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudSchedulerClient cloudSchedulerClient =
+ *     CloudSchedulerClient.create(cloudSchedulerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * CloudSchedulerSettings cloudSchedulerSettings =
+ *     CloudSchedulerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudSchedulerClient cloudSchedulerClient =
+ *     CloudSchedulerClient.create(cloudSchedulerSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudSchedulerClient implements BackgroundResource { + private final CloudSchedulerSettings settings; + private final CloudSchedulerStub stub; + + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private static final PathTemplate LOCATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private static final PathTemplate JOB_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/jobs/{job}"); + + /** Formats a string containing the fully-qualified path to represent a project resource. */ + public static final String formatProjectName(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** Formats a string containing the fully-qualified path to represent a location resource. */ + 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 job resource. */ + public static final String formatJobName(String project, String location, String job) { + return JOB_PATH_TEMPLATE.instantiate( + "project", project, + "location", location, + "job", job); + } + + /** Parses the project from the given fully-qualified path which represents a project resource. */ + public static final String parseProjectFromProjectName(String projectName) { + return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); + } + + /** + * Parses the project from the given fully-qualified path which represents a location resource. + */ + 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. + */ + 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 job resource. */ + public static final String parseProjectFromJobName(String jobName) { + return JOB_PATH_TEMPLATE.parse(jobName).get("project"); + } + + /** Parses the location from the given fully-qualified path which represents a job resource. */ + public static final String parseLocationFromJobName(String jobName) { + return JOB_PATH_TEMPLATE.parse(jobName).get("location"); + } + + /** Parses the job from the given fully-qualified path which represents a job resource. */ + public static final String parseJobFromJobName(String jobName) { + return JOB_PATH_TEMPLATE.parse(jobName).get("job"); + } + + /** Constructs an instance of CloudSchedulerClient with default settings. */ + public static final CloudSchedulerClient create() throws IOException { + return create(CloudSchedulerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudSchedulerClient, 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 CloudSchedulerClient create(CloudSchedulerSettings settings) + throws IOException { + return new CloudSchedulerClient(settings); + } + + /** + * Constructs an instance of CloudSchedulerClient, using the given stub for making calls. This is + * for advanced usage - prefer to use CloudSchedulerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudSchedulerClient create(CloudSchedulerStub stub) { + return new CloudSchedulerClient(stub); + } + + /** + * Constructs an instance of CloudSchedulerClient, 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 CloudSchedulerClient(CloudSchedulerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudSchedulerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudSchedulerClient(CloudSchedulerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CloudSchedulerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudSchedulerStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists jobs. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   for (Job element : cloudSchedulerClient.listJobs(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. + *

The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListJobsPagedResponse listJobs(String parent) { + LOCATION_PATH_TEMPLATE.validate(parent, "listJobs"); + ListJobsRequest request = ListJobsRequest.newBuilder().setParent(parent).build(); + return listJobs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists jobs. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListJobsRequest request = ListJobsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Job element : cloudSchedulerClient.listJobs(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 ListJobsPagedResponse listJobs(ListJobsRequest request) { + return listJobsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists jobs. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListJobsRequest request = ListJobsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListJobsPagedResponse> future = cloudSchedulerClient.listJobsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Job element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listJobsPagedCallable() { + return stub.listJobsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists jobs. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   ListJobsRequest request = ListJobsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListJobsResponse response = cloudSchedulerClient.listJobsCallable().call(request);
+   *     for (Job element : response.getJobsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listJobsCallable() { + return stub.listJobsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   Job response = cloudSchedulerClient.getJob(formattedName);
+   * }
+   * 
+ * + * @param name Required. + *

The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job getJob(String name) { + JOB_PATH_TEMPLATE.validate(name, "getJob"); + GetJobRequest request = GetJobRequest.newBuilder().setName(name).build(); + return getJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   GetJobRequest request = GetJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Job response = cloudSchedulerClient.getJob(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 Job getJob(GetJobRequest request) { + return getJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   GetJobRequest request = GetJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.getJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getJobCallable() { + return stub.getJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Job job = Job.newBuilder().build();
+   *   Job response = cloudSchedulerClient.createJob(formattedParent, job);
+   * }
+   * 
+ * + * @param parent Required. + *

The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. + * @param job Required. + *

The job to add. The user can optionally specify a name for the job in + * [name][google.cloud.scheduler.v1beta1.Job.name]. + * [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an existing job. If a + * name is not specified then the system will generate a random unique name that will be + * returned ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job createJob(String parent, Job job) { + LOCATION_PATH_TEMPLATE.validate(parent, "createJob"); + CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent).setJob(job).build(); + return createJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Job job = Job.newBuilder().build();
+   *   CreateJobRequest request = CreateJobRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setJob(job)
+   *     .build();
+   *   Job response = cloudSchedulerClient.createJob(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 Job createJob(CreateJobRequest request) { + return createJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]");
+   *   Job job = Job.newBuilder().build();
+   *   CreateJobRequest request = CreateJobRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setJob(job)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.createJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createJobCallable() { + return stub.createJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a job. + * + *

If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job + * does not exist, `NOT_FOUND` is returned. + * + *

If UpdateJob does not successfully return, it is possible for the job to be in an + * [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job + * in this state may not be executed. If this happens, retry the UpdateJob request until a + * successful response is received. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   Job job = Job.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Job response = cloudSchedulerClient.updateJob(job, updateMask);
+   * }
+   * 
+ * + * @param job Required. + *

The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be + * specified. + *

Output only fields cannot be modified using UpdateJob. Any value specified for an output + * only field will be ignored. + * @param updateMask A mask used to specify which fields of the job are being updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job updateJob(Job job, FieldMask updateMask) { + + UpdateJobRequest request = + UpdateJobRequest.newBuilder().setJob(job).setUpdateMask(updateMask).build(); + return updateJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a job. + * + *

If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job + * does not exist, `NOT_FOUND` is returned. + * + *

If UpdateJob does not successfully return, it is possible for the job to be in an + * [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job + * in this state may not be executed. If this happens, retry the UpdateJob request until a + * successful response is received. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   Job job = Job.newBuilder().build();
+   *   UpdateJobRequest request = UpdateJobRequest.newBuilder()
+   *     .setJob(job)
+   *     .build();
+   *   Job response = cloudSchedulerClient.updateJob(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 Job updateJob(UpdateJobRequest request) { + return updateJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a job. + * + *

If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job + * does not exist, `NOT_FOUND` is returned. + * + *

If UpdateJob does not successfully return, it is possible for the job to be in an + * [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job + * in this state may not be executed. If this happens, retry the UpdateJob request until a + * successful response is received. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   Job job = Job.newBuilder().build();
+   *   UpdateJobRequest request = UpdateJobRequest.newBuilder()
+   *     .setJob(job)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.updateJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateJobCallable() { + return stub.updateJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   cloudSchedulerClient.deleteJob(formattedName);
+   * }
+   * 
+ * + * @param name Required. + *

The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteJob(String name) { + JOB_PATH_TEMPLATE.validate(name, "deleteJob"); + DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name).build(); + deleteJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   DeleteJobRequest request = DeleteJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   cloudSchedulerClient.deleteJob(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 void deleteJob(DeleteJobRequest request) { + deleteJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a job. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   DeleteJobRequest request = DeleteJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = cloudSchedulerClient.deleteJobCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteJobCallable() { + return stub.deleteJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Pauses a job. + * + *

If a job is paused then the system will stop executing the job until it is re-enabled via + * [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The state of the job is + * stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set to + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in + * [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be paused. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   Job response = cloudSchedulerClient.pauseJob(formattedName);
+   * }
+   * 
+ * + * @param name Required. + *

The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job pauseJob(String name) { + JOB_PATH_TEMPLATE.validate(name, "pauseJob"); + PauseJobRequest request = PauseJobRequest.newBuilder().setName(name).build(); + return pauseJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Pauses a job. + * + *

If a job is paused then the system will stop executing the job until it is re-enabled via + * [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The state of the job is + * stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set to + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in + * [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be paused. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   PauseJobRequest request = PauseJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Job response = cloudSchedulerClient.pauseJob(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 Job pauseJob(PauseJobRequest request) { + return pauseJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Pauses a job. + * + *

If a job is paused then the system will stop executing the job until it is re-enabled via + * [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The state of the job is + * stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set to + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in + * [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be paused. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   PauseJobRequest request = PauseJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.pauseJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable pauseJobCallable() { + return stub.pauseJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resume a job. + * + *

This method reenables a job after it has been + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The state of a job is + * stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it + * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job + * must be in [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   Job response = cloudSchedulerClient.resumeJob(formattedName);
+   * }
+   * 
+ * + * @param name Required. + *

The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job resumeJob(String name) { + JOB_PATH_TEMPLATE.validate(name, "resumeJob"); + ResumeJobRequest request = ResumeJobRequest.newBuilder().setName(name).build(); + return resumeJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resume a job. + * + *

This method reenables a job after it has been + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The state of a job is + * stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it + * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job + * must be in [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   ResumeJobRequest request = ResumeJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Job response = cloudSchedulerClient.resumeJob(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 Job resumeJob(ResumeJobRequest request) { + return resumeJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Resume a job. + * + *

This method reenables a job after it has been + * [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The state of a job is + * stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it + * will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job + * must be in [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   ResumeJobRequest request = ResumeJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.resumeJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable resumeJobCallable() { + return stub.resumeJobCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Forces a job to run now. + * + *

When this method is called, Cloud Scheduler will dispatch the job, even if the job is + * already running. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   Job response = cloudSchedulerClient.runJob(formattedName);
+   * }
+   * 
+ * + * @param name Required. + *

The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Job runJob(String name) { + JOB_PATH_TEMPLATE.validate(name, "runJob"); + RunJobRequest request = RunJobRequest.newBuilder().setName(name).build(); + return runJob(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Forces a job to run now. + * + *

When this method is called, Cloud Scheduler will dispatch the job, even if the job is + * already running. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   RunJobRequest request = RunJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Job response = cloudSchedulerClient.runJob(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 Job runJob(RunJobRequest request) { + return runJobCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Forces a job to run now. + * + *

When this method is called, Cloud Scheduler will dispatch the job, even if the job is + * already running. + * + *

Sample code: + * + *


+   * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+   *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+   *   RunJobRequest request = RunJobRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Job> future = cloudSchedulerClient.runJobCallable().futureCall(request);
+   *   // Do something
+   *   Job response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable runJobCallable() { + return stub.runJobCallable(); + } + + @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 ListJobsPagedResponse + extends AbstractPagedListResponse< + ListJobsRequest, ListJobsResponse, Job, ListJobsPage, ListJobsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListJobsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListJobsPagedResponse apply(ListJobsPage input) { + return new ListJobsPagedResponse(input); + } + }); + } + + private ListJobsPagedResponse(ListJobsPage page) { + super(page, ListJobsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListJobsPage + extends AbstractPage { + + private ListJobsPage( + PageContext context, ListJobsResponse response) { + super(context, response); + } + + private static ListJobsPage createEmptyPage() { + return new ListJobsPage(null, null); + } + + @Override + protected ListJobsPage createPage( + PageContext context, ListJobsResponse response) { + return new ListJobsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListJobsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListJobsRequest, ListJobsResponse, Job, ListJobsPage, ListJobsFixedSizeCollection> { + + private ListJobsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListJobsFixedSizeCollection createEmptyCollection() { + return new ListJobsFixedSizeCollection(null, 0); + } + + @Override + protected ListJobsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListJobsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerSettings.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerSettings.java new file mode 100644 index 000000000000..db216d90a957 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerSettings.java @@ -0,0 +1,251 @@ +/* + * 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 + * + * 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.scheduler.v1beta1; + +import static com.google.cloud.scheduler.v1beta1.CloudSchedulerClient.ListJobsPagedResponse; + +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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.scheduler.v1beta1.stub.CloudSchedulerStubSettings; +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 CloudSchedulerClient}. + * + *

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

    + *
  • The default service address (cloudscheduler.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 getJob to 30 seconds: + * + *

+ * 
+ * CloudSchedulerSettings.Builder cloudSchedulerSettingsBuilder =
+ *     CloudSchedulerSettings.newBuilder();
+ * cloudSchedulerSettingsBuilder.getJobSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * CloudSchedulerSettings cloudSchedulerSettings = cloudSchedulerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudSchedulerSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listJobs. */ + public PagedCallSettings + listJobsSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).listJobsSettings(); + } + + /** Returns the object with the settings used for calls to getJob. */ + public UnaryCallSettings getJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).getJobSettings(); + } + + /** Returns the object with the settings used for calls to createJob. */ + public UnaryCallSettings createJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).createJobSettings(); + } + + /** Returns the object with the settings used for calls to updateJob. */ + public UnaryCallSettings updateJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).updateJobSettings(); + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public UnaryCallSettings deleteJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).deleteJobSettings(); + } + + /** Returns the object with the settings used for calls to pauseJob. */ + public UnaryCallSettings pauseJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).pauseJobSettings(); + } + + /** Returns the object with the settings used for calls to resumeJob. */ + public UnaryCallSettings resumeJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).resumeJobSettings(); + } + + /** Returns the object with the settings used for calls to runJob. */ + public UnaryCallSettings runJobSettings() { + return ((CloudSchedulerStubSettings) getStubSettings()).runJobSettings(); + } + + public static final CloudSchedulerSettings create(CloudSchedulerStubSettings stub) + throws IOException { + return new CloudSchedulerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudSchedulerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudSchedulerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudSchedulerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudSchedulerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudSchedulerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudSchedulerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudSchedulerStubSettings.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 CloudSchedulerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudSchedulerSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(CloudSchedulerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(CloudSchedulerStubSettings.newBuilder()); + } + + protected Builder(CloudSchedulerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudSchedulerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public CloudSchedulerStubSettings.Builder getStubSettingsBuilder() { + return ((CloudSchedulerStubSettings.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 listJobs. */ + public PagedCallSettings.Builder + listJobsSettings() { + return getStubSettingsBuilder().listJobsSettings(); + } + + /** Returns the builder for the settings used for calls to getJob. */ + public UnaryCallSettings.Builder getJobSettings() { + return getStubSettingsBuilder().getJobSettings(); + } + + /** Returns the builder for the settings used for calls to createJob. */ + public UnaryCallSettings.Builder createJobSettings() { + return getStubSettingsBuilder().createJobSettings(); + } + + /** Returns the builder for the settings used for calls to updateJob. */ + public UnaryCallSettings.Builder updateJobSettings() { + return getStubSettingsBuilder().updateJobSettings(); + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public UnaryCallSettings.Builder deleteJobSettings() { + return getStubSettingsBuilder().deleteJobSettings(); + } + + /** Returns the builder for the settings used for calls to pauseJob. */ + public UnaryCallSettings.Builder pauseJobSettings() { + return getStubSettingsBuilder().pauseJobSettings(); + } + + /** Returns the builder for the settings used for calls to resumeJob. */ + public UnaryCallSettings.Builder resumeJobSettings() { + return getStubSettingsBuilder().resumeJobSettings(); + } + + /** Returns the builder for the settings used for calls to runJob. */ + public UnaryCallSettings.Builder runJobSettings() { + return getStubSettingsBuilder().runJobSettings(); + } + + @Override + public CloudSchedulerSettings build() throws IOException { + return new CloudSchedulerSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/package-info.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/package-info.java new file mode 100644 index 000000000000..9240aae4f121 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/package-info.java @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 Cloud Scheduler API. + * + *

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

==================== CloudSchedulerClient ==================== + * + *

Service Description: The Cloud Scheduler API allows external entities to reliably schedule + * asynchronous jobs. + * + *

Sample for CloudSchedulerClient: + * + *

+ * 
+ * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
+ *   String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]");
+ *   Job response = cloudSchedulerClient.getJob(formattedName);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.scheduler.v1beta1; diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStub.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStub.java new file mode 100644 index 000000000000..e654678b7a25 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStub.java @@ -0,0 +1,84 @@ +/* + * 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 + * + * 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.scheduler.v1beta1.stub; + +import static com.google.cloud.scheduler.v1beta1.CloudSchedulerClient.ListJobsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.scheduler.v1beta1.CreateJobRequest; +import com.google.cloud.scheduler.v1beta1.DeleteJobRequest; +import com.google.cloud.scheduler.v1beta1.GetJobRequest; +import com.google.cloud.scheduler.v1beta1.Job; +import com.google.cloud.scheduler.v1beta1.ListJobsRequest; +import com.google.cloud.scheduler.v1beta1.ListJobsResponse; +import com.google.cloud.scheduler.v1beta1.PauseJobRequest; +import com.google.cloud.scheduler.v1beta1.ResumeJobRequest; +import com.google.cloud.scheduler.v1beta1.RunJobRequest; +import com.google.cloud.scheduler.v1beta1.UpdateJobRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Scheduler API. + * + *

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 CloudSchedulerStub implements BackgroundResource { + + public UnaryCallable listJobsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listJobsPagedCallable()"); + } + + public UnaryCallable listJobsCallable() { + throw new UnsupportedOperationException("Not implemented: listJobsCallable()"); + } + + public UnaryCallable getJobCallable() { + throw new UnsupportedOperationException("Not implemented: getJobCallable()"); + } + + public UnaryCallable createJobCallable() { + throw new UnsupportedOperationException("Not implemented: createJobCallable()"); + } + + public UnaryCallable updateJobCallable() { + throw new UnsupportedOperationException("Not implemented: updateJobCallable()"); + } + + public UnaryCallable deleteJobCallable() { + throw new UnsupportedOperationException("Not implemented: deleteJobCallable()"); + } + + public UnaryCallable pauseJobCallable() { + throw new UnsupportedOperationException("Not implemented: pauseJobCallable()"); + } + + public UnaryCallable resumeJobCallable() { + throw new UnsupportedOperationException("Not implemented: resumeJobCallable()"); + } + + public UnaryCallable runJobCallable() { + throw new UnsupportedOperationException("Not implemented: runJobCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStubSettings.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStubSettings.java new file mode 100644 index 000000000000..99413454e524 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/CloudSchedulerStubSettings.java @@ -0,0 +1,501 @@ +/* + * 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 + * + * 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.scheduler.v1beta1.stub; + +import static com.google.cloud.scheduler.v1beta1.CloudSchedulerClient.ListJobsPagedResponse; + +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.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.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.scheduler.v1beta1.CreateJobRequest; +import com.google.cloud.scheduler.v1beta1.DeleteJobRequest; +import com.google.cloud.scheduler.v1beta1.GetJobRequest; +import com.google.cloud.scheduler.v1beta1.Job; +import com.google.cloud.scheduler.v1beta1.ListJobsRequest; +import com.google.cloud.scheduler.v1beta1.ListJobsResponse; +import com.google.cloud.scheduler.v1beta1.PauseJobRequest; +import com.google.cloud.scheduler.v1beta1.ResumeJobRequest; +import com.google.cloud.scheduler.v1beta1.RunJobRequest; +import com.google.cloud.scheduler.v1beta1.UpdateJobRequest; +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.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 CloudSchedulerStub}. + * + *

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

    + *
  • The default service address (cloudscheduler.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 getJob to 30 seconds: + * + *

+ * 
+ * CloudSchedulerStubSettings.Builder cloudSchedulerSettingsBuilder =
+ *     CloudSchedulerStubSettings.newBuilder();
+ * cloudSchedulerSettingsBuilder.getJobSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * CloudSchedulerStubSettings cloudSchedulerSettings = cloudSchedulerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudSchedulerStubSettings 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 + listJobsSettings; + private final UnaryCallSettings getJobSettings; + private final UnaryCallSettings createJobSettings; + private final UnaryCallSettings updateJobSettings; + private final UnaryCallSettings deleteJobSettings; + private final UnaryCallSettings pauseJobSettings; + private final UnaryCallSettings resumeJobSettings; + private final UnaryCallSettings runJobSettings; + + /** Returns the object with the settings used for calls to listJobs. */ + public PagedCallSettings + listJobsSettings() { + return listJobsSettings; + } + + /** Returns the object with the settings used for calls to getJob. */ + public UnaryCallSettings getJobSettings() { + return getJobSettings; + } + + /** Returns the object with the settings used for calls to createJob. */ + public UnaryCallSettings createJobSettings() { + return createJobSettings; + } + + /** Returns the object with the settings used for calls to updateJob. */ + public UnaryCallSettings updateJobSettings() { + return updateJobSettings; + } + + /** Returns the object with the settings used for calls to deleteJob. */ + public UnaryCallSettings deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the object with the settings used for calls to pauseJob. */ + public UnaryCallSettings pauseJobSettings() { + return pauseJobSettings; + } + + /** Returns the object with the settings used for calls to resumeJob. */ + public UnaryCallSettings resumeJobSettings() { + return resumeJobSettings; + } + + /** Returns the object with the settings used for calls to runJob. */ + public UnaryCallSettings runJobSettings() { + return runJobSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudSchedulerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudSchedulerStub.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 "cloudscheduler.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(CloudSchedulerStubSettings.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 CloudSchedulerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listJobsSettings = settingsBuilder.listJobsSettings().build(); + getJobSettings = settingsBuilder.getJobSettings().build(); + createJobSettings = settingsBuilder.createJobSettings().build(); + updateJobSettings = settingsBuilder.updateJobSettings().build(); + deleteJobSettings = settingsBuilder.deleteJobSettings().build(); + pauseJobSettings = settingsBuilder.pauseJobSettings().build(); + resumeJobSettings = settingsBuilder.resumeJobSettings().build(); + runJobSettings = settingsBuilder.runJobSettings().build(); + } + + private static final PagedListDescriptor + LIST_JOBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListJobsRequest injectToken(ListJobsRequest payload, String token) { + return ListJobsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListJobsRequest injectPageSize(ListJobsRequest payload, int pageSize) { + return ListJobsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListJobsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListJobsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListJobsResponse payload) { + return payload.getJobsList(); + } + }; + + private static final PagedListResponseFactory< + ListJobsRequest, ListJobsResponse, ListJobsPagedResponse> + LIST_JOBS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListJobsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_JOBS_PAGE_STR_DESC, request, context); + return ListJobsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for CloudSchedulerStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListJobsRequest, ListJobsResponse, ListJobsPagedResponse> + listJobsSettings; + private final UnaryCallSettings.Builder getJobSettings; + private final UnaryCallSettings.Builder createJobSettings; + private final UnaryCallSettings.Builder updateJobSettings; + private final UnaryCallSettings.Builder deleteJobSettings; + private final UnaryCallSettings.Builder pauseJobSettings; + private final UnaryCallSettings.Builder resumeJobSettings; + private final UnaryCallSettings.Builder runJobSettings; + + 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); + + listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT); + + getJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + pauseJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + resumeJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + runJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listJobsSettings, + getJobSettings, + createJobSettings, + updateJobSettings, + deleteJobSettings, + pauseJobSettings, + resumeJobSettings, + runJobSettings); + + 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 + .listJobsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .pauseJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .resumeJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .runJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(CloudSchedulerStubSettings settings) { + super(settings); + + listJobsSettings = settings.listJobsSettings.toBuilder(); + getJobSettings = settings.getJobSettings.toBuilder(); + createJobSettings = settings.createJobSettings.toBuilder(); + updateJobSettings = settings.updateJobSettings.toBuilder(); + deleteJobSettings = settings.deleteJobSettings.toBuilder(); + pauseJobSettings = settings.pauseJobSettings.toBuilder(); + resumeJobSettings = settings.resumeJobSettings.toBuilder(); + runJobSettings = settings.runJobSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listJobsSettings, + getJobSettings, + createJobSettings, + updateJobSettings, + deleteJobSettings, + pauseJobSettings, + resumeJobSettings, + runJobSettings); + } + + // 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 listJobs. */ + public PagedCallSettings.Builder + listJobsSettings() { + return listJobsSettings; + } + + /** Returns the builder for the settings used for calls to getJob. */ + public UnaryCallSettings.Builder getJobSettings() { + return getJobSettings; + } + + /** Returns the builder for the settings used for calls to createJob. */ + public UnaryCallSettings.Builder createJobSettings() { + return createJobSettings; + } + + /** Returns the builder for the settings used for calls to updateJob. */ + public UnaryCallSettings.Builder updateJobSettings() { + return updateJobSettings; + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public UnaryCallSettings.Builder deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the builder for the settings used for calls to pauseJob. */ + public UnaryCallSettings.Builder pauseJobSettings() { + return pauseJobSettings; + } + + /** Returns the builder for the settings used for calls to resumeJob. */ + public UnaryCallSettings.Builder resumeJobSettings() { + return resumeJobSettings; + } + + /** Returns the builder for the settings used for calls to runJob. */ + public UnaryCallSettings.Builder runJobSettings() { + return runJobSettings; + } + + @Override + public CloudSchedulerStubSettings build() throws IOException { + return new CloudSchedulerStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerCallableFactory.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerCallableFactory.java new file mode 100644 index 000000000000..b1a1a7788404 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerCallableFactory.java @@ -0,0 +1,116 @@ +/* + * 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 + * + * 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.scheduler.v1beta1.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.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Scheduler API. + * + *

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 GrpcCloudSchedulerCallableFactory 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-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerStub.java b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerStub.java new file mode 100644 index 000000000000..d147c62cbd8c --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/stub/GrpcCloudSchedulerStub.java @@ -0,0 +1,294 @@ +/* + * 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 + * + * 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.scheduler.v1beta1.stub; + +import static com.google.cloud.scheduler.v1beta1.CloudSchedulerClient.ListJobsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.scheduler.v1beta1.CreateJobRequest; +import com.google.cloud.scheduler.v1beta1.DeleteJobRequest; +import com.google.cloud.scheduler.v1beta1.GetJobRequest; +import com.google.cloud.scheduler.v1beta1.Job; +import com.google.cloud.scheduler.v1beta1.ListJobsRequest; +import com.google.cloud.scheduler.v1beta1.ListJobsResponse; +import com.google.cloud.scheduler.v1beta1.PauseJobRequest; +import com.google.cloud.scheduler.v1beta1.ResumeJobRequest; +import com.google.cloud.scheduler.v1beta1.RunJobRequest; +import com.google.cloud.scheduler.v1beta1.UpdateJobRequest; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Scheduler API. + * + *

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 GrpcCloudSchedulerStub extends CloudSchedulerStub { + + private static final MethodDescriptor + listJobsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/ListJobs") + .setRequestMarshaller(ProtoUtils.marshaller(ListJobsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListJobsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/GetJob") + .setRequestMarshaller(ProtoUtils.marshaller(GetJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + private static final MethodDescriptor createJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/CreateJob") + .setRequestMarshaller(ProtoUtils.marshaller(CreateJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/UpdateJob") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/DeleteJob") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor pauseJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/PauseJob") + .setRequestMarshaller(ProtoUtils.marshaller(PauseJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + private static final MethodDescriptor resumeJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/ResumeJob") + .setRequestMarshaller(ProtoUtils.marshaller(ResumeJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + private static final MethodDescriptor runJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.scheduler.v1beta1.CloudScheduler/RunJob") + .setRequestMarshaller(ProtoUtils.marshaller(RunJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Job.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listJobsCallable; + private final UnaryCallable listJobsPagedCallable; + private final UnaryCallable getJobCallable; + private final UnaryCallable createJobCallable; + private final UnaryCallable updateJobCallable; + private final UnaryCallable deleteJobCallable; + private final UnaryCallable pauseJobCallable; + private final UnaryCallable resumeJobCallable; + private final UnaryCallable runJobCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudSchedulerStub create(CloudSchedulerStubSettings settings) + throws IOException { + return new GrpcCloudSchedulerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudSchedulerStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudSchedulerStub( + CloudSchedulerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudSchedulerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudSchedulerStub( + CloudSchedulerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudSchedulerStub, 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 GrpcCloudSchedulerStub(CloudSchedulerStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudSchedulerCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudSchedulerStub, 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 GrpcCloudSchedulerStub( + CloudSchedulerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings listJobsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .build(); + GrpcCallSettings getJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getJobMethodDescriptor) + .build(); + GrpcCallSettings createJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createJobMethodDescriptor) + .build(); + GrpcCallSettings updateJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateJobMethodDescriptor) + .build(); + GrpcCallSettings deleteJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteJobMethodDescriptor) + .build(); + GrpcCallSettings pauseJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pauseJobMethodDescriptor) + .build(); + GrpcCallSettings resumeJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resumeJobMethodDescriptor) + .build(); + GrpcCallSettings runJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(runJobMethodDescriptor) + .build(); + + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.getJobCallable = + callableFactory.createUnaryCallable( + getJobTransportSettings, settings.getJobSettings(), clientContext); + this.createJobCallable = + callableFactory.createUnaryCallable( + createJobTransportSettings, settings.createJobSettings(), clientContext); + this.updateJobCallable = + callableFactory.createUnaryCallable( + updateJobTransportSettings, settings.updateJobSettings(), clientContext); + this.deleteJobCallable = + callableFactory.createUnaryCallable( + deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); + this.pauseJobCallable = + callableFactory.createUnaryCallable( + pauseJobTransportSettings, settings.pauseJobSettings(), clientContext); + this.resumeJobCallable = + callableFactory.createUnaryCallable( + resumeJobTransportSettings, settings.resumeJobSettings(), clientContext); + this.runJobCallable = + callableFactory.createUnaryCallable( + runJobTransportSettings, settings.runJobSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + public UnaryCallable getJobCallable() { + return getJobCallable; + } + + public UnaryCallable createJobCallable() { + return createJobCallable; + } + + public UnaryCallable updateJobCallable() { + return updateJobCallable; + } + + public UnaryCallable deleteJobCallable() { + return deleteJobCallable; + } + + public UnaryCallable pauseJobCallable() { + return pauseJobCallable; + } + + public UnaryCallable resumeJobCallable() { + return resumeJobCallable; + } + + public UnaryCallable runJobCallable() { + return runJobCallable; + } + + @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-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClientTest.java b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClientTest.java new file mode 100644 index 000000000000..4af9b73e8777 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClientTest.java @@ -0,0 +1,455 @@ +/* + * 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 + * + * 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.scheduler.v1beta1; + +import static com.google.cloud.scheduler.v1beta1.CloudSchedulerClient.ListJobsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +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 CloudSchedulerClientTest { + private static MockCloudScheduler mockCloudScheduler; + private static MockServiceHelper serviceHelper; + private CloudSchedulerClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCloudScheduler = new MockCloudScheduler(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays.asList(mockCloudScheduler)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + CloudSchedulerSettings settings = + CloudSchedulerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudSchedulerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listJobsTest() { + String nextPageToken = ""; + Job jobsElement = Job.newBuilder().build(); + List jobs = Arrays.asList(jobsElement); + ListJobsResponse expectedResponse = + ListJobsResponse.newBuilder().setNextPageToken(nextPageToken).addAllJobs(jobs).build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + ListJobsPagedResponse pagedListResponse = client.listJobs(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0)); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListJobsRequest actualRequest = (ListJobsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listJobsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]"); + + client.listJobs(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getJobTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name2) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.getJob(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetJobRequest actualRequest = (GetJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.getJob(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createJobTest() { + String name = "name3373707"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + + Job actualResponse = client.createJob(formattedParent, job); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateJobRequest actualRequest = (CreateJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedParent = CloudSchedulerClient.formatLocationName("[PROJECT]", "[LOCATION]"); + Job job = Job.newBuilder().build(); + + client.createJob(formattedParent, job); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateJobTest() { + String name = "name3373707"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + Job job = Job.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Job actualResponse = client.updateJob(job, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateJobRequest actualRequest = (UpdateJobRequest) actualRequests.get(0); + + Assert.assertEquals(job, actualRequest.getJob()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + Job job = Job.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateJob(job, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteJobTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.deleteJob(formattedName); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteJobRequest actualRequest = (DeleteJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.deleteJob(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void pauseJobTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name2) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.pauseJob(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PauseJobRequest actualRequest = (PauseJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void pauseJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.pauseJob(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void resumeJobTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name2) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.resumeJob(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResumeJobRequest actualRequest = (ResumeJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void resumeJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.resumeJob(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void runJobTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + String schedule = "schedule-697920873"; + String timeZone = "timeZone36848094"; + Job expectedResponse = + Job.newBuilder() + .setName(name2) + .setDescription(description) + .setSchedule(schedule) + .setTimeZone(timeZone) + .build(); + mockCloudScheduler.addResponse(expectedResponse); + + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + Job actualResponse = client.runJob(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudScheduler.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RunJobRequest actualRequest = (RunJobRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void runJobExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudScheduler.addException(exception); + + try { + String formattedName = CloudSchedulerClient.formatJobName("[PROJECT]", "[LOCATION]", "[JOB]"); + + client.runJob(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudScheduler.java b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudScheduler.java new file mode 100644 index 000000000000..681c4c81ad32 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudScheduler.java @@ -0,0 +1,57 @@ +/* + * 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 + * + * 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.scheduler.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCloudScheduler implements MockGrpcService { + private final MockCloudSchedulerImpl serviceImpl; + + public MockCloudScheduler() { + serviceImpl = new MockCloudSchedulerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudSchedulerImpl.java b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudSchedulerImpl.java new file mode 100644 index 000000000000..9a8388821806 --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/src/test/java/com/google/cloud/scheduler/v1beta1/MockCloudSchedulerImpl.java @@ -0,0 +1,171 @@ +/* + * 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 + * + * 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.scheduler.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.scheduler.v1beta1.CloudSchedulerGrpc.CloudSchedulerImplBase; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +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 MockCloudSchedulerImpl extends CloudSchedulerImplBase { + private ArrayList requests; + private Queue responses; + + public MockCloudSchedulerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 listJobs(ListJobsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListJobsResponse) { + requests.add(request); + responseObserver.onNext((ListJobsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getJob(GetJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createJob(CreateJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateJob(UpdateJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteJob(DeleteJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void pauseJob(PauseJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void resumeJob(ResumeJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void runJob(RunJobRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Job) { + requests.add(request); + responseObserver.onNext((Job) 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-scheduler/synth.py b/google-cloud-clients/google-cloud-scheduler/synth.py new file mode 100644 index 000000000000..b27381aec46e --- /dev/null +++ b/google-cloud-clients/google-cloud-scheduler/synth.py @@ -0,0 +1,32 @@ +# 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() + +for version in ["v1beta1"]: + library = gapic.java_library( + service='cloudscheduler', + version=version, + config_path=f'/google/cloud/scheduler/artman_cloudscheduler_{version}.yaml', + artman_output_name='') + + s.copy(library / f'gapic-google-cloud-cloudscheduler-{version}/src', 'src') + s.copy(library / f'grpc-google-cloud-cloudscheduler-{version}/src', f'../../google-api-grpc/grpc-google-cloud-scheduler-{version}/src') + s.copy(library / f'proto-google-cloud-cloudscheduler-{version}/src', f'../../google-api-grpc/proto-google-cloud-scheduler-{version}/src') diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 3c722547368d..97c69f93b1ab 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -437,6 +437,7 @@ google-cloud-pubsub google-cloud-redis google-cloud-resourcemanager + google-cloud-scheduler google-cloud-spanner google-cloud-speech google-cloud-storage @@ -747,7 +748,7 @@ Stub packages - com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.redis.v1.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.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.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.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.scheduler.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.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.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.websecurityscanner.v1alpha.stub Deprecated packages @@ -854,7 +855,7 @@ Stub packages - com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.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.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.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.websecurityscanner.v1alpha.stub + com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.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.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.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.websecurityscanner.v1alpha.stub Deprecated packages diff --git a/versions.txt b/versions.txt index dae0ff8c5720..ed46cc83f2f9 100644 --- a/versions.txt +++ b/versions.txt @@ -26,6 +26,7 @@ grpc-google-cloud-os-login-v1:0.34.0:0.34.1-SNAPSHOT grpc-google-cloud-pubsub-v1:1.33.0:1.33.1-SNAPSHOT grpc-google-cloud-redis-v1:0.34.0:0.34.1-SNAPSHOT grpc-google-cloud-redis-v1beta1:0.34.0:0.34.1-SNAPSHOT +grpc-google-cloud-scheduler-v1beta1:0.34.0:0.34.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1:0.34.0:0.34.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1:0.34.0:0.34.1-SNAPSHOT grpc-google-cloud-spanner-v1:0.34.0:0.34.1-SNAPSHOT @@ -73,6 +74,7 @@ proto-google-cloud-os-login-v1:0.34.0:0.34.1-SNAPSHOT proto-google-cloud-pubsub-v1:1.33.0:1.33.1-SNAPSHOT proto-google-cloud-redis-v1:0.34.0:0.34.1-SNAPSHOT proto-google-cloud-redis-v1beta1:0.34.0:0.34.1-SNAPSHOT +proto-google-cloud-scheduler-v1beta1:0.34.0:0.34.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1:0.34.0:0.34.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1:0.34.0:0.34.1-SNAPSHOT proto-google-cloud-spanner-v1:0.34.0:0.34.1-SNAPSHOT @@ -138,6 +140,7 @@ google-cloud-os-login:0.69.0-alpha:0.69.1-alpha-SNAPSHOT google-cloud-pubsub:1.51.0:1.51.1-SNAPSHOT google-cloud-redis:0.69.0-alpha:0.69.1-alpha-SNAPSHOT google-cloud-resourcemanager:0.69.0-alpha:0.69.1-alpha-SNAPSHOT +google-cloud-scheduler:0.69.0-alpha:0.69.1-alpha-SNAPSHOT google-cloud-spanner:0.69.0-beta:0.69.1-beta-SNAPSHOT google-cloud-speech:0.69.0-beta:0.69.1-beta-SNAPSHOT google-cloud-storage:1.51.0:1.51.1-SNAPSHOT