:doc:`IVS <../../ivs>` / Client / create_playback_restriction_policy

**********************************
create_playback_restriction_policy
**********************************



.. py:method:: IVS.Client.create_playback_restriction_policy(**kwargs)

  

  Creates a new playback restriction policy, for constraining playback by countries and/or origins.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ivs-2020-07-14/CreatePlaybackRestrictionPolicy>`_  


  **Request Syntax**
  ::

    response = client.create_playback_restriction_policy(
        allowedCountries=[
            'string',
        ],
        allowedOrigins=[
            'string',
        ],
        enableStrictOriginEnforcement=True|False,
        name='string',
        tags={
            'string': 'string'
        }
    )
    
  :type allowedCountries: list
  :param allowedCountries: 

    A list of country codes that control geoblocking restriction. Allowed values are the officially assigned `ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`__ codes. Default: All countries (an empty array).

    

  
    - *(string) --* 

    

  :type allowedOrigins: list
  :param allowedOrigins: 

    A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at `https\://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin>`__. Default: All origins (an empty array).

    

  
    - *(string) --* 

    

  :type enableStrictOriginEnforcement: boolean
  :param enableStrictOriginEnforcement: 

    Whether channel playback is constrained by origin site. Default: ``false``.

    

  
  :type name: string
  :param name: 

    Playback-restriction-policy name. The value does not need to be unique.

    

  
  :type tags: dict
  :param tags: 

    Array of 1-50 maps, each of the form ``string:string (key:value)``. See `Best practices and strategies <https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html>`__ in *Tagging Amazon Web Services Resources and Tag Editor* for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'playbackRestrictionPolicy': {
              'allowedCountries': [
                  'string',
              ],
              'allowedOrigins': [
                  'string',
              ],
              'arn': 'string',
              'enableStrictOriginEnforcement': True|False,
              'name': 'string',
              'tags': {
                  'string': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **playbackRestrictionPolicy** *(dict) --* 
        

        - **allowedCountries** *(list) --* 

          A list of country codes that control geoblocking restriction. Allowed values are the officially assigned `ISO 3166-1 alpha-2 <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`__ codes. Default: All countries (an empty array).

          
          

          - *(string) --* 
      
        

        - **allowedOrigins** *(list) --* 

          A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at `https\://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin>`__. Default: All origins (an empty array).

          
          

          - *(string) --* 
      
        

        - **arn** *(string) --* 

          Playback-restriction-policy ARN

          
        

        - **enableStrictOriginEnforcement** *(boolean) --* 

          Whether channel playback is constrained by origin site. Default: ``false``.

          
        

        - **name** *(string) --* 

          Playback-restriction-policy name. The value does not need to be unique.

          
        

        - **tags** *(dict) --* 

          Tags attached to the resource. Array of 1-50 maps, each of the form ``string:string (key:value)``. See `Best practices and strategies <https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html>`__ in *Tagging Amazon Web Services Resources and Tag Editor* for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
    
  
  **Exceptions**
  
  *   :py:class:`IVS.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`IVS.Client.exceptions.ValidationException`

  
  *   :py:class:`IVS.Client.exceptions.PendingVerification`

  
  *   :py:class:`IVS.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IVS.Client.exceptions.ServiceQuotaExceededException`

  