@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * Creates a job. * * <p>Sample code: * * <pre><code> * try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) { * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * Job job = Job.newBuilder().build(); * Job response = cloudSchedulerClient.createJob(parent.toString(), job); * } * </code></pre> * * @param parent Required. * <p>The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. * @param job Required. * <p>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) { CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent).setJob(job).build(); return createJob(request); }
CreateJobRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setJob(job)