updateMobileDeviceAccessRule method

Future<void> updateMobileDeviceAccessRule({
  1. required MobileDeviceAccessRuleEffect effect,
  2. required String mobileDeviceAccessRuleId,
  3. required String name,
  4. required String organizationId,
  5. String? description,
  6. List<String>? deviceModels,
  7. List<String>? deviceOperatingSystems,
  8. List<String>? deviceTypes,
  9. List<String>? deviceUserAgents,
  10. List<String>? notDeviceModels,
  11. List<String>? notDeviceOperatingSystems,
  12. List<String>? notDeviceTypes,
  13. List<String>? notDeviceUserAgents,
})

Updates a mobile device access rule for the specified WorkMail organization.

May throw EntityNotFoundException. May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter effect : The effect of the rule when it matches. Allowed values are ALLOW or DENY.

Parameter mobileDeviceAccessRuleId : The identifier of the rule to be updated.

Parameter name : The updated rule name.

Parameter organizationId : The WorkMail organization under which the rule will be updated.

Parameter description : The updated rule description.

Parameter deviceModels : Device models that the updated rule will match.

Parameter deviceOperatingSystems : Device operating systems that the updated rule will match.

Parameter deviceTypes : Device types that the updated rule will match.

Parameter deviceUserAgents : User agents that the updated rule will match.

Parameter notDeviceModels : Device models that the updated rule will not match. All other device models will match.

Parameter notDeviceOperatingSystems : Device operating systems that the updated rule will not match. All other device operating systems will match.

Parameter notDeviceTypes : Device types that the updated rule will not match. All other device types will match.

Parameter notDeviceUserAgents : User agents that the updated rule will not match. All other user agents will match.

Implementation

Future<void> updateMobileDeviceAccessRule({
  required MobileDeviceAccessRuleEffect effect,
  required String mobileDeviceAccessRuleId,
  required String name,
  required String organizationId,
  String? description,
  List<String>? deviceModels,
  List<String>? deviceOperatingSystems,
  List<String>? deviceTypes,
  List<String>? deviceUserAgents,
  List<String>? notDeviceModels,
  List<String>? notDeviceOperatingSystems,
  List<String>? notDeviceTypes,
  List<String>? notDeviceUserAgents,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.UpdateMobileDeviceAccessRule'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Effect': effect.value,
      'MobileDeviceAccessRuleId': mobileDeviceAccessRuleId,
      'Name': name,
      'OrganizationId': organizationId,
      if (description != null) 'Description': description,
      if (deviceModels != null) 'DeviceModels': deviceModels,
      if (deviceOperatingSystems != null)
        'DeviceOperatingSystems': deviceOperatingSystems,
      if (deviceTypes != null) 'DeviceTypes': deviceTypes,
      if (deviceUserAgents != null) 'DeviceUserAgents': deviceUserAgents,
      if (notDeviceModels != null) 'NotDeviceModels': notDeviceModels,
      if (notDeviceOperatingSystems != null)
        'NotDeviceOperatingSystems': notDeviceOperatingSystems,
      if (notDeviceTypes != null) 'NotDeviceTypes': notDeviceTypes,
      if (notDeviceUserAgents != null)
        'NotDeviceUserAgents': notDeviceUserAgents,
    },
  );
}