updateSipRule method

Future<UpdateSipRuleResponse> updateSipRule({
  1. required String name,
  2. required String sipRuleId,
  3. bool? disabled,
  4. List<SipRuleTargetApplication>? targetApplications,
})

Updates the details for the specified SIP rule.

May throw UnauthorizedClientException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ConflictException. May throw ThrottledClientException. May throw ResourceLimitExceededException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter name : The new name for the specified SIP rule.

Parameter sipRuleId : The SIP rule ID.

Parameter disabled : The new value specified to indicate whether the rule is disabled.

Parameter targetApplications : The new value of the list of target applications.

Implementation

Future<UpdateSipRuleResponse> updateSipRule({
  required String name,
  required String sipRuleId,
  bool? disabled,
  List<SipRuleTargetApplication>? targetApplications,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sipRuleId, 'sipRuleId');
  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);
}