Skip to content

incident_io_client.api.incident_roles_v1.incident_roles_v1_create

asyncio async

asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody
) -> Optional[IncidentRolesV1CreateResponseBody]

Create Incident Roles V1

Create a new incident role

Parameters:

Name Type Description Default
body IncidentRolesV1CreateRequestBody

Example: {'description': 'The person currently coordinating the incident', 'instructions': 'Take point on the incident; Make sure people are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform': 'lead'}.

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[IncidentRolesV1CreateResponseBody]

IncidentRolesV1CreateResponseBody

Source code in incident_io_client/api/incident_roles_v1/incident_roles_v1_create.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody,
) -> Optional[IncidentRolesV1CreateResponseBody]:
    """Create Incident Roles V1

     Create a new incident role

    Args:
        body (IncidentRolesV1CreateRequestBody):  Example: {'description': 'The person currently
            coordinating the incident', 'instructions': 'Take point on the incident; Make sure people
            are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform':
            'lead'}.

    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:
        IncidentRolesV1CreateResponseBody
    """

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

asyncio_detailed async

asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody
) -> Response[IncidentRolesV1CreateResponseBody]

Create Incident Roles V1

Create a new incident role

Parameters:

Name Type Description Default
body IncidentRolesV1CreateRequestBody

Example: {'description': 'The person currently coordinating the incident', 'instructions': 'Take point on the incident; Make sure people are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform': 'lead'}.

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[IncidentRolesV1CreateResponseBody]

Response[IncidentRolesV1CreateResponseBody]

Source code in incident_io_client/api/incident_roles_v1/incident_roles_v1_create.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody,
) -> Response[IncidentRolesV1CreateResponseBody]:
    """Create Incident Roles V1

     Create a new incident role

    Args:
        body (IncidentRolesV1CreateRequestBody):  Example: {'description': 'The person currently
            coordinating the incident', 'instructions': 'Take point on the incident; Make sure people
            are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform':
            'lead'}.

    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[IncidentRolesV1CreateResponseBody]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync

sync(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody
) -> Optional[IncidentRolesV1CreateResponseBody]

Create Incident Roles V1

Create a new incident role

Parameters:

Name Type Description Default
body IncidentRolesV1CreateRequestBody

Example: {'description': 'The person currently coordinating the incident', 'instructions': 'Take point on the incident; Make sure people are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform': 'lead'}.

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[IncidentRolesV1CreateResponseBody]

IncidentRolesV1CreateResponseBody

Source code in incident_io_client/api/incident_roles_v1/incident_roles_v1_create.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody,
) -> Optional[IncidentRolesV1CreateResponseBody]:
    """Create Incident Roles V1

     Create a new incident role

    Args:
        body (IncidentRolesV1CreateRequestBody):  Example: {'description': 'The person currently
            coordinating the incident', 'instructions': 'Take point on the incident; Make sure people
            are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform':
            'lead'}.

    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:
        IncidentRolesV1CreateResponseBody
    """

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

sync_detailed

sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody
) -> Response[IncidentRolesV1CreateResponseBody]

Create Incident Roles V1

Create a new incident role

Parameters:

Name Type Description Default
body IncidentRolesV1CreateRequestBody

Example: {'description': 'The person currently coordinating the incident', 'instructions': 'Take point on the incident; Make sure people are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform': 'lead'}.

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[IncidentRolesV1CreateResponseBody]

Response[IncidentRolesV1CreateResponseBody]

Source code in incident_io_client/api/incident_roles_v1/incident_roles_v1_create.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentRolesV1CreateRequestBody,
) -> Response[IncidentRolesV1CreateResponseBody]:
    """Create Incident Roles V1

     Create a new incident role

    Args:
        body (IncidentRolesV1CreateRequestBody):  Example: {'description': 'The person currently
            coordinating the incident', 'instructions': 'Take point on the incident; Make sure people
            are clear on responsibilities', 'name': 'Incident Lead', 'required': False, 'shortform':
            'lead'}.

    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[IncidentRolesV1CreateResponseBody]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)