updateRule method

Future<UpdateRuleOutput> updateRule({
  1. required String domainIdentifier,
  2. required String identifier,
  3. String? description,
  4. RuleDetail? detail,
  5. bool? includeChildDomainUnits,
  6. String? name,
  7. RuleScope? scope,
})

Updates a rule. In Amazon DataZone, a rule is a formal agreement that enforces specific requirements across user workflows (e.g., publishing assets to the catalog, requesting subscriptions, creating projects) within the Amazon DataZone data portal. These rules help maintain consistency, ensure compliance, and uphold governance standards in data management processes. For instance, a metadata enforcement rule can specify the required information for creating a subscription request or publishing a data asset to the catalog, ensuring alignment with organizational standards.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The ID of the domain in which a rule is to be updated.

Parameter identifier : The ID of the rule that is to be updated

Parameter description : The description of the rule.

Parameter detail : The detail of the rule.

Parameter includeChildDomainUnits : Specifies whether to update this rule in the child domain units.

Parameter name : The name of the rule.

Parameter scope : The scrope of the rule.

Implementation

Future<UpdateRuleOutput> updateRule({
  required String domainIdentifier,
  required String identifier,
  String? description,
  RuleDetail? detail,
  bool? includeChildDomainUnits,
  String? name,
  RuleScope? scope,
}) async {
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (detail != null) 'detail': detail,
    if (includeChildDomainUnits != null)
      'includeChildDomainUnits': includeChildDomainUnits,
    if (name != null) 'name': name,
    if (scope != null) 'scope': scope,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/rules/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRuleOutput.fromJson(response);
}