Skip to content
Permalink
Browse files
feat: Add/Update API definitions for Cloud Channel API (#112)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/80dfe4c9-7eb0-4ba3-b23c-eb532cbee786/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 378177991
Source-Link: googleapis/googleapis@97d42c6

feat: Update descriptions of APIs
feat: Add additional_bindings to HTTP annotations of Customer related APIs (list/create/get/update/delete)
feat: Add a new LookupOffer RPC and LookupOfferRequest proto
feat: Add a new enum value LICENSE_CAP_CHANGED to enum EntitlementEvent.Type
  • Loading branch information
yoshi-automation committed Jun 14, 2021
1 parent 1db06f0 commit a7cc927e7b18a16f6bd3e35044dedbe4922fffa7
Showing with 1,742 additions and 618 deletions.
  1. +81 −14 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. +6 −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. +32 −0 google-cloud-channel/src/main/java/com/google/cloud/channel/v1/stub/GrpcCloudChannelServiceStub.java
  7. +54 −0 google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java
  8. +20 −0 google-cloud-channel/src/test/java/com/google/cloud/channel/v1/MockCloudChannelServiceImpl.java
  9. +159 −24 grpc-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/CloudChannelServiceGrpc.java
  10. +63 −70 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ContactInfo.java
  11. +18 −20 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ContactInfoOrBuilder.java
  12. +128 −154 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Customer.java
  13. +34 −41 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/CustomerOrBuilder.java
  14. +22 −0 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/EntitlementEvent.java
  15. +662 −0 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/LookupOfferRequest.java
  16. +58 −0 ...oogle-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/LookupOfferRequestOrBuilder.java
  17. +277 −251 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/ServiceProto.java
  18. +11 −10 proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/SubscriberEventProto.java
  19. +23 −27 proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/customers.proto
  20. +50 −4 proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/service.proto
  21. +3 −0 proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/subscriber_event.proto
  22. +5 −3 synth.metadata
@@ -306,7 +306,7 @@ public final UnaryCallable<ListCustomersRequest, ListCustomersResponse> listCust

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Customer][google.cloud.channel.v1.Customer] resource.
* Returns the requested [Customer][google.cloud.channel.v1.Customer] resource.
*
* <p>Possible error codes:
*
@@ -341,7 +341,7 @@ public final Customer getCustomer(CustomerName name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Customer][google.cloud.channel.v1.Customer] resource.
* Returns the requested [Customer][google.cloud.channel.v1.Customer] resource.
*
* <p>Possible error codes:
*
@@ -375,7 +375,7 @@ public final Customer getCustomer(String name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Customer][google.cloud.channel.v1.Customer] resource.
* Returns the requested [Customer][google.cloud.channel.v1.Customer] resource.
*
* <p>Possible error codes:
*
@@ -410,7 +410,7 @@ public final Customer getCustomer(GetCustomerRequest request) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Customer][google.cloud.channel.v1.Customer] resource.
* Returns the requested [Customer][google.cloud.channel.v1.Customer] resource.
*
* <p>Possible error codes:
*
@@ -679,7 +679,7 @@ public final UnaryCallable<UpdateCustomerRequest, Customer> updateCustomerCallab

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly.
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently.
*
* <p>Possible error codes:
*
@@ -711,7 +711,7 @@ public final void deleteCustomer(CustomerName name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly.
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently.
*
* <p>Possible error codes:
*
@@ -742,7 +742,7 @@ public final void deleteCustomer(String name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly.
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently.
*
* <p>Possible error codes:
*
@@ -775,7 +775,7 @@ public final void deleteCustomer(DeleteCustomerRequest request) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly.
* Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently.
*
* <p>Possible error codes:
*
@@ -1361,7 +1361,7 @@ public final ListTransferableOffersPagedResponse listTransferableOffers(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
* Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
*
* <p>Possible error codes:
*
@@ -1394,7 +1394,7 @@ public final Entitlement getEntitlement(GetEntitlementRequest request) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
* Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
*
* <p>Possible error codes:
*
@@ -3064,8 +3064,8 @@ public final ListChannelPartnerLinksPagedResponse listChannelPartnerLinks(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.
* You must be a distributor to call this method.
* Returns the requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]
* resource. You must be a distributor to call this method.
*
* <p>Possible error codes:
*
@@ -3101,8 +3101,8 @@ public final ChannelPartnerLink getChannelPartnerLink(GetChannelPartnerLinkReque

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.
* You must be a distributor to call this method.
* Returns the requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]
* resource. You must be a distributor to call this method.
*
* <p>Possible error codes:
*
@@ -3317,6 +3317,73 @@ public final ChannelPartnerLink updateChannelPartnerLink(
return stub.updateChannelPartnerLinkCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the requested [Offer][google.cloud.channel.v1.Offer] resource.
*
* <p>Possible error codes:
*
* <ul>
* <li>PERMISSION_DENIED: The entitlement doesn't belong to the reseller.
* <li>INVALID_ARGUMENT: Required request parameters are missing or invalid.
* <li>NOT_FOUND: Entitlement or offer was not found.
* </ul>
*
* <p>Return value: The [Offer][google.cloud.channel.v1.Offer] resource.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
* LookupOfferRequest request =
* LookupOfferRequest.newBuilder()
* .setEntitlement(
* EntitlementName.of("[ACCOUNT]", "[CUSTOMER]", "[ENTITLEMENT]").toString())
* .build();
* Offer response = cloudChannelServiceClient.lookupOffer(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 Offer lookupOffer(LookupOfferRequest request) {
return lookupOfferCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the requested [Offer][google.cloud.channel.v1.Offer] resource.
*
* <p>Possible error codes:
*
* <ul>
* <li>PERMISSION_DENIED: The entitlement doesn't belong to the reseller.
* <li>INVALID_ARGUMENT: Required request parameters are missing or invalid.
* <li>NOT_FOUND: Entitlement or offer was not found.
* </ul>
*
* <p>Return value: The [Offer][google.cloud.channel.v1.Offer] resource.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.create()) {
* LookupOfferRequest request =
* LookupOfferRequest.newBuilder()
* .setEntitlement(
* EntitlementName.of("[ACCOUNT]", "[CUSTOMER]", "[ENTITLEMENT]").toString())
* .build();
* ApiFuture<Offer> future = cloudChannelServiceClient.lookupOfferCallable().futureCall(request);
* // Do something.
* Offer response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<LookupOfferRequest, Offer> lookupOfferCallable() {
return stub.lookupOfferCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists the Products the reseller is authorized to sell.
@@ -310,6 +310,11 @@ public UnaryCallSettings<TransferEntitlementsRequest, Operation> transferEntitle
return ((CloudChannelServiceStubSettings) getStubSettings()).updateChannelPartnerLinkSettings();
}

/** Returns the object with the settings used for calls to lookupOffer. */
public UnaryCallSettings<LookupOfferRequest, Offer> lookupOfferSettings() {
return ((CloudChannelServiceStubSettings) getStubSettings()).lookupOfferSettings();
}

/** Returns the object with the settings used for calls to listProducts. */
public PagedCallSettings<ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
listProductsSettings() {
@@ -686,6 +691,11 @@ public UnaryCallSettings.Builder<ChangeOfferRequest, Operation> changeOfferSetti
return getStubSettingsBuilder().updateChannelPartnerLinkSettings();
}

/** Returns the builder for the settings used for calls to lookupOffer. */
public UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings() {
return getStubSettingsBuilder().lookupOfferSettings();
}

/** Returns the builder for the settings used for calls to listProducts. */
public PagedCallSettings.Builder<
ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
@@ -82,6 +82,9 @@
"ListTransferableSkus": {
"methods": ["listTransferableSkus", "listTransferableSkusPagedCallable", "listTransferableSkusCallable"]
},
"LookupOffer": {
"methods": ["lookupOffer", "lookupOfferCallable"]
},
"ProvisionCloudIdentity": {
"methods": ["provisionCloudIdentityAsync", "provisionCloudIdentityOperationCallable", "provisionCloudIdentityCallable"]
},
@@ -70,6 +70,8 @@
import com.google.cloud.channel.v1.ListTransferableOffersResponse;
import com.google.cloud.channel.v1.ListTransferableSkusRequest;
import com.google.cloud.channel.v1.ListTransferableSkusResponse;
import com.google.cloud.channel.v1.LookupOfferRequest;
import com.google.cloud.channel.v1.Offer;
import com.google.cloud.channel.v1.OperationMetadata;
import com.google.cloud.channel.v1.ProvisionCloudIdentityRequest;
import com.google.cloud.channel.v1.RegisterSubscriberRequest;
@@ -304,6 +306,10 @@ public UnaryCallable<TransferEntitlementsRequest, Operation> transferEntitlement
throw new UnsupportedOperationException("Not implemented: updateChannelPartnerLinkCallable()");
}

public UnaryCallable<LookupOfferRequest, Offer> lookupOfferCallable() {
throw new UnsupportedOperationException("Not implemented: lookupOfferCallable()");
}

public UnaryCallable<ListProductsRequest, ListProductsPagedResponse> listProductsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listProductsPagedCallable()");
}
@@ -93,6 +93,7 @@
import com.google.cloud.channel.v1.ListTransferableOffersResponse;
import com.google.cloud.channel.v1.ListTransferableSkusRequest;
import com.google.cloud.channel.v1.ListTransferableSkusResponse;
import com.google.cloud.channel.v1.LookupOfferRequest;
import com.google.cloud.channel.v1.Offer;
import com.google.cloud.channel.v1.OperationMetadata;
import com.google.cloud.channel.v1.Product;
@@ -237,6 +238,7 @@ public class CloudChannelServiceStubSettings extends StubSettings<CloudChannelSe
createChannelPartnerLinkSettings;
private final UnaryCallSettings<UpdateChannelPartnerLinkRequest, ChannelPartnerLink>
updateChannelPartnerLinkSettings;
private final UnaryCallSettings<LookupOfferRequest, Offer> lookupOfferSettings;
private final PagedCallSettings<
ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
listProductsSettings;
@@ -1133,6 +1135,11 @@ public UnaryCallSettings<TransferEntitlementsRequest, Operation> transferEntitle
return updateChannelPartnerLinkSettings;
}

/** Returns the object with the settings used for calls to lookupOffer. */
public UnaryCallSettings<LookupOfferRequest, Offer> lookupOfferSettings() {
return lookupOfferSettings;
}

/** Returns the object with the settings used for calls to listProducts. */
public PagedCallSettings<ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
listProductsSettings() {
@@ -1301,6 +1308,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
getChannelPartnerLinkSettings = settingsBuilder.getChannelPartnerLinkSettings().build();
createChannelPartnerLinkSettings = settingsBuilder.createChannelPartnerLinkSettings().build();
updateChannelPartnerLinkSettings = settingsBuilder.updateChannelPartnerLinkSettings().build();
lookupOfferSettings = settingsBuilder.lookupOfferSettings().build();
listProductsSettings = settingsBuilder.listProductsSettings().build();
listSkusSettings = settingsBuilder.listSkusSettings().build();
listOffersSettings = settingsBuilder.listOffersSettings().build();
@@ -1403,6 +1411,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
createChannelPartnerLinkSettings;
private final UnaryCallSettings.Builder<UpdateChannelPartnerLinkRequest, ChannelPartnerLink>
updateChannelPartnerLinkSettings;
private final UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings;
private final PagedCallSettings.Builder<
ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
listProductsSettings;
@@ -1517,6 +1526,7 @@ protected Builder(ClientContext clientContext) {
getChannelPartnerLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
createChannelPartnerLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateChannelPartnerLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
lookupOfferSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listProductsSettings = PagedCallSettings.newBuilder(LIST_PRODUCTS_PAGE_STR_FACT);
listSkusSettings = PagedCallSettings.newBuilder(LIST_SKUS_PAGE_STR_FACT);
listOffersSettings = PagedCallSettings.newBuilder(LIST_OFFERS_PAGE_STR_FACT);
@@ -1555,6 +1565,7 @@ protected Builder(ClientContext clientContext) {
getChannelPartnerLinkSettings,
createChannelPartnerLinkSettings,
updateChannelPartnerLinkSettings,
lookupOfferSettings,
listProductsSettings,
listSkusSettings,
listOffersSettings,
@@ -1613,6 +1624,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
getChannelPartnerLinkSettings = settings.getChannelPartnerLinkSettings.toBuilder();
createChannelPartnerLinkSettings = settings.createChannelPartnerLinkSettings.toBuilder();
updateChannelPartnerLinkSettings = settings.updateChannelPartnerLinkSettings.toBuilder();
lookupOfferSettings = settings.lookupOfferSettings.toBuilder();
listProductsSettings = settings.listProductsSettings.toBuilder();
listSkusSettings = settings.listSkusSettings.toBuilder();
listOffersSettings = settings.listOffersSettings.toBuilder();
@@ -1649,6 +1661,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
getChannelPartnerLinkSettings,
createChannelPartnerLinkSettings,
updateChannelPartnerLinkSettings,
lookupOfferSettings,
listProductsSettings,
listSkusSettings,
listOffersSettings,
@@ -1796,6 +1809,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
.lookupOfferSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.listProductsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
@@ -2367,6 +2385,11 @@ public UnaryCallSettings.Builder<ChangeOfferRequest, Operation> changeOfferSetti
return updateChannelPartnerLinkSettings;
}

/** Returns the builder for the settings used for calls to lookupOffer. */
public UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings() {
return lookupOfferSettings;
}

/** Returns the builder for the settings used for calls to listProducts. */
public PagedCallSettings.Builder<
ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>

0 comments on commit a7cc927

Please sign in to comment.