list method

Future<ListAttachmentsResponse> list(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? $fields,
})

List all the attachments associated with a support case.

EXAMPLES: cURL: shell case="projects/some-project/cases/23598314" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/attachments" Python:

supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport", version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
) request = ( supportApiService.cases() .attachments()
.list(parent="projects/some-project/cases/43595344") )
print(request.execute()) ```

Request parameters:

[parent] - Required. The name of the case for which attachments should be
listed.
Value must have pattern `^\[^/\]+/\[^/\]+/cases/\[^/\]+$`.

[pageSize] - The maximum number of attachments fetched with each request.
If not provided, the default is 10. The maximum page size that will be
returned is 100. The size of each page can be smaller than the requested
page size and can include zero. For example, you could request 100
attachments on one page, receive 0, and then on the next page, receive 90.

[pageToken] - A token identifying the page of results to return. If
unspecified, the first page is retrieved.

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

Completes with a [ListAttachmentsResponse].

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

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/attachments';

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