putMobileDeviceAccessOverride method

Future<void> putMobileDeviceAccessOverride({
  1. required String deviceId,
  2. required MobileDeviceAccessRuleEffect effect,
  3. required String organizationId,
  4. required String userId,
  5. String? description,
})

Creates or updates a mobile device access override for the given WorkMail organization, user, and device.

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

Parameter deviceId : The mobile device for which you create the override. DeviceId is case insensitive.

Parameter effect : The effect of the override, ALLOW or DENY.

Parameter organizationId : Identifies the WorkMail organization for which you create the override.

Parameter userId : The WorkMail user for which you create the override. Accepts the following types of user identities:

  • User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
  • Email address: user@domain.tld
  • User name: user

Parameter description : A description of the override.

Implementation

Future<void> putMobileDeviceAccessOverride({
  required String deviceId,
  required MobileDeviceAccessRuleEffect effect,
  required String organizationId,
  required String userId,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.PutMobileDeviceAccessOverride'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DeviceId': deviceId,
      'Effect': effect.value,
      'OrganizationId': organizationId,
      'UserId': userId,
      if (description != null) 'Description': description,
    },
  );
}