listFileShares method

Future<ListFileSharesOutput> listFileShares({
  1. String? gatewayARN,
  2. int? limit,
  3. String? marker,
})

Gets a list of the file shares for a specific file gateway, or the list of file shares that belong to the calling user account. This operation is only supported for file gateways.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter gatewayARN : The Amazon Resource Name (ARN) of the gateway whose file shares you want to list. If this field is not present, all file shares under your account are listed.

Parameter limit : The maximum number of file shares to return in the response. The value must be an integer with a value greater than zero. Optional.

Parameter marker : Opaque pagination token returned from a previous ListFileShares operation. If present, Marker specifies where to continue the list from after a previous call to ListFileShares. Optional.

Implementation

Future<ListFileSharesOutput> listFileShares({
  String? gatewayARN,
  int? limit,
  String? marker,
}) async {
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.ListFileShares'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (gatewayARN != null) 'GatewayARN': gatewayARN,
      if (limit != null) 'Limit': limit,
      if (marker != null) 'Marker': marker,
    },
  );

  return ListFileSharesOutput.fromJson(jsonResponse.body);
}