share method

Future<ShareAlbumResponse> share(
  1. ShareAlbumRequest request,
  2. String albumId, {
  3. String? $fields,
})

Marks an album as shared and accessible to other users.

This action can only be performed on albums which were created by the developer via the API.

request - The metadata request object.

Request parameters:

albumId - Required. Identifier of the album to be shared. This albumId must belong to an album created by the developer. Value must have pattern ^\[^/\]+$.

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

Completes with a ShareAlbumResponse.

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<ShareAlbumResponse> share(
  ShareAlbumRequest request,
  core.String albumId, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/albums/' + core.Uri.encodeFull('$albumId') + ':share';

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