surge_api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +28 -0
- data/README.md +286 -0
- data/SECURITY.md +27 -0
- data/lib/surge_api/client.rb +106 -0
- data/lib/surge_api/errors.rb +228 -0
- data/lib/surge_api/file_part.rb +55 -0
- data/lib/surge_api/internal/transport/base_client.rb +567 -0
- data/lib/surge_api/internal/transport/pooled_net_requester.rb +201 -0
- data/lib/surge_api/internal/type/array_of.rb +168 -0
- data/lib/surge_api/internal/type/base_model.rb +531 -0
- data/lib/surge_api/internal/type/base_page.rb +55 -0
- data/lib/surge_api/internal/type/boolean.rb +77 -0
- data/lib/surge_api/internal/type/converter.rb +327 -0
- data/lib/surge_api/internal/type/enum.rb +131 -0
- data/lib/surge_api/internal/type/file_input.rb +108 -0
- data/lib/surge_api/internal/type/hash_of.rb +188 -0
- data/lib/surge_api/internal/type/request_parameters.rb +42 -0
- data/lib/surge_api/internal/type/union.rb +250 -0
- data/lib/surge_api/internal/type/unknown.rb +81 -0
- data/lib/surge_api/internal/util.rb +915 -0
- data/lib/surge_api/internal.rb +20 -0
- data/lib/surge_api/models/account.rb +60 -0
- data/lib/surge_api/models/account_create_params.rb +481 -0
- data/lib/surge_api/models/account_retrieve_status_params.rb +32 -0
- data/lib/surge_api/models/account_status.rb +104 -0
- data/lib/surge_api/models/account_update_params.rb +480 -0
- data/lib/surge_api/models/blast.rb +61 -0
- data/lib/surge_api/models/blast_create_params.rb +90 -0
- data/lib/surge_api/models/call_ended_webhook_event.rb +106 -0
- data/lib/surge_api/models/campaign.rb +208 -0
- data/lib/surge_api/models/campaign_approved_webhook_event.rb +74 -0
- data/lib/surge_api/models/campaign_create_params.rb +202 -0
- data/lib/surge_api/models/contact.rb +59 -0
- data/lib/surge_api/models/contact_create_params.rb +54 -0
- data/lib/surge_api/models/contact_retrieve_params.rb +14 -0
- data/lib/surge_api/models/contact_update_params.rb +54 -0
- data/lib/surge_api/models/conversation_created_webhook_event.rb +70 -0
- data/lib/surge_api/models/error.rb +34 -0
- data/lib/surge_api/models/message.rb +146 -0
- data/lib/surge_api/models/message_create_params.rb +153 -0
- data/lib/surge_api/models/message_delivered_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_failed_webhook_event.rb +167 -0
- data/lib/surge_api/models/message_received_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_sent_webhook_event.rb +159 -0
- data/lib/surge_api/models/organization.rb +419 -0
- data/lib/surge_api/models/phone_number.rb +48 -0
- data/lib/surge_api/models/phone_number_purchase_params.rb +65 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +26 -0
- data/lib/surge_api/models/user.rb +51 -0
- data/lib/surge_api/models/user_create_params.rb +46 -0
- data/lib/surge_api/models/user_create_token_params.rb +22 -0
- data/lib/surge_api/models/user_retrieve_params.rb +14 -0
- data/lib/surge_api/models/user_token_response.rb +19 -0
- data/lib/surge_api/models/user_update_params.rb +46 -0
- data/lib/surge_api/models/verification.rb +58 -0
- data/lib/surge_api/models/verification_check.rb +43 -0
- data/lib/surge_api/models/verification_check_params.rb +22 -0
- data/lib/surge_api/models/verification_create_params.rb +22 -0
- data/lib/surge_api/models/webhook_unwrap_params.rb +14 -0
- data/lib/surge_api/models.rb +117 -0
- data/lib/surge_api/request_options.rb +77 -0
- data/lib/surge_api/resources/accounts.rb +102 -0
- data/lib/surge_api/resources/blasts.rb +53 -0
- data/lib/surge_api/resources/campaigns.rb +57 -0
- data/lib/surge_api/resources/contacts.rb +99 -0
- data/lib/surge_api/resources/messages.rb +75 -0
- data/lib/surge_api/resources/phone_numbers.rb +48 -0
- data/lib/surge_api/resources/users.rb +119 -0
- data/lib/surge_api/resources/verifications.rb +60 -0
- data/lib/surge_api/resources/webhooks.rb +22 -0
- data/lib/surge_api/version.rb +5 -0
- data/lib/surge_api.rb +100 -0
- data/manifest.yaml +15 -0
- data/rbi/surge_api/client.rbi +73 -0
- data/rbi/surge_api/errors.rbi +205 -0
- data/rbi/surge_api/file_part.rbi +37 -0
- data/rbi/surge_api/internal/transport/base_client.rbi +292 -0
- data/rbi/surge_api/internal/transport/pooled_net_requester.rbi +79 -0
- data/rbi/surge_api/internal/type/array_of.rbi +104 -0
- data/rbi/surge_api/internal/type/base_model.rbi +302 -0
- data/rbi/surge_api/internal/type/base_page.rbi +42 -0
- data/rbi/surge_api/internal/type/boolean.rbi +58 -0
- data/rbi/surge_api/internal/type/converter.rbi +216 -0
- data/rbi/surge_api/internal/type/enum.rbi +82 -0
- data/rbi/surge_api/internal/type/file_input.rbi +59 -0
- data/rbi/surge_api/internal/type/hash_of.rbi +104 -0
- data/rbi/surge_api/internal/type/request_parameters.rbi +29 -0
- data/rbi/surge_api/internal/type/union.rbi +128 -0
- data/rbi/surge_api/internal/type/unknown.rbi +58 -0
- data/rbi/surge_api/internal/util.rbi +487 -0
- data/rbi/surge_api/internal.rbi +16 -0
- data/rbi/surge_api/models/account.rbi +83 -0
- data/rbi/surge_api/models/account_create_params.rbi +1104 -0
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +96 -0
- data/rbi/surge_api/models/account_status.rbi +185 -0
- data/rbi/surge_api/models/account_update_params.rbi +1105 -0
- data/rbi/surge_api/models/blast.rbi +108 -0
- data/rbi/surge_api/models/blast_create_params.rbi +145 -0
- data/rbi/surge_api/models/call_ended_webhook_event.rbi +205 -0
- data/rbi/surge_api/models/campaign.rbi +331 -0
- data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +149 -0
- data/rbi/surge_api/models/campaign_create_params.rbi +386 -0
- data/rbi/surge_api/models/contact.rbi +88 -0
- data/rbi/surge_api/models/contact_create_params.rbi +87 -0
- data/rbi/surge_api/models/contact_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/contact_update_params.rbi +87 -0
- data/rbi/surge_api/models/conversation_created_webhook_event.rbi +129 -0
- data/rbi/surge_api/models/error.rbi +51 -0
- data/rbi/surge_api/models/message.rbi +283 -0
- data/rbi/surge_api/models/message_create_params.rbi +281 -0
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +335 -0
- data/rbi/surge_api/models/message_received_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +322 -0
- data/rbi/surge_api/models/organization.rbi +649 -0
- data/rbi/surge_api/models/phone_number.rbi +72 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +122 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +26 -0
- data/rbi/surge_api/models/user.rbi +80 -0
- data/rbi/surge_api/models/user_create_params.rbi +76 -0
- data/rbi/surge_api/models/user_create_token_params.rbi +46 -0
- data/rbi/surge_api/models/user_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/user_token_response.rbi +31 -0
- data/rbi/surge_api/models/user_update_params.rbi +76 -0
- data/rbi/surge_api/models/verification.rbi +86 -0
- data/rbi/surge_api/models/verification_check.rbi +84 -0
- data/rbi/surge_api/models/verification_check_params.rbi +40 -0
- data/rbi/surge_api/models/verification_create_params.rbi +40 -0
- data/rbi/surge_api/models/webhook_unwrap_params.rbi +27 -0
- data/rbi/surge_api/models.rbi +80 -0
- data/rbi/surge_api/request_options.rbi +59 -0
- data/rbi/surge_api/resources/accounts.rbi +94 -0
- data/rbi/surge_api/resources/blasts.rbi +48 -0
- data/rbi/surge_api/resources/campaigns.rbi +115 -0
- data/rbi/surge_api/resources/contacts.rbi +85 -0
- data/rbi/surge_api/resources/messages.rbi +72 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +43 -0
- data/rbi/surge_api/resources/users.rbi +96 -0
- data/rbi/surge_api/resources/verifications.rbi +43 -0
- data/rbi/surge_api/resources/webhooks.rbi +31 -0
- data/rbi/surge_api/version.rbi +5 -0
- data/sig/surge_api/client.rbs +42 -0
- data/sig/surge_api/errors.rbs +117 -0
- data/sig/surge_api/file_part.rbs +21 -0
- data/sig/surge_api/internal/transport/base_client.rbs +131 -0
- data/sig/surge_api/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/surge_api/internal/type/array_of.rbs +48 -0
- data/sig/surge_api/internal/type/base_model.rbs +102 -0
- data/sig/surge_api/internal/type/base_page.rbs +24 -0
- data/sig/surge_api/internal/type/boolean.rbs +26 -0
- data/sig/surge_api/internal/type/converter.rbs +79 -0
- data/sig/surge_api/internal/type/enum.rbs +32 -0
- data/sig/surge_api/internal/type/file_input.rbs +25 -0
- data/sig/surge_api/internal/type/hash_of.rbs +48 -0
- data/sig/surge_api/internal/type/request_parameters.rbs +17 -0
- data/sig/surge_api/internal/type/union.rbs +52 -0
- data/sig/surge_api/internal/type/unknown.rbs +26 -0
- data/sig/surge_api/internal/util.rbs +185 -0
- data/sig/surge_api/internal.rbs +9 -0
- data/sig/surge_api/models/account.rbs +40 -0
- data/sig/surge_api/models/account_create_params.rbs +433 -0
- data/sig/surge_api/models/account_retrieve_status_params.rbs +40 -0
- data/sig/surge_api/models/account_status.rbs +71 -0
- data/sig/surge_api/models/account_update_params.rbs +435 -0
- data/sig/surge_api/models/blast.rbs +64 -0
- data/sig/surge_api/models/blast_create_params.rbs +82 -0
- data/sig/surge_api/models/call_ended_webhook_event.rbs +99 -0
- data/sig/surge_api/models/campaign.rbs +122 -0
- data/sig/surge_api/models/campaign_approved_webhook_event.rbs +67 -0
- data/sig/surge_api/models/campaign_create_params.rbs +127 -0
- data/sig/surge_api/models/contact.rbs +53 -0
- data/sig/surge_api/models/contact_create_params.rbs +54 -0
- data/sig/surge_api/models/contact_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/contact_update_params.rbs +54 -0
- data/sig/surge_api/models/conversation_created_webhook_event.rbs +62 -0
- data/sig/surge_api/models/error.rbs +27 -0
- data/sig/surge_api/models/message.rbs +138 -0
- data/sig/surge_api/models/message_create_params.rbs +140 -0
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +148 -0
- data/sig/surge_api/models/message_received_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +143 -0
- data/sig/surge_api/models/organization.rbs +385 -0
- data/sig/surge_api/models/phone_number.rbs +37 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +62 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +18 -0
- data/sig/surge_api/models/user.rbs +48 -0
- data/sig/surge_api/models/user_create_params.rbs +47 -0
- data/sig/surge_api/models/user_create_token_params.rbs +26 -0
- data/sig/surge_api/models/user_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/user_token_response.rbs +15 -0
- data/sig/surge_api/models/user_update_params.rbs +47 -0
- data/sig/surge_api/models/verification.rbs +48 -0
- data/sig/surge_api/models/verification_check.rbs +45 -0
- data/sig/surge_api/models/verification_check_params.rbs +23 -0
- data/sig/surge_api/models/verification_create_params.rbs +23 -0
- data/sig/surge_api/models/webhook_unwrap_params.rbs +15 -0
- data/sig/surge_api/models.rbs +77 -0
- data/sig/surge_api/request_options.rbs +34 -0
- data/sig/surge_api/resources/accounts.rbs +30 -0
- data/sig/surge_api/resources/blasts.rbs +19 -0
- data/sig/surge_api/resources/campaigns.rbs +21 -0
- data/sig/surge_api/resources/contacts.rbs +32 -0
- data/sig/surge_api/resources/messages.rbs +18 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- data/sig/surge_api/resources/users.rbs +36 -0
- data/sig/surge_api/resources/verifications.rbs +18 -0
- data/sig/surge_api/resources/webhooks.rbs +17 -0
- data/sig/surge_api/version.rbs +3 -0
- metadata +269 -0
@@ -0,0 +1,159 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class MessageDeliveredWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
# @!attribute account_id
|
7
|
+
# The ID of the account in which this event occurred
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :account_id, String
|
11
|
+
|
12
|
+
# @!attribute data
|
13
|
+
# The data associated with the event
|
14
|
+
#
|
15
|
+
# @return [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data]
|
16
|
+
required :data, -> { SurgeAPI::MessageDeliveredWebhookEvent::Data }
|
17
|
+
|
18
|
+
# @!attribute timestamp
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
20
|
+
#
|
21
|
+
# @return [Time]
|
22
|
+
required :timestamp, Time
|
23
|
+
|
24
|
+
# @!attribute type
|
25
|
+
# The type of the event. Always `message.delivered` for this event.
|
26
|
+
#
|
27
|
+
# @return [Symbol, :"message.delivered"]
|
28
|
+
required :type, const: :"message.delivered"
|
29
|
+
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"message.delivered")
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
32
|
+
#
|
33
|
+
# @param data [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data] The data associated with the event
|
34
|
+
#
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
36
|
+
#
|
37
|
+
# @param type [Symbol, :"message.delivered"] The type of the event. Always `message.delivered` for this event.
|
38
|
+
|
39
|
+
# @see SurgeAPI::Models::MessageDeliveredWebhookEvent#data
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
41
|
+
# @!attribute id
|
42
|
+
# The unique identifier for the message
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
required :id, String
|
46
|
+
|
47
|
+
# @!attribute body
|
48
|
+
# The content of the message
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
required :body, String
|
52
|
+
|
53
|
+
# @!attribute conversation
|
54
|
+
# The conversation this message belongs to
|
55
|
+
#
|
56
|
+
# @return [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Conversation]
|
57
|
+
required :conversation, -> { SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation }
|
58
|
+
|
59
|
+
# @!attribute delivered_at
|
60
|
+
# When the message was delivered
|
61
|
+
#
|
62
|
+
# @return [Time]
|
63
|
+
required :delivered_at, Time
|
64
|
+
|
65
|
+
# @!attribute attachments
|
66
|
+
# Attachments included with the message
|
67
|
+
#
|
68
|
+
# @return [Array<SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment>, nil]
|
69
|
+
optional :attachments,
|
70
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment] }
|
71
|
+
|
72
|
+
# @!method initialize(id:, body:, conversation:, delivered_at:, attachments: nil)
|
73
|
+
# The data associated with the event
|
74
|
+
#
|
75
|
+
# @param id [String] The unique identifier for the message
|
76
|
+
#
|
77
|
+
# @param body [String] The content of the message
|
78
|
+
#
|
79
|
+
# @param conversation [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Conversation] The conversation this message belongs to
|
80
|
+
#
|
81
|
+
# @param delivered_at [Time] When the message was delivered
|
82
|
+
#
|
83
|
+
# @param attachments [Array<SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment>] Attachments included with the message
|
84
|
+
|
85
|
+
# @see SurgeAPI::Models::MessageDeliveredWebhookEvent::Data#conversation
|
86
|
+
class Conversation < SurgeAPI::Internal::Type::BaseModel
|
87
|
+
# @!attribute id
|
88
|
+
# The unique identifier for the conversation
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
required :id, String
|
92
|
+
|
93
|
+
# @!attribute contact
|
94
|
+
# A contact who has consented to receive messages
|
95
|
+
#
|
96
|
+
# @return [SurgeAPI::Models::Contact]
|
97
|
+
required :contact, -> { SurgeAPI::Contact }
|
98
|
+
|
99
|
+
# @!attribute phone_number
|
100
|
+
# A phone number that can be used to send and receive messages and calls
|
101
|
+
#
|
102
|
+
# @return [SurgeAPI::Models::PhoneNumber]
|
103
|
+
required :phone_number, -> { SurgeAPI::PhoneNumber }
|
104
|
+
|
105
|
+
# @!method initialize(id:, contact:, phone_number:)
|
106
|
+
# The conversation this message belongs to
|
107
|
+
#
|
108
|
+
# @param id [String] The unique identifier for the conversation
|
109
|
+
#
|
110
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
111
|
+
#
|
112
|
+
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
113
|
+
end
|
114
|
+
|
115
|
+
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
116
|
+
# @!attribute id
|
117
|
+
# The unique identifier for the attachment
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
required :id, String
|
121
|
+
|
122
|
+
# @!attribute type
|
123
|
+
# The type of attachment
|
124
|
+
#
|
125
|
+
# @return [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment::Type]
|
126
|
+
required :type, enum: -> { SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment::Type }
|
127
|
+
|
128
|
+
# @!attribute url
|
129
|
+
# The URL where the attachment can be downloaded
|
130
|
+
#
|
131
|
+
# @return [String]
|
132
|
+
required :url, String
|
133
|
+
|
134
|
+
# @!method initialize(id:, type:, url:)
|
135
|
+
# @param id [String] The unique identifier for the attachment
|
136
|
+
#
|
137
|
+
# @param type [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment::Type] The type of attachment
|
138
|
+
#
|
139
|
+
# @param url [String] The URL where the attachment can be downloaded
|
140
|
+
|
141
|
+
# The type of attachment
|
142
|
+
#
|
143
|
+
# @see SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment#type
|
144
|
+
module Type
|
145
|
+
extend SurgeAPI::Internal::Type::Enum
|
146
|
+
|
147
|
+
FILE = :file
|
148
|
+
IMAGE = :image
|
149
|
+
LINK = :link
|
150
|
+
VIDEO = :video
|
151
|
+
|
152
|
+
# @!method self.values
|
153
|
+
# @return [Array<Symbol>]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class MessageFailedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
# @!attribute account_id
|
7
|
+
# The ID of the account in which this event occurred
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :account_id, String
|
11
|
+
|
12
|
+
# @!attribute data
|
13
|
+
# The data associated with the event
|
14
|
+
#
|
15
|
+
# @return [SurgeAPI::Models::MessageFailedWebhookEvent::Data]
|
16
|
+
required :data, -> { SurgeAPI::MessageFailedWebhookEvent::Data }
|
17
|
+
|
18
|
+
# @!attribute timestamp
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
20
|
+
#
|
21
|
+
# @return [Time]
|
22
|
+
required :timestamp, Time
|
23
|
+
|
24
|
+
# @!attribute type
|
25
|
+
# The type of the event. Always `message.failed` for this event.
|
26
|
+
#
|
27
|
+
# @return [Symbol, :"message.failed"]
|
28
|
+
required :type, const: :"message.failed"
|
29
|
+
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"message.failed")
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
32
|
+
#
|
33
|
+
# @param data [SurgeAPI::Models::MessageFailedWebhookEvent::Data] The data associated with the event
|
34
|
+
#
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
36
|
+
#
|
37
|
+
# @param type [Symbol, :"message.failed"] The type of the event. Always `message.failed` for this event.
|
38
|
+
|
39
|
+
# @see SurgeAPI::Models::MessageFailedWebhookEvent#data
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
41
|
+
# @!attribute id
|
42
|
+
# The unique identifier for the message
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
required :id, String
|
46
|
+
|
47
|
+
# @!attribute body
|
48
|
+
# The content of the message
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
required :body, String
|
52
|
+
|
53
|
+
# @!attribute conversation
|
54
|
+
# The conversation this message belongs to
|
55
|
+
#
|
56
|
+
# @return [SurgeAPI::Models::MessageFailedWebhookEvent::Data::Conversation]
|
57
|
+
required :conversation, -> { SurgeAPI::MessageFailedWebhookEvent::Data::Conversation }
|
58
|
+
|
59
|
+
# @!attribute failed_at
|
60
|
+
# When the message failed
|
61
|
+
#
|
62
|
+
# @return [Time]
|
63
|
+
required :failed_at, Time
|
64
|
+
|
65
|
+
# @!attribute failure_reason
|
66
|
+
# The reason the message failed to be delivered
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
required :failure_reason, String
|
70
|
+
|
71
|
+
# @!attribute attachments
|
72
|
+
# Attachments included with the message
|
73
|
+
#
|
74
|
+
# @return [Array<SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment>, nil]
|
75
|
+
optional :attachments,
|
76
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::MessageFailedWebhookEvent::Data::Attachment] }
|
77
|
+
|
78
|
+
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, attachments: nil)
|
79
|
+
# The data associated with the event
|
80
|
+
#
|
81
|
+
# @param id [String] The unique identifier for the message
|
82
|
+
#
|
83
|
+
# @param body [String] The content of the message
|
84
|
+
#
|
85
|
+
# @param conversation [SurgeAPI::Models::MessageFailedWebhookEvent::Data::Conversation] The conversation this message belongs to
|
86
|
+
#
|
87
|
+
# @param failed_at [Time] When the message failed
|
88
|
+
#
|
89
|
+
# @param failure_reason [String] The reason the message failed to be delivered
|
90
|
+
#
|
91
|
+
# @param attachments [Array<SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment>] Attachments included with the message
|
92
|
+
|
93
|
+
# @see SurgeAPI::Models::MessageFailedWebhookEvent::Data#conversation
|
94
|
+
class Conversation < SurgeAPI::Internal::Type::BaseModel
|
95
|
+
# @!attribute id
|
96
|
+
# The unique identifier for the conversation
|
97
|
+
#
|
98
|
+
# @return [String]
|
99
|
+
required :id, String
|
100
|
+
|
101
|
+
# @!attribute contact
|
102
|
+
# A contact who has consented to receive messages
|
103
|
+
#
|
104
|
+
# @return [SurgeAPI::Models::Contact]
|
105
|
+
required :contact, -> { SurgeAPI::Contact }
|
106
|
+
|
107
|
+
# @!attribute phone_number
|
108
|
+
# A phone number that can be used to send and receive messages and calls
|
109
|
+
#
|
110
|
+
# @return [SurgeAPI::Models::PhoneNumber]
|
111
|
+
required :phone_number, -> { SurgeAPI::PhoneNumber }
|
112
|
+
|
113
|
+
# @!method initialize(id:, contact:, phone_number:)
|
114
|
+
# The conversation this message belongs to
|
115
|
+
#
|
116
|
+
# @param id [String] The unique identifier for the conversation
|
117
|
+
#
|
118
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
119
|
+
#
|
120
|
+
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
121
|
+
end
|
122
|
+
|
123
|
+
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
124
|
+
# @!attribute id
|
125
|
+
# The unique identifier for the attachment
|
126
|
+
#
|
127
|
+
# @return [String]
|
128
|
+
required :id, String
|
129
|
+
|
130
|
+
# @!attribute type
|
131
|
+
# The type of attachment
|
132
|
+
#
|
133
|
+
# @return [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment::Type]
|
134
|
+
required :type, enum: -> { SurgeAPI::MessageFailedWebhookEvent::Data::Attachment::Type }
|
135
|
+
|
136
|
+
# @!attribute url
|
137
|
+
# The URL to download the attachment
|
138
|
+
#
|
139
|
+
# @return [String]
|
140
|
+
required :url, String
|
141
|
+
|
142
|
+
# @!method initialize(id:, type:, url:)
|
143
|
+
# @param id [String] The unique identifier for the attachment
|
144
|
+
#
|
145
|
+
# @param type [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment::Type] The type of attachment
|
146
|
+
#
|
147
|
+
# @param url [String] The URL to download the attachment
|
148
|
+
|
149
|
+
# The type of attachment
|
150
|
+
#
|
151
|
+
# @see SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment#type
|
152
|
+
module Type
|
153
|
+
extend SurgeAPI::Internal::Type::Enum
|
154
|
+
|
155
|
+
FILE = :file
|
156
|
+
IMAGE = :image
|
157
|
+
LINK = :link
|
158
|
+
VIDEO = :video
|
159
|
+
|
160
|
+
# @!method self.values
|
161
|
+
# @return [Array<Symbol>]
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -0,0 +1,159 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class MessageReceivedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
# @!attribute account_id
|
7
|
+
# The ID of the account in which this event occurred
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :account_id, String
|
11
|
+
|
12
|
+
# @!attribute data
|
13
|
+
# The data associated with the event
|
14
|
+
#
|
15
|
+
# @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data]
|
16
|
+
required :data, -> { SurgeAPI::MessageReceivedWebhookEvent::Data }
|
17
|
+
|
18
|
+
# @!attribute timestamp
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
20
|
+
#
|
21
|
+
# @return [Time]
|
22
|
+
required :timestamp, Time
|
23
|
+
|
24
|
+
# @!attribute type
|
25
|
+
# The type of the event. Always `message.received` for this event.
|
26
|
+
#
|
27
|
+
# @return [Symbol, :"message.received"]
|
28
|
+
required :type, const: :"message.received"
|
29
|
+
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"message.received")
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
32
|
+
#
|
33
|
+
# @param data [SurgeAPI::Models::MessageReceivedWebhookEvent::Data] The data associated with the event
|
34
|
+
#
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
36
|
+
#
|
37
|
+
# @param type [Symbol, :"message.received"] The type of the event. Always `message.received` for this event.
|
38
|
+
|
39
|
+
# @see SurgeAPI::Models::MessageReceivedWebhookEvent#data
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
41
|
+
# @!attribute id
|
42
|
+
# The unique identifier for the message
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
required :id, String
|
46
|
+
|
47
|
+
# @!attribute body
|
48
|
+
# The content of the message
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
required :body, String
|
52
|
+
|
53
|
+
# @!attribute conversation
|
54
|
+
# The conversation this message belongs to
|
55
|
+
#
|
56
|
+
# @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation]
|
57
|
+
required :conversation, -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation }
|
58
|
+
|
59
|
+
# @!attribute received_at
|
60
|
+
# When the message was received
|
61
|
+
#
|
62
|
+
# @return [Time]
|
63
|
+
required :received_at, Time
|
64
|
+
|
65
|
+
# @!attribute attachments
|
66
|
+
# Attachments included with the message
|
67
|
+
#
|
68
|
+
# @return [Array<SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment>, nil]
|
69
|
+
optional :attachments,
|
70
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::MessageReceivedWebhookEvent::Data::Attachment] }
|
71
|
+
|
72
|
+
# @!method initialize(id:, body:, conversation:, received_at:, attachments: nil)
|
73
|
+
# The data associated with the event
|
74
|
+
#
|
75
|
+
# @param id [String] The unique identifier for the message
|
76
|
+
#
|
77
|
+
# @param body [String] The content of the message
|
78
|
+
#
|
79
|
+
# @param conversation [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation] The conversation this message belongs to
|
80
|
+
#
|
81
|
+
# @param received_at [Time] When the message was received
|
82
|
+
#
|
83
|
+
# @param attachments [Array<SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment>] Attachments included with the message
|
84
|
+
|
85
|
+
# @see SurgeAPI::Models::MessageReceivedWebhookEvent::Data#conversation
|
86
|
+
class Conversation < SurgeAPI::Internal::Type::BaseModel
|
87
|
+
# @!attribute id
|
88
|
+
# The unique identifier for the conversation
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
required :id, String
|
92
|
+
|
93
|
+
# @!attribute contact
|
94
|
+
# A contact who has consented to receive messages
|
95
|
+
#
|
96
|
+
# @return [SurgeAPI::Models::Contact]
|
97
|
+
required :contact, -> { SurgeAPI::Contact }
|
98
|
+
|
99
|
+
# @!attribute phone_number
|
100
|
+
# A phone number that can be used to send and receive messages and calls
|
101
|
+
#
|
102
|
+
# @return [SurgeAPI::Models::PhoneNumber]
|
103
|
+
required :phone_number, -> { SurgeAPI::PhoneNumber }
|
104
|
+
|
105
|
+
# @!method initialize(id:, contact:, phone_number:)
|
106
|
+
# The conversation this message belongs to
|
107
|
+
#
|
108
|
+
# @param id [String] The unique identifier for the conversation
|
109
|
+
#
|
110
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
111
|
+
#
|
112
|
+
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
113
|
+
end
|
114
|
+
|
115
|
+
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
116
|
+
# @!attribute id
|
117
|
+
# The unique identifier for the attachment
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
required :id, String
|
121
|
+
|
122
|
+
# @!attribute type
|
123
|
+
# The type of attachment
|
124
|
+
#
|
125
|
+
# @return [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment::Type]
|
126
|
+
required :type, enum: -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Attachment::Type }
|
127
|
+
|
128
|
+
# @!attribute url
|
129
|
+
# The URL to download the attachment
|
130
|
+
#
|
131
|
+
# @return [String]
|
132
|
+
required :url, String
|
133
|
+
|
134
|
+
# @!method initialize(id:, type:, url:)
|
135
|
+
# @param id [String] The unique identifier for the attachment
|
136
|
+
#
|
137
|
+
# @param type [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment::Type] The type of attachment
|
138
|
+
#
|
139
|
+
# @param url [String] The URL to download the attachment
|
140
|
+
|
141
|
+
# The type of attachment
|
142
|
+
#
|
143
|
+
# @see SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment#type
|
144
|
+
module Type
|
145
|
+
extend SurgeAPI::Internal::Type::Enum
|
146
|
+
|
147
|
+
FILE = :file
|
148
|
+
IMAGE = :image
|
149
|
+
LINK = :link
|
150
|
+
VIDEO = :video
|
151
|
+
|
152
|
+
# @!method self.values
|
153
|
+
# @return [Array<Symbol>]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
@@ -0,0 +1,159 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class MessageSentWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
# @!attribute account_id
|
7
|
+
# The ID of the account in which this event occurred
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :account_id, String
|
11
|
+
|
12
|
+
# @!attribute data
|
13
|
+
# The data associated with the event
|
14
|
+
#
|
15
|
+
# @return [SurgeAPI::Models::MessageSentWebhookEvent::Data]
|
16
|
+
required :data, -> { SurgeAPI::MessageSentWebhookEvent::Data }
|
17
|
+
|
18
|
+
# @!attribute timestamp
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
20
|
+
#
|
21
|
+
# @return [Time]
|
22
|
+
required :timestamp, Time
|
23
|
+
|
24
|
+
# @!attribute type
|
25
|
+
# The type of the event. Always `message.sent` for this event.
|
26
|
+
#
|
27
|
+
# @return [Symbol, :"message.sent"]
|
28
|
+
required :type, const: :"message.sent"
|
29
|
+
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"message.sent")
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
32
|
+
#
|
33
|
+
# @param data [SurgeAPI::Models::MessageSentWebhookEvent::Data] The data associated with the event
|
34
|
+
#
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
36
|
+
#
|
37
|
+
# @param type [Symbol, :"message.sent"] The type of the event. Always `message.sent` for this event.
|
38
|
+
|
39
|
+
# @see SurgeAPI::Models::MessageSentWebhookEvent#data
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
41
|
+
# @!attribute id
|
42
|
+
# The unique identifier for the message
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
required :id, String
|
46
|
+
|
47
|
+
# @!attribute body
|
48
|
+
# The content of the message
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
required :body, String
|
52
|
+
|
53
|
+
# @!attribute conversation
|
54
|
+
# The conversation this message belongs to
|
55
|
+
#
|
56
|
+
# @return [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation]
|
57
|
+
required :conversation, -> { SurgeAPI::MessageSentWebhookEvent::Data::Conversation }
|
58
|
+
|
59
|
+
# @!attribute sent_at
|
60
|
+
# When the message was sent
|
61
|
+
#
|
62
|
+
# @return [Time]
|
63
|
+
required :sent_at, Time
|
64
|
+
|
65
|
+
# @!attribute attachments
|
66
|
+
# Attachments included with the message
|
67
|
+
#
|
68
|
+
# @return [Array<SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment>, nil]
|
69
|
+
optional :attachments,
|
70
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::MessageSentWebhookEvent::Data::Attachment] }
|
71
|
+
|
72
|
+
# @!method initialize(id:, body:, conversation:, sent_at:, attachments: nil)
|
73
|
+
# The data associated with the event
|
74
|
+
#
|
75
|
+
# @param id [String] The unique identifier for the message
|
76
|
+
#
|
77
|
+
# @param body [String] The content of the message
|
78
|
+
#
|
79
|
+
# @param conversation [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation] The conversation this message belongs to
|
80
|
+
#
|
81
|
+
# @param sent_at [Time] When the message was sent
|
82
|
+
#
|
83
|
+
# @param attachments [Array<SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment>] Attachments included with the message
|
84
|
+
|
85
|
+
# @see SurgeAPI::Models::MessageSentWebhookEvent::Data#conversation
|
86
|
+
class Conversation < SurgeAPI::Internal::Type::BaseModel
|
87
|
+
# @!attribute id
|
88
|
+
# The unique identifier for the conversation
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
required :id, String
|
92
|
+
|
93
|
+
# @!attribute contact
|
94
|
+
# A contact who has consented to receive messages
|
95
|
+
#
|
96
|
+
# @return [SurgeAPI::Models::Contact]
|
97
|
+
required :contact, -> { SurgeAPI::Contact }
|
98
|
+
|
99
|
+
# @!attribute phone_number
|
100
|
+
# A phone number that can be used to send and receive messages and calls
|
101
|
+
#
|
102
|
+
# @return [SurgeAPI::Models::PhoneNumber]
|
103
|
+
required :phone_number, -> { SurgeAPI::PhoneNumber }
|
104
|
+
|
105
|
+
# @!method initialize(id:, contact:, phone_number:)
|
106
|
+
# The conversation this message belongs to
|
107
|
+
#
|
108
|
+
# @param id [String] The unique identifier for the conversation
|
109
|
+
#
|
110
|
+
# @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
|
111
|
+
#
|
112
|
+
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
113
|
+
end
|
114
|
+
|
115
|
+
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
116
|
+
# @!attribute id
|
117
|
+
# The unique identifier for the attachment
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
required :id, String
|
121
|
+
|
122
|
+
# @!attribute type
|
123
|
+
# The type of attachment
|
124
|
+
#
|
125
|
+
# @return [Symbol, SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::Type]
|
126
|
+
required :type, enum: -> { SurgeAPI::MessageSentWebhookEvent::Data::Attachment::Type }
|
127
|
+
|
128
|
+
# @!attribute url
|
129
|
+
# The URL to download the attachment
|
130
|
+
#
|
131
|
+
# @return [String]
|
132
|
+
required :url, String
|
133
|
+
|
134
|
+
# @!method initialize(id:, type:, url:)
|
135
|
+
# @param id [String] The unique identifier for the attachment
|
136
|
+
#
|
137
|
+
# @param type [Symbol, SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::Type] The type of attachment
|
138
|
+
#
|
139
|
+
# @param url [String] The URL to download the attachment
|
140
|
+
|
141
|
+
# The type of attachment
|
142
|
+
#
|
143
|
+
# @see SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment#type
|
144
|
+
module Type
|
145
|
+
extend SurgeAPI::Internal::Type::Enum
|
146
|
+
|
147
|
+
FILE = :file
|
148
|
+
IMAGE = :image
|
149
|
+
LINK = :link
|
150
|
+
VIDEO = :video
|
151
|
+
|
152
|
+
# @!method self.values
|
153
|
+
# @return [Array<Symbol>]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|