disassociateOriginationIdentity method
Removes the specified origination identity from an existing pool.
If the origination identity isn't associated with the specified pool, an error is returned.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter originationIdentity :
The origination identity to use such as a PhoneNumberId, PhoneNumberArn,
SenderId or SenderIdArn. You can use DescribePhoneNumbers find the
values for PhoneNumberId and PhoneNumberArn, or use
DescribeSenderIds to get the values for SenderId and SenderIdArn.
Parameter poolId :
The unique identifier for the pool to disassociate with the origination
identity. This value can be either the PoolId or PoolArn.
Parameter clientToken :
Unique, case-sensitive identifier 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 isoCountryCode :
The two-character code, in ISO 3166-1 alpha-2 format, for the country or
region. This field is optional and is not required for origination
identity types that are not country-specific, such as RCS agents.
Implementation
Future<DisassociateOriginationIdentityResult>
disassociateOriginationIdentity({
required String originationIdentity,
required String poolId,
String? clientToken,
String? isoCountryCode,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PinpointSMSVoiceV2.DisassociateOriginationIdentity'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OriginationIdentity': originationIdentity,
'PoolId': poolId,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (isoCountryCode != null) 'IsoCountryCode': isoCountryCode,
},
);
return DisassociateOriginationIdentityResult.fromJson(jsonResponse.body);
}