:doc:`SSMContacts <../../ssm-contacts>` / Client / list_preview_rotation_shifts

****************************
list_preview_rotation_shifts
****************************



.. py:method:: SSMContacts.Client.list_preview_rotation_shifts(**kwargs)

  

  Returns a list of shifts based on rotation configuration parameters.

   

  .. note::

    

    The Incident Manager primarily uses this operation to populate the **Preview** calendar. It is not typically run by end users.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-contacts-2021-05-03/ListPreviewRotationShifts>`_  


  **Request Syntax**
  ::

    response = client.list_preview_rotation_shifts(
        RotationStartTime=datetime(2015, 1, 1),
        StartTime=datetime(2015, 1, 1),
        EndTime=datetime(2015, 1, 1),
        Members=[
            'string',
        ],
        TimeZoneId='string',
        Recurrence={
            'MonthlySettings': [
                {
                    'DayOfMonth': 123,
                    'HandOffTime': {
                        'HourOfDay': 123,
                        'MinuteOfHour': 123
                    }
                },
            ],
            'WeeklySettings': [
                {
                    'DayOfWeek': 'MON'|'TUE'|'WED'|'THU'|'FRI'|'SAT'|'SUN',
                    'HandOffTime': {
                        'HourOfDay': 123,
                        'MinuteOfHour': 123
                    }
                },
            ],
            'DailySettings': [
                {
                    'HourOfDay': 123,
                    'MinuteOfHour': 123
                },
            ],
            'NumberOfOnCalls': 123,
            'ShiftCoverages': {
                'string': [
                    {
                        'Start': {
                            'HourOfDay': 123,
                            'MinuteOfHour': 123
                        },
                        'End': {
                            'HourOfDay': 123,
                            'MinuteOfHour': 123
                        }
                    },
                ]
            },
            'RecurrenceMultiplier': 123
        },
        Overrides=[
            {
                'NewMembers': [
                    'string',
                ],
                'StartTime': datetime(2015, 1, 1),
                'EndTime': datetime(2015, 1, 1)
            },
        ],
        NextToken='string',
        MaxResults=123
    )
    
  :type RotationStartTime: datetime
  :param RotationStartTime: 

    The date and time a rotation would begin. The first shift is calculated from this date and time.

    

  
  :type StartTime: datetime
  :param StartTime: 

    Used to filter the range of calculated shifts before sending the response back to the user.

    

  
  :type EndTime: datetime
  :param EndTime: **[REQUIRED]** 

    The date and time a rotation shift would end.

    

  
  :type Members: list
  :param Members: **[REQUIRED]** 

    The contacts that would be assigned to a rotation.

    

  
    - *(string) --* 

    

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

    The time zone the rotation’s activity would be based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul".

    

  
  :type Recurrence: dict
  :param Recurrence: **[REQUIRED]** 

    Information about how long a rotation would last before restarting at the beginning of the shift order.

    

  
    - **MonthlySettings** *(list) --* 

      Information about on-call rotations that recur monthly.

      

    
      - *(dict) --* 

        Information about on-call rotations that recur monthly.

        

      
        - **DayOfMonth** *(integer) --* **[REQUIRED]** 

          The day of the month when monthly recurring on-call rotations begin.

          

        
        - **HandOffTime** *(dict) --* **[REQUIRED]** 

          The time of day when a monthly recurring on-call shift rotation begins.

          

        
          - **HourOfDay** *(integer) --* **[REQUIRED]** 

            The hour when an on-call rotation shift begins or ends.

            

          
          - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

            The minute when an on-call rotation shift begins or ends.

            

          
        
      
  
    - **WeeklySettings** *(list) --* 

      Information about on-call rotations that recur weekly.

      

    
      - *(dict) --* 

        Information about rotations that recur weekly.

        

      
        - **DayOfWeek** *(string) --* **[REQUIRED]** 

          The day of the week when weekly recurring on-call shift rotations begins.

          

        
        - **HandOffTime** *(dict) --* **[REQUIRED]** 

          The time of day when a weekly recurring on-call shift rotation begins.

          

        
          - **HourOfDay** *(integer) --* **[REQUIRED]** 

            The hour when an on-call rotation shift begins or ends.

            

          
          - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

            The minute when an on-call rotation shift begins or ends.

            

          
        
      
  
    - **DailySettings** *(list) --* 

      Information about on-call rotations that recur daily.

      

    
      - *(dict) --* 

        Details about when an on-call rotation shift begins or ends.

        

      
        - **HourOfDay** *(integer) --* **[REQUIRED]** 

          The hour when an on-call rotation shift begins or ends.

          

        
        - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

          The minute when an on-call rotation shift begins or ends.

          

        
      
  
    - **NumberOfOnCalls** *(integer) --* **[REQUIRED]** 

      The number of contacts, or shift team members designated to be on call concurrently during a shift. For example, in an on-call schedule that contains ten contacts, a value of ``2`` designates that two of them are on call at any given time.

      

    
    - **ShiftCoverages** *(dict) --* 

      Information about the days of the week that the on-call rotation coverage includes.

      

    
      - *(string) --* 

      
        - *(list) --* 

        
          - *(dict) --* 

            Information about when an on-call shift begins and ends.

            

          
            - **Start** *(dict) --* 

              Information about when the on-call rotation shift begins.

              

            
              - **HourOfDay** *(integer) --* **[REQUIRED]** 

                The hour when an on-call rotation shift begins or ends.

                

              
              - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

                The minute when an on-call rotation shift begins or ends.

                

              
            
            - **End** *(dict) --* 

              Information about when the on-call rotation shift ends.

              

            
              - **HourOfDay** *(integer) --* **[REQUIRED]** 

                The hour when an on-call rotation shift begins or ends.

                

              
              - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

                The minute when an on-call rotation shift begins or ends.

                

              
            
          
      
  

    - **RecurrenceMultiplier** *(integer) --* **[REQUIRED]** 

      The number of days, weeks, or months a single rotation lasts.

      

    
  
  :type Overrides: list
  :param Overrides: 

    Information about changes that would be made in a rotation override.

    

  
    - *(dict) --* 

      Information about contacts and times that an on-call override replaces.

      

    
      - **NewMembers** *(list) --* 

        Information about contacts to add to an on-call rotation override.

        

      
        - *(string) --* 

        
    
      - **StartTime** *(datetime) --* 

        Information about the time a rotation override would begin.

        

      
      - **EndTime** *(datetime) --* 

        Information about the time a rotation override would end.

        

      
    

  :type NextToken: string
  :param NextToken: 

    A token to start the list. This token is used to get the next set of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of items to return for this call. The call also returns a token that can be specified in a subsequent call to get the next set of results.

    

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

    
    ::

      {
          'RotationShifts': [
              {
                  'ContactIds': [
                      'string',
                  ],
                  'StartTime': datetime(2015, 1, 1),
                  'EndTime': datetime(2015, 1, 1),
                  'Type': 'REGULAR'|'OVERRIDDEN',
                  'ShiftDetails': {
                      'OverriddenContactIds': [
                          'string',
                      ]
                  }
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **RotationShifts** *(list) --* 

        Details about a rotation shift, including times, types, and contacts.

        
        

        - *(dict) --* 

          Information about a shift that belongs to an on-call rotation.

          
          

          - **ContactIds** *(list) --* 

            The Amazon Resource Names (ARNs) of the contacts who are part of the shift rotation.

            
            

            - *(string) --* 
        
          

          - **StartTime** *(datetime) --* 

            The time a shift rotation begins.

            
          

          - **EndTime** *(datetime) --* 

            The time a shift rotation ends.

            
          

          - **Type** *(string) --* 

            The type of shift rotation.

            
          

          - **ShiftDetails** *(dict) --* 

            Additional information about an on-call rotation shift.

            
            

            - **OverriddenContactIds** *(list) --* 

              The Amazon Resources Names (ARNs) of the contacts who were replaced in a shift when an override was created. If the override is deleted, these contacts are restored to the shift.

              
              

              - *(string) --* 
          
        
      
    
      

      - **NextToken** *(string) --* 

        The token for the next set of items to return. This token is used to get the next set of results.

        
  
  **Exceptions**
  
  *   :py:class:`SSMContacts.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`SSMContacts.Client.exceptions.InternalServerException`

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

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

  