updateSipRule method
Updates the details of the specified SIP rule.
May throw BadRequestException.
May throw ConflictException.
May throw ForbiddenException.
May throw NotFoundException.
May throw ResourceLimitExceededException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter name :
The new name for the specified SIP rule.
Parameter sipRuleId :
The SIP rule ID.
Parameter disabled :
The new value that indicates whether the rule is disabled.
Parameter targetApplications :
The new list of target applications.
Implementation
Future<UpdateSipRuleResponse> updateSipRule({
required String name,
required String sipRuleId,
bool? disabled,
List<SipRuleTargetApplication>? targetApplications,
}) async {
final $payload = <String, dynamic>{
'Name': name,
if (disabled != null) 'Disabled': disabled,
if (targetApplications != null) 'TargetApplications': targetApplications,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/sip-rules/${Uri.encodeComponent(sipRuleId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateSipRuleResponse.fromJson(response);
}