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,649 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class Organization < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(SurgeAPI::Organization, SurgeAPI::Internal::AnyHash)
9
+ end
10
+
11
+ # The address of the organization's headquarters.
12
+ sig { returns(SurgeAPI::Organization::Address) }
13
+ attr_reader :address
14
+
15
+ sig { params(address: SurgeAPI::Organization::Address::OrHash).void }
16
+ attr_writer :address
17
+
18
+ # An object representing an individual who can be contacted if the carriers have
19
+ # any questions about the business.
20
+ sig { returns(SurgeAPI::Organization::Contact) }
21
+ attr_reader :contact
22
+
23
+ sig { params(contact: SurgeAPI::Organization::Contact::OrHash).void }
24
+ attr_writer :contact
25
+
26
+ # The two character ISO 3166 country code for the country in which the
27
+ # organization is headquartered.
28
+ sig { returns(T.nilable(String)) }
29
+ attr_accessor :country
30
+
31
+ # For publicly traded companies, an email for a representative of the company to
32
+ # whom a verification email will be sent. This must be an email on the same domain
33
+ # as the company's website (e.g. with a website domain of
34
+ # `https://dtprecisionauto.com`, the email must use the same
35
+ # `@dtprecisionauto.com`)
36
+ sig { returns(T.nilable(String)) }
37
+ attr_accessor :email
38
+
39
+ # The value of the identifier whose type is specified in the identifier_type
40
+ # field. Typically this will be an EIN, and can be formatted with or without the
41
+ # hyphen.
42
+ sig { returns(T.nilable(String)) }
43
+ attr_accessor :identifier
44
+
45
+ # The type of identifier being provided for the organization. Support for more
46
+ # values will be added in the future.
47
+ sig do
48
+ returns(T.nilable(SurgeAPI::Organization::IdentifierType::TaggedSymbol))
49
+ end
50
+ attr_accessor :identifier_type
51
+
52
+ # The industry in which the organization operates.
53
+ sig { returns(T.nilable(SurgeAPI::Organization::Industry::TaggedSymbol)) }
54
+ attr_accessor :industry
55
+
56
+ # For sole proprietors, this must be a valid US mobile phone number to which a
57
+ # verification text message will be sent. (E.164 format)
58
+ sig { returns(T.nilable(String)) }
59
+ attr_accessor :mobile_number
60
+
61
+ # An array of regions in which the organization operates.
62
+ sig do
63
+ returns(
64
+ T.nilable(
65
+ T::Array[SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol]
66
+ )
67
+ )
68
+ end
69
+ attr_accessor :regions_of_operation
70
+
71
+ # The legal name of the organization as registered with the IRS or other relevant
72
+ # authorities. For some applications, this will be matched against government
73
+ # records and should include all punctuation and everything else as well.
74
+ sig { returns(T.nilable(String)) }
75
+ attr_accessor :registered_name
76
+
77
+ # For publicly traded companies, this is the exchange on which the company's stock
78
+ # is traded.
79
+ sig do
80
+ returns(T.nilable(SurgeAPI::Organization::StockExchange::TaggedSymbol))
81
+ end
82
+ attr_accessor :stock_exchange
83
+
84
+ # For publicly traded companies, the ticker symbol for the company's stock
85
+ sig { returns(T.nilable(String)) }
86
+ attr_accessor :stock_symbol
87
+
88
+ # The type of organization
89
+ sig { returns(T.nilable(SurgeAPI::Organization::Type::TaggedSymbol)) }
90
+ attr_accessor :type
91
+
92
+ # The URL of the website for this organization. The website should be publicly
93
+ # available, clearly reflect the organization's purpose, and the URL should start
94
+ # with `https://`
95
+ sig { returns(T.nilable(String)) }
96
+ attr_accessor :website
97
+
98
+ # The legal entity on whose behalf the account will be operated.
99
+ sig do
100
+ params(
101
+ address: SurgeAPI::Organization::Address::OrHash,
102
+ contact: SurgeAPI::Organization::Contact::OrHash,
103
+ country: T.nilable(String),
104
+ email: T.nilable(String),
105
+ identifier: T.nilable(String),
106
+ identifier_type:
107
+ T.nilable(SurgeAPI::Organization::IdentifierType::OrSymbol),
108
+ industry: T.nilable(SurgeAPI::Organization::Industry::OrSymbol),
109
+ mobile_number: T.nilable(String),
110
+ regions_of_operation:
111
+ T.nilable(
112
+ T::Array[SurgeAPI::Organization::RegionsOfOperation::OrSymbol]
113
+ ),
114
+ registered_name: T.nilable(String),
115
+ stock_exchange:
116
+ T.nilable(SurgeAPI::Organization::StockExchange::OrSymbol),
117
+ stock_symbol: T.nilable(String),
118
+ type: T.nilable(SurgeAPI::Organization::Type::OrSymbol),
119
+ website: T.nilable(String)
120
+ ).returns(T.attached_class)
121
+ end
122
+ def self.new(
123
+ # The address of the organization's headquarters.
124
+ address:,
125
+ # An object representing an individual who can be contacted if the carriers have
126
+ # any questions about the business.
127
+ contact:,
128
+ # The two character ISO 3166 country code for the country in which the
129
+ # organization is headquartered.
130
+ country:,
131
+ # For publicly traded companies, an email for a representative of the company to
132
+ # whom a verification email will be sent. This must be an email on the same domain
133
+ # as the company's website (e.g. with a website domain of
134
+ # `https://dtprecisionauto.com`, the email must use the same
135
+ # `@dtprecisionauto.com`)
136
+ email:,
137
+ # The value of the identifier whose type is specified in the identifier_type
138
+ # field. Typically this will be an EIN, and can be formatted with or without the
139
+ # hyphen.
140
+ identifier:,
141
+ # The type of identifier being provided for the organization. Support for more
142
+ # values will be added in the future.
143
+ identifier_type:,
144
+ # The industry in which the organization operates.
145
+ industry:,
146
+ # For sole proprietors, this must be a valid US mobile phone number to which a
147
+ # verification text message will be sent. (E.164 format)
148
+ mobile_number:,
149
+ # An array of regions in which the organization operates.
150
+ regions_of_operation:,
151
+ # The legal name of the organization as registered with the IRS or other relevant
152
+ # authorities. For some applications, this will be matched against government
153
+ # records and should include all punctuation and everything else as well.
154
+ registered_name:,
155
+ # For publicly traded companies, this is the exchange on which the company's stock
156
+ # is traded.
157
+ stock_exchange:,
158
+ # For publicly traded companies, the ticker symbol for the company's stock
159
+ stock_symbol:,
160
+ # The type of organization
161
+ type:,
162
+ # The URL of the website for this organization. The website should be publicly
163
+ # available, clearly reflect the organization's purpose, and the URL should start
164
+ # with `https://`
165
+ website:
166
+ )
167
+ end
168
+
169
+ sig do
170
+ override.returns(
171
+ {
172
+ address: SurgeAPI::Organization::Address,
173
+ contact: SurgeAPI::Organization::Contact,
174
+ country: T.nilable(String),
175
+ email: T.nilable(String),
176
+ identifier: T.nilable(String),
177
+ identifier_type:
178
+ T.nilable(SurgeAPI::Organization::IdentifierType::TaggedSymbol),
179
+ industry: T.nilable(SurgeAPI::Organization::Industry::TaggedSymbol),
180
+ mobile_number: T.nilable(String),
181
+ regions_of_operation:
182
+ T.nilable(
183
+ T::Array[
184
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
185
+ ]
186
+ ),
187
+ registered_name: T.nilable(String),
188
+ stock_exchange:
189
+ T.nilable(SurgeAPI::Organization::StockExchange::TaggedSymbol),
190
+ stock_symbol: T.nilable(String),
191
+ type: T.nilable(SurgeAPI::Organization::Type::TaggedSymbol),
192
+ website: T.nilable(String)
193
+ }
194
+ )
195
+ end
196
+ def to_hash
197
+ end
198
+
199
+ class Address < SurgeAPI::Internal::Type::BaseModel
200
+ OrHash =
201
+ T.type_alias do
202
+ T.any(SurgeAPI::Organization::Address, SurgeAPI::Internal::AnyHash)
203
+ end
204
+
205
+ # The two character ISO 3166 country code. If none is provided, the organization's
206
+ # country code will be used.
207
+ sig { returns(T.nilable(String)) }
208
+ attr_accessor :country
209
+
210
+ # The first line of the address, typically the number and street name
211
+ sig { returns(T.nilable(String)) }
212
+ attr_accessor :line1
213
+
214
+ # The second line of the address if needed, typically an apartment or suite number
215
+ sig { returns(T.nilable(String)) }
216
+ attr_accessor :line2
217
+
218
+ # The city or locality
219
+ sig { returns(T.nilable(String)) }
220
+ attr_accessor :locality
221
+
222
+ # The name to which any mail should be addressed. If none is provided, this will
223
+ # default to the organization's registered_name
224
+ sig { returns(T.nilable(String)) }
225
+ attr_accessor :name
226
+
227
+ # The postal code
228
+ sig { returns(T.nilable(String)) }
229
+ attr_accessor :postal_code
230
+
231
+ # The state or region
232
+ sig { returns(T.nilable(String)) }
233
+ attr_accessor :region
234
+
235
+ # The address of the organization's headquarters.
236
+ sig do
237
+ params(
238
+ country: T.nilable(String),
239
+ line1: T.nilable(String),
240
+ line2: T.nilable(String),
241
+ locality: T.nilable(String),
242
+ name: T.nilable(String),
243
+ postal_code: T.nilable(String),
244
+ region: T.nilable(String)
245
+ ).returns(T.attached_class)
246
+ end
247
+ def self.new(
248
+ # The two character ISO 3166 country code. If none is provided, the organization's
249
+ # country code will be used.
250
+ country:,
251
+ # The first line of the address, typically the number and street name
252
+ line1:,
253
+ # The second line of the address if needed, typically an apartment or suite number
254
+ line2:,
255
+ # The city or locality
256
+ locality:,
257
+ # The name to which any mail should be addressed. If none is provided, this will
258
+ # default to the organization's registered_name
259
+ name:,
260
+ # The postal code
261
+ postal_code:,
262
+ # The state or region
263
+ region:
264
+ )
265
+ end
266
+
267
+ sig do
268
+ override.returns(
269
+ {
270
+ country: T.nilable(String),
271
+ line1: T.nilable(String),
272
+ line2: T.nilable(String),
273
+ locality: T.nilable(String),
274
+ name: T.nilable(String),
275
+ postal_code: T.nilable(String),
276
+ region: T.nilable(String)
277
+ }
278
+ )
279
+ end
280
+ def to_hash
281
+ end
282
+ end
283
+
284
+ class Contact < SurgeAPI::Internal::Type::BaseModel
285
+ OrHash =
286
+ T.type_alias do
287
+ T.any(SurgeAPI::Organization::Contact, SurgeAPI::Internal::AnyHash)
288
+ end
289
+
290
+ # An email address at which the individual can be reached. Typically an email
291
+ # using the same domain name as the website URL will be preferred (e.g. with a
292
+ # website domain of `https://dtprecisionauto.com`, an email like
293
+ # `dom@dtprecisionauto.com` will be preferred over one like
294
+ # `dom@anothergarage.com` or `dom.toretto@gmail.com`)
295
+ sig { returns(T.nilable(String)) }
296
+ attr_accessor :email
297
+
298
+ # The first name (or given name) of the individual
299
+ sig { returns(T.nilable(String)) }
300
+ attr_accessor :first_name
301
+
302
+ # The last name (or family name) of the individual
303
+ sig { returns(T.nilable(String)) }
304
+ attr_accessor :last_name
305
+
306
+ # A phone number at which the individual can be reached (E.164 format)
307
+ sig { returns(T.nilable(String)) }
308
+ attr_accessor :phone_number
309
+
310
+ # The job title of the individual.
311
+ sig do
312
+ returns(
313
+ T.nilable(SurgeAPI::Organization::Contact::Title::TaggedSymbol)
314
+ )
315
+ end
316
+ attr_accessor :title
317
+
318
+ # If `other` is provided for the `title` field, this field should be used to
319
+ # provide the title of the individual
320
+ sig { returns(T.nilable(String)) }
321
+ attr_accessor :title_other
322
+
323
+ # An object representing an individual who can be contacted if the carriers have
324
+ # any questions about the business.
325
+ sig do
326
+ params(
327
+ email: T.nilable(String),
328
+ first_name: T.nilable(String),
329
+ last_name: T.nilable(String),
330
+ phone_number: T.nilable(String),
331
+ title: T.nilable(SurgeAPI::Organization::Contact::Title::OrSymbol),
332
+ title_other: T.nilable(String)
333
+ ).returns(T.attached_class)
334
+ end
335
+ def self.new(
336
+ # An email address at which the individual can be reached. Typically an email
337
+ # using the same domain name as the website URL will be preferred (e.g. with a
338
+ # website domain of `https://dtprecisionauto.com`, an email like
339
+ # `dom@dtprecisionauto.com` will be preferred over one like
340
+ # `dom@anothergarage.com` or `dom.toretto@gmail.com`)
341
+ email:,
342
+ # The first name (or given name) of the individual
343
+ first_name:,
344
+ # The last name (or family name) of the individual
345
+ last_name:,
346
+ # A phone number at which the individual can be reached (E.164 format)
347
+ phone_number:,
348
+ # The job title of the individual.
349
+ title:,
350
+ # If `other` is provided for the `title` field, this field should be used to
351
+ # provide the title of the individual
352
+ title_other:
353
+ )
354
+ end
355
+
356
+ sig do
357
+ override.returns(
358
+ {
359
+ email: T.nilable(String),
360
+ first_name: T.nilable(String),
361
+ last_name: T.nilable(String),
362
+ phone_number: T.nilable(String),
363
+ title:
364
+ T.nilable(SurgeAPI::Organization::Contact::Title::TaggedSymbol),
365
+ title_other: T.nilable(String)
366
+ }
367
+ )
368
+ end
369
+ def to_hash
370
+ end
371
+
372
+ # The job title of the individual.
373
+ module Title
374
+ extend SurgeAPI::Internal::Type::Enum
375
+
376
+ TaggedSymbol =
377
+ T.type_alias do
378
+ T.all(Symbol, SurgeAPI::Organization::Contact::Title)
379
+ end
380
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
381
+
382
+ CEO =
383
+ T.let(:ceo, SurgeAPI::Organization::Contact::Title::TaggedSymbol)
384
+ CFO =
385
+ T.let(:cfo, SurgeAPI::Organization::Contact::Title::TaggedSymbol)
386
+ DIRECTOR =
387
+ T.let(
388
+ :director,
389
+ SurgeAPI::Organization::Contact::Title::TaggedSymbol
390
+ )
391
+ GM = T.let(:gm, SurgeAPI::Organization::Contact::Title::TaggedSymbol)
392
+ VP = T.let(:vp, SurgeAPI::Organization::Contact::Title::TaggedSymbol)
393
+ GENERAL_COUNSEL =
394
+ T.let(
395
+ :general_counsel,
396
+ SurgeAPI::Organization::Contact::Title::TaggedSymbol
397
+ )
398
+ OTHER =
399
+ T.let(:other, SurgeAPI::Organization::Contact::Title::TaggedSymbol)
400
+
401
+ sig do
402
+ override.returns(
403
+ T::Array[SurgeAPI::Organization::Contact::Title::TaggedSymbol]
404
+ )
405
+ end
406
+ def self.values
407
+ end
408
+ end
409
+ end
410
+
411
+ # The type of identifier being provided for the organization. Support for more
412
+ # values will be added in the future.
413
+ module IdentifierType
414
+ extend SurgeAPI::Internal::Type::Enum
415
+
416
+ TaggedSymbol =
417
+ T.type_alias { T.all(Symbol, SurgeAPI::Organization::IdentifierType) }
418
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
419
+
420
+ EIN = T.let(:ein, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
421
+
422
+ sig do
423
+ override.returns(
424
+ T::Array[SurgeAPI::Organization::IdentifierType::TaggedSymbol]
425
+ )
426
+ end
427
+ def self.values
428
+ end
429
+ end
430
+
431
+ # The industry in which the organization operates.
432
+ module Industry
433
+ extend SurgeAPI::Internal::Type::Enum
434
+
435
+ TaggedSymbol =
436
+ T.type_alias { T.all(Symbol, SurgeAPI::Organization::Industry) }
437
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
438
+
439
+ AGRICULTURE =
440
+ T.let(:agriculture, SurgeAPI::Organization::Industry::TaggedSymbol)
441
+ AUTOMOTIVE =
442
+ T.let(:automotive, SurgeAPI::Organization::Industry::TaggedSymbol)
443
+ BANKING =
444
+ T.let(:banking, SurgeAPI::Organization::Industry::TaggedSymbol)
445
+ CONSTRUCTION =
446
+ T.let(:construction, SurgeAPI::Organization::Industry::TaggedSymbol)
447
+ CONSUMER =
448
+ T.let(:consumer, SurgeAPI::Organization::Industry::TaggedSymbol)
449
+ EDUCATION =
450
+ T.let(:education, SurgeAPI::Organization::Industry::TaggedSymbol)
451
+ ELECTRONICS =
452
+ T.let(:electronics, SurgeAPI::Organization::Industry::TaggedSymbol)
453
+ ENERGY = T.let(:energy, SurgeAPI::Organization::Industry::TaggedSymbol)
454
+ ENGINEERING =
455
+ T.let(:engineering, SurgeAPI::Organization::Industry::TaggedSymbol)
456
+ FAST_MOVING_CONSUMER_GOODS =
457
+ T.let(
458
+ :fast_moving_consumer_goods,
459
+ SurgeAPI::Organization::Industry::TaggedSymbol
460
+ )
461
+ FINANCIAL =
462
+ T.let(:financial, SurgeAPI::Organization::Industry::TaggedSymbol)
463
+ FINTECH =
464
+ T.let(:fintech, SurgeAPI::Organization::Industry::TaggedSymbol)
465
+ FOOD_AND_BEVERAGE =
466
+ T.let(
467
+ :food_and_beverage,
468
+ SurgeAPI::Organization::Industry::TaggedSymbol
469
+ )
470
+ GOVERNMENT =
471
+ T.let(:government, SurgeAPI::Organization::Industry::TaggedSymbol)
472
+ HEALTHCARE =
473
+ T.let(:healthcare, SurgeAPI::Organization::Industry::TaggedSymbol)
474
+ HOSPITALITY =
475
+ T.let(:hospitality, SurgeAPI::Organization::Industry::TaggedSymbol)
476
+ INSURANCE =
477
+ T.let(:insurance, SurgeAPI::Organization::Industry::TaggedSymbol)
478
+ JEWELRY =
479
+ T.let(:jewelry, SurgeAPI::Organization::Industry::TaggedSymbol)
480
+ LEGAL = T.let(:legal, SurgeAPI::Organization::Industry::TaggedSymbol)
481
+ MANUFACTURING =
482
+ T.let(:manufacturing, SurgeAPI::Organization::Industry::TaggedSymbol)
483
+ MEDIA = T.let(:media, SurgeAPI::Organization::Industry::TaggedSymbol)
484
+ NOT_FOR_PROFIT =
485
+ T.let(:not_for_profit, SurgeAPI::Organization::Industry::TaggedSymbol)
486
+ OIL_AND_GAS =
487
+ T.let(:oil_and_gas, SurgeAPI::Organization::Industry::TaggedSymbol)
488
+ ONLINE = T.let(:online, SurgeAPI::Organization::Industry::TaggedSymbol)
489
+ PROFESSIONAL_SERVICES =
490
+ T.let(
491
+ :professional_services,
492
+ SurgeAPI::Organization::Industry::TaggedSymbol
493
+ )
494
+ RAW_MATERIALS =
495
+ T.let(:raw_materials, SurgeAPI::Organization::Industry::TaggedSymbol)
496
+ REAL_ESTATE =
497
+ T.let(:real_estate, SurgeAPI::Organization::Industry::TaggedSymbol)
498
+ RELIGION =
499
+ T.let(:religion, SurgeAPI::Organization::Industry::TaggedSymbol)
500
+ RETAIL = T.let(:retail, SurgeAPI::Organization::Industry::TaggedSymbol)
501
+ TECHNOLOGY =
502
+ T.let(:technology, SurgeAPI::Organization::Industry::TaggedSymbol)
503
+ TELECOMMUNICATIONS =
504
+ T.let(
505
+ :telecommunications,
506
+ SurgeAPI::Organization::Industry::TaggedSymbol
507
+ )
508
+ TRANSPORTATION =
509
+ T.let(:transportation, SurgeAPI::Organization::Industry::TaggedSymbol)
510
+ TRAVEL = T.let(:travel, SurgeAPI::Organization::Industry::TaggedSymbol)
511
+
512
+ sig do
513
+ override.returns(
514
+ T::Array[SurgeAPI::Organization::Industry::TaggedSymbol]
515
+ )
516
+ end
517
+ def self.values
518
+ end
519
+ end
520
+
521
+ module RegionsOfOperation
522
+ extend SurgeAPI::Internal::Type::Enum
523
+
524
+ TaggedSymbol =
525
+ T.type_alias do
526
+ T.all(Symbol, SurgeAPI::Organization::RegionsOfOperation)
527
+ end
528
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
529
+
530
+ AFRICA =
531
+ T.let(
532
+ :africa,
533
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
534
+ )
535
+ ASIA =
536
+ T.let(:asia, SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol)
537
+ AUSTRALIA =
538
+ T.let(
539
+ :australia,
540
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
541
+ )
542
+ EUROPE =
543
+ T.let(
544
+ :europe,
545
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
546
+ )
547
+ LATIN_AMERICA =
548
+ T.let(
549
+ :latin_america,
550
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
551
+ )
552
+ USA_AND_CANADA =
553
+ T.let(
554
+ :usa_and_canada,
555
+ SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol
556
+ )
557
+
558
+ sig do
559
+ override.returns(
560
+ T::Array[SurgeAPI::Organization::RegionsOfOperation::TaggedSymbol]
561
+ )
562
+ end
563
+ def self.values
564
+ end
565
+ end
566
+
567
+ # For publicly traded companies, this is the exchange on which the company's stock
568
+ # is traded.
569
+ module StockExchange
570
+ extend SurgeAPI::Internal::Type::Enum
571
+
572
+ TaggedSymbol =
573
+ T.type_alias { T.all(Symbol, SurgeAPI::Organization::StockExchange) }
574
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
575
+
576
+ AMEX = T.let(:amex, SurgeAPI::Organization::StockExchange::TaggedSymbol)
577
+ AMX = T.let(:amx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
578
+ ASX = T.let(:asx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
579
+ B3 = T.let(:b3, SurgeAPI::Organization::StockExchange::TaggedSymbol)
580
+ BME = T.let(:bme, SurgeAPI::Organization::StockExchange::TaggedSymbol)
581
+ BSE = T.let(:bse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
582
+ FRA = T.let(:fra, SurgeAPI::Organization::StockExchange::TaggedSymbol)
583
+ ICEX = T.let(:icex, SurgeAPI::Organization::StockExchange::TaggedSymbol)
584
+ JPX = T.let(:jpx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
585
+ JSE = T.let(:jse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
586
+ KRX = T.let(:krx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
587
+ LON = T.let(:lon, SurgeAPI::Organization::StockExchange::TaggedSymbol)
588
+ NASDAQ =
589
+ T.let(:nasdaq, SurgeAPI::Organization::StockExchange::TaggedSymbol)
590
+ NONE = T.let(:none, SurgeAPI::Organization::StockExchange::TaggedSymbol)
591
+ NYSE = T.let(:nyse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
592
+ NSE = T.let(:nse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
593
+ OMX = T.let(:omx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
594
+ OTHER =
595
+ T.let(:other, SurgeAPI::Organization::StockExchange::TaggedSymbol)
596
+ SEHK = T.let(:sehk, SurgeAPI::Organization::StockExchange::TaggedSymbol)
597
+ SGX = T.let(:sgx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
598
+ SSE = T.let(:sse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
599
+ STO = T.let(:sto, SurgeAPI::Organization::StockExchange::TaggedSymbol)
600
+ SWX = T.let(:swx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
601
+ SZSE = T.let(:szse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
602
+ TSX = T.let(:tsx, SurgeAPI::Organization::StockExchange::TaggedSymbol)
603
+ TWSE = T.let(:twse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
604
+ VSE = T.let(:vse, SurgeAPI::Organization::StockExchange::TaggedSymbol)
605
+
606
+ sig do
607
+ override.returns(
608
+ T::Array[SurgeAPI::Organization::StockExchange::TaggedSymbol]
609
+ )
610
+ end
611
+ def self.values
612
+ end
613
+ end
614
+
615
+ # The type of organization
616
+ module Type
617
+ extend SurgeAPI::Internal::Type::Enum
618
+
619
+ TaggedSymbol =
620
+ T.type_alias { T.all(Symbol, SurgeAPI::Organization::Type) }
621
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
622
+
623
+ CO_OP = T.let(:co_op, SurgeAPI::Organization::Type::TaggedSymbol)
624
+ GOVERNMENT =
625
+ T.let(:government, SurgeAPI::Organization::Type::TaggedSymbol)
626
+ LLC = T.let(:llc, SurgeAPI::Organization::Type::TaggedSymbol)
627
+ NON_PROFIT =
628
+ T.let(:non_profit, SurgeAPI::Organization::Type::TaggedSymbol)
629
+ PARTNERSHIP =
630
+ T.let(:partnership, SurgeAPI::Organization::Type::TaggedSymbol)
631
+ PRIVATE_CORPORATION =
632
+ T.let(
633
+ :private_corporation,
634
+ SurgeAPI::Organization::Type::TaggedSymbol
635
+ )
636
+ PUBLIC_CORPORATION =
637
+ T.let(:public_corporation, SurgeAPI::Organization::Type::TaggedSymbol)
638
+ SOLE_PROPRIETOR =
639
+ T.let(:sole_proprietor, SurgeAPI::Organization::Type::TaggedSymbol)
640
+
641
+ sig do
642
+ override.returns(T::Array[SurgeAPI::Organization::Type::TaggedSymbol])
643
+ end
644
+ def self.values
645
+ end
646
+ end
647
+ end
648
+ end
649
+ end