:doc:`WorkMail <../../workmail>` / Client / create_mobile_device_access_rule

********************************
create_mobile_device_access_rule
********************************



.. py:method:: WorkMail.Client.create_mobile_device_access_rule(**kwargs)

  

  Creates a new mobile device access rule for the specified WorkMail organization.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateMobileDeviceAccessRule>`_  


  **Request Syntax**
  ::

    response = client.create_mobile_device_access_rule(
        OrganizationId='string',
        ClientToken='string',
        Name='string',
        Description='string',
        Effect='ALLOW'|'DENY',
        DeviceTypes=[
            'string',
        ],
        NotDeviceTypes=[
            'string',
        ],
        DeviceModels=[
            'string',
        ],
        NotDeviceModels=[
            'string',
        ],
        DeviceOperatingSystems=[
            'string',
        ],
        NotDeviceOperatingSystems=[
            'string',
        ],
        DeviceUserAgents=[
            'string',
        ],
        NotDeviceUserAgents=[
            'string',
        ]
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The WorkMail organization under which the rule will be created.

    

  
  :type ClientToken: string
  :param ClientToken: 

    The idempotency token for the client request.

    This field is autopopulated if not provided.

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    The rule name.

    

  
  :type Description: string
  :param Description: 

    The rule description.

    

  
  :type Effect: string
  :param Effect: **[REQUIRED]** 

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

    

  
  :type DeviceTypes: list
  :param DeviceTypes: 

    Device types that the rule will match.

    

  
    - *(string) --* 

    

  :type NotDeviceTypes: list
  :param NotDeviceTypes: 

    Device types that the rule **will not** match. All other device types will match.

    

  
    - *(string) --* 

    

  :type DeviceModels: list
  :param DeviceModels: 

    Device models that the rule will match.

    

  
    - *(string) --* 

    

  :type NotDeviceModels: list
  :param NotDeviceModels: 

    Device models that the rule **will not** match. All other device models will match.

    

  
    - *(string) --* 

    

  :type DeviceOperatingSystems: list
  :param DeviceOperatingSystems: 

    Device operating systems that the rule will match.

    

  
    - *(string) --* 

    

  :type NotDeviceOperatingSystems: list
  :param NotDeviceOperatingSystems: 

    Device operating systems that the rule **will not** match. All other device operating systems will match.

    

  
    - *(string) --* 

    

  :type DeviceUserAgents: list
  :param DeviceUserAgents: 

    Device user agents that the rule will match.

    

  
    - *(string) --* 

    

  :type NotDeviceUserAgents: list
  :param NotDeviceUserAgents: 

    Device user agents that the rule **will not** match. All other device user agents will match.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'MobileDeviceAccessRuleId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **MobileDeviceAccessRuleId** *(string) --* 

        The identifier for the newly created mobile device access rule.

        
  
  **Exceptions**
  
  *   :py:class:`WorkMail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`WorkMail.Client.exceptions.LimitExceededException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  