Skip to content
Permalink
Browse files
feat: add API ImportCustomer for Cloud Channel API docs: update comme…
…nts for a few fields (#175)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 394721709

Source-Link: googleapis/googleapis@bf57b2c

Source-Link: https://github.com/googleapis/googleapis-gen/commit/699e6d5fdcb12daac24587c0643016855ccb2e16
  • Loading branch information
gcf-owl-bot[bot] committed Sep 13, 2021
1 parent 73d6a72 commit 825dd14d7ae7b585a75226a486638c155d32805b
Showing with 3,106 additions and 445 deletions.
  1. +86 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceClient.java
  2. +10 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceSettings.java
  3. +3 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/gapic_metadata.json
  4. +5 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStub.java
  5. +23 −0 ...cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java
  6. +30 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/GrpcCloudChannelServiceStub.java
  7. +69 −0 google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java
  8. +21 −0 google-cloud-channel/src/test/java/com/google/cloud/channel/v1/MockCloudChannelServiceImpl.java
  9. +192 −28 grpc-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceGrpc.java
  10. +21 −21 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ContactInfo.java
  11. +6 −6 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ContactInfoOrBuilder.java
  12. +14 −7 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Customer.java
  13. +4 −2 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/CustomerOrBuilder.java
  14. +1,895 −0 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ImportCustomerRequest.java
  15. +239 −0 ...le-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ImportCustomerRequestOrBuilder.java
  16. +409 −377 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ServiceProto.java
  17. +5 −4 proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/customers.proto
  18. +74 −0 proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/service.proto
@@ -805,6 +805,92 @@ public final UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable(
return stub.deleteCustomerCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with
* the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked
* Customer already exists and overwrite_if_exists is true, it will update that Customer's data.
*
* <p>Possible error codes:
*
* <ul>
* <li>PERMISSION_DENIED: The reseller account making the request is different from the reseller
* account in the API request.
* <li>NOT_FOUND: Cloud Identity doesn't exist or was deleted.
* <li>INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or
* invalid.
* <li>ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires
* an overwrite.
* </ul>
*
* <p>Return value: The [Customer][google.cloud.channel.v1.Customer].
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
* ImportCustomerRequest request =
* ImportCustomerRequest.newBuilder()
* .setParent("parent-995424086")
* .setAuthToken("authToken1450587441")
* .setOverwriteIfExists(true)
* .setChannelPartnerId("channelPartnerId-170366400")
* .setCustomer(CustomerName.of("[ACCOUNT]", "[CUSTOMER]").toString())
* .build();
* Customer response = cloudChannelServiceClient.importCustomer(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 Customer importCustomer(ImportCustomerRequest request) {
return importCustomerCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with
* the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked
* Customer already exists and overwrite_if_exists is true, it will update that Customer's data.
*
* <p>Possible error codes:
*
* <ul>
* <li>PERMISSION_DENIED: The reseller account making the request is different from the reseller
* account in the API request.
* <li>NOT_FOUND: Cloud Identity doesn't exist or was deleted.
* <li>INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or
* invalid.
* <li>ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires
* an overwrite.
* </ul>
*
* <p>Return value: The [Customer][google.cloud.channel.v1.Customer].
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
* ImportCustomerRequest request =
* ImportCustomerRequest.newBuilder()
* .setParent("parent-995424086")
* .setAuthToken("authToken1450587441")
* .setOverwriteIfExists(true)
* .setChannelPartnerId("channelPartnerId-170366400")
* .setCustomer(CustomerName.of("[ACCOUNT]", "[CUSTOMER]").toString())
* .build();
* ApiFuture<Customer> future =
* cloudChannelServiceClient.importCustomerCallable().futureCall(request);
* // Do something.
* Customer response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
return stub.importCustomerCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a Cloud Identity for the given customer using the customer's information, or the
@@ -117,6 +117,11 @@ public UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings()
return ((CloudChannelServiceStubSettings) getStubSettings()).deleteCustomerSettings();
}

/** Returns the object with the settings used for calls to importCustomer. */
public UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings() {
return ((CloudChannelServiceStubSettings) getStubSettings()).importCustomerSettings();
}

/** Returns the object with the settings used for calls to provisionCloudIdentity. */
public UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings() {
@@ -499,6 +504,11 @@ public UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSet
return getStubSettingsBuilder().deleteCustomerSettings();
}

/** Returns the builder for the settings used for calls to importCustomer. */
public UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings() {
return getStubSettingsBuilder().importCustomerSettings();
}

/** Returns the builder for the settings used for calls to provisionCloudIdentity. */
public UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings() {
@@ -49,6 +49,9 @@
"GetEntitlement": {
"methods": ["getEntitlement", "getEntitlementCallable"]
},
"ImportCustomer": {
"methods": ["importCustomer", "importCustomerCallable"]
},
"ListChannelPartnerLinks": {
"methods": ["listChannelPartnerLinks", "listChannelPartnerLinksPagedCallable", "listChannelPartnerLinksCallable"]
},
@@ -48,6 +48,7 @@
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
import com.google.cloud.channel.v1.GetCustomerRequest;
import com.google.cloud.channel.v1.GetEntitlementRequest;
import com.google.cloud.channel.v1.ImportCustomerRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -135,6 +136,10 @@ public UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable() {
throw new UnsupportedOperationException("Not implemented: deleteCustomerCallable()");
}

public UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
throw new UnsupportedOperationException("Not implemented: importCustomerCallable()");
}

public OperationCallable<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
provisionCloudIdentityOperationCallable() {
throw new UnsupportedOperationException(
@@ -71,6 +71,7 @@
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
import com.google.cloud.channel.v1.GetCustomerRequest;
import com.google.cloud.channel.v1.GetEntitlementRequest;
import com.google.cloud.channel.v1.ImportCustomerRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -174,6 +175,7 @@ public class CloudChannelServiceStubSettings extends StubSettings<CloudChannelSe
private final UnaryCallSettings<CreateCustomerRequest, Customer> createCustomerSettings;
private final UnaryCallSettings<UpdateCustomerRequest, Customer> updateCustomerSettings;
private final UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings;
private final UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings;
private final UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings;
private final OperationCallSettings<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
@@ -953,6 +955,11 @@ public UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings()
return deleteCustomerSettings;
}

/** Returns the object with the settings used for calls to importCustomer. */
public UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings() {
return importCustomerSettings;
}

/** Returns the object with the settings used for calls to provisionCloudIdentity. */
public UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings() {
@@ -1276,6 +1283,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
createCustomerSettings = settingsBuilder.createCustomerSettings().build();
updateCustomerSettings = settingsBuilder.updateCustomerSettings().build();
deleteCustomerSettings = settingsBuilder.deleteCustomerSettings().build();
importCustomerSettings = settingsBuilder.importCustomerSettings().build();
provisionCloudIdentitySettings = settingsBuilder.provisionCloudIdentitySettings().build();
provisionCloudIdentityOperationSettings =
settingsBuilder.provisionCloudIdentityOperationSettings().build();
@@ -1340,6 +1348,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
private final UnaryCallSettings.Builder<CreateCustomerRequest, Customer> createCustomerSettings;
private final UnaryCallSettings.Builder<UpdateCustomerRequest, Customer> updateCustomerSettings;
private final UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSettings;
private final UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings;
private final UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings;
private final OperationCallSettings.Builder<
@@ -1500,6 +1509,7 @@ protected Builder(ClientContext clientContext) {
createCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
importCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
provisionCloudIdentitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
provisionCloudIdentityOperationSettings = OperationCallSettings.newBuilder();
listEntitlementsSettings = PagedCallSettings.newBuilder(LIST_ENTITLEMENTS_PAGE_STR_FACT);
@@ -1553,6 +1563,7 @@ protected Builder(ClientContext clientContext) {
createCustomerSettings,
updateCustomerSettings,
deleteCustomerSettings,
importCustomerSettings,
provisionCloudIdentitySettings,
listEntitlementsSettings,
listTransferableSkusSettings,
@@ -1594,6 +1605,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
createCustomerSettings = settings.createCustomerSettings.toBuilder();
updateCustomerSettings = settings.updateCustomerSettings.toBuilder();
deleteCustomerSettings = settings.deleteCustomerSettings.toBuilder();
importCustomerSettings = settings.importCustomerSettings.toBuilder();
provisionCloudIdentitySettings = settings.provisionCloudIdentitySettings.toBuilder();
provisionCloudIdentityOperationSettings =
settings.provisionCloudIdentityOperationSettings.toBuilder();
@@ -1649,6 +1661,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
createCustomerSettings,
updateCustomerSettings,
deleteCustomerSettings,
importCustomerSettings,
provisionCloudIdentitySettings,
listEntitlementsSettings,
listTransferableSkusSettings,
@@ -1723,6 +1736,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.importCustomerSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.provisionCloudIdentitySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
@@ -2180,6 +2198,11 @@ public UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSet
return deleteCustomerSettings;
}

/** Returns the builder for the settings used for calls to importCustomer. */
public UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings() {
return importCustomerSettings;
}

/** Returns the builder for the settings used for calls to provisionCloudIdentity. */
public UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentitySettings() {
@@ -52,6 +52,7 @@
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
import com.google.cloud.channel.v1.GetCustomerRequest;
import com.google.cloud.channel.v1.GetEntitlementRequest;
import com.google.cloud.channel.v1.ImportCustomerRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -173,6 +174,16 @@ public class GrpcCloudChannelServiceStub extends CloudChannelServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();

private static final MethodDescriptor<ImportCustomerRequest, Customer>
importCustomerMethodDescriptor =
MethodDescriptor.<ImportCustomerRequest, Customer>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.channel.v1.CloudChannelService/ImportCustomer")
.setRequestMarshaller(
ProtoUtils.marshaller(ImportCustomerRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Customer.getDefaultInstance()))
.build();

private static final MethodDescriptor<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentityMethodDescriptor =
MethodDescriptor.<ProvisionCloudIdentityRequest, Operation>newBuilder()
@@ -479,6 +490,7 @@ public class GrpcCloudChannelServiceStub extends CloudChannelServiceStub {
private final UnaryCallable<CreateCustomerRequest, Customer> createCustomerCallable;
private final UnaryCallable<UpdateCustomerRequest, Customer> updateCustomerCallable;
private final UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable;
private final UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable;
private final UnaryCallable<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentityCallable;
private final OperationCallable<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
@@ -672,6 +684,16 @@ protected GrpcCloudChannelServiceStub(
return params.build();
})
.build();
GrpcCallSettings<ImportCustomerRequest, Customer> importCustomerTransportSettings =
GrpcCallSettings.<ImportCustomerRequest, Customer>newBuilder()
.setMethodDescriptor(importCustomerMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<ProvisionCloudIdentityRequest, Operation>
provisionCloudIdentityTransportSettings =
GrpcCallSettings.<ProvisionCloudIdentityRequest, Operation>newBuilder()
@@ -988,6 +1010,9 @@ protected GrpcCloudChannelServiceStub(
this.deleteCustomerCallable =
callableFactory.createUnaryCallable(
deleteCustomerTransportSettings, settings.deleteCustomerSettings(), clientContext);
this.importCustomerCallable =
callableFactory.createUnaryCallable(
importCustomerTransportSettings, settings.importCustomerSettings(), clientContext);
this.provisionCloudIdentityCallable =
callableFactory.createUnaryCallable(
provisionCloudIdentityTransportSettings,
@@ -1261,6 +1286,11 @@ public UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable() {
return deleteCustomerCallable;
}

@Override
public UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
return importCustomerCallable;
}

@Override
public UnaryCallable<ProvisionCloudIdentityRequest, Operation> provisionCloudIdentityCallable() {
return provisionCloudIdentityCallable;

0 comments on commit 825dd14

Please sign in to comment.