Skip to content

incident_io_client.api.incident_attachments_v1.incident_attachments_v1_create

asyncio async

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

Create Incident Attachments V1

Attaches an external resource to an incident

Parameters:

Name Type Description Default
body IncidentAttachmentsV1CreateRequestBody

Example: {'incident_id': '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type': 'pager_duty_incident'}}.

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

IncidentAttachmentsV1CreateResponseBody

Source code in incident_io_client/api/incident_attachments_v1/incident_attachments_v1_create.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentAttachmentsV1CreateRequestBody,
) -> Optional[IncidentAttachmentsV1CreateResponseBody]:
    """Create Incident Attachments V1

     Attaches an external resource to an incident

    Args:
        body (IncidentAttachmentsV1CreateRequestBody):  Example: {'incident_id':
            '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type':
            'pager_duty_incident'}}.

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

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

asyncio_detailed async

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

Create Incident Attachments V1

Attaches an external resource to an incident

Parameters:

Name Type Description Default
body IncidentAttachmentsV1CreateRequestBody

Example: {'incident_id': '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type': 'pager_duty_incident'}}.

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

Response[IncidentAttachmentsV1CreateResponseBody]

Source code in incident_io_client/api/incident_attachments_v1/incident_attachments_v1_create.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentAttachmentsV1CreateRequestBody,
) -> Response[IncidentAttachmentsV1CreateResponseBody]:
    """Create Incident Attachments V1

     Attaches an external resource to an incident

    Args:
        body (IncidentAttachmentsV1CreateRequestBody):  Example: {'incident_id':
            '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type':
            'pager_duty_incident'}}.

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

    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: IncidentAttachmentsV1CreateRequestBody
) -> Optional[IncidentAttachmentsV1CreateResponseBody]

Create Incident Attachments V1

Attaches an external resource to an incident

Parameters:

Name Type Description Default
body IncidentAttachmentsV1CreateRequestBody

Example: {'incident_id': '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type': 'pager_duty_incident'}}.

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

IncidentAttachmentsV1CreateResponseBody

Source code in incident_io_client/api/incident_attachments_v1/incident_attachments_v1_create.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentAttachmentsV1CreateRequestBody,
) -> Optional[IncidentAttachmentsV1CreateResponseBody]:
    """Create Incident Attachments V1

     Attaches an external resource to an incident

    Args:
        body (IncidentAttachmentsV1CreateRequestBody):  Example: {'incident_id':
            '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type':
            'pager_duty_incident'}}.

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

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

sync_detailed

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

Create Incident Attachments V1

Attaches an external resource to an incident

Parameters:

Name Type Description Default
body IncidentAttachmentsV1CreateRequestBody

Example: {'incident_id': '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type': 'pager_duty_incident'}}.

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

Response[IncidentAttachmentsV1CreateResponseBody]

Source code in incident_io_client/api/incident_attachments_v1/incident_attachments_v1_create.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    body: IncidentAttachmentsV1CreateRequestBody,
) -> Response[IncidentAttachmentsV1CreateResponseBody]:
    """Create Incident Attachments V1

     Attaches an external resource to an incident

    Args:
        body (IncidentAttachmentsV1CreateRequestBody):  Example: {'incident_id':
            '01FDAG4SAP5TYPT98WGR2N7W91', 'resource': {'external_id': '123', 'resource_type':
            'pager_duty_incident'}}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)