inttegro.async_resources.chimes

Generated public typing surface. Do not edit by hand.

  1# Generated by scripts/generate_async_resources.py; do not edit by hand.
  2"""Chimes resource for sending transactional notifications."""
  3from __future__ import annotations
  4from ..async_http_client import AsyncHttpClient
  5
  6class AsyncChimes:
  7    """
  8    Chimes resource for sending transactional notifications to customers.
  9
 10    Chimes are transactional messages sent via SMS or email to notify customers about
 11    important events like payment confirmations, order updates, and OTP codes.
 12
 13    See https://studio.inttegro.com/api/chimes for detailed documentation.
 14    """
 15
 16    def __init__(self, http: AsyncHttpClient):
 17        """Initialize Chimes resource with HTTP client."""
 18        self.http = http
 19
 20    async def send(self, payload: dict):
 21        """
 22        Send an immediate transactional notification.
 23
 24        Sends an SMS or email notification to a customer right away. Use this for time-
 25        sensitive messages like payment confirmations or OTP codes.
 26
 27        Args:
 28            payload: Notification parameters including type, recipient, and message
 29
 30        Returns:
 31            domain object containing the sent chime with id, status, and sent_at
 32
 33        Example:
 34            ```python
 35            result = client.chimes.send({
 36                "type": "sms",
 37                "recipient": "+233241234567",
 38                "message": "Your order has been confirmed. Total: GHS 50.00"
 39            })
 40            ```
 41
 42        See Also:
 43            - schedule(): Schedule notification for future delivery
 44        """
 45        return await self.http.post('/chimes/send', payload)
 46
 47    async def lookup(self, chime_id: str):
 48        """
 49        Retrieve details of a sent notification.
 50
 51        Fetches information about a previously sent chime including its delivery status
 52        and timing.
 53
 54        Args:
 55            chime_id: The chime ID (e.g., "chm_abc123")
 56
 57        Returns:
 58            domain object containing the chime with delivery details
 59
 60        Example:
 61            ```python
 62            result = client.chimes.lookup("chm_abc123")
 63            print(f"Status: {result.id}")
 64            ```
 65
 66        See Also:
 67            - send(): Send notifications
 68        """
 69        return await self.http.post('/chimes/lookup', {'chime_id': chime_id})
 70
 71    async def page(self, payload: dict | None=None):
 72        """
 73        List chimes with page-based pagination.
 74
 75        Args:
 76            payload: Optional pagination parameters.
 77
 78        Returns:
 79            domain object containing a page of chimes.
 80        """
 81        return await self.http.post('/chimes/page', payload or {})
 82
 83    async def settings(self):
 84        """Retrieve the effective, non-secret Chime delivery settings."""
 85        return await self.http.post('/chimes/settings', {})
 86
 87    async def schedule(self, payload: dict):
 88        """
 89        Schedule a notification for future delivery.
 90
 91        Schedules an SMS or email to be sent at a specific time in the future. Use this
 92        for reminder messages or follow-ups.
 93
 94        Args:
 95            payload: Scheduling parameters including recipients, message, and send_after
 96
 97        Returns:
 98            domain object containing the scheduled chime
 99
100        Example:
101            ```python
102            from datetime import datetime, timedelta
103            tomorrow = (datetime.now() + timedelta(days=1)).isoformat()
104            result = client.chimes.schedule({
105                "recipients": ["+233241234567", "user@example.com"],
106                "full_message": "Reminder: Your appointment is tomorrow",
107                "send_after": tomorrow,
108                "sender_id": "YourBrand"
109            })
110            ```
111
112        See Also:
113            - send(): Send immediate notifications
114        """
115        return await self.http.post('/chimes/schedule', payload)
116
117    async def broadcast(self, payload: dict):
118        """
119        Broadcast a chime to multiple recipients.
120
121        Queues a broadcast with a shared message template. Use broadcasts for marketing
122        announcements or bulk notifications.
123
124        Args:
125            payload: Broadcast parameters including recipients and message template
126
127        Returns:
128            domain object containing broadcast summary
129        """
130        return await self.http.post('/chimes/broadcast', payload)
class AsyncChimes:
  7class AsyncChimes:
  8    """
  9    Chimes resource for sending transactional notifications to customers.
 10
 11    Chimes are transactional messages sent via SMS or email to notify customers about
 12    important events like payment confirmations, order updates, and OTP codes.
 13
 14    See https://studio.inttegro.com/api/chimes for detailed documentation.
 15    """
 16
 17    def __init__(self, http: AsyncHttpClient):
 18        """Initialize Chimes resource with HTTP client."""
 19        self.http = http
 20
 21    async def send(self, payload: dict):
 22        """
 23        Send an immediate transactional notification.
 24
 25        Sends an SMS or email notification to a customer right away. Use this for time-
 26        sensitive messages like payment confirmations or OTP codes.
 27
 28        Args:
 29            payload: Notification parameters including type, recipient, and message
 30
 31        Returns:
 32            domain object containing the sent chime with id, status, and sent_at
 33
 34        Example:
 35            ```python
 36            result = client.chimes.send({
 37                "type": "sms",
 38                "recipient": "+233241234567",
 39                "message": "Your order has been confirmed. Total: GHS 50.00"
 40            })
 41            ```
 42
 43        See Also:
 44            - schedule(): Schedule notification for future delivery
 45        """
 46        return await self.http.post('/chimes/send', payload)
 47
 48    async def lookup(self, chime_id: str):
 49        """
 50        Retrieve details of a sent notification.
 51
 52        Fetches information about a previously sent chime including its delivery status
 53        and timing.
 54
 55        Args:
 56            chime_id: The chime ID (e.g., "chm_abc123")
 57
 58        Returns:
 59            domain object containing the chime with delivery details
 60
 61        Example:
 62            ```python
 63            result = client.chimes.lookup("chm_abc123")
 64            print(f"Status: {result.id}")
 65            ```
 66
 67        See Also:
 68            - send(): Send notifications
 69        """
 70        return await self.http.post('/chimes/lookup', {'chime_id': chime_id})
 71
 72    async def page(self, payload: dict | None=None):
 73        """
 74        List chimes with page-based pagination.
 75
 76        Args:
 77            payload: Optional pagination parameters.
 78
 79        Returns:
 80            domain object containing a page of chimes.
 81        """
 82        return await self.http.post('/chimes/page', payload or {})
 83
 84    async def settings(self):
 85        """Retrieve the effective, non-secret Chime delivery settings."""
 86        return await self.http.post('/chimes/settings', {})
 87
 88    async def schedule(self, payload: dict):
 89        """
 90        Schedule a notification for future delivery.
 91
 92        Schedules an SMS or email to be sent at a specific time in the future. Use this
 93        for reminder messages or follow-ups.
 94
 95        Args:
 96            payload: Scheduling parameters including recipients, message, and send_after
 97
 98        Returns:
 99            domain object containing the scheduled chime
100
101        Example:
102            ```python
103            from datetime import datetime, timedelta
104            tomorrow = (datetime.now() + timedelta(days=1)).isoformat()
105            result = client.chimes.schedule({
106                "recipients": ["+233241234567", "user@example.com"],
107                "full_message": "Reminder: Your appointment is tomorrow",
108                "send_after": tomorrow,
109                "sender_id": "YourBrand"
110            })
111            ```
112
113        See Also:
114            - send(): Send immediate notifications
115        """
116        return await self.http.post('/chimes/schedule', payload)
117
118    async def broadcast(self, payload: dict):
119        """
120        Broadcast a chime to multiple recipients.
121
122        Queues a broadcast with a shared message template. Use broadcasts for marketing
123        announcements or bulk notifications.
124
125        Args:
126            payload: Broadcast parameters including recipients and message template
127
128        Returns:
129            domain object containing broadcast summary
130        """
131        return await self.http.post('/chimes/broadcast', payload)

Chimes resource for sending transactional notifications to customers.

Chimes are transactional messages sent via SMS or email to notify customers about important events like payment confirmations, order updates, and OTP codes.

See https://studio.inttegro.com/api/chimes for detailed documentation.

AsyncChimes(http: inttegro.async_http_client.AsyncHttpClient)
17    def __init__(self, http: AsyncHttpClient):
18        """Initialize Chimes resource with HTTP client."""
19        self.http = http

Initialize Chimes resource with HTTP client.

http
async def send( self, payload: inttegro.chime.SendRequest) -> inttegro.chime.Chime:
21    async def send(self, payload: dict):
22        """
23        Send an immediate transactional notification.
24
25        Sends an SMS or email notification to a customer right away. Use this for time-
26        sensitive messages like payment confirmations or OTP codes.
27
28        Args:
29            payload: Notification parameters including type, recipient, and message
30
31        Returns:
32            domain object containing the sent chime with id, status, and sent_at
33
34        Example:
35            ```python
36            result = client.chimes.send({
37                "type": "sms",
38                "recipient": "+233241234567",
39                "message": "Your order has been confirmed. Total: GHS 50.00"
40            })
41            ```
42
43        See Also:
44            - schedule(): Schedule notification for future delivery
45        """
46        return await self.http.post('/chimes/send', payload)

Send an immediate transactional notification.

Sends an SMS or email notification to a customer right away. Use this for time- sensitive messages like payment confirmations or OTP codes.

Arguments:
  • payload: Notification parameters including type, recipient, and message
Returns:

domain object containing the sent chime with id, status, and sent_at

Example:
result = client.chimes.send({
    "type": "sms",
    "recipient": "+233241234567",
    "message": "Your order has been confirmed. Total: GHS 50.00"
})
See Also:
  • schedule(): Schedule notification for future delivery
async def lookup(self, chime_id: str) -> inttegro.chime.Chime:
48    async def lookup(self, chime_id: str):
49        """
50        Retrieve details of a sent notification.
51
52        Fetches information about a previously sent chime including its delivery status
53        and timing.
54
55        Args:
56            chime_id: The chime ID (e.g., "chm_abc123")
57
58        Returns:
59            domain object containing the chime with delivery details
60
61        Example:
62            ```python
63            result = client.chimes.lookup("chm_abc123")
64            print(f"Status: {result.id}")
65            ```
66
67        See Also:
68            - send(): Send notifications
69        """
70        return await self.http.post('/chimes/lookup', {'chime_id': chime_id})

Retrieve details of a sent notification.

Fetches information about a previously sent chime including its delivery status and timing.

Arguments:
  • chime_id: The chime ID (e.g., "chm_abc123")
Returns:

domain object containing the chime with delivery details

Example:
result = client.chimes.lookup("chm_abc123")
print(f"Status: {result.id}")
See Also:
  • send(): Send notifications
async def page( self, payload: inttegro.chime.PageRequest | None = None) -> inttegro.chime.Page:
72    async def page(self, payload: dict | None=None):
73        """
74        List chimes with page-based pagination.
75
76        Args:
77            payload: Optional pagination parameters.
78
79        Returns:
80            domain object containing a page of chimes.
81        """
82        return await self.http.post('/chimes/page', payload or {})

List chimes with page-based pagination.

Arguments:
  • payload: Optional pagination parameters.
Returns:

domain object containing a page of chimes.

async def settings(self) -> inttegro.chime.Settings:
84    async def settings(self):
85        """Retrieve the effective, non-secret Chime delivery settings."""
86        return await self.http.post('/chimes/settings', {})

Retrieve the effective, non-secret Chime delivery settings.

async def schedule( self, payload: inttegro.schedule.ChimeRequest) -> inttegro.schedule.CreationDetail:
 88    async def schedule(self, payload: dict):
 89        """
 90        Schedule a notification for future delivery.
 91
 92        Schedules an SMS or email to be sent at a specific time in the future. Use this
 93        for reminder messages or follow-ups.
 94
 95        Args:
 96            payload: Scheduling parameters including recipients, message, and send_after
 97
 98        Returns:
 99            domain object containing the scheduled chime
100
101        Example:
102            ```python
103            from datetime import datetime, timedelta
104            tomorrow = (datetime.now() + timedelta(days=1)).isoformat()
105            result = client.chimes.schedule({
106                "recipients": ["+233241234567", "user@example.com"],
107                "full_message": "Reminder: Your appointment is tomorrow",
108                "send_after": tomorrow,
109                "sender_id": "YourBrand"
110            })
111            ```
112
113        See Also:
114            - send(): Send immediate notifications
115        """
116        return await self.http.post('/chimes/schedule', payload)

Schedule a notification for future delivery.

Schedules an SMS or email to be sent at a specific time in the future. Use this for reminder messages or follow-ups.

Arguments:
  • payload: Scheduling parameters including recipients, message, and send_after
Returns:

domain object containing the scheduled chime

Example:
from datetime import datetime, timedelta
tomorrow = (datetime.now() + timedelta(days=1)).isoformat()
result = client.chimes.schedule({
    "recipients": ["+233241234567", "user@example.com"],
    "full_message": "Reminder: Your appointment is tomorrow",
    "send_after": tomorrow,
    "sender_id": "YourBrand"
})
See Also:
  • send(): Send immediate notifications
async def broadcast( self, payload: inttegro.broadcast.Request) -> inttegro.broadcast.CreationDetail:
118    async def broadcast(self, payload: dict):
119        """
120        Broadcast a chime to multiple recipients.
121
122        Queues a broadcast with a shared message template. Use broadcasts for marketing
123        announcements or bulk notifications.
124
125        Args:
126            payload: Broadcast parameters including recipients and message template
127
128        Returns:
129            domain object containing broadcast summary
130        """
131        return await self.http.post('/chimes/broadcast', payload)

Broadcast a chime to multiple recipients.

Queues a broadcast with a shared message template. Use broadcasts for marketing announcements or bulk notifications.

Arguments:
  • payload: Broadcast parameters including recipients and message template
Returns:

domain object containing broadcast summary