Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions activitysmith_openapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# import apis into sdk package
from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi
from activitysmith_openapi.api.devices_api import DevicesApi
from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi
from activitysmith_openapi.api.metrics_api import MetricsApi
from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi
Expand All @@ -34,6 +35,9 @@
from activitysmith_openapi.exceptions import ApiException

# import models into sdk package
from activitysmith_openapi.models.account_device import AccountDevice
from activitysmith_openapi.models.account_device_list_response import AccountDeviceListResponse
from activitysmith_openapi.models.account_device_list_response_meta import AccountDeviceListResponseMeta
from activitysmith_openapi.models.activity_metric import ActivityMetric
from activitysmith_openapi.models.activity_metric_value import ActivityMetricValue
from activitysmith_openapi.models.alert_payload import AlertPayload
Expand Down
1 change: 1 addition & 0 deletions activitysmith_openapi/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# import apis into api package
from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi
from activitysmith_openapi.api.devices_api import DevicesApi
from activitysmith_openapi.api.live_activities_api import LiveActivitiesApi
from activitysmith_openapi.api.metrics_api import MetricsApi
from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi
Expand Down
340 changes: 340 additions & 0 deletions activitysmith_openapi/api/devices_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,340 @@
# coding: utf-8

"""
ActivitySmith API

Send push notifications and Live Activities to your own devices via a single API key.

The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool
from typing import Optional
from typing_extensions import Annotated
from activitysmith_openapi.models.account_device_list_response import AccountDeviceListResponse

from activitysmith_openapi.api_client import ApiClient, RequestSerialized
from activitysmith_openapi.api_response import ApiResponse
from activitysmith_openapi.rest import RESTResponseType


class DevicesApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

Do not edit the class manually.
"""

def __init__(self, api_client=None) -> None:
if api_client is None:
api_client = ApiClient.get_default()
self.api_client = api_client


@validate_call
def list_account_devices(
self,
limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum devices to return, 1 to 100. Defaults to 100.")] = None,
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Devices to skip. Use meta.next_offset from the previous page.")] = None,
include_inactive: Annotated[Optional[StrictBool], Field(description="Include devices that can no longer receive deliveries, such as unpaired phones.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> AccountDeviceListResponse:
"""List paired devices

Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.

:param limit: Maximum devices to return, 1 to 100. Defaults to 100.
:type limit: int
:param offset: Devices to skip. Use meta.next_offset from the previous page.
:type offset: int
:param include_inactive: Include devices that can no longer receive deliveries, such as unpaired phones.
:type include_inactive: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._list_account_devices_serialize(
limit=limit,
offset=offset,
include_inactive=include_inactive,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AccountDeviceListResponse",
'403': "ForbiddenError",
'429': "RateLimitError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def list_account_devices_with_http_info(
self,
limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum devices to return, 1 to 100. Defaults to 100.")] = None,
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Devices to skip. Use meta.next_offset from the previous page.")] = None,
include_inactive: Annotated[Optional[StrictBool], Field(description="Include devices that can no longer receive deliveries, such as unpaired phones.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[AccountDeviceListResponse]:
"""List paired devices

Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.

:param limit: Maximum devices to return, 1 to 100. Defaults to 100.
:type limit: int
:param offset: Devices to skip. Use meta.next_offset from the previous page.
:type offset: int
:param include_inactive: Include devices that can no longer receive deliveries, such as unpaired phones.
:type include_inactive: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._list_account_devices_serialize(
limit=limit,
offset=offset,
include_inactive=include_inactive,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AccountDeviceListResponse",
'403': "ForbiddenError",
'429': "RateLimitError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def list_account_devices_without_preload_content(
self,
limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum devices to return, 1 to 100. Defaults to 100.")] = None,
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Devices to skip. Use meta.next_offset from the previous page.")] = None,
include_inactive: Annotated[Optional[StrictBool], Field(description="Include devices that can no longer receive deliveries, such as unpaired phones.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""List paired devices

Lists the iPhones and iPads paired to the account, active devices first. Use it to check that a device is paired before you send, or to find device IDs for Channels. An empty list means no device is paired yet: install the ActivitySmith app from the App Store and sign in. Channel-scoped API keys cannot list devices.

:param limit: Maximum devices to return, 1 to 100. Defaults to 100.
:type limit: int
:param offset: Devices to skip. Use meta.next_offset from the previous page.
:type offset: int
:param include_inactive: Include devices that can no longer receive deliveries, such as unpaired phones.
:type include_inactive: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._list_account_devices_serialize(
limit=limit,
offset=offset,
include_inactive=include_inactive,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AccountDeviceListResponse",
'403': "ForbiddenError",
'429': "RateLimitError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _list_account_devices_serialize(
self,
limit,
offset,
include_inactive,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
if limit is not None:

_query_params.append(('limit', limit))

if offset is not None:

_query_params.append(('offset', offset))

if include_inactive is not None:

_query_params.append(('include_inactive', include_inactive))

# process the header parameters
# process the form parameters
# process the body parameter


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)


# authentication setting
_auth_settings: List[str] = [
'apiKeyAuth'
]

return self.api_client.param_serialize(
method='GET',
resource_path='/account/devices',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)


Loading
Loading