Skip to content

Commit bd3b67a

Browse files
feat(api): api update
1 parent 5d0dfc8 commit bd3b67a

File tree

5 files changed

+73
-36
lines changed

5 files changed

+73
-36
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-f7e741bc6e0175fd96a9db5348092b90a77b0985154c0814bb681ad5dccdf19a.yml
3-
openapi_spec_hash: b348a9ef407a8e91dd770fcb219d4ac5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46ed24a601021d59f2e481c290509da2c05ee7be34eba58448b78b035392cbc4.yml
3+
openapi_spec_hash: afe19f94bb37ddaf7344fac1b1e64730
44
config_hash: 5146b12344dae76238940989dac1e8a0

lib/finch_api/models/jobs/automated_create_response.rb

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,40 @@ class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel
1111
# @return [Integer]
1212
required :allowed_refreshes, Integer
1313

14+
# @!attribute remaining_refreshes
15+
# The number of remaining refreshes available (per hour, fixed window)
16+
#
17+
# @return [Integer]
18+
required :remaining_refreshes, Integer
19+
1420
# @!attribute job_id
1521
# The id of the job that has been created.
1622
#
17-
# @return [String]
18-
required :job_id, String
23+
# @return [String, nil]
24+
optional :job_id, String
1925

2026
# @!attribute job_url
2127
# The url that can be used to retrieve the job status
2228
#
23-
# @return [String]
24-
required :job_url, String
29+
# @return [String, nil]
30+
optional :job_url, String
2531

26-
# @!attribute remaining_refreshes
27-
# The number of remaining refreshes available (per hour, fixed window)
32+
# @!attribute retry_at
33+
# ISO 8601 timestamp indicating when to retry the request
2834
#
29-
# @return [Integer]
30-
required :remaining_refreshes, Integer
35+
# @return [String, nil]
36+
optional :retry_at, String
3137

32-
# @!method initialize(allowed_refreshes:, job_id:, job_url:, remaining_refreshes:)
38+
# @!method initialize(allowed_refreshes:, remaining_refreshes:, job_id: nil, job_url: nil, retry_at: nil)
3339
# @param allowed_refreshes [Integer] The number of allowed refreshes per hour (per hour, fixed window)
3440
#
41+
# @param remaining_refreshes [Integer] The number of remaining refreshes available (per hour, fixed window)
42+
#
3543
# @param job_id [String] The id of the job that has been created.
3644
#
3745
# @param job_url [String] The url that can be used to retrieve the job status
3846
#
39-
# @param remaining_refreshes [Integer] The number of remaining refreshes available (per hour, fixed window)
47+
# @param retry_at [String] ISO 8601 timestamp indicating when to retry the request
4048
end
4149
end
4250
end

rbi/finch_api/models/jobs/automated_create_response.rbi

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,62 @@ module FinchAPI
1616
sig { returns(Integer) }
1717
attr_accessor :allowed_refreshes
1818

19+
# The number of remaining refreshes available (per hour, fixed window)
20+
sig { returns(Integer) }
21+
attr_accessor :remaining_refreshes
22+
1923
# The id of the job that has been created.
20-
sig { returns(String) }
21-
attr_accessor :job_id
24+
sig { returns(T.nilable(String)) }
25+
attr_reader :job_id
26+
27+
sig { params(job_id: String).void }
28+
attr_writer :job_id
2229

2330
# The url that can be used to retrieve the job status
24-
sig { returns(String) }
25-
attr_accessor :job_url
31+
sig { returns(T.nilable(String)) }
32+
attr_reader :job_url
2633

27-
# The number of remaining refreshes available (per hour, fixed window)
28-
sig { returns(Integer) }
29-
attr_accessor :remaining_refreshes
34+
sig { params(job_url: String).void }
35+
attr_writer :job_url
36+
37+
# ISO 8601 timestamp indicating when to retry the request
38+
sig { returns(T.nilable(String)) }
39+
attr_reader :retry_at
40+
41+
sig { params(retry_at: String).void }
42+
attr_writer :retry_at
3043

3144
sig do
3245
params(
3346
allowed_refreshes: Integer,
47+
remaining_refreshes: Integer,
3448
job_id: String,
3549
job_url: String,
36-
remaining_refreshes: Integer
50+
retry_at: String
3751
).returns(T.attached_class)
3852
end
3953
def self.new(
4054
# The number of allowed refreshes per hour (per hour, fixed window)
4155
allowed_refreshes:,
56+
# The number of remaining refreshes available (per hour, fixed window)
57+
remaining_refreshes:,
4258
# The id of the job that has been created.
43-
job_id:,
59+
job_id: nil,
4460
# The url that can be used to retrieve the job status
45-
job_url:,
46-
# The number of remaining refreshes available (per hour, fixed window)
47-
remaining_refreshes:
61+
job_url: nil,
62+
# ISO 8601 timestamp indicating when to retry the request
63+
retry_at: nil
4864
)
4965
end
5066

5167
sig do
5268
override.returns(
5369
{
5470
allowed_refreshes: Integer,
71+
remaining_refreshes: Integer,
5572
job_id: String,
5673
job_url: String,
57-
remaining_refreshes: Integer
74+
retry_at: String
5875
}
5976
)
6077
end

sig/finch_api/models/jobs/automated_create_response.rbs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,43 @@ module FinchAPI
44
type automated_create_response =
55
{
66
allowed_refreshes: Integer,
7+
remaining_refreshes: Integer,
78
job_id: String,
89
job_url: String,
9-
remaining_refreshes: Integer
10+
retry_at: String
1011
}
1112

1213
class AutomatedCreateResponse < FinchAPI::Internal::Type::BaseModel
1314
attr_accessor allowed_refreshes: Integer
1415

15-
attr_accessor job_id: String
16+
attr_accessor remaining_refreshes: Integer
1617

17-
attr_accessor job_url: String
18+
attr_reader job_id: String?
1819

19-
attr_accessor remaining_refreshes: Integer
20+
def job_id=: (String) -> String
21+
22+
attr_reader job_url: String?
23+
24+
def job_url=: (String) -> String
25+
26+
attr_reader retry_at: String?
27+
28+
def retry_at=: (String) -> String
2029

2130
def initialize: (
2231
allowed_refreshes: Integer,
23-
job_id: String,
24-
job_url: String,
25-
remaining_refreshes: Integer
32+
remaining_refreshes: Integer,
33+
?job_id: String,
34+
?job_url: String,
35+
?retry_at: String
2636
) -> void
2737

2838
def to_hash: -> {
2939
allowed_refreshes: Integer,
40+
remaining_refreshes: Integer,
3041
job_id: String,
3142
job_url: String,
32-
remaining_refreshes: Integer
43+
retry_at: String
3344
}
3445
end
3546
end

test/finch_api/resources/jobs/automated_test.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ def test_create_required_params
1414
assert_pattern do
1515
response => {
1616
allowed_refreshes: Integer,
17-
job_id: String,
18-
job_url: String,
19-
remaining_refreshes: Integer
17+
remaining_refreshes: Integer,
18+
job_id: String | nil,
19+
job_url: String | nil,
20+
retry_at: String | nil
2021
}
2122
end
2223
end

0 commit comments

Comments
 (0)