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

Commit

Permalink
feat: Add/Update API definitions for Cloud Channel API (#112)
Browse files Browse the repository at this point in the history
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 a7cc927
Show file tree
Hide file tree
Showing 22 changed files with 1,742 additions and 618 deletions.
Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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:
*
Expand Down Expand Up @@ -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.
Expand Down
Expand Up @@ -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() {
Expand Down Expand Up @@ -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>
Expand Down
Expand Up @@ -82,6 +82,9 @@
"ListTransferableSkus": {
"methods": ["listTransferableSkus", "listTransferableSkusPagedCallable", "listTransferableSkusCallable"]
},
"LookupOffer": {
"methods": ["lookupOffer", "lookupOfferCallable"]
},
"ProvisionCloudIdentity": {
"methods": ["provisionCloudIdentityAsync", "provisionCloudIdentityOperationCallable", "provisionCloudIdentityCallable"]
},
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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()");
}
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1403,6 +1411,7 @@ public static class Builder
createChannelPartnerLinkSettings;
private final UnaryCallSettings.Builder<UpdateChannelPartnerLinkRequest, ChannelPartnerLink>
updateChannelPartnerLinkSettings;
private final UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings;
private final PagedCallSettings.Builder<
ListProductsRequest, ListProductsResponse, ListProductsPagedResponse>
listProductsSettings;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1555,6 +1565,7 @@ protected Builder(ClientContext clientContext) {
getChannelPartnerLinkSettings,
createChannelPartnerLinkSettings,
updateChannelPartnerLinkSettings,
lookupOfferSettings,
listProductsSettings,
listSkusSettings,
listOffersSettings,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1649,6 +1661,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
getChannelPartnerLinkSettings,
createChannelPartnerLinkSettings,
updateChannelPartnerLinkSettings,
lookupOfferSettings,
listProductsSettings,
listSkusSettings,
listOffersSettings,
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit a7cc927

Please sign in to comment.