list method

Future<ListSkusResponse> list(
  1. String parent, {
  2. String? currencyCode,
  3. String? endTime,
  4. int? pageSize,
  5. String? pageToken,
  6. String? startTime,
  7. String? $fields,
})

Lists all publicly available SKUs for a given cloud service.

Request parameters:

parent - Required. The name of the service. Example: "services/6F81-5844-456A" Value must have pattern ^services/\[^/\]+$.

currencyCode - The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time. Optional. If not specified USD will be used.

endTime - Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

pageSize - Requested page size. Defaults to 5000.

pageToken - A token identifying a page of results to return. This should be a next_page_token value returned from a previous ListSkus call. If unspecified, the first page of results is returned.

startTime - Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListSkusResponse.

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<ListSkusResponse> list(
  core.String parent, {
  core.String? currencyCode,
  core.String? endTime,
  core.int? pageSize,
  core.String? pageToken,
  core.String? startTime,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (currencyCode != null) 'currencyCode': [currencyCode],
    if (endTime != null) 'endTime': [endTime],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (startTime != null) 'startTime': [startTime],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/skus';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListSkusResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}