Skip to content

Message

thingiverse.api.message

Contains endpoint functions for accessing the API

post_messages

asyncio(*, client, body=UNSET) async

Create a new message to share a thing

Parameters:

Name Type Description Default
body PostMessagesBody | Unset
UNSET

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
PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404 | None

PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404

Source code in thingiverse/api/message/post_messages.py
async def asyncio(
    *,
    client: AuthenticatedClient,
    body: PostMessagesBody | Unset = UNSET,
) -> (
    PostMessagesResponse200
    | PostMessagesResponse400
    | PostMessagesResponse401
    | PostMessagesResponse403
    | PostMessagesResponse404
    | None
):
    """Create a new message to share a thing

    Args:
        body (PostMessagesBody | Unset):

    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:
        PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404
    """

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

asyncio_detailed(*, client, body=UNSET) async

Create a new message to share a thing

Parameters:

Name Type Description Default
body PostMessagesBody | Unset
UNSET

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[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]

Response[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]

Source code in thingiverse/api/message/post_messages.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient,
    body: PostMessagesBody | Unset = UNSET,
) -> Response[
    PostMessagesResponse200
    | PostMessagesResponse400
    | PostMessagesResponse401
    | PostMessagesResponse403
    | PostMessagesResponse404
]:
    """Create a new message to share a thing

    Args:
        body (PostMessagesBody | Unset):

    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[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync(*, client, body=UNSET)

Create a new message to share a thing

Parameters:

Name Type Description Default
body PostMessagesBody | Unset
UNSET

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
PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404 | None

PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404

Source code in thingiverse/api/message/post_messages.py
def sync(
    *,
    client: AuthenticatedClient,
    body: PostMessagesBody | Unset = UNSET,
) -> (
    PostMessagesResponse200
    | PostMessagesResponse400
    | PostMessagesResponse401
    | PostMessagesResponse403
    | PostMessagesResponse404
    | None
):
    """Create a new message to share a thing

    Args:
        body (PostMessagesBody | Unset):

    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:
        PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404
    """

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

sync_detailed(*, client, body=UNSET)

Create a new message to share a thing

Parameters:

Name Type Description Default
body PostMessagesBody | Unset
UNSET

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[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]

Response[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]

Source code in thingiverse/api/message/post_messages.py
def sync_detailed(
    *,
    client: AuthenticatedClient,
    body: PostMessagesBody | Unset = UNSET,
) -> Response[
    PostMessagesResponse200
    | PostMessagesResponse400
    | PostMessagesResponse401
    | PostMessagesResponse403
    | PostMessagesResponse404
]:
    """Create a new message to share a thing

    Args:
        body (PostMessagesBody | Unset):

    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[PostMessagesResponse200 | PostMessagesResponse400 | PostMessagesResponse401 | PostMessagesResponse403 | PostMessagesResponse404]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)