surge_api 0.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8012d35d6b7aaae2d18541e688d7605e1ee985153b70ebec72790ddb0ba3b28b
4
- data.tar.gz: 7051be5e16f4e06b7eafac3c3b8b7554fc06710c5b6a0104e8f4dabe6ba8f448
3
+ metadata.gz: c36ef735ac45405fb4d5f91cfdd8c6993370f5e130a02aecf8421e4e1158c1e9
4
+ data.tar.gz: 3af2cc39257fa57acb0a2b42ae74ad17f1159b5e07c73478b98a759e4a02c070
5
5
  SHA512:
6
- metadata.gz: 50cb8dd9f5162634bb262e93eda01ed24d9af0d8c0c45171d4642969e7824292cea2465ef00d199a85e62e0ad7a38288ed082c44f7a529210c13802e0cfbcf77
7
- data.tar.gz: 4b0d24f6c73cfb6b038ac5c9663cbf2c83917770eff0f3d0d36fe9006cfc2adf80892f9c65b693380f3f9e671362af3e2ef93a1cb5743dc3d39e935d57ed12ed
6
+ metadata.gz: e87b415e0cdb6e142d8e5f438767c715f0ff455a94ca80e6eaf88631f0aefbd91c60eb87e56c18758d6b0bcdd07170d46bae507eb8d4fb71c6118a7f84677973
7
+ data.tar.gz: 46a8c93de7a473bd99a31ad51cd736312afafdb1a28c2319bdab231c2a96bcd17a748eb484a347d51249ad6f938aaf080720c37ca2fef7af755dc5ecece64ead
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## 0.12.0 (2026-03-11)
4
13
 
5
14
  Full Changelog: [v0.11.0...v0.12.0](https://github.com/surgeapi/ruby-sdk/compare/v0.11.0...v0.12.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.12.0"
20
+ gem "surge_api", "~> 0.13.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-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
@@ -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
@@ -123,6 +123,10 @@ module SurgeAPI
123
123
 
124
124
  RecordingGetFileParams = SurgeAPI::Models::RecordingGetFileParams
125
125
 
126
+ RecordingListParams = SurgeAPI::Models::RecordingListParams
127
+
128
+ RecordingRetrieveParams = SurgeAPI::Models::RecordingRetrieveParams
129
+
126
130
  UnwrapWebhookEvent = SurgeAPI::Models::UnwrapWebhookEvent
127
131
 
128
132
  User = SurgeAPI::Models::User
@@ -133,6 +137,8 @@ module SurgeAPI
133
137
 
134
138
  UserDeleteParams = SurgeAPI::Models::UserDeleteParams
135
139
 
140
+ UserListParams = SurgeAPI::Models::UserListParams
141
+
136
142
  UserRetrieveParams = SurgeAPI::Models::UserRetrieveParams
137
143
 
138
144
  UserTokenResponse = SurgeAPI::Models::UserTokenResponse
@@ -3,6 +3,57 @@
3
3
  module SurgeAPI
4
4
  module Resources
5
5
  class Recordings
6
+ # Retrieves a Recording object.
7
+ #
8
+ # @overload retrieve(id, request_options: {})
9
+ #
10
+ # @param id [String] The ID of the recording to retrieve.
11
+ #
12
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
13
+ #
14
+ # @return [SurgeAPI::Models::RecordingRetrieveResponse]
15
+ #
16
+ # @see SurgeAPI::Models::RecordingRetrieveParams
17
+ def retrieve(id, params = {})
18
+ @client.request(
19
+ method: :get,
20
+ path: ["recordings/%1$s", id],
21
+ model: SurgeAPI::Models::RecordingRetrieveResponse,
22
+ options: params[:request_options]
23
+ )
24
+ end
25
+
26
+ # Some parameter documentations has been truncated, see
27
+ # {SurgeAPI::Models::RecordingListParams} for more details.
28
+ #
29
+ # List all recordings for an account with cursor-based pagination.
30
+ #
31
+ # @overload list(account_id, after: nil, before: nil, request_options: {})
32
+ #
33
+ # @param account_id [String] The account ID to list recordings for.
34
+ #
35
+ # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
36
+ #
37
+ # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
38
+ #
39
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
40
+ #
41
+ # @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::RecordingListResponse>]
42
+ #
43
+ # @see SurgeAPI::Models::RecordingListParams
44
+ def list(account_id, params = {})
45
+ parsed, options = SurgeAPI::RecordingListParams.dump_request(params)
46
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
47
+ @client.request(
48
+ method: :get,
49
+ path: ["accounts/%1$s/recordings", account_id],
50
+ query: query,
51
+ page: SurgeAPI::Internal::Cursor,
52
+ model: SurgeAPI::Models::RecordingListResponse,
53
+ options: options
54
+ )
55
+ end
56
+
6
57
  # Deletes a recording. The recording file will be removed from storage
7
58
  # asynchronously.
8
59
  #
@@ -83,6 +83,37 @@ module SurgeAPI
83
83
  )
84
84
  end
85
85
 
86
+ # Some parameter documentations has been truncated, see
87
+ # {SurgeAPI::Models::UserListParams} for more details.
88
+ #
89
+ # List all users for an account with cursor-based pagination.
90
+ #
91
+ # @overload list(account_id, after: nil, before: nil, request_options: {})
92
+ #
93
+ # @param account_id [String] The account ID to list users for.
94
+ #
95
+ # @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
96
+ #
97
+ # @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
98
+ #
99
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
100
+ #
101
+ # @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::User>]
102
+ #
103
+ # @see SurgeAPI::Models::UserListParams
104
+ def list(account_id, params = {})
105
+ parsed, options = SurgeAPI::UserListParams.dump_request(params)
106
+ query = SurgeAPI::Internal::Util.encode_query_params(parsed)
107
+ @client.request(
108
+ method: :get,
109
+ path: ["accounts/%1$s/users", account_id],
110
+ query: query,
111
+ page: SurgeAPI::Internal::Cursor,
112
+ model: SurgeAPI::User,
113
+ options: options
114
+ )
115
+ end
116
+
86
117
  # Deletes a user.
87
118
  #
88
119
  # Once a user has been deleted, they will no longer be permitted to access any of
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SurgeAPI
4
- VERSION = "0.12.0"
4
+ VERSION = "0.13.0"
5
5
  end
data/lib/surge_api.rb CHANGED
@@ -97,11 +97,16 @@ require_relative "surge_api/models/recording_delete_params"
97
97
  require_relative "surge_api/models/recording_delete_response"
98
98
  require_relative "surge_api/models/recording_get_file_params"
99
99
  require_relative "surge_api/models/recording_get_file_response"
100
+ require_relative "surge_api/models/recording_list_params"
101
+ require_relative "surge_api/models/recording_list_response"
102
+ require_relative "surge_api/models/recording_retrieve_params"
103
+ require_relative "surge_api/models/recording_retrieve_response"
100
104
  require_relative "surge_api/models/unwrap_webhook_event"
101
105
  require_relative "surge_api/models/user"
102
106
  require_relative "surge_api/models/user_create_params"
103
107
  require_relative "surge_api/models/user_create_token_params"
104
108
  require_relative "surge_api/models/user_delete_params"
109
+ require_relative "surge_api/models/user_list_params"
105
110
  require_relative "surge_api/models/user_retrieve_params"
106
111
  require_relative "surge_api/models/user_token_response"
107
112
  require_relative "surge_api/models/user_update_params"
@@ -0,0 +1,59 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class RecordingListParams < 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::RecordingListParams, SurgeAPI::Internal::AnyHash)
12
+ end
13
+
14
+ # Cursor for forward pagination. Use the next_cursor from a previous response.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :after
17
+
18
+ sig { params(after: String).void }
19
+ attr_writer :after
20
+
21
+ # Cursor for backward pagination. Use the previous_cursor from a previous
22
+ # response.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :before
25
+
26
+ sig { params(before: String).void }
27
+ attr_writer :before
28
+
29
+ sig do
30
+ params(
31
+ after: String,
32
+ before: String,
33
+ request_options: SurgeAPI::RequestOptions::OrHash
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(
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
+ sig do
47
+ override.returns(
48
+ {
49
+ after: String,
50
+ before: String,
51
+ request_options: SurgeAPI::RequestOptions
52
+ }
53
+ )
54
+ end
55
+ def to_hash
56
+ end
57
+ end
58
+ end
59
+ end