list method
Lists the Offers the reseller can sell.
Possible error codes: * INVALID_ARGUMENT: Required request parameters are missing or invalid.
Request parameters:
parent
- Required. The resource name of the reseller account from which
to list Offers. Parent uses the format: accounts/{account_id}.
Value must have pattern ^accounts/\[^/\]+$
.
filter
- Optional. The expression to filter results by name (name of the
Offer), sku.name (name of the SKU), or sku.product.name (name of the
Product). Example 1: sku.product.name=products/p1 AND
sku.name!=products/p1/skus/s1 Example 2: name=accounts/a1/offers/o1
languageCode
- Optional. The BCP-47 language code. For example, "en-US".
The response will localize in the corresponding language code, if
specified. The default value is "en-US".
pageSize
- Optional. Requested page size. Server might return fewer
results than requested. If unspecified, returns at most 500 Offers. The
maximum value is 1000; the server will coerce values above 1000.
pageToken
- Optional. A token for a page of results other than the first
page.
showFutureOffers
- Optional. A boolean flag that determines if a
response returns future offers 30 days from now. If the show_future_offers
is true, the response will only contain offers that are scheduled to be
available 30 days from now.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudChannelV1ListOffersResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleCloudChannelV1ListOffersResponse> list(
core.String parent, {
core.String? filter,
core.String? languageCode,
core.int? pageSize,
core.String? pageToken,
core.bool? showFutureOffers,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (languageCode != null) 'languageCode': [languageCode],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (showFutureOffers != null) 'showFutureOffers': ['${showFutureOffers}'],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/offers';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleCloudChannelV1ListOffersResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}