surge_api 0.16.0 → 0.17.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 +8 -0
- data/README.md +6 -6
- data/lib/surge_api/internal/cursor.rb +2 -2
- data/lib/surge_api/models/account_list_params.rb +34 -0
- data/lib/surge_api/models.rb +2 -0
- data/lib/surge_api/resources/accounts.rb +29 -0
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +1 -0
- data/rbi/surge_api/models/account_list_params.rbi +59 -0
- data/rbi/surge_api/models.rbi +2 -0
- data/rbi/surge_api/resources/accounts.rbi +18 -0
- data/sig/surge_api/models/account_list_params.rbs +32 -0
- data/sig/surge_api/models.rbs +2 -0
- data/sig/surge_api/resources/accounts.rbs +6 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcd65a3f11b5c187dcefe5f82f90dfef4bb4421e06115246ccda187f459e9202
|
|
4
|
+
data.tar.gz: c8bac9291bc751a4ddfdb952f70eb32fcb696ef886a5c3521f149e7235f18733
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0032493ed7b14b18fc06f216c37ed91814fbd61874e777604013cde0c694859767b177820dc298559024a9a2c7f39d878157e7e6b24035fce20ad07fa1b984e0'
|
|
7
|
+
data.tar.gz: abe1e0ff490003f4f4376847989c4b0f982abb34ac3eae1bc308b81abf22a03e4078dd08d49c23db58a91e271831d450fe2087938286455fcc381d126602a14c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.17.0 (2026-05-04)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.16.0...v0.17.0](https://github.com/surgeapi/ruby-sdk/compare/v0.16.0...v0.17.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** list accounts endpoint ([510b3bc](https://github.com/surgeapi/ruby-sdk/commit/510b3bc3d2ab9b8659e5ca0701cef8fc2c5f2a2e))
|
|
10
|
+
|
|
3
11
|
## 0.16.0 (2026-04-22)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.15.0...v0.16.0](https://github.com/surgeapi/ruby-sdk/compare/v0.15.0...v0.16.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.17.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.accounts.list
|
|
48
48
|
|
|
49
49
|
# Fetch single item from page.
|
|
50
|
-
|
|
51
|
-
puts(
|
|
50
|
+
account = page.data[0]
|
|
51
|
+
puts(account.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 |account|
|
|
55
|
+
puts(account.id)
|
|
56
56
|
end
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Accounts#list
|
|
6
|
+
class AccountListParams < 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::AccountListParams} 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
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -45,6 +45,8 @@ module SurgeAPI
|
|
|
45
45
|
|
|
46
46
|
AccountCreateParams = SurgeAPI::Models::AccountCreateParams
|
|
47
47
|
|
|
48
|
+
AccountListParams = SurgeAPI::Models::AccountListParams
|
|
49
|
+
|
|
48
50
|
AccountRetrieveStatusParams = SurgeAPI::Models::AccountRetrieveStatusParams
|
|
49
51
|
|
|
50
52
|
AccountStatus = SurgeAPI::Models::AccountStatus
|
|
@@ -67,6 +67,35 @@ module SurgeAPI
|
|
|
67
67
|
)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
+
# Some parameter documentations has been truncated, see
|
|
71
|
+
# {SurgeAPI::Models::AccountListParams} for more details.
|
|
72
|
+
#
|
|
73
|
+
# List all accounts for the calling platform with cursor-based pagination.
|
|
74
|
+
#
|
|
75
|
+
# @overload list(after: nil, before: nil, request_options: {})
|
|
76
|
+
#
|
|
77
|
+
# @param after [String] Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
78
|
+
#
|
|
79
|
+
# @param before [String] Cursor for backward pagination. Use the previous_cursor from a previous response
|
|
80
|
+
#
|
|
81
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
82
|
+
#
|
|
83
|
+
# @return [SurgeAPI::Internal::Cursor<SurgeAPI::Models::Account>]
|
|
84
|
+
#
|
|
85
|
+
# @see SurgeAPI::Models::AccountListParams
|
|
86
|
+
def list(params = {})
|
|
87
|
+
parsed, options = SurgeAPI::AccountListParams.dump_request(params)
|
|
88
|
+
query = SurgeAPI::Internal::Util.encode_query_params(parsed)
|
|
89
|
+
@client.request(
|
|
90
|
+
method: :get,
|
|
91
|
+
path: "accounts",
|
|
92
|
+
query: query,
|
|
93
|
+
page: SurgeAPI::Internal::Cursor,
|
|
94
|
+
model: SurgeAPI::Account,
|
|
95
|
+
options: options
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
70
99
|
# Archives an account and releases all associated resources.
|
|
71
100
|
#
|
|
72
101
|
# **Warning**: This action will:
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -58,6 +58,7 @@ require_relative "surge_api/models/message_params"
|
|
|
58
58
|
require_relative "surge_api/models/account"
|
|
59
59
|
require_relative "surge_api/models/account_archive_params"
|
|
60
60
|
require_relative "surge_api/models/account_create_params"
|
|
61
|
+
require_relative "surge_api/models/account_list_params"
|
|
61
62
|
require_relative "surge_api/models/account_retrieve_status_params"
|
|
62
63
|
require_relative "surge_api/models/account_status"
|
|
63
64
|
require_relative "surge_api/models/account_update_params"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class AccountListParams < 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::AccountListParams, 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
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -7,6 +7,8 @@ module SurgeAPI
|
|
|
7
7
|
|
|
8
8
|
AccountCreateParams = SurgeAPI::Models::AccountCreateParams
|
|
9
9
|
|
|
10
|
+
AccountListParams = SurgeAPI::Models::AccountListParams
|
|
11
|
+
|
|
10
12
|
AccountRetrieveStatusParams = SurgeAPI::Models::AccountRetrieveStatusParams
|
|
11
13
|
|
|
12
14
|
AccountStatus = SurgeAPI::Models::AccountStatus
|
|
@@ -65,6 +65,24 @@ module SurgeAPI
|
|
|
65
65
|
)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
# List all accounts for the calling platform with cursor-based pagination.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
after: String,
|
|
72
|
+
before: String,
|
|
73
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
74
|
+
).returns(SurgeAPI::Internal::Cursor[SurgeAPI::Account])
|
|
75
|
+
end
|
|
76
|
+
def list(
|
|
77
|
+
# Cursor for forward pagination. Use the next_cursor from a previous response.
|
|
78
|
+
after: nil,
|
|
79
|
+
# Cursor for backward pagination. Use the previous_cursor from a previous
|
|
80
|
+
# response.
|
|
81
|
+
before: nil,
|
|
82
|
+
request_options: {}
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
68
86
|
# Archives an account and releases all associated resources.
|
|
69
87
|
#
|
|
70
88
|
# **Warning**: This action will:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type account_list_params =
|
|
4
|
+
{ after: String, before: String }
|
|
5
|
+
& SurgeAPI::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class AccountListParams < 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
|
data/sig/surge_api/models.rbs
CHANGED
|
@@ -5,6 +5,8 @@ module SurgeAPI
|
|
|
5
5
|
|
|
6
6
|
class AccountCreateParams = SurgeAPI::Models::AccountCreateParams
|
|
7
7
|
|
|
8
|
+
class AccountListParams = SurgeAPI::Models::AccountListParams
|
|
9
|
+
|
|
8
10
|
class AccountRetrieveStatusParams = SurgeAPI::Models::AccountRetrieveStatusParams
|
|
9
11
|
|
|
10
12
|
class AccountStatus = SurgeAPI::Models::AccountStatus
|
|
@@ -18,6 +18,12 @@ module SurgeAPI
|
|
|
18
18
|
?request_options: SurgeAPI::request_opts
|
|
19
19
|
) -> SurgeAPI::Account
|
|
20
20
|
|
|
21
|
+
def list: (
|
|
22
|
+
?after: String,
|
|
23
|
+
?before: String,
|
|
24
|
+
?request_options: SurgeAPI::request_opts
|
|
25
|
+
) -> SurgeAPI::Internal::Cursor[SurgeAPI::Account]
|
|
26
|
+
|
|
21
27
|
def archive: (
|
|
22
28
|
String id,
|
|
23
29
|
?request_options: SurgeAPI::request_opts
|
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.17.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-04
|
|
11
|
+
date: 2026-05-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -73,6 +73,7 @@ files:
|
|
|
73
73
|
- lib/surge_api/models/account.rb
|
|
74
74
|
- lib/surge_api/models/account_archive_params.rb
|
|
75
75
|
- lib/surge_api/models/account_create_params.rb
|
|
76
|
+
- lib/surge_api/models/account_list_params.rb
|
|
76
77
|
- lib/surge_api/models/account_retrieve_status_params.rb
|
|
77
78
|
- lib/surge_api/models/account_status.rb
|
|
78
79
|
- lib/surge_api/models/account_update_params.rb
|
|
@@ -178,6 +179,7 @@ files:
|
|
|
178
179
|
- rbi/surge_api/models/account.rbi
|
|
179
180
|
- rbi/surge_api/models/account_archive_params.rbi
|
|
180
181
|
- rbi/surge_api/models/account_create_params.rbi
|
|
182
|
+
- rbi/surge_api/models/account_list_params.rbi
|
|
181
183
|
- rbi/surge_api/models/account_retrieve_status_params.rbi
|
|
182
184
|
- rbi/surge_api/models/account_status.rbi
|
|
183
185
|
- rbi/surge_api/models/account_update_params.rbi
|
|
@@ -282,6 +284,7 @@ files:
|
|
|
282
284
|
- sig/surge_api/models/account.rbs
|
|
283
285
|
- sig/surge_api/models/account_archive_params.rbs
|
|
284
286
|
- sig/surge_api/models/account_create_params.rbs
|
|
287
|
+
- sig/surge_api/models/account_list_params.rbs
|
|
285
288
|
- sig/surge_api/models/account_retrieve_status_params.rbs
|
|
286
289
|
- sig/surge_api/models/account_status.rbs
|
|
287
290
|
- sig/surge_api/models/account_update_params.rbs
|