diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c412e974..52b3e834 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.29" + ".": "0.1.0-alpha.30" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ff867f70..496cf9a0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bf86910e96e83e583689cf5d1a5c583268754026ec68288994fa6a969dc248f2.yml -openapi_spec_hash: 195038e056891afec204c49dadce3b95 -config_hash: 5146b12344dae76238940989dac1e8a0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bb50c0ae41ff5036adf72344d33057941f6de67c5fae811eba2e758bfa4ffd31.yml +openapi_spec_hash: 1b21e4bfc46daeef1613e410e5aa8f28 +config_hash: 6d3585c0032e08d723d077d660fc8448 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2317d6a3..f6f69b1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.1.0-alpha.30 (2025-09-08) + +Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.29...v0.1.0-alpha.30) + +### Features + +* **api:** api update ([a67b714](https://github.com/Finch-API/finch-api-ruby/commit/a67b7140a175c5091a52ef82b90860b39a74075f)) +* **api:** make client id, client secret optional again ([d1b769f](https://github.com/Finch-API/finch-api-ruby/commit/d1b769f81ce16d27fe940f647c19d6f6e4b1b2b4)) + ## 0.1.0-alpha.29 (2025-08-24) Full Changelog: [v0.1.0-alpha.28...v0.1.0-alpha.29](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.28...v0.1.0-alpha.29) diff --git a/Gemfile.lock b/Gemfile.lock index 8ae7e139..d02d747e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - finch-api (0.1.0.pre.alpha.29) + finch-api (0.1.0.pre.alpha.30) connection_pool GEM diff --git a/README.md b/README.md index ec81c90a..c458f72d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.29" +gem "finch-api", "~> 0.1.0.pre.alpha.30" ``` diff --git a/lib/finch_api/models/access_token_create_params.rb b/lib/finch_api/models/access_token_create_params.rb index 2dd62859..f6c8e4fd 100644 --- a/lib/finch_api/models/access_token_create_params.rb +++ b/lib/finch_api/models/access_token_create_params.rb @@ -7,23 +7,23 @@ class AccessTokenCreateParams < FinchAPI::Internal::Type::BaseModel extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters + # @!attribute code + # The authorization code received from the authorization server + # + # @return [String] + required :code, String + # @!attribute client_id # The client ID for your application # - # @return [String] - required :client_id, String + # @return [String, nil] + optional :client_id, String # @!attribute client_secret # The client secret for your application # - # @return [String] - required :client_secret, String - - # @!attribute code - # The authorization code received from the authorization server - # - # @return [String] - required :code, String + # @return [String, nil] + optional :client_secret, String # @!attribute redirect_uri # The redirect URI used in the authorization request (optional) @@ -31,13 +31,13 @@ class AccessTokenCreateParams < FinchAPI::Internal::Type::BaseModel # @return [String, nil] optional :redirect_uri, String - # @!method initialize(client_id:, client_secret:, code:, redirect_uri: nil, request_options: {}) + # @!method initialize(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) + # @param code [String] The authorization code received from the authorization server + # # @param client_id [String] The client ID for your application # # @param client_secret [String] The client secret for your application # - # @param code [String] The authorization code received from the authorization server - # # @param redirect_uri [String] The redirect URI used in the authorization request (optional) # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/finch_api/models/hris/pay_statement.rb b/lib/finch_api/models/hris/pay_statement.rb index 0483a523..c716eccd 100644 --- a/lib/finch_api/models/hris/pay_statement.rb +++ b/lib/finch_api/models/hris/pay_statement.rb @@ -176,31 +176,19 @@ module Type # @see FinchAPI::Models::HRIS::PayStatement::Earning#attributes class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). # - # @return [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata] - required :metadata, -> { FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata } + # @return [Hash{Symbol=>Object, nil}] + required :metadata, + FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] # @!method initialize(metadata:) - # @param metadata [FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata] - - # @see FinchAPI::Models::HRIS::PayStatement::Earning::Attributes#metadata - class Metadata < FinchAPI::Internal::Type::BaseModel - # @!attribute metadata - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - # - # @return [Hash{Symbol=>Object, nil}] - required :metadata, - FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] - - # @!method initialize(metadata:) - # Some parameter documentations has been truncated, see - # {FinchAPI::Models::HRIS::PayStatement::Earning::Attributes::Metadata} for more - # details. - # - # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p - end + # Some parameter documentations has been truncated, see + # {FinchAPI::Models::HRIS::PayStatement::Earning::Attributes} for more details. + # + # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p end end @@ -256,31 +244,20 @@ class EmployeeDeduction < FinchAPI::Internal::Type::BaseModel # @see FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction#attributes class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). # - # @return [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata] - required :metadata, -> { FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata } + # @return [Hash{Symbol=>Object, nil}] + required :metadata, + FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] # @!method initialize(metadata:) - # @param metadata [FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata] - - # @see FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes#metadata - class Metadata < FinchAPI::Internal::Type::BaseModel - # @!attribute metadata - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - # - # @return [Hash{Symbol=>Object, nil}] - required :metadata, - FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] - - # @!method initialize(metadata:) - # Some parameter documentations has been truncated, see - # {FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata} - # for more details. - # - # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p - end + # Some parameter documentations has been truncated, see + # {FinchAPI::Models::HRIS::PayStatement::EmployeeDeduction::Attributes} for more + # details. + # + # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p end end @@ -332,31 +309,20 @@ class EmployerContribution < FinchAPI::Internal::Type::BaseModel # @see FinchAPI::Models::HRIS::PayStatement::EmployerContribution#attributes class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). # - # @return [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata] - required :metadata, -> { FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata } + # @return [Hash{Symbol=>Object, nil}] + required :metadata, + FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] # @!method initialize(metadata:) - # @param metadata [FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata] - - # @see FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes#metadata - class Metadata < FinchAPI::Internal::Type::BaseModel - # @!attribute metadata - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - # - # @return [Hash{Symbol=>Object, nil}] - required :metadata, - FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] - - # @!method initialize(metadata:) - # Some parameter documentations has been truncated, see - # {FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes::Metadata} - # for more details. - # - # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p - end + # Some parameter documentations has been truncated, see + # {FinchAPI::Models::HRIS::PayStatement::EmployerContribution::Attributes} for + # more details. + # + # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p end end @@ -441,31 +407,19 @@ module Type # @see FinchAPI::Models::HRIS::PayStatement::Tax#attributes class Attributes < FinchAPI::Internal::Type::BaseModel # @!attribute metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). # - # @return [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata] - required :metadata, -> { FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata } + # @return [Hash{Symbol=>Object, nil}] + required :metadata, + FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] # @!method initialize(metadata:) - # @param metadata [FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata] - - # @see FinchAPI::Models::HRIS::PayStatement::Tax::Attributes#metadata - class Metadata < FinchAPI::Internal::Type::BaseModel - # @!attribute metadata - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - # - # @return [Hash{Symbol=>Object, nil}] - required :metadata, - FinchAPI::Internal::Type::HashOf[FinchAPI::Internal::Type::Unknown, nil?: true] - - # @!method initialize(metadata:) - # Some parameter documentations has been truncated, see - # {FinchAPI::Models::HRIS::PayStatement::Tax::Attributes::Metadata} for more - # details. - # - # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p - end + # Some parameter documentations has been truncated, see + # {FinchAPI::Models::HRIS::PayStatement::Tax::Attributes} for more details. + # + # @param metadata [Hash{Symbol=>Object, nil}] The metadata to be attached to the entity by existing rules. It is a key-value p end end diff --git a/lib/finch_api/resources/access_tokens.rb b/lib/finch_api/resources/access_tokens.rb index 38a3cf89..9efb267d 100644 --- a/lib/finch_api/resources/access_tokens.rb +++ b/lib/finch_api/resources/access_tokens.rb @@ -5,14 +5,14 @@ module Resources class AccessTokens # Exchange the authorization code for an access token # - # @overload create(client_id:, client_secret:, code:, redirect_uri: nil, request_options: {}) + # @overload create(code:, client_id: nil, client_secret: nil, redirect_uri: nil, request_options: {}) + # + # @param code [String] The authorization code received from the authorization server # # @param client_id [String] The client ID for your application # # @param client_secret [String] The client secret for your application # - # @param code [String] The authorization code received from the authorization server - # # @param redirect_uri [String] The redirect URI used in the authorization request (optional) # # @param request_options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/finch_api/version.rb b/lib/finch_api/version.rb index 818ecc34..43c4172f 100644 --- a/lib/finch_api/version.rb +++ b/lib/finch_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FinchAPI - VERSION = "0.1.0.pre.alpha.29" + VERSION = "0.1.0.pre.alpha.30" end diff --git a/rbi/finch_api/models/access_token_create_params.rbi b/rbi/finch_api/models/access_token_create_params.rbi index b674a4c9..6059b06b 100644 --- a/rbi/finch_api/models/access_token_create_params.rbi +++ b/rbi/finch_api/models/access_token_create_params.rbi @@ -11,17 +11,23 @@ module FinchAPI T.any(FinchAPI::AccessTokenCreateParams, FinchAPI::Internal::AnyHash) end - # The client ID for your application + # The authorization code received from the authorization server sig { returns(String) } - attr_accessor :client_id + attr_accessor :code + + # The client ID for your application + sig { returns(T.nilable(String)) } + attr_reader :client_id + + sig { params(client_id: String).void } + attr_writer :client_id # The client secret for your application - sig { returns(String) } - attr_accessor :client_secret + sig { returns(T.nilable(String)) } + attr_reader :client_secret - # The authorization code received from the authorization server - sig { returns(String) } - attr_accessor :code + sig { params(client_secret: String).void } + attr_writer :client_secret # The redirect URI used in the authorization request (optional) sig { returns(T.nilable(String)) } @@ -32,20 +38,20 @@ module FinchAPI sig do params( + code: String, client_id: String, client_secret: String, - code: String, redirect_uri: String, request_options: FinchAPI::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( - # The client ID for your application - client_id:, - # The client secret for your application - client_secret:, # The authorization code received from the authorization server code:, + # The client ID for your application + client_id: nil, + # The client secret for your application + client_secret: nil, # The redirect URI used in the authorization request (optional) redirect_uri: nil, request_options: {} @@ -55,9 +61,9 @@ module FinchAPI sig do override.returns( { + code: String, client_id: String, client_secret: String, - code: String, redirect_uri: String, request_options: FinchAPI::RequestOptions } diff --git a/rbi/finch_api/models/hris/pay_statement.rbi b/rbi/finch_api/models/hris/pay_statement.rbi index 1de7f657..b8160f83 100644 --- a/rbi/finch_api/models/hris/pay_statement.rbi +++ b/rbi/finch_api/models/hris/pay_statement.rbi @@ -382,77 +382,32 @@ module FinchAPI ) end - sig do - returns( - FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata - ) - end - attr_reader :metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } + attr_accessor :metadata sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata::OrHash - ).returns(T.attached_class) + params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).returns( + T.attached_class + ) end - def self.new(metadata:) + def self.new( + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + metadata: + ) end sig do override.returns( - { - metadata: - FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata - } + { metadata: T::Hash[Symbol, T.nilable(T.anything)] } ) end def to_hash end - - class Metadata < FinchAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata, - FinchAPI::Internal::AnyHash - ) - end - - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } - attr_accessor :metadata - - sig do - params( - metadata: T::Hash[Symbol, T.nilable(T.anything)] - ).returns(T.attached_class) - end - def self.new( - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - metadata: - ) - end - - sig do - override.returns( - { metadata: T::Hash[Symbol, T.nilable(T.anything)] } - ) - end - def to_hash - end - end end end @@ -559,77 +514,32 @@ module FinchAPI ) end - sig do - returns( - FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - ) - end - attr_reader :metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } + attr_accessor :metadata sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata::OrHash - ).returns(T.attached_class) + params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).returns( + T.attached_class + ) end - def self.new(metadata:) + def self.new( + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + metadata: + ) end sig do override.returns( - { - metadata: - FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - } + { metadata: T::Hash[Symbol, T.nilable(T.anything)] } ) end def to_hash end - - class Metadata < FinchAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata, - FinchAPI::Internal::AnyHash - ) - end - - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } - attr_accessor :metadata - - sig do - params( - metadata: T::Hash[Symbol, T.nilable(T.anything)] - ).returns(T.attached_class) - end - def self.new( - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - metadata: - ) - end - - sig do - override.returns( - { metadata: T::Hash[Symbol, T.nilable(T.anything)] } - ) - end - def to_hash - end - end end end @@ -728,77 +638,32 @@ module FinchAPI ) end - sig do - returns( - FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata - ) - end - attr_reader :metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } + attr_accessor :metadata sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata::OrHash - ).returns(T.attached_class) + params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).returns( + T.attached_class + ) end - def self.new(metadata:) + def self.new( + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + metadata: + ) end sig do override.returns( - { - metadata: - FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata - } + { metadata: T::Hash[Symbol, T.nilable(T.anything)] } ) end def to_hash end - - class Metadata < FinchAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata, - FinchAPI::Internal::AnyHash - ) - end - - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } - attr_accessor :metadata - - sig do - params( - metadata: T::Hash[Symbol, T.nilable(T.anything)] - ).returns(T.attached_class) - end - def self.new( - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - metadata: - ) - end - - sig do - override.returns( - { metadata: T::Hash[Symbol, T.nilable(T.anything)] } - ) - end - def to_hash - end - end end end @@ -980,75 +845,32 @@ module FinchAPI ) end - sig do - returns(FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata) - end - attr_reader :metadata + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } + attr_accessor :metadata sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - params( - metadata: - FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata::OrHash - ).returns(T.attached_class) + params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).returns( + T.attached_class + ) end - def self.new(metadata:) + def self.new( + # The metadata to be attached to the entity by existing rules. It is a key-value + # pairs where the values can be of any type (string, number, boolean, object, + # array, etc.). + metadata: + ) end sig do override.returns( - { - metadata: - FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata - } + { metadata: T::Hash[Symbol, T.nilable(T.anything)] } ) end def to_hash end - - class Metadata < FinchAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata, - FinchAPI::Internal::AnyHash - ) - end - - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) } - attr_accessor :metadata - - sig do - params( - metadata: T::Hash[Symbol, T.nilable(T.anything)] - ).returns(T.attached_class) - end - def self.new( - # The metadata to be attached to the entity by existing rules. It is a key-value - # pairs where the values can be of any type (string, number, boolean, object, - # array, etc.). - metadata: - ) - end - - sig do - override.returns( - { metadata: T::Hash[Symbol, T.nilable(T.anything)] } - ) - end - def to_hash - end - end end end diff --git a/rbi/finch_api/resources/access_tokens.rbi b/rbi/finch_api/resources/access_tokens.rbi index c04ba687..10b3551f 100644 --- a/rbi/finch_api/resources/access_tokens.rbi +++ b/rbi/finch_api/resources/access_tokens.rbi @@ -6,20 +6,20 @@ module FinchAPI # Exchange the authorization code for an access token sig do params( + code: String, client_id: String, client_secret: String, - code: String, redirect_uri: String, request_options: FinchAPI::RequestOptions::OrHash ).returns(FinchAPI::CreateAccessTokenResponse) end def create( - # The client ID for your application - client_id:, - # The client secret for your application - client_secret:, # The authorization code received from the authorization server code:, + # The client ID for your application + client_id: nil, + # The client secret for your application + client_secret: nil, # The redirect URI used in the authorization request (optional) redirect_uri: nil, request_options: {} diff --git a/sig/finch_api/models/access_token_create_params.rbs b/sig/finch_api/models/access_token_create_params.rbs index 7bf905b7..017785ab 100644 --- a/sig/finch_api/models/access_token_create_params.rbs +++ b/sig/finch_api/models/access_token_create_params.rbs @@ -2,9 +2,9 @@ module FinchAPI module Models type access_token_create_params = { + code: String, client_id: String, client_secret: String, - code: String, redirect_uri: String } & FinchAPI::Internal::Type::request_parameters @@ -13,28 +13,32 @@ module FinchAPI extend FinchAPI::Internal::Type::RequestParameters::Converter include FinchAPI::Internal::Type::RequestParameters - attr_accessor client_id: String + attr_accessor code: String - attr_accessor client_secret: String + attr_reader client_id: String? - attr_accessor code: String + def client_id=: (String) -> String + + attr_reader client_secret: String? + + def client_secret=: (String) -> String attr_reader redirect_uri: String? def redirect_uri=: (String) -> String def initialize: ( - client_id: String, - client_secret: String, code: String, + ?client_id: String, + ?client_secret: String, ?redirect_uri: String, ?request_options: FinchAPI::request_opts ) -> void def to_hash: -> { + code: String, client_id: String, client_secret: String, - code: String, redirect_uri: String, request_options: FinchAPI::RequestOptions } diff --git a/sig/finch_api/models/hris/pay_statement.rbs b/sig/finch_api/models/hris/pay_statement.rbs index 2c5572b3..d5ac5e28 100644 --- a/sig/finch_api/models/hris/pay_statement.rbs +++ b/sig/finch_api/models/hris/pay_statement.rbs @@ -138,31 +138,14 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Earning::type_] end - type attributes = - { - metadata: FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata - } + type attributes = { metadata: ::Hash[Symbol, top?] } class Attributes < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata + attr_accessor metadata: ::Hash[Symbol, top?] - def initialize: ( - metadata: FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata - ) -> void + def initialize: (metadata: ::Hash[Symbol, top?]) -> void - def to_hash: -> { - metadata: FinchAPI::HRIS::PayStatement::Earning::Attributes::Metadata - } - - type metadata = { metadata: ::Hash[Symbol, top?] } - - class Metadata < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: ::Hash[Symbol, top?] - - def initialize: (metadata: ::Hash[Symbol, top?]) -> void - - def to_hash: -> { metadata: ::Hash[Symbol, top?] } - end + def to_hash: -> { metadata: ::Hash[Symbol, top?] } end end @@ -207,31 +190,14 @@ module FinchAPI attributes: FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes? } - type attributes = - { - metadata: FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - } + type attributes = { metadata: ::Hash[Symbol, top?] } class Attributes < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - - def initialize: ( - metadata: FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - ) -> void - - def to_hash: -> { - metadata: FinchAPI::HRIS::PayStatement::EmployeeDeduction::Attributes::Metadata - } - - type metadata = { metadata: ::Hash[Symbol, top?] } - - class Metadata < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: ::Hash[Symbol, top?] + attr_accessor metadata: ::Hash[Symbol, top?] - def initialize: (metadata: ::Hash[Symbol, top?]) -> void + def initialize: (metadata: ::Hash[Symbol, top?]) -> void - def to_hash: -> { metadata: ::Hash[Symbol, top?] } - end + def to_hash: -> { metadata: ::Hash[Symbol, top?] } end end @@ -271,31 +237,14 @@ module FinchAPI attributes: FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes? } - type attributes = - { - metadata: FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata - } + type attributes = { metadata: ::Hash[Symbol, top?] } class Attributes < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata + attr_accessor metadata: ::Hash[Symbol, top?] - def initialize: ( - metadata: FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata - ) -> void + def initialize: (metadata: ::Hash[Symbol, top?]) -> void - def to_hash: -> { - metadata: FinchAPI::HRIS::PayStatement::EmployerContribution::Attributes::Metadata - } - - type metadata = { metadata: ::Hash[Symbol, top?] } - - class Metadata < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: ::Hash[Symbol, top?] - - def initialize: (metadata: ::Hash[Symbol, top?]) -> void - - def to_hash: -> { metadata: ::Hash[Symbol, top?] } - end + def to_hash: -> { metadata: ::Hash[Symbol, top?] } end end @@ -365,31 +314,14 @@ module FinchAPI def self?.values: -> ::Array[FinchAPI::Models::HRIS::PayStatement::Tax::type_] end - type attributes = - { - metadata: FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata - } + type attributes = { metadata: ::Hash[Symbol, top?] } class Attributes < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata - - def initialize: ( - metadata: FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata - ) -> void - - def to_hash: -> { - metadata: FinchAPI::HRIS::PayStatement::Tax::Attributes::Metadata - } - - type metadata = { metadata: ::Hash[Symbol, top?] } - - class Metadata < FinchAPI::Internal::Type::BaseModel - attr_accessor metadata: ::Hash[Symbol, top?] + attr_accessor metadata: ::Hash[Symbol, top?] - def initialize: (metadata: ::Hash[Symbol, top?]) -> void + def initialize: (metadata: ::Hash[Symbol, top?]) -> void - def to_hash: -> { metadata: ::Hash[Symbol, top?] } - end + def to_hash: -> { metadata: ::Hash[Symbol, top?] } end end diff --git a/sig/finch_api/resources/access_tokens.rbs b/sig/finch_api/resources/access_tokens.rbs index 028f71d9..a5c143c4 100644 --- a/sig/finch_api/resources/access_tokens.rbs +++ b/sig/finch_api/resources/access_tokens.rbs @@ -2,9 +2,9 @@ module FinchAPI module Resources class AccessTokens def create: ( - client_id: String, - client_secret: String, code: String, + ?client_id: String, + ?client_secret: String, ?redirect_uri: String, ?request_options: FinchAPI::request_opts ) -> FinchAPI::CreateAccessTokenResponse diff --git a/test/finch_api/resources/access_tokens_test.rb b/test/finch_api/resources/access_tokens_test.rb index 6507a773..766e8cf7 100644 --- a/test/finch_api/resources/access_tokens_test.rb +++ b/test/finch_api/resources/access_tokens_test.rb @@ -4,12 +4,7 @@ class FinchAPI::Test::Resources::AccessTokensTest < FinchAPI::Test::ResourceTest def test_create_required_params - response = - @finch.access_tokens.create( - client_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - client_secret: "client_secret", - code: "code" - ) + response = @finch.access_tokens.create(code: "code") assert_pattern do response => FinchAPI::CreateAccessTokenResponse