Skip to content

Commit 106335f

Browse files
feat(api): api update
1 parent 7e8da29 commit 106335f

File tree

8 files changed

+59
-74
lines changed

8 files changed

+59
-74
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-d31af54a2b29a3535df6342584c2511b59a10a7c11c9c983f1cf209199c6ed0e.yml
3-
openapi_spec_hash: 6643320491f28a8bca49846e1b718c70
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-47c01c819b97af4a1a342357c958d7072f88f43bfdc5885462f9330dcf99773c.yml
3+
openapi_spec_hash: 15b236a1f536d8fb2e4356ea57de0836
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

lib/finch_api/models/hris/individual_in_directory.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,46 @@ class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel
88
# @!attribute id
99
# A stable Finch `id` (UUID v4) for an individual in the company.
1010
#
11-
# @return [String, nil]
12-
optional :id, String
11+
# @return [String]
12+
required :id, String
1313

1414
# @!attribute department
1515
# The department object.
1616
#
1717
# @return [FinchAPI::Models::HRIS::IndividualInDirectory::Department, nil]
18-
optional :department, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Department }, nil?: true
18+
required :department, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Department }, nil?: true
1919

2020
# @!attribute first_name
2121
# The legal first name of the individual.
2222
#
2323
# @return [String, nil]
24-
optional :first_name, String, nil?: true
24+
required :first_name, String, nil?: true
2525

2626
# @!attribute is_active
2727
# `true` if the individual is an active employee or contractor at the company.
2828
#
2929
# @return [Boolean, nil]
30-
optional :is_active, FinchAPI::Internal::Type::Boolean, nil?: true
30+
required :is_active, FinchAPI::Internal::Type::Boolean, nil?: true
3131

3232
# @!attribute last_name
3333
# The legal last name of the individual.
3434
#
3535
# @return [String, nil]
36-
optional :last_name, String, nil?: true
36+
required :last_name, String, nil?: true
3737

3838
# @!attribute manager
3939
# The manager object.
4040
#
4141
# @return [FinchAPI::Models::HRIS::IndividualInDirectory::Manager, nil]
42-
optional :manager, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Manager }, nil?: true
42+
required :manager, -> { FinchAPI::Models::HRIS::IndividualInDirectory::Manager }, nil?: true
4343

4444
# @!attribute middle_name
4545
# The legal middle name of the individual.
4646
#
4747
# @return [String, nil]
48-
optional :middle_name, String, nil?: true
48+
required :middle_name, String, nil?: true
4949

50-
# @!method initialize(id: nil, department: nil, first_name: nil, is_active: nil, last_name: nil, manager: nil, middle_name: nil)
50+
# @!method initialize(id:, department:, first_name:, is_active:, last_name:, manager:, middle_name:)
5151
# @param id [String] A stable Finch `id` (UUID v4) for an individual in the company.
5252
#
5353
# @param department [FinchAPI::Models::HRIS::IndividualInDirectory::Department, nil] The department object.
@@ -81,10 +81,10 @@ class Manager < FinchAPI::Internal::Type::BaseModel
8181
# @!attribute id
8282
# A stable Finch `id` (UUID v4) for an individual in the company.
8383
#
84-
# @return [String, nil]
85-
optional :id, String
84+
# @return [String]
85+
required :id, String
8686

87-
# @!method initialize(id: nil)
87+
# @!method initialize(id:)
8888
# The manager object.
8989
#
9090
# @param id [String] A stable Finch `id` (UUID v4) for an individual in the company.

lib/finch_api/models/paging.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
module FinchAPI
44
module Models
55
class Paging < FinchAPI::Internal::Type::BaseModel
6+
# @!attribute offset
7+
# The current start index of the returned list of elements
8+
#
9+
# @return [Integer]
10+
required :offset, Integer
11+
612
# @!attribute count
713
# The total number of elements for the entire query (not just the given page)
814
#
915
# @return [Integer, nil]
1016
optional :count, Integer
1117

12-
# @!attribute offset
13-
# The current start index of the returned list of elements
18+
# @!method initialize(offset:, count: nil)
19+
# @param offset [Integer] The current start index of the returned list of elements
1420
#
15-
# @return [Integer, nil]
16-
optional :offset, Integer
17-
18-
# @!method initialize(count: nil, offset: nil)
1921
# @param count [Integer] The total number of elements for the entire query (not just the given page)
20-
#
21-
# @param offset [Integer] The current start index of the returned list of elements
2222
end
2323
end
2424
end

rbi/finch_api/models/hris/individual_in_directory.rbi

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ module FinchAPI
55
module HRIS
66
class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel
77
# A stable Finch `id` (UUID v4) for an individual in the company.
8-
sig { returns(T.nilable(String)) }
9-
attr_reader :id
10-
11-
sig { params(id: String).void }
12-
attr_writer :id
8+
sig { returns(String) }
9+
attr_accessor :id
1310

1411
# The department object.
1512
sig { returns(T.nilable(FinchAPI::Models::HRIS::IndividualInDirectory::Department)) }
@@ -65,19 +62,19 @@ module FinchAPI
6562
end
6663
def self.new(
6764
# A stable Finch `id` (UUID v4) for an individual in the company.
68-
id: nil,
65+
id:,
6966
# The department object.
70-
department: nil,
67+
department:,
7168
# The legal first name of the individual.
72-
first_name: nil,
69+
first_name:,
7370
# `true` if the individual is an active employee or contractor at the company.
74-
is_active: nil,
71+
is_active:,
7572
# The legal last name of the individual.
76-
last_name: nil,
73+
last_name:,
7774
# The manager object.
78-
manager: nil,
75+
manager:,
7976
# The legal middle name of the individual.
80-
middle_name: nil
77+
middle_name:
8178
); end
8279
sig do
8380
override
@@ -112,17 +109,14 @@ module FinchAPI
112109

113110
class Manager < FinchAPI::Internal::Type::BaseModel
114111
# A stable Finch `id` (UUID v4) for an individual in the company.
115-
sig { returns(T.nilable(String)) }
116-
attr_reader :id
117-
118-
sig { params(id: String).void }
119-
attr_writer :id
112+
sig { returns(String) }
113+
attr_accessor :id
120114

121115
# The manager object.
122116
sig { params(id: String).returns(T.attached_class) }
123117
def self.new(
124118
# A stable Finch `id` (UUID v4) for an individual in the company.
125-
id: nil
119+
id:
126120
); end
127121
sig { override.returns({id: String}) }
128122
def to_hash; end

rbi/finch_api/models/paging.rbi

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@
33
module FinchAPI
44
module Models
55
class Paging < FinchAPI::Internal::Type::BaseModel
6+
# The current start index of the returned list of elements
7+
sig { returns(Integer) }
8+
attr_accessor :offset
9+
610
# The total number of elements for the entire query (not just the given page)
711
sig { returns(T.nilable(Integer)) }
812
attr_reader :count
913

1014
sig { params(count: Integer).void }
1115
attr_writer :count
1216

13-
# The current start index of the returned list of elements
14-
sig { returns(T.nilable(Integer)) }
15-
attr_reader :offset
16-
17-
sig { params(offset: Integer).void }
18-
attr_writer :offset
19-
20-
sig { params(count: Integer, offset: Integer).returns(T.attached_class) }
17+
sig { params(offset: Integer, count: Integer).returns(T.attached_class) }
2118
def self.new(
22-
# The total number of elements for the entire query (not just the given page)
23-
count: nil,
2419
# The current start index of the returned list of elements
25-
offset: nil
20+
offset:,
21+
# The total number of elements for the entire query (not just the given page)
22+
count: nil
2623
); end
27-
sig { override.returns({count: Integer, offset: Integer}) }
24+
sig { override.returns({offset: Integer, count: Integer}) }
2825
def to_hash; end
2926
end
3027
end

sig/finch_api/models/hris/individual_in_directory.rbs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ module FinchAPI
1313
}
1414

1515
class IndividualInDirectory < FinchAPI::Internal::Type::BaseModel
16-
attr_reader id: String?
17-
18-
def id=: (String) -> String
16+
attr_accessor id: String
1917

2018
attr_accessor department: FinchAPI::Models::HRIS::IndividualInDirectory::Department?
2119

@@ -30,13 +28,13 @@ module FinchAPI
3028
attr_accessor middle_name: String?
3129

3230
def initialize: (
33-
?id: String,
34-
?department: FinchAPI::Models::HRIS::IndividualInDirectory::Department?,
35-
?first_name: String?,
36-
?is_active: bool?,
37-
?last_name: String?,
38-
?manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager?,
39-
?middle_name: String?
31+
id: String,
32+
department: FinchAPI::Models::HRIS::IndividualInDirectory::Department?,
33+
first_name: String?,
34+
is_active: bool?,
35+
last_name: String?,
36+
manager: FinchAPI::Models::HRIS::IndividualInDirectory::Manager?,
37+
middle_name: String?
4038
) -> void
4139

4240
def to_hash: -> FinchAPI::Models::HRIS::individual_in_directory
@@ -54,11 +52,9 @@ module FinchAPI
5452
type manager = { id: String }
5553

5654
class Manager < FinchAPI::Internal::Type::BaseModel
57-
attr_reader id: String?
58-
59-
def id=: (String) -> String
55+
attr_accessor id: String
6056

61-
def initialize: (?id: String) -> void
57+
def initialize: (id: String) -> void
6258

6359
def to_hash: -> FinchAPI::Models::HRIS::IndividualInDirectory::manager
6460
end

sig/finch_api/models/paging.rbs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
module FinchAPI
22
module Models
3-
type paging = { count: Integer, offset: Integer }
3+
type paging = { offset: Integer, count: Integer }
44

55
class Paging < FinchAPI::Internal::Type::BaseModel
6+
attr_accessor offset: Integer
7+
68
attr_reader count: Integer?
79

810
def count=: (Integer) -> Integer
911

10-
attr_reader offset: Integer?
11-
12-
def offset=: (Integer) -> Integer
13-
14-
def initialize: (?count: Integer, ?offset: Integer) -> void
12+
def initialize: (offset: Integer, ?count: Integer) -> void
1513

1614
def to_hash: -> FinchAPI::Models::paging
1715
end

test/finch_api/resources/hris/directory_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_list
1919

2020
assert_pattern do
2121
row => {
22-
id: String | nil,
22+
id: String,
2323
department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil,
2424
first_name: String | nil,
2525
is_active: FinchAPI::Internal::Type::Boolean | nil,
@@ -46,7 +46,7 @@ def test_list_individuals
4646

4747
assert_pattern do
4848
row => {
49-
id: String | nil,
49+
id: String,
5050
department: FinchAPI::Models::HRIS::IndividualInDirectory::Department | nil,
5151
first_name: String | nil,
5252
is_active: FinchAPI::Internal::Type::Boolean | nil,

0 commit comments

Comments
 (0)