surge_api 0.11.0 → 0.13.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +1 -1
  4. data/lib/surge_api/internal/util.rb +31 -0
  5. data/lib/surge_api/models/blast_create_params.rb +4 -4
  6. data/lib/surge_api/models/campaign.rb +0 -1
  7. data/lib/surge_api/models/phone_number.rb +9 -1
  8. data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +96 -0
  9. data/lib/surge_api/models/recording_list_params.rb +34 -0
  10. data/lib/surge_api/models/recording_list_response.rb +101 -0
  11. data/lib/surge_api/models/recording_retrieve_params.rb +14 -0
  12. data/lib/surge_api/models/recording_retrieve_response.rb +101 -0
  13. data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
  14. data/lib/surge_api/models/user_list_params.rb +34 -0
  15. data/lib/surge_api/models.rb +8 -0
  16. data/lib/surge_api/resources/accounts.rb +2 -1
  17. data/lib/surge_api/resources/blasts.rb +1 -1
  18. data/lib/surge_api/resources/campaigns.rb +2 -1
  19. data/lib/surge_api/resources/contacts.rb +2 -1
  20. data/lib/surge_api/resources/messages.rb +2 -1
  21. data/lib/surge_api/resources/phone_numbers.rb +2 -1
  22. data/lib/surge_api/resources/recordings.rb +51 -0
  23. data/lib/surge_api/resources/users.rb +31 -0
  24. data/lib/surge_api/resources/webhooks.rb +1 -1
  25. data/lib/surge_api/version.rb +1 -1
  26. data/lib/surge_api.rb +6 -0
  27. data/rbi/surge_api/internal/util.rbi +20 -0
  28. data/rbi/surge_api/models/blast_create_params.rbi +4 -4
  29. data/rbi/surge_api/models/campaign.rbi +0 -1
  30. data/rbi/surge_api/models/phone_number.rbi +8 -0
  31. data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +181 -0
  32. data/rbi/surge_api/models/recording_list_params.rbi +59 -0
  33. data/rbi/surge_api/models/recording_list_response.rbi +209 -0
  34. data/rbi/surge_api/models/recording_retrieve_params.rbi +27 -0
  35. data/rbi/surge_api/models/recording_retrieve_response.rbi +211 -0
  36. data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
  37. data/rbi/surge_api/models/user_list_params.rbi +59 -0
  38. data/rbi/surge_api/models.rbi +9 -0
  39. data/rbi/surge_api/resources/blasts.rbi +2 -2
  40. data/rbi/surge_api/resources/recordings.rbi +37 -0
  41. data/rbi/surge_api/resources/users.rbi +21 -0
  42. data/rbi/surge_api/resources/webhooks.rbi +1 -0
  43. data/sig/surge_api/internal/util.rbs +10 -0
  44. data/sig/surge_api/models/campaign.rbs +1 -8
  45. data/sig/surge_api/models/phone_number.rbs +10 -1
  46. data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +79 -0
  47. data/sig/surge_api/models/recording_list_params.rbs +32 -0
  48. data/sig/surge_api/models/recording_list_response.rbs +94 -0
  49. data/sig/surge_api/models/recording_retrieve_params.rbs +15 -0
  50. data/sig/surge_api/models/recording_retrieve_response.rbs +94 -0
  51. data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
  52. data/sig/surge_api/models/user_list_params.rbs +32 -0
  53. data/sig/surge_api/models.rbs +8 -0
  54. data/sig/surge_api/resources/recordings.rbs +12 -0
  55. data/sig/surge_api/resources/users.rbs +7 -0
  56. data/sig/surge_api/resources/webhooks.rbs +1 -0
  57. metadata +20 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21d19ad8088d287a26c0293ecbec97d29a879616d98b219dbcb8c672c699f58d
4
- data.tar.gz: eb81ac34997ec986242cdd64006a69d31f7bb76555a8a711644fcc06210c1293
3
+ metadata.gz: c36ef735ac45405fb4d5f91cfdd8c6993370f5e130a02aecf8421e4e1158c1e9
4
+ data.tar.gz: 3af2cc39257fa57acb0a2b42ae74ad17f1159b5e07c73478b98a759e4a02c070
5
5
  SHA512:
6
- metadata.gz: af5bc8ed33052eb78f9a1bcb9e165e594f2b684891c6a159315903847da918c38ce1a4b8cb60bdb10b5cc4d144eb1a7398f816c90606268189408f9da6de25d0
7
- data.tar.gz: 17951922f214b0a5d290fd520658d9964ae51972e5761199272d3193a91bfa3f2b52cc1fa749f4235174d42733472d732b2c20a4dd6767509b5b89b06e86d82b
6
+ metadata.gz: e87b415e0cdb6e142d8e5f438767c715f0ff455a94ca80e6eaf88631f0aefbd91c60eb87e56c18758d6b0bcdd07170d46bae507eb8d4fb71c6118a7f84677973
7
+ data.tar.gz: 46a8c93de7a473bd99a31ad51cd736312afafdb1a28c2319bdab231c2a96bcd17a748eb484a347d51249ad6f938aaf080720c37ca2fef7af755dc5ecece64ead
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0 (2026-03-24)
4
+
5
+ Full Changelog: [v0.12.0...v0.13.0](https://github.com/surgeapi/ruby-sdk/compare/v0.12.0...v0.13.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** get and list recordings endpoints ([5c70f53](https://github.com/surgeapi/ruby-sdk/commit/5c70f532acc1a8eea9a2122e8f126f46b4e57d0a))
10
+ * **api:** list users endpoint ([660a12d](https://github.com/surgeapi/ruby-sdk/commit/660a12d464f024ad86cd4c9fd4af250937ac8205))
11
+
12
+ ## 0.12.0 (2026-03-11)
13
+
14
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/surgeapi/ruby-sdk/compare/v0.11.0...v0.12.0)
15
+
16
+ ### Features
17
+
18
+ * **api:** add campaign ID to phone numbers ([76e02a6](https://github.com/surgeapi/ruby-sdk/commit/76e02a67b248539548b0bc918178dcb9749ef2aa))
19
+ * **api:** add phoneNumberAttachedToCampaign webhook ([b145691](https://github.com/surgeapi/ruby-sdk/commit/b14569150ea04fd2d74f9f17ff0ab3bbf00d9c19))
20
+ * **api:** remove 'pending' campaign status ([067f38a](https://github.com/surgeapi/ruby-sdk/commit/067f38adf747327111ad032362f5e9faf31dddce))
21
+ * **api:** rename segments to audiences ([69c982c](https://github.com/surgeapi/ruby-sdk/commit/69c982c90af4999babdff64a46ffe5df1d54391a))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * properly mock time in ruby ci tests ([6c75ef3](https://github.com/surgeapi/ruby-sdk/commit/6c75ef31490dc13fb591146b2b27a8a3c8f3495c))
27
+
28
+
29
+ ### Chores
30
+
31
+ * **ci:** add build step ([4999f0c](https://github.com/surgeapi/ruby-sdk/commit/4999f0c610b73f42d468fc200aeafe002f4947b0))
32
+ * **internal:** codegen related update ([bd1d5f0](https://github.com/surgeapi/ruby-sdk/commit/bd1d5f019b6ec12acdca6e36af2c46065dab0e70))
33
+
3
34
  ## 0.11.0 (2026-02-22)
4
35
 
5
36
  Full Changelog: [v0.10.0...v0.11.0](https://github.com/surgeapi/ruby-sdk/compare/v0.10.0...v0.11.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.11.0"
20
+ gem "surge_api", "~> 0.13.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -490,6 +490,37 @@ module SurgeAPI
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
492
492
  class << self
493
+ # @api private
494
+ #
495
+ # @param query [Hash{Symbol=>Object}]
496
+ #
497
+ # @return [Hash{Symbol=>Object}]
498
+ def encode_query_params(query)
499
+ out = {}
500
+ query.each { write_query_param_element!(out, _1, _2) }
501
+ out
502
+ end
503
+
504
+ # @api private
505
+ #
506
+ # @param collection [Hash{Symbol=>Object}]
507
+ # @param key [String]
508
+ # @param element [Object]
509
+ #
510
+ # @return [nil]
511
+ private def write_query_param_element!(collection, key, element)
512
+ case element
513
+ in Hash
514
+ element.each do |name, value|
515
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
516
+ end
517
+ in Array
518
+ collection[key] = element.map(&:to_s).join(",")
519
+ else
520
+ collection[key] = element.to_s
521
+ end
522
+ end
523
+
493
524
  # @api private
494
525
  #
495
526
  # @param y [Enumerator::Yielder]
@@ -41,9 +41,9 @@ module SurgeAPI
41
41
  optional :name, String
42
42
 
43
43
  # @!attribute segments
44
- # @deprecated Use `to` to specify recipients instead.
44
+ # @deprecated Use `to` with audience IDs (`aud_...`) to specify audience recipients instead.
45
45
  #
46
- # Deprecated. Use `to` instead.
46
+ # Deprecated. Use `to` with audience IDs instead.
47
47
  #
48
48
  # @return [Array<String>, nil]
49
49
  optional :segments, SurgeAPI::Internal::Type::ArrayOf[String]
@@ -56,7 +56,7 @@ module SurgeAPI
56
56
 
57
57
  # @!attribute to
58
58
  # List of recipients to whom the blast should be sent. This can be a combination
59
- # of contact IDs, segment IDs, and phone numbers.
59
+ # of contact IDs, audience IDs, and phone numbers.
60
60
  #
61
61
  # @return [Array<String>, nil]
62
62
  optional :to, SurgeAPI::Internal::Type::ArrayOf[String]
@@ -75,7 +75,7 @@ module SurgeAPI
75
75
  #
76
76
  # @param name [String] Optional name for the blast.
77
77
  #
78
- # @param segments [Array<String>] Deprecated. Use `to` instead.
78
+ # @param segments [Array<String>] Deprecated. Use `to` with audience IDs instead.
79
79
  #
80
80
  # @param send_at [Time] When to send the blast. If not provided, sends immediately.
81
81
  #
@@ -183,7 +183,6 @@ module SurgeAPI
183
183
  CREATED = :created
184
184
  DEACTIVATED = :deactivated
185
185
  IN_REVIEW = :in_review
186
- PENDING = :pending
187
186
  REJECTED = :rejected
188
187
 
189
188
  # @!method self.values
@@ -10,6 +10,12 @@ module SurgeAPI
10
10
  # @return [String]
11
11
  required :id, String
12
12
 
13
+ # @!attribute campaign_id
14
+ # The unique identifier of the campaign this phone number is attached to, if any
15
+ #
16
+ # @return [String, nil]
17
+ required :campaign_id, String, nil?: true
18
+
13
19
  # @!attribute number
14
20
  # The phone number in E.164 format
15
21
  #
@@ -22,11 +28,13 @@ module SurgeAPI
22
28
  # @return [Symbol, SurgeAPI::Models::PhoneNumber::Type]
23
29
  required :type, enum: -> { SurgeAPI::PhoneNumber::Type }
24
30
 
25
- # @!method initialize(id:, number:, type:)
31
+ # @!method initialize(id:, campaign_id:, number:, type:)
26
32
  # A phone number that can be used to send and receive messages and calls
27
33
  #
28
34
  # @param id [String] Unique identifier for the phone number
29
35
  #
36
+ # @param campaign_id [String, nil] The unique identifier of the campaign this phone number is attached to, if any
37
+ #
30
38
  # @param number [String] The phone number in E.164 format
31
39
  #
32
40
  # @param type [Symbol, SurgeAPI::Models::PhoneNumber::Type] Whether the phone number is local, toll-free, or short code
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class PhoneNumberAttachedToCampaignWebhookEvent < 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::PhoneNumberAttachedToCampaignWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::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.attached_to_campaign` for this
26
+ # event.
27
+ #
28
+ # @return [Symbol, :"phone_number.attached_to_campaign"]
29
+ required :type, const: :"phone_number.attached_to_campaign"
30
+
31
+ # @!method initialize(account_id:, data:, timestamp:, type: :"phone_number.attached_to_campaign")
32
+ # Some parameter documentations has been truncated, see
33
+ # {SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent} for more details.
34
+ #
35
+ # @param account_id [String] The ID of the account in which this event occurred
36
+ #
37
+ # @param data [SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data] The data associated with the event
38
+ #
39
+ # @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
40
+ #
41
+ # @param type [Symbol, :"phone_number.attached_to_campaign"] The type of the event. Always `phone_number.attached_to_campaign` for this event
42
+
43
+ # @see SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent#data
44
+ class Data < SurgeAPI::Internal::Type::BaseModel
45
+ # @!attribute id
46
+ # The unique identifier for the phone number
47
+ #
48
+ # @return [String]
49
+ required :id, String
50
+
51
+ # @!attribute campaign_id
52
+ # The unique identifier of the campaign this phone number is attached to
53
+ #
54
+ # @return [String]
55
+ required :campaign_id, String
56
+
57
+ # @!attribute number
58
+ # The phone number in E.164 format
59
+ #
60
+ # @return [String]
61
+ required :number, String
62
+
63
+ # @!attribute type
64
+ # Whether the phone number is local, toll-free, or short code
65
+ #
66
+ # @return [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type]
67
+ required :type, enum: -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type }
68
+
69
+ # @!method initialize(id:, campaign_id:, number:, type:)
70
+ # The data associated with the event
71
+ #
72
+ # @param id [String] The unique identifier for the phone number
73
+ #
74
+ # @param campaign_id [String] The unique identifier of the campaign this phone number is attached to
75
+ #
76
+ # @param number [String] The phone number in E.164 format
77
+ #
78
+ # @param type [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type] Whether the phone number is local, toll-free, or short code
79
+
80
+ # Whether the phone number is local, toll-free, or short code
81
+ #
82
+ # @see SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data#type
83
+ module Type
84
+ extend SurgeAPI::Internal::Type::Enum
85
+
86
+ LOCAL = :local
87
+ SHORT_CODE = :short_code
88
+ TOLL_FREE = :toll_free
89
+
90
+ # @!method self.values
91
+ # @return [Array<Symbol>]
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Recordings#list
6
+ class RecordingListParams < 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::RecordingListParams} 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
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Recordings#list
6
+ class RecordingListResponse < SurgeAPI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The unique identifier for the recording
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute call
14
+ # The call that produced this recording
15
+ #
16
+ # @return [SurgeAPI::Models::RecordingListResponse::Call]
17
+ required :call, -> { SurgeAPI::Models::RecordingListResponse::Call }
18
+
19
+ # @!attribute duration
20
+ # The duration of the recording in seconds
21
+ #
22
+ # @return [Integer]
23
+ required :duration, Integer
24
+
25
+ # @!method initialize(id:, call:, duration:)
26
+ # A call recording
27
+ #
28
+ # @param id [String] The unique identifier for the recording
29
+ #
30
+ # @param call [SurgeAPI::Models::RecordingListResponse::Call] The call that produced this recording
31
+ #
32
+ # @param duration [Integer] The duration of the recording in seconds
33
+
34
+ # @see SurgeAPI::Models::RecordingListResponse#call
35
+ class Call < SurgeAPI::Internal::Type::BaseModel
36
+ # @!attribute id
37
+ # The unique identifier for the call
38
+ #
39
+ # @return [String]
40
+ required :id, String
41
+
42
+ # @!attribute contact
43
+ # A contact who has consented to receive messages
44
+ #
45
+ # @return [SurgeAPI::Models::Contact]
46
+ required :contact, -> { SurgeAPI::Contact }
47
+
48
+ # @!attribute duration
49
+ # The duration of the call in seconds
50
+ #
51
+ # @return [Integer]
52
+ required :duration, Integer
53
+
54
+ # @!attribute initiated_at
55
+ # When the call was initiated
56
+ #
57
+ # @return [Time]
58
+ required :initiated_at, Time
59
+
60
+ # @!attribute status
61
+ # The status of the call
62
+ #
63
+ # @return [Symbol, SurgeAPI::Models::RecordingListResponse::Call::Status]
64
+ required :status, enum: -> { SurgeAPI::Models::RecordingListResponse::Call::Status }
65
+
66
+ # @!method initialize(id:, contact:, duration:, initiated_at:, status:)
67
+ # The call that produced this recording
68
+ #
69
+ # @param id [String] The unique identifier for the call
70
+ #
71
+ # @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
72
+ #
73
+ # @param duration [Integer] The duration of the call in seconds
74
+ #
75
+ # @param initiated_at [Time] When the call was initiated
76
+ #
77
+ # @param status [Symbol, SurgeAPI::Models::RecordingListResponse::Call::Status] The status of the call
78
+
79
+ # The status of the call
80
+ #
81
+ # @see SurgeAPI::Models::RecordingListResponse::Call#status
82
+ module Status
83
+ extend SurgeAPI::Internal::Type::Enum
84
+
85
+ BUSY = :busy
86
+ CANCELED = :canceled
87
+ COMPLETED = :completed
88
+ FAILED = :failed
89
+ IN_PROGRESS = :in_progress
90
+ MISSED = :missed
91
+ NO_ANSWER = :no_answer
92
+ QUEUED = :queued
93
+ RINGING = :ringing
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Recordings#retrieve
6
+ class RecordingRetrieveParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Recordings#retrieve
6
+ class RecordingRetrieveResponse < SurgeAPI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The unique identifier for the recording
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute call
14
+ # The call that produced this recording
15
+ #
16
+ # @return [SurgeAPI::Models::RecordingRetrieveResponse::Call]
17
+ required :call, -> { SurgeAPI::Models::RecordingRetrieveResponse::Call }
18
+
19
+ # @!attribute duration
20
+ # The duration of the recording in seconds
21
+ #
22
+ # @return [Integer]
23
+ required :duration, Integer
24
+
25
+ # @!method initialize(id:, call:, duration:)
26
+ # A call recording
27
+ #
28
+ # @param id [String] The unique identifier for the recording
29
+ #
30
+ # @param call [SurgeAPI::Models::RecordingRetrieveResponse::Call] The call that produced this recording
31
+ #
32
+ # @param duration [Integer] The duration of the recording in seconds
33
+
34
+ # @see SurgeAPI::Models::RecordingRetrieveResponse#call
35
+ class Call < SurgeAPI::Internal::Type::BaseModel
36
+ # @!attribute id
37
+ # The unique identifier for the call
38
+ #
39
+ # @return [String]
40
+ required :id, String
41
+
42
+ # @!attribute contact
43
+ # A contact who has consented to receive messages
44
+ #
45
+ # @return [SurgeAPI::Models::Contact]
46
+ required :contact, -> { SurgeAPI::Contact }
47
+
48
+ # @!attribute duration
49
+ # The duration of the call in seconds
50
+ #
51
+ # @return [Integer]
52
+ required :duration, Integer
53
+
54
+ # @!attribute initiated_at
55
+ # When the call was initiated
56
+ #
57
+ # @return [Time]
58
+ required :initiated_at, Time
59
+
60
+ # @!attribute status
61
+ # The status of the call
62
+ #
63
+ # @return [Symbol, SurgeAPI::Models::RecordingRetrieveResponse::Call::Status]
64
+ required :status, enum: -> { SurgeAPI::Models::RecordingRetrieveResponse::Call::Status }
65
+
66
+ # @!method initialize(id:, contact:, duration:, initiated_at:, status:)
67
+ # The call that produced this recording
68
+ #
69
+ # @param id [String] The unique identifier for the call
70
+ #
71
+ # @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
72
+ #
73
+ # @param duration [Integer] The duration of the call in seconds
74
+ #
75
+ # @param initiated_at [Time] When the call was initiated
76
+ #
77
+ # @param status [Symbol, SurgeAPI::Models::RecordingRetrieveResponse::Call::Status] The status of the call
78
+
79
+ # The status of the call
80
+ #
81
+ # @see SurgeAPI::Models::RecordingRetrieveResponse::Call#status
82
+ module Status
83
+ extend SurgeAPI::Internal::Type::Enum
84
+
85
+ BUSY = :busy
86
+ CANCELED = :canceled
87
+ COMPLETED = :completed
88
+ FAILED = :failed
89
+ IN_PROGRESS = :in_progress
90
+ MISSED = :missed
91
+ NO_ANSWER = :no_answer
92
+ QUEUED = :queued
93
+ RINGING = :ringing
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -27,12 +27,14 @@ module SurgeAPI
27
27
 
28
28
  variant :"message.sent", -> { SurgeAPI::MessageSentWebhookEvent }
29
29
 
30
+ variant :"phone_number.attached_to_campaign", -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent }
31
+
30
32
  variant :"recording.completed", -> { SurgeAPI::RecordingCompletedWebhookEvent }
31
33
 
32
34
  variant :"voicemail.received", -> { SurgeAPI::VoicemailReceivedWebhookEvent }
33
35
 
34
36
  # @!method self.variants
35
- # @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::RecordingCompletedWebhookEvent, SurgeAPI::Models::VoicemailReceivedWebhookEvent)]
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)]
36
38
  end
37
39
  end
38
40
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Users#list
6
+ class UserListParams < 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::UserListParams} 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
@@ -111,6 +111,8 @@ module SurgeAPI
111
111
 
112
112
  PhoneNumber = SurgeAPI::Models::PhoneNumber
113
113
 
114
+ PhoneNumberAttachedToCampaignWebhookEvent = SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent
115
+
114
116
  PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
115
117
 
116
118
  PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
@@ -121,6 +123,10 @@ module SurgeAPI
121
123
 
122
124
  RecordingGetFileParams = SurgeAPI::Models::RecordingGetFileParams
123
125
 
126
+ RecordingListParams = SurgeAPI::Models::RecordingListParams
127
+
128
+ RecordingRetrieveParams = SurgeAPI::Models::RecordingRetrieveParams
129
+
124
130
  UnwrapWebhookEvent = SurgeAPI::Models::UnwrapWebhookEvent
125
131
 
126
132
  User = SurgeAPI::Models::User
@@ -131,6 +137,8 @@ module SurgeAPI
131
137
 
132
138
  UserDeleteParams = SurgeAPI::Models::UserDeleteParams
133
139
 
140
+ UserListParams = SurgeAPI::Models::UserListParams
141
+
134
142
  UserRetrieveParams = SurgeAPI::Models::UserRetrieveParams
135
143
 
136
144
  UserTokenResponse = SurgeAPI::Models::UserTokenResponse
@@ -111,10 +111,11 @@ module SurgeAPI
111
111
  # @see SurgeAPI::Models::AccountRetrieveStatusParams
112
112
  def retrieve_status(account_id, params = {})
113
113
  parsed, options = SurgeAPI::AccountRetrieveStatusParams.dump_request(params)
114
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
114
115
  @client.request(
115
116
  method: :get,
116
117
  path: ["accounts/%1$s/status", account_id],
117
- query: parsed,
118
+ query: query,
118
119
  model: SurgeAPI::AccountStatus,
119
120
  options: options
120
121
  )
@@ -22,7 +22,7 @@ module SurgeAPI
22
22
  #
23
23
  # @param name [String] Optional name for the blast.
24
24
  #
25
- # @param segments [Array<String>] Deprecated. Use `to` instead.
25
+ # @param segments [Array<String>] Deprecated. Use `to` with audience IDs instead.
26
26
  #
27
27
  # @param send_at [Time] When to send the blast. If not provided, sends immediately.
28
28
  #
@@ -75,10 +75,11 @@ module SurgeAPI
75
75
  # @see SurgeAPI::Models::CampaignListParams
76
76
  def list(account_id, params = {})
77
77
  parsed, options = SurgeAPI::CampaignListParams.dump_request(params)
78
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
78
79
  @client.request(
79
80
  method: :get,
80
81
  path: ["accounts/%1$s/campaigns", account_id],
81
- query: parsed,
82
+ query: query,
82
83
  page: SurgeAPI::Internal::Cursor,
83
84
  model: SurgeAPI::Campaign,
84
85
  options: options
@@ -108,10 +108,11 @@ module SurgeAPI
108
108
  # @see SurgeAPI::Models::ContactListParams
109
109
  def list(account_id, params = {})
110
110
  parsed, options = SurgeAPI::ContactListParams.dump_request(params)
111
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
111
112
  @client.request(
112
113
  method: :get,
113
114
  path: ["accounts/%1$s/contacts", account_id],
114
- query: parsed,
115
+ query: query,
115
116
  page: SurgeAPI::Internal::Cursor,
116
117
  model: SurgeAPI::Contact,
117
118
  options: options
@@ -99,10 +99,11 @@ module SurgeAPI
99
99
  # @see SurgeAPI::Models::MessageListParams
100
100
  def list(account_id, params = {})
101
101
  parsed, options = SurgeAPI::MessageListParams.dump_request(params)
102
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
102
103
  @client.request(
103
104
  method: :get,
104
105
  path: ["accounts/%1$s/messages", account_id],
105
- query: parsed,
106
+ query: query,
106
107
  page: SurgeAPI::Internal::Cursor,
107
108
  model: SurgeAPI::Message,
108
109
  options: options