list method
Returns a list of all flight classes for a given issuer ID.
Request parameters:
issuerId
- The ID of the issuer authorized to list classes.
maxResults
- Identifies the max number of results returned by a list.
All results are returned if maxResults
isn't defined.
token
- Used to get the next set of results if maxResults
is
specified, but more than maxResults
classes are available in a list. For
example, if you have a list of 200 classes and you call list with
maxResults
set to 20, list will return the first 20 classes and a token.
Call list again with maxResults
set to 20 and the token to get the next
20 classes.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a FlightClassListResponse.
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<FlightClassListResponse> list({
core.String? issuerId,
core.int? maxResults,
core.String? token,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (issuerId != null) 'issuerId': [issuerId],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (token != null) 'token': [token],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'walletobjects/v1/flightClass';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FlightClassListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}