Skip to content

incident_io_client.api.schedules_v2.schedules_v2_update

asyncio async

asyncio(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody
) -> Optional[SchedulesV2UpdateResponseBody]

Update Schedules V2

Update a schedule.

Parameters:

Name Type Description Default
id str
required
body SchedulesV2UpdateRequestBody

Example: {'schedule': {'annotations': {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations': [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at': '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}], 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval': [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]}, 'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule', 'timezone': 'America/Los_Angeles'}}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[SchedulesV2UpdateResponseBody]

SchedulesV2UpdateResponseBody

Source code in incident_io_client/api/schedules_v2/schedules_v2_update.py
async def asyncio(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody,
) -> Optional[SchedulesV2UpdateResponseBody]:
    """Update Schedules V2

     Update a schedule.

    Args:
        id (str):
        body (SchedulesV2UpdateRequestBody):  Example: {'schedule': {'annotations':
            {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations':
            [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at':
            '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}],
            'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH',
            'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id':
            '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval':
            [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]},
            'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule',
            'timezone': 'America/Los_Angeles'}}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        SchedulesV2UpdateResponseBody
    """

    return (
        await asyncio_detailed(
            id=id,
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed async

asyncio_detailed(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody
) -> Response[SchedulesV2UpdateResponseBody]

Update Schedules V2

Update a schedule.

Parameters:

Name Type Description Default
id str
required
body SchedulesV2UpdateRequestBody

Example: {'schedule': {'annotations': {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations': [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at': '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}], 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval': [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]}, 'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule', 'timezone': 'America/Los_Angeles'}}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[SchedulesV2UpdateResponseBody]

Response[SchedulesV2UpdateResponseBody]

Source code in incident_io_client/api/schedules_v2/schedules_v2_update.py
async def asyncio_detailed(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody,
) -> Response[SchedulesV2UpdateResponseBody]:
    """Update Schedules V2

     Update a schedule.

    Args:
        id (str):
        body (SchedulesV2UpdateRequestBody):  Example: {'schedule': {'annotations':
            {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations':
            [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at':
            '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}],
            'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH',
            'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id':
            '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval':
            [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]},
            'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule',
            'timezone': 'America/Los_Angeles'}}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[SchedulesV2UpdateResponseBody]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync

sync(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody
) -> Optional[SchedulesV2UpdateResponseBody]

Update Schedules V2

Update a schedule.

Parameters:

Name Type Description Default
id str
required
body SchedulesV2UpdateRequestBody

Example: {'schedule': {'annotations': {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations': [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at': '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}], 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval': [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]}, 'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule', 'timezone': 'America/Los_Angeles'}}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[SchedulesV2UpdateResponseBody]

SchedulesV2UpdateResponseBody

Source code in incident_io_client/api/schedules_v2/schedules_v2_update.py
def sync(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody,
) -> Optional[SchedulesV2UpdateResponseBody]:
    """Update Schedules V2

     Update a schedule.

    Args:
        id (str):
        body (SchedulesV2UpdateRequestBody):  Example: {'schedule': {'annotations':
            {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations':
            [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at':
            '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}],
            'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH',
            'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id':
            '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval':
            [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]},
            'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule',
            'timezone': 'America/Los_Angeles'}}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        SchedulesV2UpdateResponseBody
    """

    return sync_detailed(
        id=id,
        client=client,
        body=body,
    ).parsed

sync_detailed

sync_detailed(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody
) -> Response[SchedulesV2UpdateResponseBody]

Update Schedules V2

Update a schedule.

Parameters:

Name Type Description Default
id str
required
body SchedulesV2UpdateRequestBody

Example: {'schedule': {'annotations': {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations': [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at': '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}], 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval': [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]}, 'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule', 'timezone': 'America/Los_Angeles'}}.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[SchedulesV2UpdateResponseBody]

Response[SchedulesV2UpdateResponseBody]

Source code in incident_io_client/api/schedules_v2/schedules_v2_update.py
def sync_detailed(
    id: str,
    *,
    client: Union[AuthenticatedClient, Client],
    body: SchedulesV2UpdateRequestBody,
) -> Response[SchedulesV2UpdateResponseBody]:
    """Update Schedules V2

     Update a schedule.

    Args:
        id (str):
        body (SchedulesV2UpdateRequestBody):  Example: {'schedule': {'annotations':
            {'incident.io/terraform/version': 'version-of-terraform'}, 'config': {'rotations':
            [{'effective_from': '2021-08-17T13:28:57.801578Z', 'handover_start_at':
            '2021-08-17T13:28:57.801578Z', 'handovers': [{'interval': 1, 'interval_type': 'daily'}],
            'id': '01G0J1EXE7AXZ2C93K61WBPYEH', 'layers': [{'id': '01G0J1EXE7AXZ2C93K61WBPYEH',
            'name': 'Layer 1'}], 'name': 'My Rotation', 'users': [{'email': 'bob@example.com', 'id':
            '01G0J1EXE7AXZ2C93K61WBPYEH', 'slack_user_id': 'USER123'}], 'working_interval':
            [{'end_time': '17:00', 'start_time': '09:00', 'weekday': 'tuesday'}]}]},
            'holidays_public_config': {'country_codes': ['abc123']}, 'name': 'My Schedule',
            'timezone': 'America/Los_Angeles'}}.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[SchedulesV2UpdateResponseBody]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)