createRcsAgent method
Creates a new RCS agent for sending rich messages through the RCS channel. The RCS agent serves as an origination identity for sending RCS messages to your recipients.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter clientToken :
Unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If you don't specify a client token, a
randomly generated token is used for the request to ensure idempotency.
Parameter deletionProtectionEnabled :
By default this is set to false. When set to true the RCS agent can't be
deleted. You can change this value using the UpdateRcsAgent action.
Parameter optOutListName :
The OptOutList to associate with the RCS agent. Valid values are either
OptOutListName or OptOutListArn.
Parameter tags :
An array of tags (key and value pairs) associated with the RCS agent.
Implementation
Future<CreateRcsAgentResult> createRcsAgent({
String? clientToken,
bool? deletionProtectionEnabled,
String? optOutListName,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PinpointSMSVoiceV2.CreateRcsAgent'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (deletionProtectionEnabled != null)
'DeletionProtectionEnabled': deletionProtectionEnabled,
if (optOutListName != null) 'OptOutListName': optOutListName,
if (tags != null) 'Tags': tags,
},
);
return CreateRcsAgentResult.fromJson(jsonResponse.body);
}