surge_api 0.13.0 → 0.14.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 +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +6 -6
- data/lib/surge_api/client.rb +4 -0
- data/lib/surge_api/internal/cursor.rb +2 -2
- data/lib/surge_api/models/account_create_params.rb +11 -10
- data/lib/surge_api/models/account_update_params.rb +11 -10
- data/lib/surge_api/models/audience_add_contact_params.rb +26 -0
- data/lib/surge_api/models/audience_list_contacts_params.rb +34 -0
- data/lib/surge_api/models/organization.rb +11 -10
- data/lib/surge_api/models.rb +4 -0
- data/lib/surge_api/resources/audiences.rb +73 -0
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +3 -0
- data/rbi/surge_api/client.rbi +3 -0
- data/rbi/surge_api/models/account_create_params.rbi +19 -14
- data/rbi/surge_api/models/account_update_params.rbi +19 -14
- data/rbi/surge_api/models/audience_add_contact_params.rbi +42 -0
- data/rbi/surge_api/models/audience_list_contacts_params.rbi +62 -0
- data/rbi/surge_api/models/organization.rbi +15 -14
- data/rbi/surge_api/models.rbi +4 -0
- data/rbi/surge_api/resources/audiences.rbi +52 -0
- data/sig/surge_api/client.rbs +2 -0
- data/sig/surge_api/models/account_create_params.rbs +2 -1
- data/sig/surge_api/models/account_update_params.rbs +2 -1
- data/sig/surge_api/models/audience_add_contact_params.rbs +20 -0
- data/sig/surge_api/models/audience_list_contacts_params.rbs +32 -0
- data/sig/surge_api/models/organization.rbs +2 -1
- data/sig/surge_api/models.rbs +4 -0
- data/sig/surge_api/resources/audiences.rbs +20 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ab96cd22457002ccedc81712121dba63dbae5e4cf07727d9b993b92fd0969b0
|
|
4
|
+
data.tar.gz: 1eb78284fdc3b52214c58857cd45cc36133b344e95a10066dbd4b2b89636354d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66e8cbb2c329875bd0eada2097083f37de865d9909c421cd8a40b05b003f6c79f2ed4bb0137ac2f77d8159077499f12371c0a59dd4a47316fc02fb4d3eb37f4d
|
|
7
|
+
data.tar.gz: 51690c17e967f65a50ecde699f3ebd40b88dbc67bf53add883b147698c4fcb8e2477a12f346d4beb93d7d9ceda221b57c3e9a9604a0e3903eea2c954bc5b2fd1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0 (2026-04-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.13.0...v0.14.0](https://github.com/surgeapi/ruby-sdk/compare/v0.13.0...v0.14.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add a contact to an audience ([e018d30](https://github.com/surgeapi/ruby-sdk/commit/e018d30efea8ab2796e5c8ba74e1bef5e582abe0))
|
|
10
|
+
* **api:** allow canadian organizations ([0291b0c](https://github.com/surgeapi/ruby-sdk/commit/0291b0c4d0209f6b7f47a755501f2c863e798f67))
|
|
11
|
+
* **api:** list contacts in audiences ([75df97d](https://github.com/surgeapi/ruby-sdk/commit/75df97dace94cbdb661a82ee360a89f270216c84))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
|
|
16
|
+
* **api:** allow Canadian mobile number ([b5c8e47](https://github.com/surgeapi/ruby-sdk/commit/b5c8e477b89659b6a0554ffcada847e481138311))
|
|
17
|
+
|
|
3
18
|
## 0.13.0 (2026-03-24)
|
|
4
19
|
|
|
5
20
|
Full Changelog: [v0.12.0...v0.13.0](https://github.com/surgeapi/ruby-sdk/compare/v0.12.0...v0.13.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "surge_api", "~> 0.
|
|
20
|
+
gem "surge_api", "~> 0.14.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -44,15 +44,15 @@ List methods in the Surge API are paginated.
|
|
|
44
44
|
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
|
45
45
|
|
|
46
46
|
```ruby
|
|
47
|
-
page = surge.
|
|
47
|
+
page = surge.audiences.list_contacts
|
|
48
48
|
|
|
49
49
|
# Fetch single item from page.
|
|
50
|
-
|
|
51
|
-
puts(
|
|
50
|
+
audience = page.data[0]
|
|
51
|
+
puts(audience.id)
|
|
52
52
|
|
|
53
53
|
# Automatically fetches more pages as needed.
|
|
54
|
-
page.auto_paging_each do |
|
|
55
|
-
puts(
|
|
54
|
+
page.auto_paging_each do |audience|
|
|
55
|
+
puts(audience.id)
|
|
56
56
|
end
|
|
57
57
|
```
|
|
58
58
|
|
data/lib/surge_api/client.rb
CHANGED
|
@@ -21,6 +21,9 @@ module SurgeAPI
|
|
|
21
21
|
# @return [SurgeAPI::Resources::Accounts]
|
|
22
22
|
attr_reader :accounts
|
|
23
23
|
|
|
24
|
+
# @return [SurgeAPI::Resources::Audiences]
|
|
25
|
+
attr_reader :audiences
|
|
26
|
+
|
|
24
27
|
# @return [SurgeAPI::Resources::Blasts]
|
|
25
28
|
attr_reader :blasts
|
|
26
29
|
|
|
@@ -96,6 +99,7 @@ module SurgeAPI
|
|
|
96
99
|
)
|
|
97
100
|
|
|
98
101
|
@accounts = SurgeAPI::Resources::Accounts.new(client: self)
|
|
102
|
+
@audiences = SurgeAPI::Resources::Audiences.new(client: self)
|
|
99
103
|
@blasts = SurgeAPI::Resources::Blasts.new(client: self)
|
|
100
104
|
@campaigns = SurgeAPI::Resources::Campaigns.new(client: self)
|
|
101
105
|
@contacts = SurgeAPI::Resources::Contacts.new(client: self)
|
|
@@ -88,15 +88,15 @@ module SurgeAPI
|
|
|
88
88
|
|
|
89
89
|
# @!attribute identifier
|
|
90
90
|
# The value of the identifier whose type is specified in the identifier_type
|
|
91
|
-
# field.
|
|
92
|
-
#
|
|
91
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
92
|
+
# exactly 9 digits.
|
|
93
93
|
#
|
|
94
94
|
# @return [String, nil]
|
|
95
95
|
optional :identifier, String, nil?: true
|
|
96
96
|
|
|
97
97
|
# @!attribute identifier_type
|
|
98
|
-
# The type of identifier being provided for the organization.
|
|
99
|
-
#
|
|
98
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
99
|
+
# businesses or "cbn" for Canadian businesses.
|
|
100
100
|
#
|
|
101
101
|
# @return [Symbol, SurgeAPI::Models::AccountCreateParams::Organization::IdentifierType, nil]
|
|
102
102
|
optional :identifier_type,
|
|
@@ -110,8 +110,8 @@ module SurgeAPI
|
|
|
110
110
|
optional :industry, enum: -> { SurgeAPI::AccountCreateParams::Organization::Industry }, nil?: true
|
|
111
111
|
|
|
112
112
|
# @!attribute mobile_number
|
|
113
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
114
|
-
# verification text message will be sent. (E.164 format)
|
|
113
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
114
|
+
# which a verification text message will be sent. (E.164 format)
|
|
115
115
|
#
|
|
116
116
|
# @return [String, nil]
|
|
117
117
|
optional :mobile_number, String, nil?: true
|
|
@@ -180,11 +180,11 @@ module SurgeAPI
|
|
|
180
180
|
#
|
|
181
181
|
# @param identifier [String, nil] The value of the identifier whose type is specified in the identifier_type field
|
|
182
182
|
#
|
|
183
|
-
# @param identifier_type [Symbol, SurgeAPI::Models::AccountCreateParams::Organization::IdentifierType, nil] The type of identifier being provided for the organization.
|
|
183
|
+
# @param identifier_type [Symbol, SurgeAPI::Models::AccountCreateParams::Organization::IdentifierType, nil] The type of identifier being provided for the organization. Use "ein" for US bus
|
|
184
184
|
#
|
|
185
185
|
# @param industry [Symbol, SurgeAPI::Models::AccountCreateParams::Organization::Industry, nil] The industry in which the organization operates.
|
|
186
186
|
#
|
|
187
|
-
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US mobile phone number to
|
|
187
|
+
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
188
188
|
#
|
|
189
189
|
# @param regions_of_operation [Array<Symbol, SurgeAPI::Models::AccountCreateParams::Organization::RegionsOfOperation>, nil] An array of regions in which the organization operates.
|
|
190
190
|
#
|
|
@@ -354,14 +354,15 @@ module SurgeAPI
|
|
|
354
354
|
end
|
|
355
355
|
end
|
|
356
356
|
|
|
357
|
-
# The type of identifier being provided for the organization.
|
|
358
|
-
#
|
|
357
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
358
|
+
# businesses or "cbn" for Canadian businesses.
|
|
359
359
|
#
|
|
360
360
|
# @see SurgeAPI::Models::AccountCreateParams::Organization#identifier_type
|
|
361
361
|
module IdentifierType
|
|
362
362
|
extend SurgeAPI::Internal::Type::Enum
|
|
363
363
|
|
|
364
364
|
EIN = :ein
|
|
365
|
+
CBN = :cbn
|
|
365
366
|
|
|
366
367
|
# @!method self.values
|
|
367
368
|
# @return [Array<Symbol>]
|
|
@@ -87,15 +87,15 @@ module SurgeAPI
|
|
|
87
87
|
|
|
88
88
|
# @!attribute identifier
|
|
89
89
|
# The value of the identifier whose type is specified in the identifier_type
|
|
90
|
-
# field.
|
|
91
|
-
#
|
|
90
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
91
|
+
# exactly 9 digits.
|
|
92
92
|
#
|
|
93
93
|
# @return [String, nil]
|
|
94
94
|
optional :identifier, String, nil?: true
|
|
95
95
|
|
|
96
96
|
# @!attribute identifier_type
|
|
97
|
-
# The type of identifier being provided for the organization.
|
|
98
|
-
#
|
|
97
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
98
|
+
# businesses or "cbn" for Canadian businesses.
|
|
99
99
|
#
|
|
100
100
|
# @return [Symbol, SurgeAPI::Models::AccountUpdateParams::Organization::IdentifierType, nil]
|
|
101
101
|
optional :identifier_type,
|
|
@@ -109,8 +109,8 @@ module SurgeAPI
|
|
|
109
109
|
optional :industry, enum: -> { SurgeAPI::AccountUpdateParams::Organization::Industry }, nil?: true
|
|
110
110
|
|
|
111
111
|
# @!attribute mobile_number
|
|
112
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
113
|
-
# verification text message will be sent. (E.164 format)
|
|
112
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
113
|
+
# which a verification text message will be sent. (E.164 format)
|
|
114
114
|
#
|
|
115
115
|
# @return [String, nil]
|
|
116
116
|
optional :mobile_number, String, nil?: true
|
|
@@ -179,11 +179,11 @@ module SurgeAPI
|
|
|
179
179
|
#
|
|
180
180
|
# @param identifier [String, nil] The value of the identifier whose type is specified in the identifier_type field
|
|
181
181
|
#
|
|
182
|
-
# @param identifier_type [Symbol, SurgeAPI::Models::AccountUpdateParams::Organization::IdentifierType, nil] The type of identifier being provided for the organization.
|
|
182
|
+
# @param identifier_type [Symbol, SurgeAPI::Models::AccountUpdateParams::Organization::IdentifierType, nil] The type of identifier being provided for the organization. Use "ein" for US bus
|
|
183
183
|
#
|
|
184
184
|
# @param industry [Symbol, SurgeAPI::Models::AccountUpdateParams::Organization::Industry, nil] The industry in which the organization operates.
|
|
185
185
|
#
|
|
186
|
-
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US mobile phone number to
|
|
186
|
+
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
187
187
|
#
|
|
188
188
|
# @param regions_of_operation [Array<Symbol, SurgeAPI::Models::AccountUpdateParams::Organization::RegionsOfOperation>, nil] An array of regions in which the organization operates.
|
|
189
189
|
#
|
|
@@ -353,14 +353,15 @@ module SurgeAPI
|
|
|
353
353
|
end
|
|
354
354
|
end
|
|
355
355
|
|
|
356
|
-
# The type of identifier being provided for the organization.
|
|
357
|
-
#
|
|
356
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
357
|
+
# businesses or "cbn" for Canadian businesses.
|
|
358
358
|
#
|
|
359
359
|
# @see SurgeAPI::Models::AccountUpdateParams::Organization#identifier_type
|
|
360
360
|
module IdentifierType
|
|
361
361
|
extend SurgeAPI::Internal::Type::Enum
|
|
362
362
|
|
|
363
363
|
EIN = :ein
|
|
364
|
+
CBN = :cbn
|
|
364
365
|
|
|
365
366
|
# @!method self.values
|
|
366
367
|
# @return [Array<Symbol>]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Audiences#add_contact
|
|
6
|
+
class AudienceAddContactParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
# The ID of the contact to add. The contact must belong to the same account as the
|
|
12
|
+
# audience.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :id, String
|
|
16
|
+
|
|
17
|
+
# @!method initialize(id:, request_options: {})
|
|
18
|
+
# Some parameter documentations has been truncated, see
|
|
19
|
+
# {SurgeAPI::Models::AudienceAddContactParams} for more details.
|
|
20
|
+
#
|
|
21
|
+
# @param id [String] The ID of the contact to add. The contact must belong to the same account as the
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Audiences#list_contacts
|
|
6
|
+
class AudienceListContactsParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute after
|
|
11
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :after, String
|
|
15
|
+
|
|
16
|
+
# @!attribute before
|
|
17
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
18
|
+
# response.
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :before, String
|
|
22
|
+
|
|
23
|
+
# @!method initialize(after: nil, before: nil, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {SurgeAPI::Models::AudienceListContactsParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
28
|
+
#
|
|
29
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -35,15 +35,15 @@ module SurgeAPI
|
|
|
35
35
|
|
|
36
36
|
# @!attribute identifier
|
|
37
37
|
# The value of the identifier whose type is specified in the identifier_type
|
|
38
|
-
# field.
|
|
39
|
-
#
|
|
38
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
39
|
+
# exactly 9 digits.
|
|
40
40
|
#
|
|
41
41
|
# @return [String, nil]
|
|
42
42
|
required :identifier, String, nil?: true
|
|
43
43
|
|
|
44
44
|
# @!attribute identifier_type
|
|
45
|
-
# The type of identifier being provided for the organization.
|
|
46
|
-
#
|
|
45
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
46
|
+
# businesses or "cbn" for Canadian businesses.
|
|
47
47
|
#
|
|
48
48
|
# @return [Symbol, SurgeAPI::Models::Organization::IdentifierType, nil]
|
|
49
49
|
required :identifier_type, enum: -> { SurgeAPI::Organization::IdentifierType }, nil?: true
|
|
@@ -55,8 +55,8 @@ module SurgeAPI
|
|
|
55
55
|
required :industry, enum: -> { SurgeAPI::Organization::Industry }, nil?: true
|
|
56
56
|
|
|
57
57
|
# @!attribute mobile_number
|
|
58
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
59
|
-
# verification text message will be sent. (E.164 format)
|
|
58
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
59
|
+
# which a verification text message will be sent. (E.164 format)
|
|
60
60
|
#
|
|
61
61
|
# @return [String, nil]
|
|
62
62
|
required :mobile_number, String, nil?: true
|
|
@@ -120,11 +120,11 @@ module SurgeAPI
|
|
|
120
120
|
#
|
|
121
121
|
# @param identifier [String, nil] The value of the identifier whose type is specified in the identifier_type field
|
|
122
122
|
#
|
|
123
|
-
# @param identifier_type [Symbol, SurgeAPI::Models::Organization::IdentifierType, nil] The type of identifier being provided for the organization.
|
|
123
|
+
# @param identifier_type [Symbol, SurgeAPI::Models::Organization::IdentifierType, nil] The type of identifier being provided for the organization. Use "ein" for US bus
|
|
124
124
|
#
|
|
125
125
|
# @param industry [Symbol, SurgeAPI::Models::Organization::Industry, nil] The industry in which the organization operates.
|
|
126
126
|
#
|
|
127
|
-
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US mobile phone number to
|
|
127
|
+
# @param mobile_number [String, nil] For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
128
128
|
#
|
|
129
129
|
# @param regions_of_operation [Array<Symbol, SurgeAPI::Models::Organization::RegionsOfOperation>, nil] An array of regions in which the organization operates.
|
|
130
130
|
#
|
|
@@ -286,14 +286,15 @@ module SurgeAPI
|
|
|
286
286
|
end
|
|
287
287
|
end
|
|
288
288
|
|
|
289
|
-
# The type of identifier being provided for the organization.
|
|
290
|
-
#
|
|
289
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
290
|
+
# businesses or "cbn" for Canadian businesses.
|
|
291
291
|
#
|
|
292
292
|
# @see SurgeAPI::Models::Organization#identifier_type
|
|
293
293
|
module IdentifierType
|
|
294
294
|
extend SurgeAPI::Internal::Type::Enum
|
|
295
295
|
|
|
296
296
|
EIN = :ein
|
|
297
|
+
CBN = :cbn
|
|
297
298
|
|
|
298
299
|
# @!method self.values
|
|
299
300
|
# @return [Array<Symbol>]
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -51,6 +51,10 @@ module SurgeAPI
|
|
|
51
51
|
|
|
52
52
|
AccountUpdateParams = SurgeAPI::Models::AccountUpdateParams
|
|
53
53
|
|
|
54
|
+
AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
55
|
+
|
|
56
|
+
AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
57
|
+
|
|
54
58
|
Blast = SurgeAPI::Models::Blast
|
|
55
59
|
|
|
56
60
|
BlastCreateParams = SurgeAPI::Models::BlastCreateParams
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Audiences
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {SurgeAPI::Models::AudienceAddContactParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Adds an existing contact to a manual audience.
|
|
10
|
+
#
|
|
11
|
+
# @overload add_contact(audience_id, id:, request_options: {})
|
|
12
|
+
#
|
|
13
|
+
# @param audience_id [String] The audience ID to add the contact to.
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] The ID of the contact to add. The contact must belong to the same account as the
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
|
+
#
|
|
19
|
+
# @return [SurgeAPI::Models::Contact]
|
|
20
|
+
#
|
|
21
|
+
# @see SurgeAPI::Models::AudienceAddContactParams
|
|
22
|
+
def add_contact(audience_id, params)
|
|
23
|
+
parsed, options = SurgeAPI::AudienceAddContactParams.dump_request(params)
|
|
24
|
+
@client.request(
|
|
25
|
+
method: :post,
|
|
26
|
+
path: ["audiences/%1$s/contacts", audience_id],
|
|
27
|
+
body: parsed,
|
|
28
|
+
model: SurgeAPI::Contact,
|
|
29
|
+
options: options
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Some parameter documentations has been truncated, see
|
|
34
|
+
# {SurgeAPI::Models::AudienceListContactsParams} for more details.
|
|
35
|
+
#
|
|
36
|
+
# List all contacts in an audience with cursor-based pagination. The account is
|
|
37
|
+
# inferred from the audience.
|
|
38
|
+
#
|
|
39
|
+
# @overload list_contacts(audience_id, after: nil, before: nil, request_options: {})
|
|
40
|
+
#
|
|
41
|
+
# @param audience_id [String] The audience ID to list contacts for.
|
|
42
|
+
#
|
|
43
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
44
|
+
#
|
|
45
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
46
|
+
#
|
|
47
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
48
|
+
#
|
|
49
|
+
# @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::Contact>]
|
|
50
|
+
#
|
|
51
|
+
# @see SurgeAPI::Models::AudienceListContactsParams
|
|
52
|
+
def list_contacts(audience_id, params = {})
|
|
53
|
+
parsed, options = SurgeAPI::AudienceListContactsParams.dump_request(params)
|
|
54
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
55
|
+
@client.request(
|
|
56
|
+
method: :get,
|
|
57
|
+
path: ["audiences/%1$s/contacts", audience_id],
|
|
58
|
+
query: query,
|
|
59
|
+
page: SurgeAPI::Internal::Cursor,
|
|
60
|
+
model: SurgeAPI::Contact,
|
|
61
|
+
options: options
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @api private
|
|
66
|
+
#
|
|
67
|
+
# @param client [SurgeAPI::Client]
|
|
68
|
+
def initialize(client:)
|
|
69
|
+
@client = client
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -61,6 +61,8 @@ require_relative "surge_api/models/account_create_params"
|
|
|
61
61
|
require_relative "surge_api/models/account_retrieve_status_params"
|
|
62
62
|
require_relative "surge_api/models/account_status"
|
|
63
63
|
require_relative "surge_api/models/account_update_params"
|
|
64
|
+
require_relative "surge_api/models/audience_add_contact_params"
|
|
65
|
+
require_relative "surge_api/models/audience_list_contacts_params"
|
|
64
66
|
require_relative "surge_api/models/blast"
|
|
65
67
|
require_relative "surge_api/models/blast_create_params"
|
|
66
68
|
require_relative "surge_api/models/call_ended_webhook_event"
|
|
@@ -118,6 +120,7 @@ require_relative "surge_api/models/voicemail_received_webhook_event"
|
|
|
118
120
|
require_relative "surge_api/models/webhook_unwrap_params"
|
|
119
121
|
require_relative "surge_api/models"
|
|
120
122
|
require_relative "surge_api/resources/accounts"
|
|
123
|
+
require_relative "surge_api/resources/audiences"
|
|
121
124
|
require_relative "surge_api/resources/blasts"
|
|
122
125
|
require_relative "surge_api/resources/campaigns"
|
|
123
126
|
require_relative "surge_api/resources/contacts"
|
data/rbi/surge_api/client.rbi
CHANGED
|
@@ -148,13 +148,13 @@ module SurgeAPI
|
|
|
148
148
|
attr_accessor :email
|
|
149
149
|
|
|
150
150
|
# The value of the identifier whose type is specified in the identifier_type
|
|
151
|
-
# field.
|
|
152
|
-
#
|
|
151
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
152
|
+
# exactly 9 digits.
|
|
153
153
|
sig { returns(T.nilable(String)) }
|
|
154
154
|
attr_accessor :identifier
|
|
155
155
|
|
|
156
|
-
# The type of identifier being provided for the organization.
|
|
157
|
-
#
|
|
156
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
157
|
+
# businesses or "cbn" for Canadian businesses.
|
|
158
158
|
sig do
|
|
159
159
|
returns(
|
|
160
160
|
T.nilable(
|
|
@@ -174,8 +174,8 @@ module SurgeAPI
|
|
|
174
174
|
end
|
|
175
175
|
attr_accessor :industry
|
|
176
176
|
|
|
177
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
178
|
-
# verification text message will be sent. (E.164 format)
|
|
177
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
178
|
+
# which a verification text message will be sent. (E.164 format)
|
|
179
179
|
sig { returns(T.nilable(String)) }
|
|
180
180
|
attr_accessor :mobile_number
|
|
181
181
|
|
|
@@ -288,16 +288,16 @@ module SurgeAPI
|
|
|
288
288
|
# `@dtprecisionauto.com`)
|
|
289
289
|
email: nil,
|
|
290
290
|
# The value of the identifier whose type is specified in the identifier_type
|
|
291
|
-
# field.
|
|
292
|
-
#
|
|
291
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
292
|
+
# exactly 9 digits.
|
|
293
293
|
identifier: nil,
|
|
294
|
-
# The type of identifier being provided for the organization.
|
|
295
|
-
#
|
|
294
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
295
|
+
# businesses or "cbn" for Canadian businesses.
|
|
296
296
|
identifier_type: nil,
|
|
297
297
|
# The industry in which the organization operates.
|
|
298
298
|
industry: nil,
|
|
299
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
300
|
-
# verification text message will be sent. (E.164 format)
|
|
299
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
300
|
+
# which a verification text message will be sent. (E.164 format)
|
|
301
301
|
mobile_number: nil,
|
|
302
302
|
# An array of regions in which the organization operates.
|
|
303
303
|
regions_of_operation: nil,
|
|
@@ -612,8 +612,8 @@ module SurgeAPI
|
|
|
612
612
|
end
|
|
613
613
|
end
|
|
614
614
|
|
|
615
|
-
# The type of identifier being provided for the organization.
|
|
616
|
-
#
|
|
615
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
616
|
+
# businesses or "cbn" for Canadian businesses.
|
|
617
617
|
module IdentifierType
|
|
618
618
|
extend SurgeAPI::Internal::Type::Enum
|
|
619
619
|
|
|
@@ -631,6 +631,11 @@ module SurgeAPI
|
|
|
631
631
|
:ein,
|
|
632
632
|
SurgeAPI::AccountCreateParams::Organization::IdentifierType::TaggedSymbol
|
|
633
633
|
)
|
|
634
|
+
CBN =
|
|
635
|
+
T.let(
|
|
636
|
+
:cbn,
|
|
637
|
+
SurgeAPI::AccountCreateParams::Organization::IdentifierType::TaggedSymbol
|
|
638
|
+
)
|
|
634
639
|
|
|
635
640
|
sig do
|
|
636
641
|
override.returns(
|
|
@@ -149,13 +149,13 @@ module SurgeAPI
|
|
|
149
149
|
attr_accessor :email
|
|
150
150
|
|
|
151
151
|
# The value of the identifier whose type is specified in the identifier_type
|
|
152
|
-
# field.
|
|
153
|
-
#
|
|
152
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
153
|
+
# exactly 9 digits.
|
|
154
154
|
sig { returns(T.nilable(String)) }
|
|
155
155
|
attr_accessor :identifier
|
|
156
156
|
|
|
157
|
-
# The type of identifier being provided for the organization.
|
|
158
|
-
#
|
|
157
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
158
|
+
# businesses or "cbn" for Canadian businesses.
|
|
159
159
|
sig do
|
|
160
160
|
returns(
|
|
161
161
|
T.nilable(
|
|
@@ -175,8 +175,8 @@ module SurgeAPI
|
|
|
175
175
|
end
|
|
176
176
|
attr_accessor :industry
|
|
177
177
|
|
|
178
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
179
|
-
# verification text message will be sent. (E.164 format)
|
|
178
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
179
|
+
# which a verification text message will be sent. (E.164 format)
|
|
180
180
|
sig { returns(T.nilable(String)) }
|
|
181
181
|
attr_accessor :mobile_number
|
|
182
182
|
|
|
@@ -289,16 +289,16 @@ module SurgeAPI
|
|
|
289
289
|
# `@dtprecisionauto.com`)
|
|
290
290
|
email: nil,
|
|
291
291
|
# The value of the identifier whose type is specified in the identifier_type
|
|
292
|
-
# field.
|
|
293
|
-
#
|
|
292
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
293
|
+
# exactly 9 digits.
|
|
294
294
|
identifier: nil,
|
|
295
|
-
# The type of identifier being provided for the organization.
|
|
296
|
-
#
|
|
295
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
296
|
+
# businesses or "cbn" for Canadian businesses.
|
|
297
297
|
identifier_type: nil,
|
|
298
298
|
# The industry in which the organization operates.
|
|
299
299
|
industry: nil,
|
|
300
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
301
|
-
# verification text message will be sent. (E.164 format)
|
|
300
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
301
|
+
# which a verification text message will be sent. (E.164 format)
|
|
302
302
|
mobile_number: nil,
|
|
303
303
|
# An array of regions in which the organization operates.
|
|
304
304
|
regions_of_operation: nil,
|
|
@@ -613,8 +613,8 @@ module SurgeAPI
|
|
|
613
613
|
end
|
|
614
614
|
end
|
|
615
615
|
|
|
616
|
-
# The type of identifier being provided for the organization.
|
|
617
|
-
#
|
|
616
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
617
|
+
# businesses or "cbn" for Canadian businesses.
|
|
618
618
|
module IdentifierType
|
|
619
619
|
extend SurgeAPI::Internal::Type::Enum
|
|
620
620
|
|
|
@@ -632,6 +632,11 @@ module SurgeAPI
|
|
|
632
632
|
:ein,
|
|
633
633
|
SurgeAPI::AccountUpdateParams::Organization::IdentifierType::TaggedSymbol
|
|
634
634
|
)
|
|
635
|
+
CBN =
|
|
636
|
+
T.let(
|
|
637
|
+
:cbn,
|
|
638
|
+
SurgeAPI::AccountUpdateParams::Organization::IdentifierType::TaggedSymbol
|
|
639
|
+
)
|
|
635
640
|
|
|
636
641
|
sig do
|
|
637
642
|
override.returns(
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class AudienceAddContactParams < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(SurgeAPI::AudienceAddContactParams, SurgeAPI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the contact to add. The contact must belong to the same account as the
|
|
15
|
+
# audience.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
id: String,
|
|
22
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
23
|
+
).returns(T.attached_class)
|
|
24
|
+
end
|
|
25
|
+
def self.new(
|
|
26
|
+
# The ID of the contact to add. The contact must belong to the same account as the
|
|
27
|
+
# audience.
|
|
28
|
+
id:,
|
|
29
|
+
request_options: {}
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{ id: String, request_options: SurgeAPI::RequestOptions }
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class AudienceListContactsParams < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
SurgeAPI::AudienceListContactsParams,
|
|
13
|
+
SurgeAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :after
|
|
20
|
+
|
|
21
|
+
sig { params(after: String).void }
|
|
22
|
+
attr_writer :after
|
|
23
|
+
|
|
24
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
25
|
+
# response.
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :before
|
|
28
|
+
|
|
29
|
+
sig { params(before: String).void }
|
|
30
|
+
attr_writer :before
|
|
31
|
+
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
after: String,
|
|
35
|
+
before: String,
|
|
36
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
41
|
+
after: nil,
|
|
42
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
43
|
+
# response.
|
|
44
|
+
before: nil,
|
|
45
|
+
request_options: {}
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
override.returns(
|
|
51
|
+
{
|
|
52
|
+
after: String,
|
|
53
|
+
before: String,
|
|
54
|
+
request_options: SurgeAPI::RequestOptions
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
def to_hash
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -37,13 +37,13 @@ module SurgeAPI
|
|
|
37
37
|
attr_accessor :email
|
|
38
38
|
|
|
39
39
|
# The value of the identifier whose type is specified in the identifier_type
|
|
40
|
-
# field.
|
|
41
|
-
#
|
|
40
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
41
|
+
# exactly 9 digits.
|
|
42
42
|
sig { returns(T.nilable(String)) }
|
|
43
43
|
attr_accessor :identifier
|
|
44
44
|
|
|
45
|
-
# The type of identifier being provided for the organization.
|
|
46
|
-
#
|
|
45
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
46
|
+
# businesses or "cbn" for Canadian businesses.
|
|
47
47
|
sig do
|
|
48
48
|
returns(T.nilable(SurgeAPI::Organization::IdentifierType::TaggedSymbol))
|
|
49
49
|
end
|
|
@@ -53,8 +53,8 @@ module SurgeAPI
|
|
|
53
53
|
sig { returns(T.nilable(SurgeAPI::Organization::Industry::TaggedSymbol)) }
|
|
54
54
|
attr_accessor :industry
|
|
55
55
|
|
|
56
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
57
|
-
# verification text message will be sent. (E.164 format)
|
|
56
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
57
|
+
# which a verification text message will be sent. (E.164 format)
|
|
58
58
|
sig { returns(T.nilable(String)) }
|
|
59
59
|
attr_accessor :mobile_number
|
|
60
60
|
|
|
@@ -135,16 +135,16 @@ module SurgeAPI
|
|
|
135
135
|
# `@dtprecisionauto.com`)
|
|
136
136
|
email:,
|
|
137
137
|
# The value of the identifier whose type is specified in the identifier_type
|
|
138
|
-
# field.
|
|
139
|
-
#
|
|
138
|
+
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
139
|
+
# exactly 9 digits.
|
|
140
140
|
identifier:,
|
|
141
|
-
# The type of identifier being provided for the organization.
|
|
142
|
-
#
|
|
141
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
142
|
+
# businesses or "cbn" for Canadian businesses.
|
|
143
143
|
identifier_type:,
|
|
144
144
|
# The industry in which the organization operates.
|
|
145
145
|
industry:,
|
|
146
|
-
# For sole proprietors, this must be a valid US mobile phone number to
|
|
147
|
-
# verification text message will be sent. (E.164 format)
|
|
146
|
+
# For sole proprietors, this must be a valid US or Canadian mobile phone number to
|
|
147
|
+
# which a verification text message will be sent. (E.164 format)
|
|
148
148
|
mobile_number:,
|
|
149
149
|
# An array of regions in which the organization operates.
|
|
150
150
|
regions_of_operation:,
|
|
@@ -408,8 +408,8 @@ module SurgeAPI
|
|
|
408
408
|
end
|
|
409
409
|
end
|
|
410
410
|
|
|
411
|
-
# The type of identifier being provided for the organization.
|
|
412
|
-
#
|
|
411
|
+
# The type of identifier being provided for the organization. Use "ein" for US
|
|
412
|
+
# businesses or "cbn" for Canadian businesses.
|
|
413
413
|
module IdentifierType
|
|
414
414
|
extend SurgeAPI::Internal::Type::Enum
|
|
415
415
|
|
|
@@ -418,6 +418,7 @@ module SurgeAPI
|
|
|
418
418
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
419
419
|
|
|
420
420
|
EIN = T.let(:ein, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
|
|
421
|
+
CBN = T.let(:cbn, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
|
|
421
422
|
|
|
422
423
|
sig do
|
|
423
424
|
override.returns(
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -13,6 +13,10 @@ module SurgeAPI
|
|
|
13
13
|
|
|
14
14
|
AccountUpdateParams = SurgeAPI::Models::AccountUpdateParams
|
|
15
15
|
|
|
16
|
+
AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
17
|
+
|
|
18
|
+
AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
19
|
+
|
|
16
20
|
Blast = SurgeAPI::Models::Blast
|
|
17
21
|
|
|
18
22
|
BlastCreateParams = SurgeAPI::Models::BlastCreateParams
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Audiences
|
|
6
|
+
# Adds an existing contact to a manual audience.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
audience_id: String,
|
|
10
|
+
id: String,
|
|
11
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
12
|
+
).returns(SurgeAPI::Contact)
|
|
13
|
+
end
|
|
14
|
+
def add_contact(
|
|
15
|
+
# The audience ID to add the contact to.
|
|
16
|
+
audience_id,
|
|
17
|
+
# The ID of the contact to add. The contact must belong to the same account as the
|
|
18
|
+
# audience.
|
|
19
|
+
id:,
|
|
20
|
+
request_options: {}
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# List all contacts in an audience with cursor-based pagination. The account is
|
|
25
|
+
# inferred from the audience.
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
audience_id: String,
|
|
29
|
+
after: String,
|
|
30
|
+
before: String,
|
|
31
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
32
|
+
).returns(SurgeAPI::Internal::Cursor[SurgeAPI::Contact])
|
|
33
|
+
end
|
|
34
|
+
def list_contacts(
|
|
35
|
+
# The audience ID to list contacts for.
|
|
36
|
+
audience_id,
|
|
37
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
38
|
+
after: nil,
|
|
39
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
40
|
+
# response.
|
|
41
|
+
before: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @api private
|
|
47
|
+
sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
|
|
48
|
+
def self.new(client:)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
data/sig/surge_api/client.rbs
CHANGED
|
@@ -234,12 +234,13 @@ module SurgeAPI
|
|
|
234
234
|
end
|
|
235
235
|
end
|
|
236
236
|
|
|
237
|
-
type identifier_type = :ein
|
|
237
|
+
type identifier_type = :ein | :cbn
|
|
238
238
|
|
|
239
239
|
module IdentifierType
|
|
240
240
|
extend SurgeAPI::Internal::Type::Enum
|
|
241
241
|
|
|
242
242
|
EIN: :ein
|
|
243
|
+
CBN: :cbn
|
|
243
244
|
|
|
244
245
|
def self?.values: -> ::Array[SurgeAPI::Models::AccountCreateParams::Organization::identifier_type]
|
|
245
246
|
end
|
|
@@ -236,12 +236,13 @@ module SurgeAPI
|
|
|
236
236
|
end
|
|
237
237
|
end
|
|
238
238
|
|
|
239
|
-
type identifier_type = :ein
|
|
239
|
+
type identifier_type = :ein | :cbn
|
|
240
240
|
|
|
241
241
|
module IdentifierType
|
|
242
242
|
extend SurgeAPI::Internal::Type::Enum
|
|
243
243
|
|
|
244
244
|
EIN: :ein
|
|
245
|
+
CBN: :cbn
|
|
245
246
|
|
|
246
247
|
def self?.values: -> ::Array[SurgeAPI::Models::AccountUpdateParams::Organization::identifier_type]
|
|
247
248
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type audience_add_contact_params =
|
|
4
|
+
{ id: String } & SurgeAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class AudienceAddContactParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor id: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
id: String,
|
|
14
|
+
?request_options: SurgeAPI::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type audience_list_contacts_params =
|
|
4
|
+
{ after: String, before: String }
|
|
5
|
+
& SurgeAPI::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class AudienceListContactsParams < SurgeAPI::Internal::Type::BaseModel
|
|
8
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_reader after: String?
|
|
12
|
+
|
|
13
|
+
def after=: (String) -> String
|
|
14
|
+
|
|
15
|
+
attr_reader before: String?
|
|
16
|
+
|
|
17
|
+
def before=: (String) -> String
|
|
18
|
+
|
|
19
|
+
def initialize: (
|
|
20
|
+
?after: String,
|
|
21
|
+
?before: String,
|
|
22
|
+
?request_options: SurgeAPI::request_opts
|
|
23
|
+
) -> void
|
|
24
|
+
|
|
25
|
+
def to_hash: -> {
|
|
26
|
+
after: String,
|
|
27
|
+
before: String,
|
|
28
|
+
request_options: SurgeAPI::RequestOptions
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -187,12 +187,13 @@ module SurgeAPI
|
|
|
187
187
|
end
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
type identifier_type = :ein
|
|
190
|
+
type identifier_type = :ein | :cbn
|
|
191
191
|
|
|
192
192
|
module IdentifierType
|
|
193
193
|
extend SurgeAPI::Internal::Type::Enum
|
|
194
194
|
|
|
195
195
|
EIN: :ein
|
|
196
|
+
CBN: :cbn
|
|
196
197
|
|
|
197
198
|
def self?.values: -> ::Array[SurgeAPI::Models::Organization::identifier_type]
|
|
198
199
|
end
|
data/sig/surge_api/models.rbs
CHANGED
|
@@ -11,6 +11,10 @@ module SurgeAPI
|
|
|
11
11
|
|
|
12
12
|
class AccountUpdateParams = SurgeAPI::Models::AccountUpdateParams
|
|
13
13
|
|
|
14
|
+
class AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
15
|
+
|
|
16
|
+
class AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
17
|
+
|
|
14
18
|
class Blast = SurgeAPI::Models::Blast
|
|
15
19
|
|
|
16
20
|
class BlastCreateParams = SurgeAPI::Models::BlastCreateParams
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Resources
|
|
3
|
+
class Audiences
|
|
4
|
+
def add_contact: (
|
|
5
|
+
String audience_id,
|
|
6
|
+
id: String,
|
|
7
|
+
?request_options: SurgeAPI::request_opts
|
|
8
|
+
) -> SurgeAPI::Contact
|
|
9
|
+
|
|
10
|
+
def list_contacts: (
|
|
11
|
+
String audience_id,
|
|
12
|
+
?after: String,
|
|
13
|
+
?before: String,
|
|
14
|
+
?request_options: SurgeAPI::request_opts
|
|
15
|
+
) -> SurgeAPI::Internal::Cursor[SurgeAPI::Contact]
|
|
16
|
+
|
|
17
|
+
def initialize: (client: SurgeAPI::Client) -> void
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: surge_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Surge
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -76,6 +76,8 @@ files:
|
|
|
76
76
|
- lib/surge_api/models/account_retrieve_status_params.rb
|
|
77
77
|
- lib/surge_api/models/account_status.rb
|
|
78
78
|
- lib/surge_api/models/account_update_params.rb
|
|
79
|
+
- lib/surge_api/models/audience_add_contact_params.rb
|
|
80
|
+
- lib/surge_api/models/audience_list_contacts_params.rb
|
|
79
81
|
- lib/surge_api/models/blast.rb
|
|
80
82
|
- lib/surge_api/models/blast_create_params.rb
|
|
81
83
|
- lib/surge_api/models/call_ended_webhook_event.rb
|
|
@@ -135,6 +137,7 @@ files:
|
|
|
135
137
|
- lib/surge_api/models/webhook_unwrap_params.rb
|
|
136
138
|
- lib/surge_api/request_options.rb
|
|
137
139
|
- lib/surge_api/resources/accounts.rb
|
|
140
|
+
- lib/surge_api/resources/audiences.rb
|
|
138
141
|
- lib/surge_api/resources/blasts.rb
|
|
139
142
|
- lib/surge_api/resources/campaigns.rb
|
|
140
143
|
- lib/surge_api/resources/contacts.rb
|
|
@@ -172,6 +175,8 @@ files:
|
|
|
172
175
|
- rbi/surge_api/models/account_retrieve_status_params.rbi
|
|
173
176
|
- rbi/surge_api/models/account_status.rbi
|
|
174
177
|
- rbi/surge_api/models/account_update_params.rbi
|
|
178
|
+
- rbi/surge_api/models/audience_add_contact_params.rbi
|
|
179
|
+
- rbi/surge_api/models/audience_list_contacts_params.rbi
|
|
175
180
|
- rbi/surge_api/models/blast.rbi
|
|
176
181
|
- rbi/surge_api/models/blast_create_params.rbi
|
|
177
182
|
- rbi/surge_api/models/call_ended_webhook_event.rbi
|
|
@@ -231,6 +236,7 @@ files:
|
|
|
231
236
|
- rbi/surge_api/models/webhook_unwrap_params.rbi
|
|
232
237
|
- rbi/surge_api/request_options.rbi
|
|
233
238
|
- rbi/surge_api/resources/accounts.rbi
|
|
239
|
+
- rbi/surge_api/resources/audiences.rbi
|
|
234
240
|
- rbi/surge_api/resources/blasts.rbi
|
|
235
241
|
- rbi/surge_api/resources/campaigns.rbi
|
|
236
242
|
- rbi/surge_api/resources/contacts.rbi
|
|
@@ -267,6 +273,8 @@ files:
|
|
|
267
273
|
- sig/surge_api/models/account_retrieve_status_params.rbs
|
|
268
274
|
- sig/surge_api/models/account_status.rbs
|
|
269
275
|
- sig/surge_api/models/account_update_params.rbs
|
|
276
|
+
- sig/surge_api/models/audience_add_contact_params.rbs
|
|
277
|
+
- sig/surge_api/models/audience_list_contacts_params.rbs
|
|
270
278
|
- sig/surge_api/models/blast.rbs
|
|
271
279
|
- sig/surge_api/models/blast_create_params.rbs
|
|
272
280
|
- sig/surge_api/models/call_ended_webhook_event.rbs
|
|
@@ -326,6 +334,7 @@ files:
|
|
|
326
334
|
- sig/surge_api/models/webhook_unwrap_params.rbs
|
|
327
335
|
- sig/surge_api/request_options.rbs
|
|
328
336
|
- sig/surge_api/resources/accounts.rbs
|
|
337
|
+
- sig/surge_api/resources/audiences.rbs
|
|
329
338
|
- sig/surge_api/resources/blasts.rbs
|
|
330
339
|
- sig/surge_api/resources/campaigns.rbs
|
|
331
340
|
- sig/surge_api/resources/contacts.rbs
|