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

Commit 825dd14

Browse files
feat: add API ImportCustomer for Cloud Channel API docs: update comments 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
1 parent 73d6a72 commit 825dd14

File tree

18 files changed

+3106
-445
lines changed

18 files changed

+3106
-445
lines changed

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceClient.java

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,92 @@ public final UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable(
805805
return stub.deleteCustomerCallable();
806806
}
807807

808+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
809+
/**
810+
* Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with
811+
* the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked
812+
* Customer already exists and overwrite_if_exists is true, it will update that Customer's data.
813+
*
814+
* <p>Possible error codes:
815+
*
816+
* <ul>
817+
* <li>PERMISSION_DENIED: The reseller account making the request is different from the reseller
818+
* account in the API request.
819+
* <li>NOT_FOUND: Cloud Identity doesn't exist or was deleted.
820+
* <li>INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or
821+
* invalid.
822+
* <li>ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires
823+
* an overwrite.
824+
* </ul>
825+
*
826+
* <p>Return value: The [Customer][google.cloud.channel.v1.Customer].
827+
*
828+
* <p>Sample code:
829+
*
830+
* <pre>{@code
831+
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
832+
* ImportCustomerRequest request =
833+
* ImportCustomerRequest.newBuilder()
834+
* .setParent("parent-995424086")
835+
* .setAuthToken("authToken1450587441")
836+
* .setOverwriteIfExists(true)
837+
* .setChannelPartnerId("channelPartnerId-170366400")
838+
* .setCustomer(CustomerName.of("[ACCOUNT]", "[CUSTOMER]").toString())
839+
* .build();
840+
* Customer response = cloudChannelServiceClient.importCustomer(request);
841+
* }
842+
* }</pre>
843+
*
844+
* @param request The request object containing all of the parameters for the API call.
845+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
846+
*/
847+
public final Customer importCustomer(ImportCustomerRequest request) {
848+
return importCustomerCallable().call(request);
849+
}
850+
851+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
852+
/**
853+
* Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with
854+
* the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked
855+
* Customer already exists and overwrite_if_exists is true, it will update that Customer's data.
856+
*
857+
* <p>Possible error codes:
858+
*
859+
* <ul>
860+
* <li>PERMISSION_DENIED: The reseller account making the request is different from the reseller
861+
* account in the API request.
862+
* <li>NOT_FOUND: Cloud Identity doesn't exist or was deleted.
863+
* <li>INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or
864+
* invalid.
865+
* <li>ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires
866+
* an overwrite.
867+
* </ul>
868+
*
869+
* <p>Return value: The [Customer][google.cloud.channel.v1.Customer].
870+
*
871+
* <p>Sample code:
872+
*
873+
* <pre>{@code
874+
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
875+
* ImportCustomerRequest request =
876+
* ImportCustomerRequest.newBuilder()
877+
* .setParent("parent-995424086")
878+
* .setAuthToken("authToken1450587441")
879+
* .setOverwriteIfExists(true)
880+
* .setChannelPartnerId("channelPartnerId-170366400")
881+
* .setCustomer(CustomerName.of("[ACCOUNT]", "[CUSTOMER]").toString())
882+
* .build();
883+
* ApiFuture<Customer> future =
884+
* cloudChannelServiceClient.importCustomerCallable().futureCall(request);
885+
* // Do something.
886+
* Customer response = future.get();
887+
* }
888+
* }</pre>
889+
*/
890+
public final UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
891+
return stub.importCustomerCallable();
892+
}
893+
808894
// AUTO-GENERATED DOCUMENTATION AND METHOD.
809895
/**
810896
* Creates a Cloud Identity for the given customer using the customer's information, or the

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceSettings.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ public UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings()
117117
return ((CloudChannelServiceStubSettings) getStubSettings()).deleteCustomerSettings();
118118
}
119119

120+
/** Returns the object with the settings used for calls to importCustomer. */
121+
public UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings() {
122+
return ((CloudChannelServiceStubSettings) getStubSettings()).importCustomerSettings();
123+
}
124+
120125
/** Returns the object with the settings used for calls to provisionCloudIdentity. */
121126
public UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
122127
provisionCloudIdentitySettings() {
@@ -499,6 +504,11 @@ public UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSet
499504
return getStubSettingsBuilder().deleteCustomerSettings();
500505
}
501506

507+
/** Returns the builder for the settings used for calls to importCustomer. */
508+
public UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings() {
509+
return getStubSettingsBuilder().importCustomerSettings();
510+
}
511+
502512
/** Returns the builder for the settings used for calls to provisionCloudIdentity. */
503513
public UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
504514
provisionCloudIdentitySettings() {

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
"GetEntitlement": {
5050
"methods": ["getEntitlement", "getEntitlementCallable"]
5151
},
52+
"ImportCustomer": {
53+
"methods": ["importCustomer", "importCustomerCallable"]
54+
},
5255
"ListChannelPartnerLinks": {
5356
"methods": ["listChannelPartnerLinks", "listChannelPartnerLinksPagedCallable", "listChannelPartnerLinksCallable"]
5457
},

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStub.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
4949
import com.google.cloud.channel.v1.GetCustomerRequest;
5050
import com.google.cloud.channel.v1.GetEntitlementRequest;
51+
import com.google.cloud.channel.v1.ImportCustomerRequest;
5152
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
5253
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
5354
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -135,6 +136,10 @@ public UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable() {
135136
throw new UnsupportedOperationException("Not implemented: deleteCustomerCallable()");
136137
}
137138

139+
public UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
140+
throw new UnsupportedOperationException("Not implemented: importCustomerCallable()");
141+
}
142+
138143
public OperationCallable<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
139144
provisionCloudIdentityOperationCallable() {
140145
throw new UnsupportedOperationException(

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/CloudChannelServiceStubSettings.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
7272
import com.google.cloud.channel.v1.GetCustomerRequest;
7373
import com.google.cloud.channel.v1.GetEntitlementRequest;
74+
import com.google.cloud.channel.v1.ImportCustomerRequest;
7475
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
7576
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
7677
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -174,6 +175,7 @@ public class CloudChannelServiceStubSettings extends StubSettings<CloudChannelSe
174175
private final UnaryCallSettings<CreateCustomerRequest, Customer> createCustomerSettings;
175176
private final UnaryCallSettings<UpdateCustomerRequest, Customer> updateCustomerSettings;
176177
private final UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings;
178+
private final UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings;
177179
private final UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
178180
provisionCloudIdentitySettings;
179181
private final OperationCallSettings<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
@@ -953,6 +955,11 @@ public UnaryCallSettings<DeleteCustomerRequest, Empty> deleteCustomerSettings()
953955
return deleteCustomerSettings;
954956
}
955957

958+
/** Returns the object with the settings used for calls to importCustomer. */
959+
public UnaryCallSettings<ImportCustomerRequest, Customer> importCustomerSettings() {
960+
return importCustomerSettings;
961+
}
962+
956963
/** Returns the object with the settings used for calls to provisionCloudIdentity. */
957964
public UnaryCallSettings<ProvisionCloudIdentityRequest, Operation>
958965
provisionCloudIdentitySettings() {
@@ -1276,6 +1283,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
12761283
createCustomerSettings = settingsBuilder.createCustomerSettings().build();
12771284
updateCustomerSettings = settingsBuilder.updateCustomerSettings().build();
12781285
deleteCustomerSettings = settingsBuilder.deleteCustomerSettings().build();
1286+
importCustomerSettings = settingsBuilder.importCustomerSettings().build();
12791287
provisionCloudIdentitySettings = settingsBuilder.provisionCloudIdentitySettings().build();
12801288
provisionCloudIdentityOperationSettings =
12811289
settingsBuilder.provisionCloudIdentityOperationSettings().build();
@@ -1340,6 +1348,7 @@ public static class Builder
13401348
private final UnaryCallSettings.Builder<CreateCustomerRequest, Customer> createCustomerSettings;
13411349
private final UnaryCallSettings.Builder<UpdateCustomerRequest, Customer> updateCustomerSettings;
13421350
private final UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSettings;
1351+
private final UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings;
13431352
private final UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
13441353
provisionCloudIdentitySettings;
13451354
private final OperationCallSettings.Builder<
@@ -1500,6 +1509,7 @@ protected Builder(ClientContext clientContext) {
15001509
createCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
15011510
updateCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
15021511
deleteCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
1512+
importCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
15031513
provisionCloudIdentitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
15041514
provisionCloudIdentityOperationSettings = OperationCallSettings.newBuilder();
15051515
listEntitlementsSettings = PagedCallSettings.newBuilder(LIST_ENTITLEMENTS_PAGE_STR_FACT);
@@ -1553,6 +1563,7 @@ protected Builder(ClientContext clientContext) {
15531563
createCustomerSettings,
15541564
updateCustomerSettings,
15551565
deleteCustomerSettings,
1566+
importCustomerSettings,
15561567
provisionCloudIdentitySettings,
15571568
listEntitlementsSettings,
15581569
listTransferableSkusSettings,
@@ -1594,6 +1605,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
15941605
createCustomerSettings = settings.createCustomerSettings.toBuilder();
15951606
updateCustomerSettings = settings.updateCustomerSettings.toBuilder();
15961607
deleteCustomerSettings = settings.deleteCustomerSettings.toBuilder();
1608+
importCustomerSettings = settings.importCustomerSettings.toBuilder();
15971609
provisionCloudIdentitySettings = settings.provisionCloudIdentitySettings.toBuilder();
15981610
provisionCloudIdentityOperationSettings =
15991611
settings.provisionCloudIdentityOperationSettings.toBuilder();
@@ -1649,6 +1661,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
16491661
createCustomerSettings,
16501662
updateCustomerSettings,
16511663
deleteCustomerSettings,
1664+
importCustomerSettings,
16521665
provisionCloudIdentitySettings,
16531666
listEntitlementsSettings,
16541667
listTransferableSkusSettings,
@@ -1723,6 +1736,11 @@ private static Builder initDefaults(Builder builder) {
17231736
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
17241737
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
17251738

1739+
builder
1740+
.importCustomerSettings()
1741+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1742+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
1743+
17261744
builder
17271745
.provisionCloudIdentitySettings()
17281746
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
@@ -2180,6 +2198,11 @@ public UnaryCallSettings.Builder<DeleteCustomerRequest, Empty> deleteCustomerSet
21802198
return deleteCustomerSettings;
21812199
}
21822200

2201+
/** Returns the builder for the settings used for calls to importCustomer. */
2202+
public UnaryCallSettings.Builder<ImportCustomerRequest, Customer> importCustomerSettings() {
2203+
return importCustomerSettings;
2204+
}
2205+
21832206
/** Returns the builder for the settings used for calls to provisionCloudIdentity. */
21842207
public UnaryCallSettings.Builder<ProvisionCloudIdentityRequest, Operation>
21852208
provisionCloudIdentitySettings() {

google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/GrpcCloudChannelServiceStub.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
5353
import com.google.cloud.channel.v1.GetCustomerRequest;
5454
import com.google.cloud.channel.v1.GetEntitlementRequest;
55+
import com.google.cloud.channel.v1.ImportCustomerRequest;
5556
import com.google.cloud.channel.v1.ListChannelPartnerLinksRequest;
5657
import com.google.cloud.channel.v1.ListChannelPartnerLinksResponse;
5758
import com.google.cloud.channel.v1.ListCustomersRequest;
@@ -173,6 +174,16 @@ public class GrpcCloudChannelServiceStub extends CloudChannelServiceStub {
173174
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
174175
.build();
175176

177+
private static final MethodDescriptor<ImportCustomerRequest, Customer>
178+
importCustomerMethodDescriptor =
179+
MethodDescriptor.<ImportCustomerRequest, Customer>newBuilder()
180+
.setType(MethodDescriptor.MethodType.UNARY)
181+
.setFullMethodName("google.cloud.channel.v1.CloudChannelService/ImportCustomer")
182+
.setRequestMarshaller(
183+
ProtoUtils.marshaller(ImportCustomerRequest.getDefaultInstance()))
184+
.setResponseMarshaller(ProtoUtils.marshaller(Customer.getDefaultInstance()))
185+
.build();
186+
176187
private static final MethodDescriptor<ProvisionCloudIdentityRequest, Operation>
177188
provisionCloudIdentityMethodDescriptor =
178189
MethodDescriptor.<ProvisionCloudIdentityRequest, Operation>newBuilder()
@@ -479,6 +490,7 @@ public class GrpcCloudChannelServiceStub extends CloudChannelServiceStub {
479490
private final UnaryCallable<CreateCustomerRequest, Customer> createCustomerCallable;
480491
private final UnaryCallable<UpdateCustomerRequest, Customer> updateCustomerCallable;
481492
private final UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable;
493+
private final UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable;
482494
private final UnaryCallable<ProvisionCloudIdentityRequest, Operation>
483495
provisionCloudIdentityCallable;
484496
private final OperationCallable<ProvisionCloudIdentityRequest, Customer, OperationMetadata>
@@ -672,6 +684,16 @@ protected GrpcCloudChannelServiceStub(
672684
return params.build();
673685
})
674686
.build();
687+
GrpcCallSettings<ImportCustomerRequest, Customer> importCustomerTransportSettings =
688+
GrpcCallSettings.<ImportCustomerRequest, Customer>newBuilder()
689+
.setMethodDescriptor(importCustomerMethodDescriptor)
690+
.setParamsExtractor(
691+
request -> {
692+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
693+
params.put("parent", String.valueOf(request.getParent()));
694+
return params.build();
695+
})
696+
.build();
675697
GrpcCallSettings<ProvisionCloudIdentityRequest, Operation>
676698
provisionCloudIdentityTransportSettings =
677699
GrpcCallSettings.<ProvisionCloudIdentityRequest, Operation>newBuilder()
@@ -988,6 +1010,9 @@ protected GrpcCloudChannelServiceStub(
9881010
this.deleteCustomerCallable =
9891011
callableFactory.createUnaryCallable(
9901012
deleteCustomerTransportSettings, settings.deleteCustomerSettings(), clientContext);
1013+
this.importCustomerCallable =
1014+
callableFactory.createUnaryCallable(
1015+
importCustomerTransportSettings, settings.importCustomerSettings(), clientContext);
9911016
this.provisionCloudIdentityCallable =
9921017
callableFactory.createUnaryCallable(
9931018
provisionCloudIdentityTransportSettings,
@@ -1261,6 +1286,11 @@ public UnaryCallable<DeleteCustomerRequest, Empty> deleteCustomerCallable() {
12611286
return deleteCustomerCallable;
12621287
}
12631288

1289+
@Override
1290+
public UnaryCallable<ImportCustomerRequest, Customer> importCustomerCallable() {
1291+
return importCustomerCallable;
1292+
}
1293+
12641294
@Override
12651295
public UnaryCallable<ProvisionCloudIdentityRequest, Operation> provisionCloudIdentityCallable() {
12661296
return provisionCloudIdentityCallable;

0 commit comments

Comments
 (0)