putResourcePolicy method
Stores a resource policy for the ARN of a Project or
ReportGroup object.
May throw InvalidInputException.
May throw ResourceNotFoundException.
Parameter policy :
A JSON-formatted resource policy. For more information, see Sharing
a Project and Sharing
a Report Group in the CodeBuild User Guide.
Parameter resourceArn :
The ARN of the Project or ReportGroup resource
you want to associate with a resource policy.
Implementation
Future<PutResourcePolicyOutput> putResourcePolicy({
required String policy,
required String resourceArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeBuild_20161006.PutResourcePolicy'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'policy': policy,
'resourceArn': resourceArn,
},
);
return PutResourcePolicyOutput.fromJson(jsonResponse.body);
}