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.
Files changed (212) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +28 -0
  4. data/README.md +286 -0
  5. data/SECURITY.md +27 -0
  6. data/lib/surge_api/client.rb +106 -0
  7. data/lib/surge_api/errors.rb +228 -0
  8. data/lib/surge_api/file_part.rb +55 -0
  9. data/lib/surge_api/internal/transport/base_client.rb +567 -0
  10. data/lib/surge_api/internal/transport/pooled_net_requester.rb +201 -0
  11. data/lib/surge_api/internal/type/array_of.rb +168 -0
  12. data/lib/surge_api/internal/type/base_model.rb +531 -0
  13. data/lib/surge_api/internal/type/base_page.rb +55 -0
  14. data/lib/surge_api/internal/type/boolean.rb +77 -0
  15. data/lib/surge_api/internal/type/converter.rb +327 -0
  16. data/lib/surge_api/internal/type/enum.rb +131 -0
  17. data/lib/surge_api/internal/type/file_input.rb +108 -0
  18. data/lib/surge_api/internal/type/hash_of.rb +188 -0
  19. data/lib/surge_api/internal/type/request_parameters.rb +42 -0
  20. data/lib/surge_api/internal/type/union.rb +250 -0
  21. data/lib/surge_api/internal/type/unknown.rb +81 -0
  22. data/lib/surge_api/internal/util.rb +915 -0
  23. data/lib/surge_api/internal.rb +20 -0
  24. data/lib/surge_api/models/account.rb +60 -0
  25. data/lib/surge_api/models/account_create_params.rb +481 -0
  26. data/lib/surge_api/models/account_retrieve_status_params.rb +32 -0
  27. data/lib/surge_api/models/account_status.rb +104 -0
  28. data/lib/surge_api/models/account_update_params.rb +480 -0
  29. data/lib/surge_api/models/blast.rb +61 -0
  30. data/lib/surge_api/models/blast_create_params.rb +90 -0
  31. data/lib/surge_api/models/call_ended_webhook_event.rb +106 -0
  32. data/lib/surge_api/models/campaign.rb +208 -0
  33. data/lib/surge_api/models/campaign_approved_webhook_event.rb +74 -0
  34. data/lib/surge_api/models/campaign_create_params.rb +202 -0
  35. data/lib/surge_api/models/contact.rb +59 -0
  36. data/lib/surge_api/models/contact_create_params.rb +54 -0
  37. data/lib/surge_api/models/contact_retrieve_params.rb +14 -0
  38. data/lib/surge_api/models/contact_update_params.rb +54 -0
  39. data/lib/surge_api/models/conversation_created_webhook_event.rb +70 -0
  40. data/lib/surge_api/models/error.rb +34 -0
  41. data/lib/surge_api/models/message.rb +146 -0
  42. data/lib/surge_api/models/message_create_params.rb +153 -0
  43. data/lib/surge_api/models/message_delivered_webhook_event.rb +159 -0
  44. data/lib/surge_api/models/message_failed_webhook_event.rb +167 -0
  45. data/lib/surge_api/models/message_received_webhook_event.rb +159 -0
  46. data/lib/surge_api/models/message_sent_webhook_event.rb +159 -0
  47. data/lib/surge_api/models/organization.rb +419 -0
  48. data/lib/surge_api/models/phone_number.rb +48 -0
  49. data/lib/surge_api/models/phone_number_purchase_params.rb +65 -0
  50. data/lib/surge_api/models/unwrap_webhook_event.rb +26 -0
  51. data/lib/surge_api/models/user.rb +51 -0
  52. data/lib/surge_api/models/user_create_params.rb +46 -0
  53. data/lib/surge_api/models/user_create_token_params.rb +22 -0
  54. data/lib/surge_api/models/user_retrieve_params.rb +14 -0
  55. data/lib/surge_api/models/user_token_response.rb +19 -0
  56. data/lib/surge_api/models/user_update_params.rb +46 -0
  57. data/lib/surge_api/models/verification.rb +58 -0
  58. data/lib/surge_api/models/verification_check.rb +43 -0
  59. data/lib/surge_api/models/verification_check_params.rb +22 -0
  60. data/lib/surge_api/models/verification_create_params.rb +22 -0
  61. data/lib/surge_api/models/webhook_unwrap_params.rb +14 -0
  62. data/lib/surge_api/models.rb +117 -0
  63. data/lib/surge_api/request_options.rb +77 -0
  64. data/lib/surge_api/resources/accounts.rb +102 -0
  65. data/lib/surge_api/resources/blasts.rb +53 -0
  66. data/lib/surge_api/resources/campaigns.rb +57 -0
  67. data/lib/surge_api/resources/contacts.rb +99 -0
  68. data/lib/surge_api/resources/messages.rb +75 -0
  69. data/lib/surge_api/resources/phone_numbers.rb +48 -0
  70. data/lib/surge_api/resources/users.rb +119 -0
  71. data/lib/surge_api/resources/verifications.rb +60 -0
  72. data/lib/surge_api/resources/webhooks.rb +22 -0
  73. data/lib/surge_api/version.rb +5 -0
  74. data/lib/surge_api.rb +100 -0
  75. data/manifest.yaml +15 -0
  76. data/rbi/surge_api/client.rbi +73 -0
  77. data/rbi/surge_api/errors.rbi +205 -0
  78. data/rbi/surge_api/file_part.rbi +37 -0
  79. data/rbi/surge_api/internal/transport/base_client.rbi +292 -0
  80. data/rbi/surge_api/internal/transport/pooled_net_requester.rbi +79 -0
  81. data/rbi/surge_api/internal/type/array_of.rbi +104 -0
  82. data/rbi/surge_api/internal/type/base_model.rbi +302 -0
  83. data/rbi/surge_api/internal/type/base_page.rbi +42 -0
  84. data/rbi/surge_api/internal/type/boolean.rbi +58 -0
  85. data/rbi/surge_api/internal/type/converter.rbi +216 -0
  86. data/rbi/surge_api/internal/type/enum.rbi +82 -0
  87. data/rbi/surge_api/internal/type/file_input.rbi +59 -0
  88. data/rbi/surge_api/internal/type/hash_of.rbi +104 -0
  89. data/rbi/surge_api/internal/type/request_parameters.rbi +29 -0
  90. data/rbi/surge_api/internal/type/union.rbi +128 -0
  91. data/rbi/surge_api/internal/type/unknown.rbi +58 -0
  92. data/rbi/surge_api/internal/util.rbi +487 -0
  93. data/rbi/surge_api/internal.rbi +16 -0
  94. data/rbi/surge_api/models/account.rbi +83 -0
  95. data/rbi/surge_api/models/account_create_params.rbi +1104 -0
  96. data/rbi/surge_api/models/account_retrieve_status_params.rbi +96 -0
  97. data/rbi/surge_api/models/account_status.rbi +185 -0
  98. data/rbi/surge_api/models/account_update_params.rbi +1105 -0
  99. data/rbi/surge_api/models/blast.rbi +108 -0
  100. data/rbi/surge_api/models/blast_create_params.rbi +145 -0
  101. data/rbi/surge_api/models/call_ended_webhook_event.rbi +205 -0
  102. data/rbi/surge_api/models/campaign.rbi +331 -0
  103. data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +149 -0
  104. data/rbi/surge_api/models/campaign_create_params.rbi +386 -0
  105. data/rbi/surge_api/models/contact.rbi +88 -0
  106. data/rbi/surge_api/models/contact_create_params.rbi +87 -0
  107. data/rbi/surge_api/models/contact_retrieve_params.rbi +27 -0
  108. data/rbi/surge_api/models/contact_update_params.rbi +87 -0
  109. data/rbi/surge_api/models/conversation_created_webhook_event.rbi +129 -0
  110. data/rbi/surge_api/models/error.rbi +51 -0
  111. data/rbi/surge_api/models/message.rbi +283 -0
  112. data/rbi/surge_api/models/message_create_params.rbi +281 -0
  113. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +331 -0
  114. data/rbi/surge_api/models/message_failed_webhook_event.rbi +335 -0
  115. data/rbi/surge_api/models/message_received_webhook_event.rbi +331 -0
  116. data/rbi/surge_api/models/message_sent_webhook_event.rbi +322 -0
  117. data/rbi/surge_api/models/organization.rbi +649 -0
  118. data/rbi/surge_api/models/phone_number.rbi +72 -0
  119. data/rbi/surge_api/models/phone_number_purchase_params.rbi +122 -0
  120. data/rbi/surge_api/models/unwrap_webhook_event.rbi +26 -0
  121. data/rbi/surge_api/models/user.rbi +80 -0
  122. data/rbi/surge_api/models/user_create_params.rbi +76 -0
  123. data/rbi/surge_api/models/user_create_token_params.rbi +46 -0
  124. data/rbi/surge_api/models/user_retrieve_params.rbi +27 -0
  125. data/rbi/surge_api/models/user_token_response.rbi +31 -0
  126. data/rbi/surge_api/models/user_update_params.rbi +76 -0
  127. data/rbi/surge_api/models/verification.rbi +86 -0
  128. data/rbi/surge_api/models/verification_check.rbi +84 -0
  129. data/rbi/surge_api/models/verification_check_params.rbi +40 -0
  130. data/rbi/surge_api/models/verification_create_params.rbi +40 -0
  131. data/rbi/surge_api/models/webhook_unwrap_params.rbi +27 -0
  132. data/rbi/surge_api/models.rbi +80 -0
  133. data/rbi/surge_api/request_options.rbi +59 -0
  134. data/rbi/surge_api/resources/accounts.rbi +94 -0
  135. data/rbi/surge_api/resources/blasts.rbi +48 -0
  136. data/rbi/surge_api/resources/campaigns.rbi +115 -0
  137. data/rbi/surge_api/resources/contacts.rbi +85 -0
  138. data/rbi/surge_api/resources/messages.rbi +72 -0
  139. data/rbi/surge_api/resources/phone_numbers.rbi +43 -0
  140. data/rbi/surge_api/resources/users.rbi +96 -0
  141. data/rbi/surge_api/resources/verifications.rbi +43 -0
  142. data/rbi/surge_api/resources/webhooks.rbi +31 -0
  143. data/rbi/surge_api/version.rbi +5 -0
  144. data/sig/surge_api/client.rbs +42 -0
  145. data/sig/surge_api/errors.rbs +117 -0
  146. data/sig/surge_api/file_part.rbs +21 -0
  147. data/sig/surge_api/internal/transport/base_client.rbs +131 -0
  148. data/sig/surge_api/internal/transport/pooled_net_requester.rbs +45 -0
  149. data/sig/surge_api/internal/type/array_of.rbs +48 -0
  150. data/sig/surge_api/internal/type/base_model.rbs +102 -0
  151. data/sig/surge_api/internal/type/base_page.rbs +24 -0
  152. data/sig/surge_api/internal/type/boolean.rbs +26 -0
  153. data/sig/surge_api/internal/type/converter.rbs +79 -0
  154. data/sig/surge_api/internal/type/enum.rbs +32 -0
  155. data/sig/surge_api/internal/type/file_input.rbs +25 -0
  156. data/sig/surge_api/internal/type/hash_of.rbs +48 -0
  157. data/sig/surge_api/internal/type/request_parameters.rbs +17 -0
  158. data/sig/surge_api/internal/type/union.rbs +52 -0
  159. data/sig/surge_api/internal/type/unknown.rbs +26 -0
  160. data/sig/surge_api/internal/util.rbs +185 -0
  161. data/sig/surge_api/internal.rbs +9 -0
  162. data/sig/surge_api/models/account.rbs +40 -0
  163. data/sig/surge_api/models/account_create_params.rbs +433 -0
  164. data/sig/surge_api/models/account_retrieve_status_params.rbs +40 -0
  165. data/sig/surge_api/models/account_status.rbs +71 -0
  166. data/sig/surge_api/models/account_update_params.rbs +435 -0
  167. data/sig/surge_api/models/blast.rbs +64 -0
  168. data/sig/surge_api/models/blast_create_params.rbs +82 -0
  169. data/sig/surge_api/models/call_ended_webhook_event.rbs +99 -0
  170. data/sig/surge_api/models/campaign.rbs +122 -0
  171. data/sig/surge_api/models/campaign_approved_webhook_event.rbs +67 -0
  172. data/sig/surge_api/models/campaign_create_params.rbs +127 -0
  173. data/sig/surge_api/models/contact.rbs +53 -0
  174. data/sig/surge_api/models/contact_create_params.rbs +54 -0
  175. data/sig/surge_api/models/contact_retrieve_params.rbs +15 -0
  176. data/sig/surge_api/models/contact_update_params.rbs +54 -0
  177. data/sig/surge_api/models/conversation_created_webhook_event.rbs +62 -0
  178. data/sig/surge_api/models/error.rbs +27 -0
  179. data/sig/surge_api/models/message.rbs +138 -0
  180. data/sig/surge_api/models/message_create_params.rbs +140 -0
  181. data/sig/surge_api/models/message_delivered_webhook_event.rbs +143 -0
  182. data/sig/surge_api/models/message_failed_webhook_event.rbs +148 -0
  183. data/sig/surge_api/models/message_received_webhook_event.rbs +143 -0
  184. data/sig/surge_api/models/message_sent_webhook_event.rbs +143 -0
  185. data/sig/surge_api/models/organization.rbs +385 -0
  186. data/sig/surge_api/models/phone_number.rbs +37 -0
  187. data/sig/surge_api/models/phone_number_purchase_params.rbs +62 -0
  188. data/sig/surge_api/models/unwrap_webhook_event.rbs +18 -0
  189. data/sig/surge_api/models/user.rbs +48 -0
  190. data/sig/surge_api/models/user_create_params.rbs +47 -0
  191. data/sig/surge_api/models/user_create_token_params.rbs +26 -0
  192. data/sig/surge_api/models/user_retrieve_params.rbs +15 -0
  193. data/sig/surge_api/models/user_token_response.rbs +15 -0
  194. data/sig/surge_api/models/user_update_params.rbs +47 -0
  195. data/sig/surge_api/models/verification.rbs +48 -0
  196. data/sig/surge_api/models/verification_check.rbs +45 -0
  197. data/sig/surge_api/models/verification_check_params.rbs +23 -0
  198. data/sig/surge_api/models/verification_create_params.rbs +23 -0
  199. data/sig/surge_api/models/webhook_unwrap_params.rbs +15 -0
  200. data/sig/surge_api/models.rbs +77 -0
  201. data/sig/surge_api/request_options.rbs +34 -0
  202. data/sig/surge_api/resources/accounts.rbs +30 -0
  203. data/sig/surge_api/resources/blasts.rbs +19 -0
  204. data/sig/surge_api/resources/campaigns.rbs +21 -0
  205. data/sig/surge_api/resources/contacts.rbs +32 -0
  206. data/sig/surge_api/resources/messages.rbs +18 -0
  207. data/sig/surge_api/resources/phone_numbers.rbs +16 -0
  208. data/sig/surge_api/resources/users.rbs +36 -0
  209. data/sig/surge_api/resources/verifications.rbs +18 -0
  210. data/sig/surge_api/resources/webhooks.rbs +17 -0
  211. data/sig/surge_api/version.rbs +3 -0
  212. metadata +269 -0
@@ -0,0 +1,143 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type message_sent_webhook_event =
4
+ {
5
+ account_id: String,
6
+ data: SurgeAPI::MessageSentWebhookEvent::Data,
7
+ timestamp: Time,
8
+ type: :"message.sent"
9
+ }
10
+
11
+ class MessageSentWebhookEvent < SurgeAPI::Internal::Type::BaseModel
12
+ attr_accessor account_id: String
13
+
14
+ attr_accessor data: SurgeAPI::MessageSentWebhookEvent::Data
15
+
16
+ attr_accessor timestamp: Time
17
+
18
+ attr_accessor type: :"message.sent"
19
+
20
+ def initialize: (
21
+ account_id: String,
22
+ data: SurgeAPI::MessageSentWebhookEvent::Data,
23
+ timestamp: Time,
24
+ ?type: :"message.sent"
25
+ ) -> void
26
+
27
+ def to_hash: -> {
28
+ account_id: String,
29
+ data: SurgeAPI::MessageSentWebhookEvent::Data,
30
+ timestamp: Time,
31
+ type: :"message.sent"
32
+ }
33
+
34
+ type data =
35
+ {
36
+ id: String,
37
+ body: String,
38
+ conversation: SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
39
+ sent_at: Time,
40
+ attachments: ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]
41
+ }
42
+
43
+ class Data < SurgeAPI::Internal::Type::BaseModel
44
+ attr_accessor id: String
45
+
46
+ attr_accessor body: String
47
+
48
+ attr_accessor conversation: SurgeAPI::MessageSentWebhookEvent::Data::Conversation
49
+
50
+ attr_accessor sent_at: Time
51
+
52
+ attr_reader attachments: ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]?
53
+
54
+ def attachments=: (
55
+ ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]
56
+ ) -> ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]
57
+
58
+ def initialize: (
59
+ id: String,
60
+ body: String,
61
+ conversation: SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
62
+ sent_at: Time,
63
+ ?attachments: ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ id: String,
68
+ body: String,
69
+ conversation: SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
70
+ sent_at: Time,
71
+ attachments: ::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment]
72
+ }
73
+
74
+ type conversation =
75
+ {
76
+ id: String,
77
+ contact: SurgeAPI::Contact,
78
+ phone_number: SurgeAPI::PhoneNumber
79
+ }
80
+
81
+ class Conversation < SurgeAPI::Internal::Type::BaseModel
82
+ attr_accessor id: String
83
+
84
+ attr_accessor contact: SurgeAPI::Contact
85
+
86
+ attr_accessor phone_number: SurgeAPI::PhoneNumber
87
+
88
+ def initialize: (
89
+ id: String,
90
+ contact: SurgeAPI::Contact,
91
+ phone_number: SurgeAPI::PhoneNumber
92
+ ) -> void
93
+
94
+ def to_hash: -> {
95
+ id: String,
96
+ contact: SurgeAPI::Contact,
97
+ phone_number: SurgeAPI::PhoneNumber
98
+ }
99
+ end
100
+
101
+ type attachment =
102
+ {
103
+ id: String,
104
+ type: SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::type_,
105
+ url: String
106
+ }
107
+
108
+ class Attachment < SurgeAPI::Internal::Type::BaseModel
109
+ attr_accessor id: String
110
+
111
+ attr_accessor type: SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::type_
112
+
113
+ attr_accessor url: String
114
+
115
+ def initialize: (
116
+ id: String,
117
+ type: SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::type_,
118
+ url: String
119
+ ) -> void
120
+
121
+ def to_hash: -> {
122
+ id: String,
123
+ type: SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::type_,
124
+ url: String
125
+ }
126
+
127
+ type type_ = :file | :image | :link | :video
128
+
129
+ module Type
130
+ extend SurgeAPI::Internal::Type::Enum
131
+
132
+ FILE: :file
133
+ IMAGE: :image
134
+ LINK: :link
135
+ VIDEO: :video
136
+
137
+ def self?.values: -> ::Array[SurgeAPI::Models::MessageSentWebhookEvent::Data::Attachment::type_]
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,385 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type organization =
4
+ {
5
+ address: SurgeAPI::Organization::Address,
6
+ contact: SurgeAPI::Organization::Contact,
7
+ country: String?,
8
+ email: String?,
9
+ identifier: String?,
10
+ identifier_type: SurgeAPI::Models::Organization::identifier_type?,
11
+ industry: SurgeAPI::Models::Organization::industry?,
12
+ mobile_number: String?,
13
+ regions_of_operation: ::Array[SurgeAPI::Models::Organization::regions_of_operation]?,
14
+ registered_name: String?,
15
+ stock_exchange: SurgeAPI::Models::Organization::stock_exchange?,
16
+ stock_symbol: String?,
17
+ type: SurgeAPI::Models::Organization::type_?,
18
+ website: String?
19
+ }
20
+
21
+ class Organization < SurgeAPI::Internal::Type::BaseModel
22
+ attr_accessor address: SurgeAPI::Organization::Address
23
+
24
+ attr_accessor contact: SurgeAPI::Organization::Contact
25
+
26
+ attr_accessor country: String?
27
+
28
+ attr_accessor email: String?
29
+
30
+ attr_accessor identifier: String?
31
+
32
+ attr_accessor identifier_type: SurgeAPI::Models::Organization::identifier_type?
33
+
34
+ attr_accessor industry: SurgeAPI::Models::Organization::industry?
35
+
36
+ attr_accessor mobile_number: String?
37
+
38
+ attr_accessor regions_of_operation: ::Array[SurgeAPI::Models::Organization::regions_of_operation]?
39
+
40
+ attr_accessor registered_name: String?
41
+
42
+ attr_accessor stock_exchange: SurgeAPI::Models::Organization::stock_exchange?
43
+
44
+ attr_accessor stock_symbol: String?
45
+
46
+ attr_accessor type: SurgeAPI::Models::Organization::type_?
47
+
48
+ attr_accessor website: String?
49
+
50
+ def initialize: (
51
+ address: SurgeAPI::Organization::Address,
52
+ contact: SurgeAPI::Organization::Contact,
53
+ country: String?,
54
+ email: String?,
55
+ identifier: String?,
56
+ identifier_type: SurgeAPI::Models::Organization::identifier_type?,
57
+ industry: SurgeAPI::Models::Organization::industry?,
58
+ mobile_number: String?,
59
+ regions_of_operation: ::Array[SurgeAPI::Models::Organization::regions_of_operation]?,
60
+ registered_name: String?,
61
+ stock_exchange: SurgeAPI::Models::Organization::stock_exchange?,
62
+ stock_symbol: String?,
63
+ type: SurgeAPI::Models::Organization::type_?,
64
+ website: String?
65
+ ) -> void
66
+
67
+ def to_hash: -> {
68
+ address: SurgeAPI::Organization::Address,
69
+ contact: SurgeAPI::Organization::Contact,
70
+ country: String?,
71
+ email: String?,
72
+ identifier: String?,
73
+ identifier_type: SurgeAPI::Models::Organization::identifier_type?,
74
+ industry: SurgeAPI::Models::Organization::industry?,
75
+ mobile_number: String?,
76
+ regions_of_operation: ::Array[SurgeAPI::Models::Organization::regions_of_operation]?,
77
+ registered_name: String?,
78
+ stock_exchange: SurgeAPI::Models::Organization::stock_exchange?,
79
+ stock_symbol: String?,
80
+ type: SurgeAPI::Models::Organization::type_?,
81
+ website: String?
82
+ }
83
+
84
+ type address =
85
+ {
86
+ country: String?,
87
+ :line1 => String?,
88
+ :line2 => String?,
89
+ locality: String?,
90
+ name: String?,
91
+ postal_code: String?,
92
+ region: String?
93
+ }
94
+
95
+ class Address < SurgeAPI::Internal::Type::BaseModel
96
+ attr_accessor country: String?
97
+
98
+ attr_accessor line1: String?
99
+
100
+ attr_accessor line2: String?
101
+
102
+ attr_accessor locality: String?
103
+
104
+ attr_accessor name: String?
105
+
106
+ attr_accessor postal_code: String?
107
+
108
+ attr_accessor region: String?
109
+
110
+ def initialize: (
111
+ country: String?,
112
+ line1: String?,
113
+ line2: String?,
114
+ locality: String?,
115
+ name: String?,
116
+ postal_code: String?,
117
+ region: String?
118
+ ) -> void
119
+
120
+ def to_hash: -> {
121
+ country: String?,
122
+ :line1 => String?,
123
+ :line2 => String?,
124
+ locality: String?,
125
+ name: String?,
126
+ postal_code: String?,
127
+ region: String?
128
+ }
129
+ end
130
+
131
+ type contact =
132
+ {
133
+ email: String?,
134
+ first_name: String?,
135
+ last_name: String?,
136
+ phone_number: String?,
137
+ title: SurgeAPI::Models::Organization::Contact::title?,
138
+ title_other: String?
139
+ }
140
+
141
+ class Contact < SurgeAPI::Internal::Type::BaseModel
142
+ attr_accessor email: String?
143
+
144
+ attr_accessor first_name: String?
145
+
146
+ attr_accessor last_name: String?
147
+
148
+ attr_accessor phone_number: String?
149
+
150
+ attr_accessor title: SurgeAPI::Models::Organization::Contact::title?
151
+
152
+ attr_accessor title_other: String?
153
+
154
+ def initialize: (
155
+ email: String?,
156
+ first_name: String?,
157
+ last_name: String?,
158
+ phone_number: String?,
159
+ title: SurgeAPI::Models::Organization::Contact::title?,
160
+ title_other: String?
161
+ ) -> void
162
+
163
+ def to_hash: -> {
164
+ email: String?,
165
+ first_name: String?,
166
+ last_name: String?,
167
+ phone_number: String?,
168
+ title: SurgeAPI::Models::Organization::Contact::title?,
169
+ title_other: String?
170
+ }
171
+
172
+ type title =
173
+ :ceo | :cfo | :director | :gm | :vp | :general_counsel | :other
174
+
175
+ module Title
176
+ extend SurgeAPI::Internal::Type::Enum
177
+
178
+ CEO: :ceo
179
+ CFO: :cfo
180
+ DIRECTOR: :director
181
+ GM: :gm
182
+ VP: :vp
183
+ GENERAL_COUNSEL: :general_counsel
184
+ OTHER: :other
185
+
186
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::Contact::title]
187
+ end
188
+ end
189
+
190
+ type identifier_type = :ein
191
+
192
+ module IdentifierType
193
+ extend SurgeAPI::Internal::Type::Enum
194
+
195
+ EIN: :ein
196
+
197
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::identifier_type]
198
+ end
199
+
200
+ type industry =
201
+ :agriculture
202
+ | :automotive
203
+ | :banking
204
+ | :construction
205
+ | :consumer
206
+ | :education
207
+ | :electronics
208
+ | :energy
209
+ | :engineering
210
+ | :fast_moving_consumer_goods
211
+ | :financial
212
+ | :fintech
213
+ | :food_and_beverage
214
+ | :government
215
+ | :healthcare
216
+ | :hospitality
217
+ | :insurance
218
+ | :jewelry
219
+ | :legal
220
+ | :manufacturing
221
+ | :media
222
+ | :not_for_profit
223
+ | :oil_and_gas
224
+ | :online
225
+ | :professional_services
226
+ | :raw_materials
227
+ | :real_estate
228
+ | :religion
229
+ | :retail
230
+ | :technology
231
+ | :telecommunications
232
+ | :transportation
233
+ | :travel
234
+
235
+ module Industry
236
+ extend SurgeAPI::Internal::Type::Enum
237
+
238
+ AGRICULTURE: :agriculture
239
+ AUTOMOTIVE: :automotive
240
+ BANKING: :banking
241
+ CONSTRUCTION: :construction
242
+ CONSUMER: :consumer
243
+ EDUCATION: :education
244
+ ELECTRONICS: :electronics
245
+ ENERGY: :energy
246
+ ENGINEERING: :engineering
247
+ FAST_MOVING_CONSUMER_GOODS: :fast_moving_consumer_goods
248
+ FINANCIAL: :financial
249
+ FINTECH: :fintech
250
+ FOOD_AND_BEVERAGE: :food_and_beverage
251
+ GOVERNMENT: :government
252
+ HEALTHCARE: :healthcare
253
+ HOSPITALITY: :hospitality
254
+ INSURANCE: :insurance
255
+ JEWELRY: :jewelry
256
+ LEGAL: :legal
257
+ MANUFACTURING: :manufacturing
258
+ MEDIA: :media
259
+ NOT_FOR_PROFIT: :not_for_profit
260
+ OIL_AND_GAS: :oil_and_gas
261
+ ONLINE: :online
262
+ PROFESSIONAL_SERVICES: :professional_services
263
+ RAW_MATERIALS: :raw_materials
264
+ REAL_ESTATE: :real_estate
265
+ RELIGION: :religion
266
+ RETAIL: :retail
267
+ TECHNOLOGY: :technology
268
+ TELECOMMUNICATIONS: :telecommunications
269
+ TRANSPORTATION: :transportation
270
+ TRAVEL: :travel
271
+
272
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::industry]
273
+ end
274
+
275
+ type regions_of_operation =
276
+ :africa
277
+ | :asia
278
+ | :australia
279
+ | :europe
280
+ | :latin_america
281
+ | :usa_and_canada
282
+
283
+ module RegionsOfOperation
284
+ extend SurgeAPI::Internal::Type::Enum
285
+
286
+ AFRICA: :africa
287
+ ASIA: :asia
288
+ AUSTRALIA: :australia
289
+ EUROPE: :europe
290
+ LATIN_AMERICA: :latin_america
291
+ USA_AND_CANADA: :usa_and_canada
292
+
293
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::regions_of_operation]
294
+ end
295
+
296
+ type stock_exchange =
297
+ :amex
298
+ | :amx
299
+ | :asx
300
+ | :b3
301
+ | :bme
302
+ | :bse
303
+ | :fra
304
+ | :icex
305
+ | :jpx
306
+ | :jse
307
+ | :krx
308
+ | :lon
309
+ | :nasdaq
310
+ | :none
311
+ | :nyse
312
+ | :nse
313
+ | :omx
314
+ | :other
315
+ | :sehk
316
+ | :sgx
317
+ | :sse
318
+ | :sto
319
+ | :swx
320
+ | :szse
321
+ | :tsx
322
+ | :twse
323
+ | :vse
324
+
325
+ module StockExchange
326
+ extend SurgeAPI::Internal::Type::Enum
327
+
328
+ AMEX: :amex
329
+ AMX: :amx
330
+ ASX: :asx
331
+ B3: :b3
332
+ BME: :bme
333
+ BSE: :bse
334
+ FRA: :fra
335
+ ICEX: :icex
336
+ JPX: :jpx
337
+ JSE: :jse
338
+ KRX: :krx
339
+ LON: :lon
340
+ NASDAQ: :nasdaq
341
+ NONE: :none
342
+ NYSE: :nyse
343
+ NSE: :nse
344
+ OMX: :omx
345
+ OTHER: :other
346
+ SEHK: :sehk
347
+ SGX: :sgx
348
+ SSE: :sse
349
+ STO: :sto
350
+ SWX: :swx
351
+ SZSE: :szse
352
+ TSX: :tsx
353
+ TWSE: :twse
354
+ VSE: :vse
355
+
356
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::stock_exchange]
357
+ end
358
+
359
+ type type_ =
360
+ :co_op
361
+ | :government
362
+ | :llc
363
+ | :non_profit
364
+ | :partnership
365
+ | :private_corporation
366
+ | :public_corporation
367
+ | :sole_proprietor
368
+
369
+ module Type
370
+ extend SurgeAPI::Internal::Type::Enum
371
+
372
+ CO_OP: :co_op
373
+ GOVERNMENT: :government
374
+ LLC: :llc
375
+ NON_PROFIT: :non_profit
376
+ PARTNERSHIP: :partnership
377
+ PRIVATE_CORPORATION: :private_corporation
378
+ PUBLIC_CORPORATION: :public_corporation
379
+ SOLE_PROPRIETOR: :sole_proprietor
380
+
381
+ def self?.values: -> ::Array[SurgeAPI::Models::Organization::type_]
382
+ end
383
+ end
384
+ end
385
+ end
@@ -0,0 +1,37 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type phone_number =
4
+ { id: String, number: String, type: SurgeAPI::Models::PhoneNumber::type_ }
5
+
6
+ class PhoneNumber < SurgeAPI::Internal::Type::BaseModel
7
+ attr_accessor id: String
8
+
9
+ attr_accessor number: String
10
+
11
+ attr_accessor type: SurgeAPI::Models::PhoneNumber::type_
12
+
13
+ def initialize: (
14
+ id: String,
15
+ number: String,
16
+ type: SurgeAPI::Models::PhoneNumber::type_
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ id: String,
21
+ number: String,
22
+ type: SurgeAPI::Models::PhoneNumber::type_
23
+ }
24
+
25
+ type type_ = :local | :toll_free
26
+
27
+ module Type
28
+ extend SurgeAPI::Internal::Type::Enum
29
+
30
+ LOCAL: :local
31
+ TOLL_FREE: :toll_free
32
+
33
+ def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumber::type_]
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,62 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type phone_number_purchase_params =
4
+ {
5
+ area_code: String,
6
+ latitude: Float,
7
+ longitude: Float,
8
+ type: SurgeAPI::Models::PhoneNumberPurchaseParams::type_
9
+ }
10
+ & SurgeAPI::Internal::Type::request_parameters
11
+
12
+ class PhoneNumberPurchaseParams < SurgeAPI::Internal::Type::BaseModel
13
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
14
+ include SurgeAPI::Internal::Type::RequestParameters
15
+
16
+ attr_reader area_code: String?
17
+
18
+ def area_code=: (String) -> String
19
+
20
+ attr_reader latitude: Float?
21
+
22
+ def latitude=: (Float) -> Float
23
+
24
+ attr_reader longitude: Float?
25
+
26
+ def longitude=: (Float) -> Float
27
+
28
+ attr_reader type: SurgeAPI::Models::PhoneNumberPurchaseParams::type_?
29
+
30
+ def type=: (
31
+ SurgeAPI::Models::PhoneNumberPurchaseParams::type_
32
+ ) -> SurgeAPI::Models::PhoneNumberPurchaseParams::type_
33
+
34
+ def initialize: (
35
+ ?area_code: String,
36
+ ?latitude: Float,
37
+ ?longitude: Float,
38
+ ?type: SurgeAPI::Models::PhoneNumberPurchaseParams::type_,
39
+ ?request_options: SurgeAPI::request_opts
40
+ ) -> void
41
+
42
+ def to_hash: -> {
43
+ area_code: String,
44
+ latitude: Float,
45
+ longitude: Float,
46
+ type: SurgeAPI::Models::PhoneNumberPurchaseParams::type_,
47
+ request_options: SurgeAPI::RequestOptions
48
+ }
49
+
50
+ type type_ = :local | :toll_free
51
+
52
+ module Type
53
+ extend SurgeAPI::Internal::Type::Enum
54
+
55
+ LOCAL: :local
56
+ TOLL_FREE: :toll_free
57
+
58
+ def self?.values: -> ::Array[SurgeAPI::Models::PhoneNumberPurchaseParams::type_]
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,18 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type unwrap_webhook_event =
4
+ SurgeAPI::CallEndedWebhookEvent
5
+ | SurgeAPI::CampaignApprovedWebhookEvent
6
+ | SurgeAPI::ConversationCreatedWebhookEvent
7
+ | SurgeAPI::MessageDeliveredWebhookEvent
8
+ | SurgeAPI::MessageFailedWebhookEvent
9
+ | SurgeAPI::MessageReceivedWebhookEvent
10
+ | SurgeAPI::MessageSentWebhookEvent
11
+
12
+ module UnwrapWebhookEvent
13
+ extend SurgeAPI::Internal::Type::Union
14
+
15
+ def self?.variants: -> ::Array[SurgeAPI::Models::unwrap_webhook_event]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,48 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type user =
4
+ {
5
+ first_name: String,
6
+ id: String,
7
+ last_name: String,
8
+ metadata: ::Hash[Symbol, String],
9
+ photo_url: String
10
+ }
11
+
12
+ class User < SurgeAPI::Internal::Type::BaseModel
13
+ attr_accessor first_name: String
14
+
15
+ attr_reader id: String?
16
+
17
+ def id=: (String) -> String
18
+
19
+ attr_reader last_name: String?
20
+
21
+ def last_name=: (String) -> String
22
+
23
+ attr_reader metadata: ::Hash[Symbol, String]?
24
+
25
+ def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
26
+
27
+ attr_reader photo_url: String?
28
+
29
+ def photo_url=: (String) -> String
30
+
31
+ def initialize: (
32
+ first_name: String,
33
+ ?id: String,
34
+ ?last_name: String,
35
+ ?metadata: ::Hash[Symbol, String],
36
+ ?photo_url: String
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ first_name: String,
41
+ id: String,
42
+ last_name: String,
43
+ metadata: ::Hash[Symbol, String],
44
+ photo_url: String
45
+ }
46
+ end
47
+ end
48
+ end