Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
feat: add default retry configuration (#188)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

feat: add DeleteTransferJob operation
feat: add AWS S3 compatible data source

PiperOrigin-RevId: 473348271

Source-Link: googleapis/googleapis@56f2049

Source-Link: https://github.com/googleapis/googleapis-gen/commit/4f0ba4ff11c129006f76be68465f8e68a4a32814
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGYwYmE0ZmYxMWMxMjkwMDZmNzZiZTY4NDY1ZjhlNjhhNGEzMjgxNCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Sep 10, 2022
1 parent 861fbc1 commit 6769f28
Show file tree
Hide file tree
Showing 15 changed files with 6,038 additions and 399 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,69 @@ public final OperationFuture<Empty, TransferTypes.TransferOperation> runTransfer
return stub.runTransferJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a transfer job. Deleting a transfer job sets its status to
* [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StorageTransferServiceClient storageTransferServiceClient =
* StorageTransferServiceClient.create()) {
* TransferProto.DeleteTransferJobRequest request =
* TransferProto.DeleteTransferJobRequest.newBuilder()
* .setJobName("jobName-1438096408")
* .setProjectId("projectId-894832108")
* .build();
* storageTransferServiceClient.deleteTransferJob(request);
* }
* }</pre>
*
* @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 deleteTransferJob(TransferProto.DeleteTransferJobRequest request) {
deleteTransferJobCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a transfer job. Deleting a transfer job sets its status to
* [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StorageTransferServiceClient storageTransferServiceClient =
* StorageTransferServiceClient.create()) {
* TransferProto.DeleteTransferJobRequest request =
* TransferProto.DeleteTransferJobRequest.newBuilder()
* .setJobName("jobName-1438096408")
* .setProjectId("projectId-894832108")
* .build();
* ApiFuture<Empty> future =
* storageTransferServiceClient.deleteTransferJobCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }</pre>
*/
public final UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobCallable() {
return stub.deleteTransferJobCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an agent pool resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ public class StorageTransferServiceSettings extends ClientSettings<StorageTransf
.runTransferJobOperationSettings();
}

/** Returns the object with the settings used for calls to deleteTransferJob. */
public UnaryCallSettings<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobSettings() {
return ((StorageTransferServiceStubSettings) getStubSettings()).deleteTransferJobSettings();
}

/** Returns the object with the settings used for calls to createAgentPool. */
public UnaryCallSettings<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolSettings() {
Expand Down Expand Up @@ -353,6 +359,12 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().runTransferJobOperationSettings();
}

/** Returns the builder for the settings used for calls to deleteTransferJob. */
public UnaryCallSettings.Builder<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobSettings() {
return getStubSettingsBuilder().deleteTransferJobSettings();
}

/** Returns the builder for the settings used for calls to createAgentPool. */
public UnaryCallSettings.Builder<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"DeleteAgentPool": {
"methods": ["deleteAgentPool", "deleteAgentPool", "deleteAgentPoolCallable"]
},
"DeleteTransferJob": {
"methods": ["deleteTransferJob", "deleteTransferJobCallable"]
},
"GetAgentPool": {
"methods": ["getAgentPool", "getAgentPool", "getAgentPoolCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ public class GrpcStorageTransferServiceStub extends StorageTransferServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();

private static final MethodDescriptor<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobMethodDescriptor =
MethodDescriptor.<TransferProto.DeleteTransferJobRequest, Empty>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.storagetransfer.v1.StorageTransferService/DeleteTransferJob")
.setRequestMarshaller(
ProtoUtils.marshaller(
TransferProto.DeleteTransferJobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();

private static final MethodDescriptor<
TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolMethodDescriptor =
Expand Down Expand Up @@ -239,6 +251,8 @@ public class GrpcStorageTransferServiceStub extends StorageTransferServiceStub {
private final OperationCallable<
TransferProto.RunTransferJobRequest, Empty, TransferTypes.TransferOperation>
runTransferJobOperationCallable;
private final UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobCallable;
private final UnaryCallable<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolCallable;
private final UnaryCallable<TransferProto.UpdateAgentPoolRequest, TransferTypes.AgentPool>
Expand Down Expand Up @@ -380,6 +394,17 @@ protected GrpcStorageTransferServiceStub(
return params.build();
})
.build();
GrpcCallSettings<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobTransportSettings =
GrpcCallSettings.<TransferProto.DeleteTransferJobRequest, Empty>newBuilder()
.setMethodDescriptor(deleteTransferJobMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("job_name", String.valueOf(request.getJobName()));
return params.build();
})
.build();
GrpcCallSettings<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolTransportSettings =
GrpcCallSettings
Expand Down Expand Up @@ -484,6 +509,11 @@ protected GrpcStorageTransferServiceStub(
settings.runTransferJobOperationSettings(),
clientContext,
operationsStub);
this.deleteTransferJobCallable =
callableFactory.createUnaryCallable(
deleteTransferJobTransportSettings,
settings.deleteTransferJobSettings(),
clientContext);
this.createAgentPoolCallable =
callableFactory.createUnaryCallable(
createAgentPoolTransportSettings, settings.createAgentPoolSettings(), clientContext);
Expand Down Expand Up @@ -573,6 +603,11 @@ public UnaryCallable<TransferProto.RunTransferJobRequest, Operation> runTransfer
return runTransferJobOperationCallable;
}

@Override
public UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty> deleteTransferJobCallable() {
return deleteTransferJobCallable;
}

@Override
public UnaryCallable<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolCallable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,41 @@ public class HttpJsonStorageTransferServiceStub extends StorageTransferServiceSt
HttpJsonOperationSnapshot.create(response))
.build();

private static final ApiMethodDescriptor<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobMethodDescriptor =
ApiMethodDescriptor.<TransferProto.DeleteTransferJobRequest, Empty>newBuilder()
.setFullMethodName(
"google.storagetransfer.v1.StorageTransferService/DeleteTransferJob")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.<TransferProto.DeleteTransferJobRequest>newBuilder()
.setPath(
"/v1/{jobName=transferJobs/**}",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<TransferProto.DeleteTransferJobRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "jobName", request.getJobName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<TransferProto.DeleteTransferJobRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "projectId", request.getProjectId());
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.<Empty>newBuilder()
.setDefaultInstance(Empty.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();

private static final ApiMethodDescriptor<
TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolMethodDescriptor =
Expand Down Expand Up @@ -578,6 +613,8 @@ public class HttpJsonStorageTransferServiceStub extends StorageTransferServiceSt
private final OperationCallable<
TransferProto.RunTransferJobRequest, Empty, TransferTypes.TransferOperation>
runTransferJobOperationCallable;
private final UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobCallable;
private final UnaryCallable<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolCallable;
private final UnaryCallable<TransferProto.UpdateAgentPoolRequest, TransferTypes.AgentPool>
Expand Down Expand Up @@ -695,6 +732,12 @@ protected HttpJsonStorageTransferServiceStub(
.setMethodDescriptor(runTransferJobMethodDescriptor)
.setTypeRegistry(typeRegistry)
.build();
HttpJsonCallSettings<TransferProto.DeleteTransferJobRequest, Empty>
deleteTransferJobTransportSettings =
HttpJsonCallSettings.<TransferProto.DeleteTransferJobRequest, Empty>newBuilder()
.setMethodDescriptor(deleteTransferJobMethodDescriptor)
.setTypeRegistry(typeRegistry)
.build();
HttpJsonCallSettings<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolTransportSettings =
HttpJsonCallSettings
Expand Down Expand Up @@ -774,6 +817,11 @@ protected HttpJsonStorageTransferServiceStub(
settings.runTransferJobOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.deleteTransferJobCallable =
callableFactory.createUnaryCallable(
deleteTransferJobTransportSettings,
settings.deleteTransferJobSettings(),
clientContext);
this.createAgentPoolCallable =
callableFactory.createUnaryCallable(
createAgentPoolTransportSettings, settings.createAgentPoolSettings(), clientContext);
Expand Down Expand Up @@ -808,6 +856,7 @@ public static List<ApiMethodDescriptor> getMethodDescriptors() {
methodDescriptors.add(pauseTransferOperationMethodDescriptor);
methodDescriptors.add(resumeTransferOperationMethodDescriptor);
methodDescriptors.add(runTransferJobMethodDescriptor);
methodDescriptors.add(deleteTransferJobMethodDescriptor);
methodDescriptors.add(createAgentPoolMethodDescriptor);
methodDescriptors.add(updateAgentPoolMethodDescriptor);
methodDescriptors.add(getAgentPoolMethodDescriptor);
Expand Down Expand Up @@ -882,6 +931,11 @@ public UnaryCallable<TransferProto.RunTransferJobRequest, Operation> runTransfer
return runTransferJobOperationCallable;
}

@Override
public UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty> deleteTransferJobCallable() {
return deleteTransferJobCallable;
}

@Override
public UnaryCallable<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolCallable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public UnaryCallable<TransferProto.RunTransferJobRequest, Operation> runTransfer
throw new UnsupportedOperationException("Not implemented: runTransferJobCallable()");
}

public UnaryCallable<TransferProto.DeleteTransferJobRequest, Empty> deleteTransferJobCallable() {
throw new UnsupportedOperationException("Not implemented: deleteTransferJobCallable()");
}

public UnaryCallable<TransferProto.CreateAgentPoolRequest, TransferTypes.AgentPool>
createAgentPoolCallable() {
throw new UnsupportedOperationException("Not implemented: createAgentPoolCallable()");
Expand Down
Loading

0 comments on commit 6769f28

Please sign in to comment.