list method
Lists Entitlements for which the provider has read access.
Request parameters:
parent
- Required. The parent resource name.
Value must have pattern ^providers/\[^/\]+$
.
filter
- The filter that can be used to limit the list request. The
filter is a query string that can match a selected set of attributes with
string values. For example account=E-1234-5678-ABCD-EFGH
,
state=pending_cancellation
, and plan!=foo-plan
. Supported query
attributes are * account
* customer_billing_account
with value in the
format of: billingAccounts/{id}
* product_external_name
*
quote_external_name
* offer
* new_pending_offer
* plan
*
newPendingPlan
or new_pending_plan
* state
* consumers.project
*
change_history.new_offer
Note that the consumers and
change_history.new_offer match works on repeated structures, so equality
(consumers.project=projects/123456789
) is not supported. Set membership
can be expressed with the :
operator. For example,
consumers.project:projects/123456789
finds entitlements with at least
one consumer with project field equal to projects/123456789
.
change_history.new_offer
retrieves all entitlements that were once
associated or are currently active with the offer. Also note that the
state name match is case-insensitive and query can omit the prefix
"ENTITLEMENT_". For example, state=active
is equivalent to
state=ENTITLEMENT_ACTIVE
. If the query contains some special characters
other than letters, underscore, or digits, the phrase must be quoted with
double quotes. For example, product="providerId:productId"
, where the
product name needs to be quoted because it contains special character
colon. Queries can be combined with AND
, OR
, and NOT
to form more
complex queries. They can also be grouped to force a desired evaluation
order. For example, state=active AND (account=E-1234 OR account=5678) AND NOT (product=foo-product)
. Connective AND
can be omitted between two
predicates. For example account=E-1234 state=active
is equivalent to
account=E-1234 AND state=active
.
pageSize
- The maximum number of entries that are requested. The default
page size is 200.
pageToken
- The token for fetching the next page.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListEntitlementsResponse.
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<ListEntitlementsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/entitlements';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListEntitlementsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}