- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateMobileDeviceAccessRuleCommand
Creates a new mobile device access rule for the specified WorkMail organization.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { WorkMailClient, CreateMobileDeviceAccessRuleCommand } from "@aws-sdk/client-workmail"; // ES Modules import
// const { WorkMailClient, CreateMobileDeviceAccessRuleCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
const client = new WorkMailClient(config);
const input = { // CreateMobileDeviceAccessRuleRequest
OrganizationId: "STRING_VALUE", // required
ClientToken: "STRING_VALUE",
Name: "STRING_VALUE", // required
Description: "STRING_VALUE",
Effect: "ALLOW" || "DENY", // required
DeviceTypes: [ // DeviceTypeList
"STRING_VALUE",
],
NotDeviceTypes: [
"STRING_VALUE",
],
DeviceModels: [ // DeviceModelList
"STRING_VALUE",
],
NotDeviceModels: [
"STRING_VALUE",
],
DeviceOperatingSystems: [ // DeviceOperatingSystemList
"STRING_VALUE",
],
NotDeviceOperatingSystems: [
"STRING_VALUE",
],
DeviceUserAgents: [ // DeviceUserAgentList
"STRING_VALUE",
],
NotDeviceUserAgents: [
"STRING_VALUE",
],
};
const command = new CreateMobileDeviceAccessRuleCommand(input);
const response = await client.send(command);
// { // CreateMobileDeviceAccessRuleResponse
// MobileDeviceAccessRuleId: "STRING_VALUE",
// };
CreateMobileDeviceAccessRuleCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Effect Required | MobileDeviceAccessRuleEffect | undefined | The effect of the rule when it matches. Allowed values are |
Name Required | string | undefined | The rule name. |
OrganizationId Required | string | undefined | The WorkMail organization under which the rule will be created. |
ClientToken | string | undefined | The idempotency token for the client request. |
Description | string | undefined | The rule description. |
DeviceModels | string[] | undefined | Device models that the rule will match. |
DeviceOperatingSystems | string[] | undefined | Device operating systems that the rule will match. |
DeviceTypes | string[] | undefined | Device types that the rule will match. |
DeviceUserAgents | string[] | undefined | Device user agents that the rule will match. |
NotDeviceModels | string[] | undefined | Device models that the rule will not match. All other device models will match. |
NotDeviceOperatingSystems | string[] | undefined | Device operating systems that the rule will not match. All other device operating systems will match. |
NotDeviceTypes | string[] | undefined | Device types that the rule will not match. All other device types will match. |
NotDeviceUserAgents | string[] | undefined | Device user agents that the rule will not match. All other device user agents will match. |
CreateMobileDeviceAccessRuleCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
MobileDeviceAccessRuleId | string | undefined | The identifier for the newly created mobile device access rule. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterException | client | One or more of the input parameters don't match the service's restrictions. |
LimitExceededException | client | The request exceeds the limit of the resource. |
OrganizationNotFoundException | client | An operation received a valid organization identifier that either doesn't belong or exist in the system. |
OrganizationStateException | client | The organization must have a valid state to perform certain operations on the organization or its members. |
WorkMailServiceException | Base exception class for all service exceptions from WorkMail service. |