surge_api 0.22.0 → 0.24.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 +25 -0
- data/README.md +1 -1
- data/lib/surge_api/models/account_create_params.rb +8 -4
- data/lib/surge_api/models/account_retrieve_status_params.rb +1 -0
- data/lib/surge_api/models/account_update_params.rb +8 -4
- data/lib/surge_api/models/campaign.rb +6 -6
- data/lib/surge_api/models/campaign_params.rb +5 -6
- data/lib/surge_api/models/contact.rb +9 -1
- data/lib/surge_api/models/contact_create_params.rb +9 -1
- data/lib/surge_api/models/contact_update_params.rb +9 -1
- data/lib/surge_api/models/message.rb +25 -1
- data/lib/surge_api/models/message_delivered_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_failed_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_params.rb +9 -1
- data/lib/surge_api/models/message_received_webhook_event.rb +21 -1
- data/lib/surge_api/models/message_sent_webhook_event.rb +21 -1
- data/lib/surge_api/models/organization.rb +8 -4
- data/lib/surge_api/models/phone_number_imported_webhook_event.rb +152 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
- data/lib/surge_api/models.rb +2 -0
- data/lib/surge_api/resources/contacts.rb +6 -2
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +1 -0
- data/rbi/surge_api/models/account_create_params.rbi +15 -5
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +5 -0
- data/rbi/surge_api/models/account_update_params.rbi +15 -5
- data/rbi/surge_api/models/campaign.rbi +9 -10
- data/rbi/surge_api/models/campaign_params.rbi +8 -10
- data/rbi/surge_api/models/contact.rbi +14 -3
- data/rbi/surge_api/models/contact_create_params.rbi +11 -0
- data/rbi/surge_api/models/contact_update_params.rbi +11 -0
- data/rbi/surge_api/models/message.rbi +34 -3
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +44 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +40 -0
- data/rbi/surge_api/models/message_params.rbi +14 -3
- data/rbi/surge_api/models/message_received_webhook_event.rbi +41 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +38 -0
- data/rbi/surge_api/models/organization.rbi +11 -5
- data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +310 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
- data/rbi/surge_api/models.rbi +3 -0
- data/rbi/surge_api/resources/contacts.rbi +6 -0
- data/rbi/surge_api/resources/webhooks.rbi +1 -0
- data/sig/surge_api/models/account_create_params.rbs +2 -1
- data/sig/surge_api/models/account_retrieve_status_params.rbs +2 -1
- data/sig/surge_api/models/account_update_params.rbs +2 -1
- data/sig/surge_api/models/campaign.rbs +3 -1
- data/sig/surge_api/models/contact.rbs +10 -3
- data/sig/surge_api/models/contact_create_params.rbs +8 -1
- data/sig/surge_api/models/contact_update_params.rbs +8 -1
- data/sig/surge_api/models/message.rbs +26 -3
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_params.rbs +10 -3
- data/sig/surge_api/models/message_received_webhook_event.rbs +15 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +15 -0
- data/sig/surge_api/models/organization.rbs +2 -1
- data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +125 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
- data/sig/surge_api/models.rbs +2 -0
- data/sig/surge_api/resources/contacts.rbs +2 -0
- data/sig/surge_api/resources/webhooks.rbs +1 -0
- metadata +5 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class PhoneNumberImportedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The ID of the account in which this event occurred
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute data
|
|
13
|
+
# The data associated with the event
|
|
14
|
+
#
|
|
15
|
+
# @return [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data }
|
|
17
|
+
|
|
18
|
+
# @!attribute timestamp
|
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
20
|
+
#
|
|
21
|
+
# @return [Time]
|
|
22
|
+
required :timestamp, Time
|
|
23
|
+
|
|
24
|
+
# @!attribute type
|
|
25
|
+
# The type of the event. Always `phone_number.imported` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"phone_number.imported"]
|
|
28
|
+
required :type, const: :"phone_number.imported"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"phone_number.imported")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data] The data associated with the event
|
|
34
|
+
#
|
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :"phone_number.imported"] The type of the event. Always `phone_number.imported` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent#data
|
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
41
|
+
# @!attribute id
|
|
42
|
+
# The unique identifier for the phone number
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :id, String
|
|
46
|
+
|
|
47
|
+
# @!attribute campaign
|
|
48
|
+
# Campaign attachment details for a domestic local phone number
|
|
49
|
+
#
|
|
50
|
+
# @return [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign, nil]
|
|
51
|
+
required :campaign, -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign }, nil?: true
|
|
52
|
+
|
|
53
|
+
# @!attribute campaign_id
|
|
54
|
+
# @deprecated Use `campaign.id` instead.
|
|
55
|
+
#
|
|
56
|
+
# Deprecated. The unique identifier of the campaign this phone number is attached
|
|
57
|
+
# to
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
required :campaign_id, String, nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute name
|
|
63
|
+
# A human-readable name for the phone number
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
required :name, String, nil?: true
|
|
67
|
+
|
|
68
|
+
# @!attribute number
|
|
69
|
+
# The phone number in E.164 format
|
|
70
|
+
#
|
|
71
|
+
# @return [String]
|
|
72
|
+
required :number, String
|
|
73
|
+
|
|
74
|
+
# @!attribute type
|
|
75
|
+
# Whether the phone number is local, toll-free, or short code
|
|
76
|
+
#
|
|
77
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Type]
|
|
78
|
+
required :type, enum: -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type }
|
|
79
|
+
|
|
80
|
+
# @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
|
|
81
|
+
# Some parameter documentations has been truncated, see
|
|
82
|
+
# {SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data} for more details.
|
|
83
|
+
#
|
|
84
|
+
# The data associated with the event
|
|
85
|
+
#
|
|
86
|
+
# @param id [String] The unique identifier for the phone number
|
|
87
|
+
#
|
|
88
|
+
# @param campaign [SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign, nil] Campaign attachment details for a domestic local phone number
|
|
89
|
+
#
|
|
90
|
+
# @param campaign_id [String, nil] Deprecated. The unique identifier of the campaign this phone number is attached
|
|
91
|
+
#
|
|
92
|
+
# @param name [String, nil] A human-readable name for the phone number
|
|
93
|
+
#
|
|
94
|
+
# @param number [String] The phone number in E.164 format
|
|
95
|
+
#
|
|
96
|
+
# @param type [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Type] Whether the phone number is local, toll-free, or short code
|
|
97
|
+
|
|
98
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data#campaign
|
|
99
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
|
100
|
+
# @!attribute id
|
|
101
|
+
# The unique identifier of the campaign this phone number is attached to
|
|
102
|
+
#
|
|
103
|
+
# @return [String]
|
|
104
|
+
required :id, String
|
|
105
|
+
|
|
106
|
+
# @!attribute attachment_status
|
|
107
|
+
# The current campaign attachment status for this phone number.
|
|
108
|
+
#
|
|
109
|
+
# @return [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus]
|
|
110
|
+
required :attachment_status,
|
|
111
|
+
enum: -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus }
|
|
112
|
+
|
|
113
|
+
# @!method initialize(id:, attachment_status:)
|
|
114
|
+
# Campaign attachment details for a domestic local phone number
|
|
115
|
+
#
|
|
116
|
+
# @param id [String] The unique identifier of the campaign this phone number is attached to
|
|
117
|
+
#
|
|
118
|
+
# @param attachment_status [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus] The current campaign attachment status for this phone number.
|
|
119
|
+
|
|
120
|
+
# The current campaign attachment status for this phone number.
|
|
121
|
+
#
|
|
122
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Campaign#attachment_status
|
|
123
|
+
module AttachmentStatus
|
|
124
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
125
|
+
|
|
126
|
+
ATTACHED = :attached
|
|
127
|
+
ATTACHMENT_PENDING = :attachment_pending
|
|
128
|
+
DETACHED = :detached
|
|
129
|
+
DETACHMENT_PENDING = :detachment_pending
|
|
130
|
+
|
|
131
|
+
# @!method self.values
|
|
132
|
+
# @return [Array<Symbol>]
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Whether the phone number is local, toll-free, or short code
|
|
137
|
+
#
|
|
138
|
+
# @see SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data#type
|
|
139
|
+
module Type
|
|
140
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
141
|
+
|
|
142
|
+
LOCAL = :local
|
|
143
|
+
SHORT_CODE = :short_code
|
|
144
|
+
TOLL_FREE = :toll_free
|
|
145
|
+
|
|
146
|
+
# @!method self.values
|
|
147
|
+
# @return [Array<Symbol>]
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -29,12 +29,14 @@ module SurgeAPI
|
|
|
29
29
|
|
|
30
30
|
variant :"phone_number.attached_to_campaign", -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent }
|
|
31
31
|
|
|
32
|
+
variant :"phone_number.imported", -> { SurgeAPI::PhoneNumberImportedWebhookEvent }
|
|
33
|
+
|
|
32
34
|
variant :"recording.completed", -> { SurgeAPI::RecordingCompletedWebhookEvent }
|
|
33
35
|
|
|
34
36
|
variant :"voicemail.received", -> { SurgeAPI::VoicemailReceivedWebhookEvent }
|
|
35
37
|
|
|
36
38
|
# @!method self.variants
|
|
37
|
-
# @return [Array(SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent)]
|
|
39
|
+
# @return [Array(SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent, SurgeAPI::Models::PhoneNumberImportedWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent)]
|
|
38
40
|
end
|
|
39
41
|
end
|
|
40
42
|
end
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -130,6 +130,8 @@ module SurgeAPI
|
|
|
130
130
|
|
|
131
131
|
PhoneNumberAttachedToCampaignWebhookEvent = SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
|
|
132
132
|
|
|
133
|
+
PhoneNumberImportedWebhookEvent = SurgeAPI::Models::PhoneNumberImportedWebhookEvent
|
|
134
|
+
|
|
133
135
|
PhoneNumberListAvailableNumbersParams = SurgeAPI::Models::PhoneNumberListAvailableNumbersParams
|
|
134
136
|
|
|
135
137
|
PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
|
|
@@ -5,7 +5,7 @@ module SurgeAPI
|
|
|
5
5
|
class Contacts
|
|
6
6
|
# Creates a new Contact object.
|
|
7
7
|
#
|
|
8
|
-
# @overload create(account_id, phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, request_options: {})
|
|
8
|
+
# @overload create(account_id, phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, outbound_disabled: nil, request_options: {})
|
|
9
9
|
#
|
|
10
10
|
# @param account_id [String] The account for which the contact should be created.
|
|
11
11
|
#
|
|
@@ -19,6 +19,8 @@ module SurgeAPI
|
|
|
19
19
|
#
|
|
20
20
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
21
21
|
#
|
|
22
|
+
# @param outbound_disabled [Boolean] Whether outbound messaging should be manually disabled for the contact.
|
|
23
|
+
#
|
|
22
24
|
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
25
|
#
|
|
24
26
|
# @return [SurgeAPI::Models::Contact]
|
|
@@ -58,7 +60,7 @@ module SurgeAPI
|
|
|
58
60
|
# Updates the specified contact by setting the values of the parameters passed.
|
|
59
61
|
# Any parameters not provided will be left unchanged.
|
|
60
62
|
#
|
|
61
|
-
# @overload update(id, phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, request_options: {})
|
|
63
|
+
# @overload update(id, phone_number:, email: nil, first_name: nil, last_name: nil, metadata: nil, outbound_disabled: nil, request_options: {})
|
|
62
64
|
#
|
|
63
65
|
# @param id [String] The ID of the contact to update.
|
|
64
66
|
#
|
|
@@ -72,6 +74,8 @@ module SurgeAPI
|
|
|
72
74
|
#
|
|
73
75
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
74
76
|
#
|
|
77
|
+
# @param outbound_disabled [Boolean] Whether outbound messaging should be manually disabled for the contact.
|
|
78
|
+
#
|
|
75
79
|
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
76
80
|
#
|
|
77
81
|
# @return [SurgeAPI::Models::Contact]
|
|
@@ -9,7 +9,7 @@ module SurgeAPI
|
|
|
9
9
|
#
|
|
10
10
|
# @param key [String, nil] The webhook signing key
|
|
11
11
|
#
|
|
12
|
-
# @return [SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent]
|
|
12
|
+
# @return [SurgeAPI::Models::CallEndedWebhookEvent, SurgeAPI::Models::CampaignApprovedWebhookEvent, SurgeAPI::Models::ContactOptedInWebhookEvent, SurgeAPI::Models::ContactOptedOutWebhookEvent, SurgeAPI::Models::ConversationCreatedWebhookEvent, SurgeAPI::Models::LinkFollowedWebhookEvent, SurgeAPI::Models::MessageDeliveredWebhookEvent, SurgeAPI::Models::MessageFailedWebhookEvent, SurgeAPI::Models::MessageReceivedWebhookEvent, SurgeAPI::Models::MessageSentWebhookEvent, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent, SurgeAPI::Models::PhoneNumberImportedWebhookEvent, SurgeAPI::Models::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent]
|
|
13
13
|
def unwrap(payload, headers:, key: @client.webhook_signing_secret)
|
|
14
14
|
if key.nil?
|
|
15
15
|
raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_signing_secret or passed in as an argument")
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -102,6 +102,7 @@ require_relative "surge_api/models/message_sent_webhook_event"
|
|
|
102
102
|
require_relative "surge_api/models/organization"
|
|
103
103
|
require_relative "surge_api/models/phone_number"
|
|
104
104
|
require_relative "surge_api/models/phone_number_attached_to_campaign_webhook_event"
|
|
105
|
+
require_relative "surge_api/models/phone_number_imported_webhook_event"
|
|
105
106
|
require_relative "surge_api/models/phone_number_list_available_numbers_params"
|
|
106
107
|
require_relative "surge_api/models/phone_number_list_available_numbers_response"
|
|
107
108
|
require_relative "surge_api/models/phone_number_list_params"
|
|
@@ -149,12 +149,14 @@ module SurgeAPI
|
|
|
149
149
|
|
|
150
150
|
# The value of the identifier whose type is specified in the identifier_type
|
|
151
151
|
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
152
|
-
# exactly 9 digits.
|
|
152
|
+
# exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
|
|
153
|
+
# digits.
|
|
153
154
|
sig { returns(T.nilable(String)) }
|
|
154
155
|
attr_accessor :identifier
|
|
155
156
|
|
|
156
157
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
157
|
-
#
|
|
158
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
159
|
+
# international organizations.
|
|
158
160
|
sig do
|
|
159
161
|
returns(
|
|
160
162
|
T.nilable(
|
|
@@ -289,10 +291,12 @@ module SurgeAPI
|
|
|
289
291
|
email: nil,
|
|
290
292
|
# The value of the identifier whose type is specified in the identifier_type
|
|
291
293
|
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
292
|
-
# exactly 9 digits.
|
|
294
|
+
# exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
|
|
295
|
+
# digits.
|
|
293
296
|
identifier: nil,
|
|
294
297
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
295
|
-
#
|
|
298
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
299
|
+
# international organizations.
|
|
296
300
|
identifier_type: nil,
|
|
297
301
|
# The industry in which the organization operates.
|
|
298
302
|
industry: nil,
|
|
@@ -613,7 +617,8 @@ module SurgeAPI
|
|
|
613
617
|
end
|
|
614
618
|
|
|
615
619
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
616
|
-
#
|
|
620
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
621
|
+
# international organizations.
|
|
617
622
|
module IdentifierType
|
|
618
623
|
extend SurgeAPI::Internal::Type::Enum
|
|
619
624
|
|
|
@@ -636,6 +641,11 @@ module SurgeAPI
|
|
|
636
641
|
:cbn,
|
|
637
642
|
SurgeAPI::AccountCreateParams::Organization::IdentifierType::TaggedSymbol
|
|
638
643
|
)
|
|
644
|
+
VAT =
|
|
645
|
+
T.let(
|
|
646
|
+
:vat,
|
|
647
|
+
SurgeAPI::AccountCreateParams::Organization::IdentifierType::TaggedSymbol
|
|
648
|
+
)
|
|
639
649
|
|
|
640
650
|
sig do
|
|
641
651
|
override.returns(
|
|
@@ -88,6 +88,11 @@ module SurgeAPI
|
|
|
88
88
|
:local_messaging,
|
|
89
89
|
SurgeAPI::AccountRetrieveStatusParams::Capability::TaggedSymbol
|
|
90
90
|
)
|
|
91
|
+
TOLL_FREE_MESSAGING =
|
|
92
|
+
T.let(
|
|
93
|
+
:toll_free_messaging,
|
|
94
|
+
SurgeAPI::AccountRetrieveStatusParams::Capability::TaggedSymbol
|
|
95
|
+
)
|
|
91
96
|
|
|
92
97
|
sig do
|
|
93
98
|
override.returns(
|
|
@@ -158,12 +158,14 @@ module SurgeAPI
|
|
|
158
158
|
|
|
159
159
|
# The value of the identifier whose type is specified in the identifier_type
|
|
160
160
|
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
161
|
-
# exactly 9 digits.
|
|
161
|
+
# exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
|
|
162
|
+
# digits.
|
|
162
163
|
sig { returns(T.nilable(String)) }
|
|
163
164
|
attr_accessor :identifier
|
|
164
165
|
|
|
165
166
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
166
|
-
#
|
|
167
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
168
|
+
# international organizations.
|
|
167
169
|
sig do
|
|
168
170
|
returns(
|
|
169
171
|
T.nilable(
|
|
@@ -298,10 +300,12 @@ module SurgeAPI
|
|
|
298
300
|
email: nil,
|
|
299
301
|
# The value of the identifier whose type is specified in the identifier_type
|
|
300
302
|
# field. For EIN, can be formatted with or without the hyphen. For CBN, must be
|
|
301
|
-
# exactly 9 digits.
|
|
303
|
+
# exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
|
|
304
|
+
# digits.
|
|
302
305
|
identifier: nil,
|
|
303
306
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
304
|
-
#
|
|
307
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
308
|
+
# international organizations.
|
|
305
309
|
identifier_type: nil,
|
|
306
310
|
# The industry in which the organization operates.
|
|
307
311
|
industry: nil,
|
|
@@ -622,7 +626,8 @@ module SurgeAPI
|
|
|
622
626
|
end
|
|
623
627
|
|
|
624
628
|
# The type of identifier being provided for the organization. Use "ein" for US
|
|
625
|
-
#
|
|
629
|
+
# organizations, "cbn" for Canadian organizations, or "vat" for supported
|
|
630
|
+
# international organizations.
|
|
626
631
|
module IdentifierType
|
|
627
632
|
extend SurgeAPI::Internal::Type::Enum
|
|
628
633
|
|
|
@@ -645,6 +650,11 @@ module SurgeAPI
|
|
|
645
650
|
:cbn,
|
|
646
651
|
SurgeAPI::AccountUpdateParams::Organization::IdentifierType::TaggedSymbol
|
|
647
652
|
)
|
|
653
|
+
VAT =
|
|
654
|
+
T.let(
|
|
655
|
+
:vat,
|
|
656
|
+
SurgeAPI::AccountUpdateParams::Organization::IdentifierType::TaggedSymbol
|
|
657
|
+
)
|
|
648
658
|
|
|
649
659
|
sig do
|
|
650
660
|
override.returns(
|
|
@@ -96,11 +96,10 @@ module SurgeAPI
|
|
|
96
96
|
sig { returns(SurgeAPI::Campaign::Volume::TaggedSymbol) }
|
|
97
97
|
attr_accessor :volume
|
|
98
98
|
|
|
99
|
-
# A sample link that might be sent by this campaign.
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
# to disable automatic link shortening.
|
|
99
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
100
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
101
|
+
# will use in production. If links from other domains are sent through this
|
|
102
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
104
103
|
sig { returns(T.nilable(String)) }
|
|
105
104
|
attr_reader :link_sample
|
|
106
105
|
|
|
@@ -207,11 +206,10 @@ module SurgeAPI
|
|
|
207
206
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
208
207
|
# charged as high volume numbers going forward.
|
|
209
208
|
volume:,
|
|
210
|
-
# A sample link that might be sent by this campaign.
|
|
211
|
-
#
|
|
212
|
-
#
|
|
213
|
-
#
|
|
214
|
-
# to disable automatic link shortening.
|
|
209
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
210
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
211
|
+
# will use in production. If links from other domains are sent through this
|
|
212
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
215
213
|
link_sample: nil,
|
|
216
214
|
# The URL of the terms and conditions presented to end users when they opt in to
|
|
217
215
|
# messaging. These terms and conditions may be shared among all of a platform's
|
|
@@ -272,6 +270,7 @@ module SurgeAPI
|
|
|
272
270
|
|
|
273
271
|
ACTIVE = T.let(:active, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
274
272
|
CANCELED = T.let(:canceled, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
273
|
+
REJECTED = T.let(:rejected, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
275
274
|
CREATED = T.let(:created, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
276
275
|
DEACTIVATED =
|
|
277
276
|
T.let(:deactivated, SurgeAPI::Campaign::Status::TaggedSymbol)
|
|
@@ -141,11 +141,10 @@ module SurgeAPI
|
|
|
141
141
|
end
|
|
142
142
|
attr_writer :includes
|
|
143
143
|
|
|
144
|
-
# A sample link that might be sent by this campaign.
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
-
#
|
|
148
|
-
# to disable automatic link shortening.
|
|
144
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
145
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
146
|
+
# will use in production. If links from other domains are sent through this
|
|
147
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
149
148
|
sig { returns(T.nilable(String)) }
|
|
150
149
|
attr_reader :link_sample
|
|
151
150
|
|
|
@@ -247,11 +246,10 @@ module SurgeAPI
|
|
|
247
246
|
# - `direct_lending` - whether the campaign contains content related to direct
|
|
248
247
|
# lending or other loan arrangements
|
|
249
248
|
includes: nil,
|
|
250
|
-
# A sample link that might be sent by this campaign.
|
|
251
|
-
#
|
|
252
|
-
#
|
|
253
|
-
#
|
|
254
|
-
# to disable automatic link shortening.
|
|
249
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
250
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
251
|
+
# will use in production. If links from other domains are sent through this
|
|
252
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
255
253
|
link_sample: nil
|
|
256
254
|
)
|
|
257
255
|
end
|
|
@@ -42,6 +42,13 @@ module SurgeAPI
|
|
|
42
42
|
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
43
43
|
attr_writer :metadata
|
|
44
44
|
|
|
45
|
+
# Whether outbound messaging has been manually disabled for the contact.
|
|
46
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
47
|
+
attr_reader :outbound_disabled
|
|
48
|
+
|
|
49
|
+
sig { params(outbound_disabled: T::Boolean).void }
|
|
50
|
+
attr_writer :outbound_disabled
|
|
51
|
+
|
|
45
52
|
# A contact who has consented to receive messages
|
|
46
53
|
sig do
|
|
47
54
|
params(
|
|
@@ -50,7 +57,8 @@ module SurgeAPI
|
|
|
50
57
|
email: String,
|
|
51
58
|
first_name: String,
|
|
52
59
|
last_name: String,
|
|
53
|
-
metadata: T::Hash[Symbol, String]
|
|
60
|
+
metadata: T::Hash[Symbol, String],
|
|
61
|
+
outbound_disabled: T::Boolean
|
|
54
62
|
).returns(T.attached_class)
|
|
55
63
|
end
|
|
56
64
|
def self.new(
|
|
@@ -65,7 +73,9 @@ module SurgeAPI
|
|
|
65
73
|
# The contact's last name.
|
|
66
74
|
last_name: nil,
|
|
67
75
|
# Set of key-value pairs that will be stored with the object.
|
|
68
|
-
metadata: nil
|
|
76
|
+
metadata: nil,
|
|
77
|
+
# Whether outbound messaging has been manually disabled for the contact.
|
|
78
|
+
outbound_disabled: nil
|
|
69
79
|
)
|
|
70
80
|
end
|
|
71
81
|
|
|
@@ -77,7 +87,8 @@ module SurgeAPI
|
|
|
77
87
|
email: String,
|
|
78
88
|
first_name: String,
|
|
79
89
|
last_name: String,
|
|
80
|
-
metadata: T::Hash[Symbol, String]
|
|
90
|
+
metadata: T::Hash[Symbol, String],
|
|
91
|
+
outbound_disabled: T::Boolean
|
|
81
92
|
}
|
|
82
93
|
)
|
|
83
94
|
end
|
|
@@ -47,6 +47,13 @@ module SurgeAPI
|
|
|
47
47
|
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
48
48
|
attr_writer :metadata
|
|
49
49
|
|
|
50
|
+
# Whether outbound messaging should be manually disabled for the contact.
|
|
51
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
52
|
+
attr_reader :outbound_disabled
|
|
53
|
+
|
|
54
|
+
sig { params(outbound_disabled: T::Boolean).void }
|
|
55
|
+
attr_writer :outbound_disabled
|
|
56
|
+
|
|
50
57
|
sig do
|
|
51
58
|
params(
|
|
52
59
|
account_id: String,
|
|
@@ -55,6 +62,7 @@ module SurgeAPI
|
|
|
55
62
|
first_name: String,
|
|
56
63
|
last_name: String,
|
|
57
64
|
metadata: T::Hash[Symbol, String],
|
|
65
|
+
outbound_disabled: T::Boolean,
|
|
58
66
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
59
67
|
).returns(T.attached_class)
|
|
60
68
|
end
|
|
@@ -71,6 +79,8 @@ module SurgeAPI
|
|
|
71
79
|
last_name: nil,
|
|
72
80
|
# Set of key-value pairs that will be stored with the object.
|
|
73
81
|
metadata: nil,
|
|
82
|
+
# Whether outbound messaging should be manually disabled for the contact.
|
|
83
|
+
outbound_disabled: nil,
|
|
74
84
|
request_options: {}
|
|
75
85
|
)
|
|
76
86
|
end
|
|
@@ -84,6 +94,7 @@ module SurgeAPI
|
|
|
84
94
|
first_name: String,
|
|
85
95
|
last_name: String,
|
|
86
96
|
metadata: T::Hash[Symbol, String],
|
|
97
|
+
outbound_disabled: T::Boolean,
|
|
87
98
|
request_options: SurgeAPI::RequestOptions
|
|
88
99
|
}
|
|
89
100
|
)
|
|
@@ -47,6 +47,13 @@ module SurgeAPI
|
|
|
47
47
|
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
48
48
|
attr_writer :metadata
|
|
49
49
|
|
|
50
|
+
# Whether outbound messaging should be manually disabled for the contact.
|
|
51
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
52
|
+
attr_reader :outbound_disabled
|
|
53
|
+
|
|
54
|
+
sig { params(outbound_disabled: T::Boolean).void }
|
|
55
|
+
attr_writer :outbound_disabled
|
|
56
|
+
|
|
50
57
|
sig do
|
|
51
58
|
params(
|
|
52
59
|
id: String,
|
|
@@ -55,6 +62,7 @@ module SurgeAPI
|
|
|
55
62
|
first_name: String,
|
|
56
63
|
last_name: String,
|
|
57
64
|
metadata: T::Hash[Symbol, String],
|
|
65
|
+
outbound_disabled: T::Boolean,
|
|
58
66
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
59
67
|
).returns(T.attached_class)
|
|
60
68
|
end
|
|
@@ -71,6 +79,8 @@ module SurgeAPI
|
|
|
71
79
|
last_name: nil,
|
|
72
80
|
# Set of key-value pairs that will be stored with the object.
|
|
73
81
|
metadata: nil,
|
|
82
|
+
# Whether outbound messaging should be manually disabled for the contact.
|
|
83
|
+
outbound_disabled: nil,
|
|
74
84
|
request_options: {}
|
|
75
85
|
)
|
|
76
86
|
end
|
|
@@ -84,6 +94,7 @@ module SurgeAPI
|
|
|
84
94
|
first_name: String,
|
|
85
95
|
last_name: String,
|
|
86
96
|
metadata: T::Hash[Symbol, String],
|
|
97
|
+
outbound_disabled: T::Boolean,
|
|
87
98
|
request_options: SurgeAPI::RequestOptions
|
|
88
99
|
}
|
|
89
100
|
)
|
|
@@ -46,6 +46,13 @@ module SurgeAPI
|
|
|
46
46
|
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
47
47
|
attr_writer :metadata
|
|
48
48
|
|
|
49
|
+
# The current status of the message.
|
|
50
|
+
sig { returns(T.nilable(SurgeAPI::Message::Status::TaggedSymbol)) }
|
|
51
|
+
attr_reader :status
|
|
52
|
+
|
|
53
|
+
sig { params(status: SurgeAPI::Message::Status::OrSymbol).void }
|
|
54
|
+
attr_writer :status
|
|
55
|
+
|
|
49
56
|
# A Message is a communication sent to a Contact.
|
|
50
57
|
sig do
|
|
51
58
|
params(
|
|
@@ -54,7 +61,8 @@ module SurgeAPI
|
|
|
54
61
|
blast_id: T.nilable(String),
|
|
55
62
|
body: T.nilable(String),
|
|
56
63
|
conversation: SurgeAPI::Message::Conversation::OrHash,
|
|
57
|
-
metadata: T::Hash[Symbol, String]
|
|
64
|
+
metadata: T::Hash[Symbol, String],
|
|
65
|
+
status: SurgeAPI::Message::Status::OrSymbol
|
|
58
66
|
).returns(T.attached_class)
|
|
59
67
|
end
|
|
60
68
|
def self.new(
|
|
@@ -69,7 +77,9 @@ module SurgeAPI
|
|
|
69
77
|
# A conversation with a Contact
|
|
70
78
|
conversation: nil,
|
|
71
79
|
# Set of key-value pairs that will be stored with the object.
|
|
72
|
-
metadata: nil
|
|
80
|
+
metadata: nil,
|
|
81
|
+
# The current status of the message.
|
|
82
|
+
status: nil
|
|
73
83
|
)
|
|
74
84
|
end
|
|
75
85
|
|
|
@@ -81,7 +91,8 @@ module SurgeAPI
|
|
|
81
91
|
blast_id: T.nilable(String),
|
|
82
92
|
body: T.nilable(String),
|
|
83
93
|
conversation: SurgeAPI::Message::Conversation,
|
|
84
|
-
metadata: T::Hash[Symbol, String]
|
|
94
|
+
metadata: T::Hash[Symbol, String],
|
|
95
|
+
status: SurgeAPI::Message::Status::TaggedSymbol
|
|
85
96
|
}
|
|
86
97
|
)
|
|
87
98
|
end
|
|
@@ -342,6 +353,26 @@ module SurgeAPI
|
|
|
342
353
|
end
|
|
343
354
|
end
|
|
344
355
|
end
|
|
356
|
+
|
|
357
|
+
# The current status of the message.
|
|
358
|
+
module Status
|
|
359
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
360
|
+
|
|
361
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, SurgeAPI::Message::Status) }
|
|
362
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
363
|
+
|
|
364
|
+
PENDING = T.let(:pending, SurgeAPI::Message::Status::TaggedSymbol)
|
|
365
|
+
RECEIVED = T.let(:received, SurgeAPI::Message::Status::TaggedSymbol)
|
|
366
|
+
SENT = T.let(:sent, SurgeAPI::Message::Status::TaggedSymbol)
|
|
367
|
+
DELIVERED = T.let(:delivered, SurgeAPI::Message::Status::TaggedSymbol)
|
|
368
|
+
FAILED = T.let(:failed, SurgeAPI::Message::Status::TaggedSymbol)
|
|
369
|
+
|
|
370
|
+
sig do
|
|
371
|
+
override.returns(T::Array[SurgeAPI::Message::Status::TaggedSymbol])
|
|
372
|
+
end
|
|
373
|
+
def self.values
|
|
374
|
+
end
|
|
375
|
+
end
|
|
345
376
|
end
|
|
346
377
|
end
|
|
347
378
|
end
|