getLayerVersionPolicy method

Future<GetLayerVersionPolicyResponse> getLayerVersionPolicy({
  1. required String layerName,
  2. required int versionNumber,
})

Returns the permission policy for a version of an AWS Lambda layer. For more information, see AddLayerVersionPermission.

May throw ServiceException. May throw ResourceNotFoundException. May throw TooManyRequestsException. May throw InvalidParameterValueException.

Parameter layerName : The name or Amazon Resource Name (ARN) of the layer.

Parameter versionNumber : The version number.

Implementation

Future<GetLayerVersionPolicyResponse> getLayerVersionPolicy({
  required String layerName,
  required int versionNumber,
}) async {
  ArgumentError.checkNotNull(layerName, 'layerName');
  _s.validateStringLength(
    'layerName',
    layerName,
    1,
    140,
    isRequired: true,
  );
  ArgumentError.checkNotNull(versionNumber, 'versionNumber');
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2018-10-31/layers/${Uri.encodeComponent(layerName)}/versions/${Uri.encodeComponent(versionNumber.toString())}/policy',
    exceptionFnMap: _exceptionFns,
  );
  return GetLayerVersionPolicyResponse.fromJson(response);
}