addProfilePermission method
Adds cross-account permissions to a signing profile.
May throw ValidationException. May throw ResourceNotFoundException. May throw AccessDeniedException. May throw ServiceLimitExceededException. May throw ConflictException. May throw TooManyRequestsException. May throw InternalServiceErrorException.
Parameter action
:
The AWS Signer action permitted as part of cross-account permissions.
Parameter principal
:
The AWS principal receiving cross-account permissions. This may be an IAM
role or another AWS account ID.
Parameter profileName
:
The human-readable name of the signing profile.
Parameter statementId
:
A unique identifier for the cross-account permission statement.
Parameter profileVersion
:
The version of the signing profile.
Parameter revisionId
:
A unique identifier for the current profile revision.
Implementation
Future<AddProfilePermissionResponse> addProfilePermission({
required String action,
required String principal,
required String profileName,
required String statementId,
String? profileVersion,
String? revisionId,
}) async {
ArgumentError.checkNotNull(action, 'action');
ArgumentError.checkNotNull(principal, 'principal');
ArgumentError.checkNotNull(profileName, 'profileName');
_s.validateStringLength(
'profileName',
profileName,
2,
64,
isRequired: true,
);
ArgumentError.checkNotNull(statementId, 'statementId');
_s.validateStringLength(
'profileVersion',
profileVersion,
10,
10,
);
final $payload = <String, dynamic>{
'action': action,
'principal': principal,
'statementId': statementId,
if (profileVersion != null) 'profileVersion': profileVersion,
if (revisionId != null) 'revisionId': revisionId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/signing-profiles/${Uri.encodeComponent(profileName)}/permissions',
exceptionFnMap: _exceptionFns,
);
return AddProfilePermissionResponse.fromJson(response);
}