inttegro.resources.chimes

Generated public typing surface. Do not edit by hand.

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

Chimes(http: inttegro.http_client.HttpClient)
19    def __init__(self, http: HttpClient):
20        """Initialize Chimes resource with HTTP client."""
21        self.http = http

Initialize Chimes resource with HTTP client.

http
def send( self, payload: inttegro.chime.SendRequest) -> inttegro.chime.Chime:
23    def send(self, payload: dict):
24        """
25        Send an immediate transactional notification.
26
27        Sends an SMS or email notification to a customer right away. Use this for time-
28        sensitive messages like payment confirmations or OTP codes.
29
30        Args:
31            payload: Notification parameters including type, recipient, and message
32
33        Returns:
34            domain object containing the sent chime with id, status, and sent_at
35
36        Example:
37            ```python
38            result = client.chimes.send({
39                "type": "sms",
40                "recipient": "+233241234567",
41                "message": "Your order has been confirmed. Total: GHS 50.00"
42            })
43            ```
44
45        See Also:
46            - schedule(): Schedule notification for future delivery
47        """
48        return 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
def lookup(self, chime_id: str) -> inttegro.chime.Chime:
50    def lookup(self, chime_id: str):
51        """
52        Retrieve details of a sent notification.
53
54        Fetches information about a previously sent chime including its delivery status
55        and timing.
56
57        Args:
58            chime_id: The chime ID (e.g., "chm_abc123")
59
60        Returns:
61            domain object containing the chime with delivery details
62
63        Example:
64            ```python
65            result = client.chimes.lookup("chm_abc123")
66            print(f"Status: {result.id}")
67            ```
68
69        See Also:
70            - send(): Send notifications
71        """
72        return 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
def page( self, payload: inttegro.chime.PageRequest | None = None) -> inttegro.chime.Page:
74    def page(self, payload: dict | None = None):
75        """
76        List chimes with page-based pagination.
77
78        Args:
79            payload: Optional pagination parameters.
80
81        Returns:
82            domain object containing a page of chimes.
83        """
84        return 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.

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

Retrieve the effective, non-secret Chime delivery settings.

def schedule( self, payload: inttegro.schedule.ChimeRequest) -> inttegro.schedule.CreationDetail:
 90    def schedule(self, payload: dict):
 91        """
 92        Schedule a notification for future delivery.
 93
 94        Schedules an SMS or email to be sent at a specific time in the future. Use this
 95        for reminder messages or follow-ups.
 96
 97        Args:
 98            payload: Scheduling parameters including recipients, message, and send_after
 99
100        Returns:
101            domain object containing the scheduled chime
102
103        Example:
104            ```python
105            from datetime import datetime, timedelta
106            tomorrow = (datetime.now() + timedelta(days=1)).isoformat()
107            result = client.chimes.schedule({
108                "recipients": ["+233241234567", "user@example.com"],
109                "full_message": "Reminder: Your appointment is tomorrow",
110                "send_after": tomorrow,
111                "sender_id": "YourBrand"
112            })
113            ```
114
115        See Also:
116            - send(): Send immediate notifications
117        """
118        return 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
def broadcast( self, payload: inttegro.broadcast.Request) -> inttegro.broadcast.CreationDetail:
120    def broadcast(self, payload: dict):
121        """
122        Broadcast a chime to multiple recipients.
123
124        Queues a broadcast with a shared message template. Use broadcasts for marketing
125        announcements or bulk notifications.
126
127        Args:
128            payload: Broadcast parameters including recipients and message template
129
130        Returns:
131            domain object containing broadcast summary
132        """
133        return 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