Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions java-channel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Java idiomatic client for [Channel Services][product-docs].

If you are using Maven, add this to your pom.xml file:

<!--- {x-version-update-start:google-cloud-channel:released} -->

```xml
<dependency>
Expand All @@ -35,7 +34,6 @@ If you are using SBT, add this to your dependencies:
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-channel" % "3.16.0"
```
<!--- {x-version-update-end} -->

## Authentication

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListChannelPartnerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementChangesPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListOffersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListProductsPagedResponse;
Expand Down Expand Up @@ -459,6 +460,15 @@ public UnaryCallSettings<LookupOfferRequest, Offer> lookupOfferSettings() {
return ((CloudChannelServiceStubSettings) getStubSettings()).listSubscribersSettings();
}

/** Returns the object with the settings used for calls to listEntitlementChanges. */
public PagedCallSettings<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings() {
return ((CloudChannelServiceStubSettings) getStubSettings()).listEntitlementChangesSettings();
}

public static final CloudChannelServiceSettings create(CloudChannelServiceStubSettings stub)
throws IOException {
return new CloudChannelServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -942,6 +952,15 @@ public UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings(
return getStubSettingsBuilder().listSubscribersSettings();
}

/** Returns the builder for the settings used for calls to listEntitlementChanges. */
public PagedCallSettings.Builder<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings() {
return getStubSettingsBuilder().listEntitlementChangesSettings();
}

@Override
public CloudChannelServiceSettings build() throws IOException {
return new CloudChannelServiceSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
"ListCustomers": {
"methods": ["listCustomers", "listCustomersPagedCallable", "listCustomersCallable"]
},
"ListEntitlementChanges": {
"methods": ["listEntitlementChanges", "listEntitlementChanges", "listEntitlementChanges", "listEntitlementChangesPagedCallable", "listEntitlementChangesCallable"]
},
"ListEntitlements": {
"methods": ["listEntitlements", "listEntitlementsPagedCallable", "listEntitlementsCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListChannelPartnerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementChangesPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListOffersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListProductsPagedResponse;
Expand Down Expand Up @@ -67,6 +68,8 @@
import com.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse;
import com.google.cloud.channel.v1.ListCustomersRequest;
import com.google.cloud.channel.v1.ListCustomersResponse;
import com.google.cloud.channel.v1.ListEntitlementChangesRequest;
import com.google.cloud.channel.v1.ListEntitlementChangesResponse;
import com.google.cloud.channel.v1.ListEntitlementsRequest;
import com.google.cloud.channel.v1.ListEntitlementsResponse;
import com.google.cloud.channel.v1.ListOffersRequest;
Expand Down Expand Up @@ -475,6 +478,17 @@ public UnaryCallable<ListSubscribersRequest, ListSubscribersResponse> listSubscr
throw new UnsupportedOperationException("Not implemented: listSubscribersCallable()");
}

public UnaryCallable<ListEntitlementChangesRequest, ListEntitlementChangesPagedResponse>
listEntitlementChangesPagedCallable() {
throw new UnsupportedOperationException(
"Not implemented: listEntitlementChangesPagedCallable()");
}

public UnaryCallable<ListEntitlementChangesRequest, ListEntitlementChangesResponse>
listEntitlementChangesCallable() {
throw new UnsupportedOperationException("Not implemented: listEntitlementChangesCallable()");
}

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListChannelPartnerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomerRepricingConfigsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListCustomersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementChangesPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListEntitlementsPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListOffersPagedResponse;
import static com.google.cloud.channel.v1.CloudChannelServiceClient.ListProductsPagedResponse;
Expand Down Expand Up @@ -79,6 +80,7 @@
import com.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest;
import com.google.cloud.channel.v1.DeleteCustomerRequest;
import com.google.cloud.channel.v1.Entitlement;
import com.google.cloud.channel.v1.EntitlementChange;
import com.google.cloud.channel.v1.GetChannelPartnerLinkRequest;
import com.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest;
import com.google.cloud.channel.v1.GetCustomerRepricingConfigRequest;
Expand All @@ -93,6 +95,8 @@
import com.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse;
import com.google.cloud.channel.v1.ListCustomersRequest;
import com.google.cloud.channel.v1.ListCustomersResponse;
import com.google.cloud.channel.v1.ListEntitlementChangesRequest;
import com.google.cloud.channel.v1.ListEntitlementChangesResponse;
import com.google.cloud.channel.v1.ListEntitlementsRequest;
import com.google.cloud.channel.v1.ListEntitlementsResponse;
import com.google.cloud.channel.v1.ListOffersRequest;
Expand Down Expand Up @@ -316,6 +320,11 @@ public class CloudChannelServiceStubSettings extends StubSettings<CloudChannelSe
private final PagedCallSettings<
ListSubscribersRequest, ListSubscribersResponse, ListSubscribersPagedResponse>
listSubscribersSettings;
private final PagedCallSettings<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings;

private static final PagedListDescriptor<ListCustomersRequest, ListCustomersResponse, Customer>
LIST_CUSTOMERS_PAGE_STR_DESC =
Expand Down Expand Up @@ -847,6 +856,49 @@ public Iterable<String> extractResources(ListSubscribersResponse payload) {
}
};

private static final PagedListDescriptor<
ListEntitlementChangesRequest, ListEntitlementChangesResponse, EntitlementChange>
LIST_ENTITLEMENT_CHANGES_PAGE_STR_DESC =
new PagedListDescriptor<
ListEntitlementChangesRequest, ListEntitlementChangesResponse, EntitlementChange>() {
@Override
public String emptyToken() {
return "";
}

@Override
public ListEntitlementChangesRequest injectToken(
ListEntitlementChangesRequest payload, String token) {
return ListEntitlementChangesRequest.newBuilder(payload).setPageToken(token).build();
}

@Override
public ListEntitlementChangesRequest injectPageSize(
ListEntitlementChangesRequest payload, int pageSize) {
return ListEntitlementChangesRequest.newBuilder(payload)
.setPageSize(pageSize)
.build();
}

@Override
public Integer extractPageSize(ListEntitlementChangesRequest payload) {
return payload.getPageSize();
}

@Override
public String extractNextToken(ListEntitlementChangesResponse payload) {
return payload.getNextPageToken();
}

@Override
public Iterable<EntitlementChange> extractResources(
ListEntitlementChangesResponse payload) {
return payload.getEntitlementChangesList() == null
? ImmutableList.<EntitlementChange>of()
: payload.getEntitlementChangesList();
}
};

private static final PagedListResponseFactory<
ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse>
LIST_CUSTOMERS_PAGE_STR_FACT =
Expand Down Expand Up @@ -1139,6 +1191,33 @@ public ApiFuture<ListSubscribersPagedResponse> getFuturePagedResponse(
}
};

private static final PagedListResponseFactory<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
LIST_ENTITLEMENT_CHANGES_PAGE_STR_FACT =
new PagedListResponseFactory<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>() {
@Override
public ApiFuture<ListEntitlementChangesPagedResponse> getFuturePagedResponse(
UnaryCallable<ListEntitlementChangesRequest, ListEntitlementChangesResponse>
callable,
ListEntitlementChangesRequest request,
ApiCallContext context,
ApiFuture<ListEntitlementChangesResponse> futureResponse) {
PageContext<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
EntitlementChange>
pageContext =
PageContext.create(
callable, LIST_ENTITLEMENT_CHANGES_PAGE_STR_DESC, request, context);
return ListEntitlementChangesPagedResponse.createAsync(pageContext, futureResponse);
}
};

/** Returns the object with the settings used for calls to listCustomers. */
public PagedCallSettings<ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse>
listCustomersSettings() {
Expand Down Expand Up @@ -1485,6 +1564,15 @@ public UnaryCallSettings<LookupOfferRequest, Offer> lookupOfferSettings() {
return listSubscribersSettings;
}

/** Returns the object with the settings used for calls to listEntitlementChanges. */
public PagedCallSettings<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings() {
return listEntitlementChangesSettings;
}

public CloudChannelServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down Expand Up @@ -1667,6 +1755,7 @@ protected CloudChannelServiceStubSettings(Builder settingsBuilder) throws IOExce
registerSubscriberSettings = settingsBuilder.registerSubscriberSettings().build();
unregisterSubscriberSettings = settingsBuilder.unregisterSubscriberSettings().build();
listSubscribersSettings = settingsBuilder.listSubscribersSettings().build();
listEntitlementChangesSettings = settingsBuilder.listEntitlementChangesSettings().build();
}

/** Builder for CloudChannelServiceStubSettings. */
Expand Down Expand Up @@ -1822,6 +1911,11 @@ public static class Builder
private final PagedCallSettings.Builder<
ListSubscribersRequest, ListSubscribersResponse, ListSubscribersPagedResponse>
listSubscribersSettings;
private final PagedCallSettings.Builder<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings;
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;

Expand Down Expand Up @@ -1933,6 +2027,8 @@ protected Builder(ClientContext clientContext) {
registerSubscriberSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unregisterSubscriberSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listSubscribersSettings = PagedCallSettings.newBuilder(LIST_SUBSCRIBERS_PAGE_STR_FACT);
listEntitlementChangesSettings =
PagedCallSettings.newBuilder(LIST_ENTITLEMENT_CHANGES_PAGE_STR_FACT);

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -1980,7 +2076,8 @@ protected Builder(ClientContext clientContext) {
listPurchasableOffersSettings,
registerSubscriberSettings,
unregisterSubscriberSettings,
listSubscribersSettings);
listSubscribersSettings,
listEntitlementChangesSettings);
initDefaults(this);
}

Expand Down Expand Up @@ -2060,6 +2157,7 @@ protected Builder(CloudChannelServiceStubSettings settings) {
registerSubscriberSettings = settings.registerSubscriberSettings.toBuilder();
unregisterSubscriberSettings = settings.unregisterSubscriberSettings.toBuilder();
listSubscribersSettings = settings.listSubscribersSettings.toBuilder();
listEntitlementChangesSettings = settings.listEntitlementChangesSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -2107,7 +2205,8 @@ protected Builder(CloudChannelServiceStubSettings settings) {
listPurchasableOffersSettings,
registerSubscriberSettings,
unregisterSubscriberSettings,
listSubscribersSettings);
listSubscribersSettings,
listEntitlementChangesSettings);
}

private static Builder createDefault() {
Expand Down Expand Up @@ -2362,6 +2461,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
.listEntitlementChangesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.provisionCloudIdentityOperationSettings()
.setInitialCallSettings(
Expand Down Expand Up @@ -3035,6 +3139,15 @@ public UnaryCallSettings.Builder<LookupOfferRequest, Offer> lookupOfferSettings(
return listSubscribersSettings;
}

/** Returns the builder for the settings used for calls to listEntitlementChanges. */
public PagedCallSettings.Builder<
ListEntitlementChangesRequest,
ListEntitlementChangesResponse,
ListEntitlementChangesPagedResponse>
listEntitlementChangesSettings() {
return listEntitlementChangesSettings;
}

@Override
public CloudChannelServiceStubSettings build() throws IOException {
return new CloudChannelServiceStubSettings(this);
Expand Down
Loading