From 17ddacf1c78a6f3e52a2f007d8efebab892db46e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 18:13:07 +0000 Subject: [PATCH 1/3] feat: expose response headers for both streams and errors --- lib/increase/errors.rb | 36 +++++++++++++------ lib/increase/internal/page.rb | 2 +- .../internal/transport/base_client.rb | 18 ++++++---- lib/increase/internal/type/base_page.rb | 2 +- lib/increase/internal/util.rb | 2 +- rbi/increase/errors.rbi | 31 ++++++++++++++-- .../internal/transport/base_client.rbi | 9 +++-- rbi/increase/internal/type/base_page.rbi | 2 +- rbi/increase/internal/util.rbi | 2 +- sig/increase/errors.rbs | 7 ++++ 10 files changed, 81 insertions(+), 30 deletions(-) diff --git a/lib/increase/errors.rb b/lib/increase/errors.rb index ae9d305c8..320ad4c35 100644 --- a/lib/increase/errors.rb +++ b/lib/increase/errors.rb @@ -40,6 +40,9 @@ class APIError < Increase::Errors::Error # @return [Integer, nil] attr_accessor :status + # @return [Hash{String=>String}, nil] + attr_accessor :headers + # @return [Object, nil] attr_accessor :body @@ -47,13 +50,15 @@ class APIError < Increase::Errors::Error # # @param url [URI::Generic] # @param status [Integer, nil] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] - def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) + def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil) @url = url @status = status + @headers = headers @body = body @request = request @response = response @@ -74,6 +79,7 @@ class APIConnectionError < Increase::Errors::APIError # # @param url [URI::Generic] # @param status [nil] + # @param headers [Hash{String=>String}, nil] # @param body [nil] # @param request [nil] # @param response [nil] @@ -81,6 +87,7 @@ class APIConnectionError < Increase::Errors::APIError def initialize( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -95,6 +102,7 @@ class APITimeoutError < Increase::Errors::APIConnectionError # # @param url [URI::Generic] # @param status [nil] + # @param headers [Hash{String=>String}, nil] # @param body [nil] # @param request [nil] # @param response [nil] @@ -102,6 +110,7 @@ class APITimeoutError < Increase::Errors::APIConnectionError def initialize( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -116,22 +125,25 @@ class APIStatusError < Increase::Errors::APIError # # @param url [URI::Generic] # @param status [Integer] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] # # @return [self] - def self.for(url:, status:, body:, request:, response:, message: nil) + def self.for(url:, status:, headers:, body:, request:, response:, message: nil) key = Increase::Internal::Util.dig(body, :type) - kwargs = { - url: url, - status: status, - body: body, - request: request, - response: response, - message: message - } + kwargs = + { + url: url, + status: status, + headers: headers, + body: body, + request: request, + response: response, + message: message + } case [status, key] in [400, Increase::Errors::InvalidParametersError::TYPE] @@ -185,15 +197,17 @@ def self.for(url:, status:, body:, request:, response:, message: nil) # # @param url [URI::Generic] # @param status [Integer] + # @param headers [Hash{String=>String}, nil] # @param body [Object, nil] # @param request [nil] # @param response [nil] # @param message [String, nil] - def initialize(url:, status:, body:, request:, response:, message: nil) + def initialize(url:, status:, headers:, body:, request:, response:, message: nil) message ||= {url: url.to_s, status: status, body: body} super( url: url, status: status, + headers: headers, body: body, request: request, response: response, diff --git a/lib/increase/internal/page.rb b/lib/increase/internal/page.rb index fd1bd80b4..aee3a8821 100644 --- a/lib/increase/internal/page.rb +++ b/lib/increase/internal/page.rb @@ -60,7 +60,7 @@ def auto_paging_each(&blk) # # @param client [Increase::Internal::Transport::BaseClient] # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param page_data [Hash{Symbol=>Object}] def initialize(client:, req:, headers:, page_data:) super diff --git a/lib/increase/internal/transport/base_client.rb b/lib/increase/internal/transport/base_client.rb index 5f39af181..16a2cf02d 100644 --- a/lib/increase/internal/transport/base_client.rb +++ b/lib/increase/internal/transport/base_client.rb @@ -47,7 +47,7 @@ def validate!(req) # @api private # # @param status [Integer] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # # @return [Boolean] def should_retry?(status, headers:) @@ -85,7 +85,7 @@ def should_retry?(status, headers:) # # @param status [Integer] # - # @param response_headers [Hash{String=>String}, Net::HTTPHeader] + # @param response_headers [Hash{String=>String}] # # @return [Hash{Symbol=>Object}] def follow_redirect(request, status:, response_headers:) @@ -378,6 +378,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) rescue Increase::Errors::APIConnectionError => e status = e end + headers = Increase::Internal::Util.normalized_headers(response&.each_header&.to_h) case status in ..299 @@ -390,7 +391,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) in 300..399 self.class.reap_connection!(status, stream: stream) - request = self.class.follow_redirect(request, status: status, response_headers: response) + request = self.class.follow_redirect(request, status: status, response_headers: headers) send_request( request, redirect_count: redirect_count + 1, @@ -399,9 +400,9 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) ) in Increase::Errors::APIConnectionError if retry_count >= max_retries raise status - in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response) + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers) decoded = Kernel.then do - Increase::Internal::Util.decode_content(response, stream: stream, suppress_error: true) + Increase::Internal::Util.decode_content(headers, stream: stream, suppress_error: true) ensure self.class.reap_connection!(status, stream: stream) end @@ -409,6 +410,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:) raise Increase::Errors::APIStatusError.for( url: url, status: status, + headers: headers, body: decoded, request: nil, response: response @@ -485,19 +487,21 @@ def request(req) send_retry_header: send_retry_header ) - decoded = Increase::Internal::Util.decode_content(response, stream: stream) + headers = Increase::Internal::Util.normalized_headers(response.each_header.to_h) + decoded = Increase::Internal::Util.decode_content(headers, stream: stream) case req in {stream: Class => st} st.new( model: model, url: url, status: status, + headers: headers, response: response, unwrap: unwrap, stream: decoded ) in {page: Class => page} - page.new(client: self, req: req, headers: response, page_data: decoded) + page.new(client: self, req: req, headers: headers, page_data: decoded) else unwrapped = Increase::Internal::Util.dig(decoded, unwrap) Increase::Internal::Type::Converter.coerce(model, unwrapped) diff --git a/lib/increase/internal/type/base_page.rb b/lib/increase/internal/type/base_page.rb index df453f6df..b1dbc7a9d 100644 --- a/lib/increase/internal/type/base_page.rb +++ b/lib/increase/internal/type/base_page.rb @@ -39,7 +39,7 @@ def to_enum = super(:auto_paging_each) # # @param client [Increase::Internal::Transport::BaseClient] # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param page_data [Object] def initialize(client:, req:, headers:, page_data:) @client = client diff --git a/lib/increase/internal/util.rb b/lib/increase/internal/util.rb index 76aa92182..acece214d 100644 --- a/lib/increase/internal/util.rb +++ b/lib/increase/internal/util.rb @@ -647,7 +647,7 @@ def force_charset!(content_type, text:) # # Assumes each chunk in stream has `Encoding::BINARY`. # - # @param headers [Hash{String=>String}, Net::HTTPHeader] + # @param headers [Hash{String=>String}] # @param stream [Enumerable] # @param suppress_error [Boolean] # diff --git a/rbi/increase/errors.rbi b/rbi/increase/errors.rbi index 13258bfb8..43f9fae39 100644 --- a/rbi/increase/errors.rbi +++ b/rbi/increase/errors.rbi @@ -33,6 +33,9 @@ module Increase sig { returns(T.nilable(Integer)) } attr_accessor :status + sig { returns(T.nilable(T::Hash[String, String])) } + attr_accessor :headers + sig { returns(T.nilable(T.anything)) } attr_accessor :body @@ -41,6 +44,7 @@ module Increase params( url: URI::Generic, status: T.nilable(Integer), + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, @@ -50,6 +54,7 @@ module Increase def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -70,6 +75,7 @@ module Increase params( url: URI::Generic, status: NilClass, + headers: T.nilable(T::Hash[String, String]), body: NilClass, request: NilClass, response: NilClass, @@ -79,6 +85,7 @@ module Increase def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -93,6 +100,7 @@ module Increase params( url: URI::Generic, status: NilClass, + headers: T.nilable(T::Hash[String, String]), body: NilClass, request: NilClass, response: NilClass, @@ -102,6 +110,7 @@ module Increase def self.new( url:, status: nil, + headers: nil, body: nil, request: nil, response: nil, @@ -116,13 +125,22 @@ module Increase params( url: URI::Generic, status: Integer, + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, message: T.nilable(String) ).returns(T.attached_class) end - def self.for(url:, status:, body:, request:, response:, message: nil) + def self.for( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) end sig { returns(Integer) } @@ -133,13 +151,22 @@ module Increase params( url: URI::Generic, status: Integer, + headers: T.nilable(T::Hash[String, String]), body: T.nilable(Object), request: NilClass, response: NilClass, message: T.nilable(String) ).returns(T.attached_class) end - def self.new(url:, status:, body:, request:, response:, message: nil) + def self.new( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) end end diff --git a/rbi/increase/internal/transport/base_client.rbi b/rbi/increase/internal/transport/base_client.rbi index 84a7fe95d..4e9a0b498 100644 --- a/rbi/increase/internal/transport/base_client.rbi +++ b/rbi/increase/internal/transport/base_client.rbi @@ -84,10 +84,9 @@ module Increase # @api private sig do - params( - status: Integer, - headers: T.any(T::Hash[String, String], Net::HTTPHeader) - ).returns(T::Boolean) + params(status: Integer, headers: T::Hash[String, String]).returns( + T::Boolean + ) end def should_retry?(status, headers:) end @@ -97,7 +96,7 @@ module Increase params( request: Increase::Internal::Transport::BaseClient::RequestInput, status: Integer, - response_headers: T.any(T::Hash[String, String], Net::HTTPHeader) + response_headers: T::Hash[String, String] ).returns(Increase::Internal::Transport::BaseClient::RequestInput) end def follow_redirect(request, status:, response_headers:) diff --git a/rbi/increase/internal/type/base_page.rbi b/rbi/increase/internal/type/base_page.rbi index e6521378b..b8cc45891 100644 --- a/rbi/increase/internal/type/base_page.rbi +++ b/rbi/increase/internal/type/base_page.rbi @@ -30,7 +30,7 @@ module Increase params( client: Increase::Internal::Transport::BaseClient, req: Increase::Internal::Transport::BaseClient::RequestComponents, - headers: T.any(T::Hash[String, String], Net::HTTPHeader), + headers: T::Hash[String, String], page_data: T.anything ).void end diff --git a/rbi/increase/internal/util.rbi b/rbi/increase/internal/util.rbi index 5979a448f..483a69e1e 100644 --- a/rbi/increase/internal/util.rbi +++ b/rbi/increase/internal/util.rbi @@ -361,7 +361,7 @@ module Increase # Assumes each chunk in stream has `Encoding::BINARY`. sig do params( - headers: T.any(T::Hash[String, String], Net::HTTPHeader), + headers: T::Hash[String, String], stream: T::Enumerable[String], suppress_error: T::Boolean ).returns(T.anything) diff --git a/sig/increase/errors.rbs b/sig/increase/errors.rbs index f477a95bc..7c49d932c 100644 --- a/sig/increase/errors.rbs +++ b/sig/increase/errors.rbs @@ -21,11 +21,14 @@ module Increase attr_accessor status: Integer? + attr_accessor headers: ::Hash[String, String]? + attr_accessor body: top? def initialize: ( url: URI::Generic, ?status: Integer?, + ?headers: ::Hash[String, String]?, ?body: Object?, ?request: nil, ?response: nil, @@ -37,6 +40,7 @@ module Increase def initialize: ( url: URI::Generic, ?status: nil, + ?headers: ::Hash[String, String]?, ?body: nil, ?request: nil, ?response: nil, @@ -48,6 +52,7 @@ module Increase def initialize: ( url: URI::Generic, ?status: nil, + ?headers: ::Hash[String, String]?, ?body: nil, ?request: nil, ?response: nil, @@ -59,6 +64,7 @@ module Increase def self.for: ( url: URI::Generic, status: Integer, + headers: ::Hash[String, String]?, body: Object?, request: nil, response: nil, @@ -68,6 +74,7 @@ module Increase def initialize: ( url: URI::Generic, status: Integer, + headers: ::Hash[String, String]?, body: Object?, request: nil, response: nil, From d16cb6abc1e6f4ca71d86374cde091360d657602 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 22:36:17 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 8 +- lib/increase.rb | 7 - lib/increase/client.rb | 4 - lib/increase/models.rb | 8 - lib/increase/models/card_dispute.rb | 302 ------------- .../models/card_dispute_create_params.rb | 45 -- .../models/card_dispute_list_params.rb | 144 ------ .../models/card_dispute_retrieve_params.rb | 14 - .../simulations/card_dispute_action_params.rb | 55 --- lib/increase/models/transaction.rb | 30 +- lib/increase/resources/card_disputes.rb | 97 ---- lib/increase/resources/simulations.rb | 4 - .../resources/simulations/card_disputes.rb | 45 -- rbi/increase/client.rbi | 3 - rbi/increase/models.rbi | 8 - rbi/increase/models/card_dispute.rbi | 425 ------------------ .../models/card_dispute_create_params.rbi | 70 --- .../models/card_dispute_list_params.rbi | 289 ------------ .../models/card_dispute_retrieve_params.rbi | 30 -- .../card_dispute_action_params.rbi | 124 ----- rbi/increase/models/transaction.rbi | 44 +- rbi/increase/resources/card_disputes.rbi | 78 ---- rbi/increase/resources/simulations.rbi | 3 - .../resources/simulations/card_disputes.rbi | 38 -- sig/increase/client.rbs | 2 - sig/increase/models.rbs | 8 - sig/increase/models/card_dispute.rbs | 207 --------- .../models/card_dispute_create_params.rbs | 34 -- .../models/card_dispute_list_params.rbs | 146 ------ .../models/card_dispute_retrieve_params.rbs | 15 - .../card_dispute_action_params.rbs | 59 --- sig/increase/models/transaction.rbs | 32 +- sig/increase/resources/card_disputes.rbs | 28 -- sig/increase/resources/simulations.rbs | 2 - .../resources/simulations/card_disputes.rbs | 16 - test/increase/resources/card_disputes_test.rb | 91 ---- .../simulations/card_disputes_test.rb | 30 -- 37 files changed, 16 insertions(+), 2529 deletions(-) delete mode 100644 lib/increase/models/card_dispute.rb delete mode 100644 lib/increase/models/card_dispute_create_params.rb delete mode 100644 lib/increase/models/card_dispute_list_params.rb delete mode 100644 lib/increase/models/card_dispute_retrieve_params.rb delete mode 100644 lib/increase/models/simulations/card_dispute_action_params.rb delete mode 100644 lib/increase/resources/card_disputes.rb delete mode 100644 lib/increase/resources/simulations/card_disputes.rb delete mode 100644 rbi/increase/models/card_dispute.rbi delete mode 100644 rbi/increase/models/card_dispute_create_params.rbi delete mode 100644 rbi/increase/models/card_dispute_list_params.rbi delete mode 100644 rbi/increase/models/card_dispute_retrieve_params.rbi delete mode 100644 rbi/increase/models/simulations/card_dispute_action_params.rbi delete mode 100644 rbi/increase/resources/card_disputes.rbi delete mode 100644 rbi/increase/resources/simulations/card_disputes.rbi delete mode 100644 sig/increase/models/card_dispute.rbs delete mode 100644 sig/increase/models/card_dispute_create_params.rbs delete mode 100644 sig/increase/models/card_dispute_list_params.rbs delete mode 100644 sig/increase/models/card_dispute_retrieve_params.rbs delete mode 100644 sig/increase/models/simulations/card_dispute_action_params.rbs delete mode 100644 sig/increase/resources/card_disputes.rbs delete mode 100644 sig/increase/resources/simulations/card_disputes.rbs delete mode 100644 test/increase/resources/card_disputes_test.rb delete mode 100644 test/increase/resources/simulations/card_disputes_test.rb diff --git a/.stats.yml b/.stats.yml index 14e640b1e..f6bbc76b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-61210b27ac135ed841515ad3c3dfedaf42dc1398b0a3ed63bbd6c154d1b31a6a.yml -openapi_spec_hash: b0d2957f6269776252f0ddaa6489772a -config_hash: e1885b38eded054b77308a024c5d80cc +configured_endpoints: 213 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fc17d091731928c882b2272ea5de831cafcbf237a7887652a5f133c29cb1bbc4.yml +openapi_spec_hash: aad429d087b7557be4103d1309cd81a0 +config_hash: e1e8bc2138a13f290956ae6687f099cd diff --git a/lib/increase.rb b/lib/increase.rb index aed6ea993..a0b564884 100644 --- a/lib/increase.rb +++ b/lib/increase.rb @@ -101,10 +101,6 @@ require_relative "increase/models/card_create_params" require_relative "increase/models/card_details" require_relative "increase/models/card_details_params" -require_relative "increase/models/card_dispute" -require_relative "increase/models/card_dispute_create_params" -require_relative "increase/models/card_dispute_list_params" -require_relative "increase/models/card_dispute_retrieve_params" require_relative "increase/models/card_iframe_url" require_relative "increase/models/card_list_params" require_relative "increase/models/card_payment" @@ -284,7 +280,6 @@ require_relative "increase/models/simulations/card_authorization_create_params" require_relative "increase/models/simulations/card_authorization_create_response" require_relative "increase/models/simulations/card_authorization_expiration_create_params" -require_relative "increase/models/simulations/card_dispute_action_params" require_relative "increase/models/simulations/card_fuel_confirmation_create_params" require_relative "increase/models/simulations/card_increment_create_params" require_relative "increase/models/simulations/card_refund_create_params" @@ -339,7 +334,6 @@ require_relative "increase/resources/bookkeeping_accounts" require_relative "increase/resources/bookkeeping_entries" require_relative "increase/resources/bookkeeping_entry_sets" -require_relative "increase/resources/card_disputes" require_relative "increase/resources/card_payments" require_relative "increase/resources/card_purchase_supplements" require_relative "increase/resources/card_push_transfers" @@ -386,7 +380,6 @@ require_relative "increase/resources/simulations/ach_transfers" require_relative "increase/resources/simulations/card_authorization_expirations" require_relative "increase/resources/simulations/card_authorizations" -require_relative "increase/resources/simulations/card_disputes" require_relative "increase/resources/simulations/card_fuel_confirmations" require_relative "increase/resources/simulations/card_increments" require_relative "increase/resources/simulations/card_refunds" diff --git a/lib/increase/client.rb b/lib/increase/client.rb index d81709908..87262758d 100644 --- a/lib/increase/client.rb +++ b/lib/increase/client.rb @@ -41,9 +41,6 @@ class Client < Increase::Internal::Transport::BaseClient # @return [Increase::Resources::CardPurchaseSupplements] attr_reader :card_purchase_supplements - # @return [Increase::Resources::CardDisputes] - attr_reader :card_disputes - # @return [Increase::Resources::PhysicalCards] attr_reader :physical_cards @@ -256,7 +253,6 @@ def initialize( @cards = Increase::Resources::Cards.new(client: self) @card_payments = Increase::Resources::CardPayments.new(client: self) @card_purchase_supplements = Increase::Resources::CardPurchaseSupplements.new(client: self) - @card_disputes = Increase::Resources::CardDisputes.new(client: self) @physical_cards = Increase::Resources::PhysicalCards.new(client: self) @digital_card_profiles = Increase::Resources::DigitalCardProfiles.new(client: self) @physical_card_profiles = Increase::Resources::PhysicalCardProfiles.new(client: self) diff --git a/lib/increase/models.rb b/lib/increase/models.rb index 8d70eb83c..bf804f132 100644 --- a/lib/increase/models.rb +++ b/lib/increase/models.rb @@ -139,14 +139,6 @@ module Increase CardDetailsParams = Increase::Models::CardDetailsParams - CardDispute = Increase::Models::CardDispute - - CardDisputeCreateParams = Increase::Models::CardDisputeCreateParams - - CardDisputeListParams = Increase::Models::CardDisputeListParams - - CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams - CardIframeURL = Increase::Models::CardIframeURL CardListParams = Increase::Models::CardListParams diff --git a/lib/increase/models/card_dispute.rb b/lib/increase/models/card_dispute.rb deleted file mode 100644 index ea51948cb..000000000 --- a/lib/increase/models/card_dispute.rb +++ /dev/null @@ -1,302 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Models - # @see Increase::Resources::CardDisputes#create - class CardDispute < Increase::Internal::Type::BaseModel - # @!attribute id - # The Card Dispute identifier. - # - # @return [String] - required :id, String - - # @!attribute acceptance - # If the Card Dispute's status is `accepted`, this will contain details of the - # successful dispute. - # - # @return [Increase::Models::CardDispute::Acceptance, nil] - required :acceptance, -> { Increase::CardDispute::Acceptance }, nil?: true - - # @!attribute amount - # The amount of the dispute, if provided, or the transaction amount otherwise. - # - # @return [Integer, nil] - required :amount, Integer, nil?: true - - # @!attribute created_at - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was created. - # - # @return [Time] - required :created_at, Time - - # @!attribute disputed_transaction_id - # The identifier of the Transaction that was disputed. - # - # @return [String] - required :disputed_transaction_id, String - - # @!attribute explanation - # Why you disputed the Transaction in question. - # - # @return [String] - required :explanation, String - - # @!attribute idempotency_key - # The idempotency key you chose for this object. This value is unique across - # Increase and is used to ensure that a request is only processed once. Learn more - # about [idempotency](https://increase.com/documentation/idempotency-keys). - # - # @return [String, nil] - required :idempotency_key, String, nil?: true - - # @!attribute loss - # If the Card Dispute's status is `lost`, this will contain details of the lost - # dispute. - # - # @return [Increase::Models::CardDispute::Loss, nil] - required :loss, -> { Increase::CardDispute::Loss }, nil?: true - - # @!attribute rejection - # If the Card Dispute's status is `rejected`, this will contain details of the - # unsuccessful dispute. - # - # @return [Increase::Models::CardDispute::Rejection, nil] - required :rejection, -> { Increase::CardDispute::Rejection }, nil?: true - - # @!attribute status - # The results of the Dispute investigation. - # - # @return [Symbol, Increase::Models::CardDispute::Status] - required :status, enum: -> { Increase::CardDispute::Status } - - # @!attribute type - # A constant representing the object's type. For this resource it will always be - # `card_dispute`. - # - # @return [Symbol, Increase::Models::CardDispute::Type] - required :type, enum: -> { Increase::CardDispute::Type } - - # @!attribute win - # If the Card Dispute's status is `won`, this will contain details of the won - # dispute. - # - # @return [Increase::Models::CardDispute::Win, nil] - required :win, -> { Increase::CardDispute::Win }, nil?: true - - # @!method initialize(id:, acceptance:, amount:, created_at:, disputed_transaction_id:, explanation:, idempotency_key:, loss:, rejection:, status:, type:, win:) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDispute} for more details. - # - # If unauthorized activity occurs on a card, you can create a Card Dispute and - # we'll return the funds if appropriate. - # - # @param id [String] The Card Dispute identifier. - # - # @param acceptance [Increase::Models::CardDispute::Acceptance, nil] If the Card Dispute's status is `accepted`, this will contain details of the suc - # - # @param amount [Integer, nil] The amount of the dispute, if provided, or the transaction amount otherwise. - # - # @param created_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th - # - # @param disputed_transaction_id [String] The identifier of the Transaction that was disputed. - # - # @param explanation [String] Why you disputed the Transaction in question. - # - # @param idempotency_key [String, nil] The idempotency key you chose for this object. This value is unique across Incre - # - # @param loss [Increase::Models::CardDispute::Loss, nil] If the Card Dispute's status is `lost`, this will contain details of the lost di - # - # @param rejection [Increase::Models::CardDispute::Rejection, nil] If the Card Dispute's status is `rejected`, this will contain details of the uns - # - # @param status [Symbol, Increase::Models::CardDispute::Status] The results of the Dispute investigation. - # - # @param type [Symbol, Increase::Models::CardDispute::Type] A constant representing the object's type. For this resource it will always be ` - # - # @param win [Increase::Models::CardDispute::Win, nil] If the Card Dispute's status is `won`, this will contain details of the won disp - - # @see Increase::Models::CardDispute#acceptance - class Acceptance < Increase::Internal::Type::BaseModel - # @!attribute accepted_at - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was accepted. - # - # @return [Time] - required :accepted_at, Time - - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was accepted. - # - # @return [String] - required :card_dispute_id, String - - # @!attribute transaction_id - # The identifier of the Transaction that was created to return the disputed funds - # to your account. - # - # @return [String] - required :transaction_id, String - - # @!method initialize(accepted_at:, card_dispute_id:, transaction_id:) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDispute::Acceptance} for more details. - # - # If the Card Dispute's status is `accepted`, this will contain details of the - # successful dispute. - # - # @param accepted_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th - # - # @param card_dispute_id [String] The identifier of the Card Dispute that was accepted. - # - # @param transaction_id [String] The identifier of the Transaction that was created to return the disputed funds - end - - # @see Increase::Models::CardDispute#loss - class Loss < Increase::Internal::Type::BaseModel - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was lost. - # - # @return [String] - required :card_dispute_id, String - - # @!attribute explanation - # Why the Card Dispute was lost. - # - # @return [String] - required :explanation, String - - # @!attribute lost_at - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was lost. - # - # @return [Time] - required :lost_at, Time - - # @!attribute transaction_id - # The identifier of the Transaction that was created to debit the disputed funds - # from your account. - # - # @return [String] - required :transaction_id, String - - # @!method initialize(card_dispute_id:, explanation:, lost_at:, transaction_id:) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDispute::Loss} for more details. - # - # If the Card Dispute's status is `lost`, this will contain details of the lost - # dispute. - # - # @param card_dispute_id [String] The identifier of the Card Dispute that was lost. - # - # @param explanation [String] Why the Card Dispute was lost. - # - # @param lost_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th - # - # @param transaction_id [String] The identifier of the Transaction that was created to debit the disputed funds f - end - - # @see Increase::Models::CardDispute#rejection - class Rejection < Increase::Internal::Type::BaseModel - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was rejected. - # - # @return [String] - required :card_dispute_id, String - - # @!attribute explanation - # Why the Card Dispute was rejected. - # - # @return [String] - required :explanation, String - - # @!attribute rejected_at - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was rejected. - # - # @return [Time] - required :rejected_at, Time - - # @!method initialize(card_dispute_id:, explanation:, rejected_at:) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDispute::Rejection} for more details. - # - # If the Card Dispute's status is `rejected`, this will contain details of the - # unsuccessful dispute. - # - # @param card_dispute_id [String] The identifier of the Card Dispute that was rejected. - # - # @param explanation [String] Why the Card Dispute was rejected. - # - # @param rejected_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th - end - - # The results of the Dispute investigation. - # - # @see Increase::Models::CardDispute#status - module Status - extend Increase::Internal::Type::Enum - - # The Card Dispute is pending review. - PENDING_REVIEWING = :pending_reviewing - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = :accepted - - # The Card Dispute has been rejected. - REJECTED = :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = :lost - - # The Card Dispute has been won and no further action can be taken. - WON = :won - - # @!method self.values - # @return [Array] - end - - # A constant representing the object's type. For this resource it will always be - # `card_dispute`. - # - # @see Increase::Models::CardDispute#type - module Type - extend Increase::Internal::Type::Enum - - CARD_DISPUTE = :card_dispute - - # @!method self.values - # @return [Array] - end - - # @see Increase::Models::CardDispute#win - class Win < Increase::Internal::Type::BaseModel - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was won. - # - # @return [String] - required :card_dispute_id, String - - # @!attribute won_at - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was won. - # - # @return [Time] - required :won_at, Time - - # @!method initialize(card_dispute_id:, won_at:) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDispute::Win} for more details. - # - # If the Card Dispute's status is `won`, this will contain details of the won - # dispute. - # - # @param card_dispute_id [String] The identifier of the Card Dispute that was won. - # - # @param won_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th - end - end - end -end diff --git a/lib/increase/models/card_dispute_create_params.rb b/lib/increase/models/card_dispute_create_params.rb deleted file mode 100644 index 40a5bfa10..000000000 --- a/lib/increase/models/card_dispute_create_params.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Models - # @see Increase::Resources::CardDisputes#create - class CardDisputeCreateParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - # @!attribute disputed_transaction_id - # The Transaction you wish to dispute. This Transaction must have a `source_type` - # of `card_settlement`. - # - # @return [String] - required :disputed_transaction_id, String - - # @!attribute explanation - # Why you are disputing this Transaction. - # - # @return [String] - required :explanation, String - - # @!attribute amount - # The monetary amount of the part of the transaction that is being disputed. This - # is optional and will default to the full amount of the transaction if not - # provided. If provided, the amount must be less than or equal to the amount of - # the transaction. - # - # @return [Integer, nil] - optional :amount, Integer - - # @!method initialize(disputed_transaction_id:, explanation:, amount: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeCreateParams} for more details. - # - # @param disputed_transaction_id [String] The Transaction you wish to dispute. This Transaction must have a `source_type` - # - # @param explanation [String] Why you are disputing this Transaction. - # - # @param amount [Integer] The monetary amount of the part of the transaction that is being disputed. This - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/increase/models/card_dispute_list_params.rb b/lib/increase/models/card_dispute_list_params.rb deleted file mode 100644 index a37f90a0b..000000000 --- a/lib/increase/models/card_dispute_list_params.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Models - # @see Increase::Resources::CardDisputes#list - class CardDisputeListParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - # @!attribute created_at - # - # @return [Increase::Models::CardDisputeListParams::CreatedAt, nil] - optional :created_at, -> { Increase::CardDisputeListParams::CreatedAt } - - # @!attribute cursor - # Return the page of entries after this one. - # - # @return [String, nil] - optional :cursor, String - - # @!attribute idempotency_key - # Filter records to the one with the specified `idempotency_key` you chose for - # that object. This value is unique across Increase and is used to ensure that a - # request is only processed once. Learn more about - # [idempotency](https://increase.com/documentation/idempotency-keys). - # - # @return [String, nil] - optional :idempotency_key, String - - # @!attribute limit - # Limit the size of the list that is returned. The default (and maximum) is 100 - # objects. - # - # @return [Integer, nil] - optional :limit, Integer - - # @!attribute status - # - # @return [Increase::Models::CardDisputeListParams::Status, nil] - optional :status, -> { Increase::CardDisputeListParams::Status } - - # @!method initialize(created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeListParams} for more details. - # - # @param created_at [Increase::Models::CardDisputeListParams::CreatedAt] - # - # @param cursor [String] Return the page of entries after this one. - # - # @param idempotency_key [String] Filter records to the one with the specified `idempotency_key` you chose for tha - # - # @param limit [Integer] Limit the size of the list that is returned. The default (and maximum) is 100 ob - # - # @param status [Increase::Models::CardDisputeListParams::Status] - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] - - class CreatedAt < Increase::Internal::Type::BaseModel - # @!attribute after - # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - # - # @return [Time, nil] - optional :after, Time - - # @!attribute before - # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - # - # @return [Time, nil] - optional :before, Time - - # @!attribute on_or_after - # Return results on or after this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - # - # @return [Time, nil] - optional :on_or_after, Time - - # @!attribute on_or_before - # Return results on or before this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - # - # @return [Time, nil] - optional :on_or_before, Time - - # @!method initialize(after: nil, before: nil, on_or_after: nil, on_or_before: nil) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeListParams::CreatedAt} for more details. - # - # @param after [Time] Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) tim - # - # @param before [Time] Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ti - # - # @param on_or_after [Time] Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_860 - # - # @param on_or_before [Time] Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_86 - end - - class Status < Increase::Internal::Type::BaseModel - # @!attribute in_ - # Filter Card Disputes for those with the specified status or statuses. For GET - # requests, this should be encoded as a comma-delimited string, such as - # `?in=one,two,three`. - # - # @return [Array, nil] - optional :in_, - -> { Increase::Internal::Type::ArrayOf[enum: Increase::CardDisputeListParams::Status::In] }, - api_name: :in - - # @!method initialize(in_: nil) - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeListParams::Status} for more details. - # - # @param in_ [Array] Filter Card Disputes for those with the specified status or statuses. For GET re - - module In - extend Increase::Internal::Type::Enum - - # The Card Dispute is pending review. - PENDING_REVIEWING = :pending_reviewing - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = :accepted - - # The Card Dispute has been rejected. - REJECTED = :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = :lost - - # The Card Dispute has been won and no further action can be taken. - WON = :won - - # @!method self.values - # @return [Array] - end - end - end - end -end diff --git a/lib/increase/models/card_dispute_retrieve_params.rb b/lib/increase/models/card_dispute_retrieve_params.rb deleted file mode 100644 index 6cf746d86..000000000 --- a/lib/increase/models/card_dispute_retrieve_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Models - # @see Increase::Resources::CardDisputes#retrieve - class CardDisputeRetrieveParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/increase/models/simulations/card_dispute_action_params.rb b/lib/increase/models/simulations/card_dispute_action_params.rb deleted file mode 100644 index 21033c1e4..000000000 --- a/lib/increase/models/simulations/card_dispute_action_params.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Models - module Simulations - # @see Increase::Resources::Simulations::CardDisputes#action - class CardDisputeActionParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - # @!attribute status - # The status to move the dispute to. - # - # @return [Symbol, Increase::Models::Simulations::CardDisputeActionParams::Status] - required :status, enum: -> { Increase::Simulations::CardDisputeActionParams::Status } - - # @!attribute explanation - # Why the dispute was rejected. Not required for accepting disputes. - # - # @return [String, nil] - optional :explanation, String - - # @!method initialize(status:, explanation: nil, request_options: {}) - # @param status [Symbol, Increase::Models::Simulations::CardDisputeActionParams::Status] The status to move the dispute to. - # - # @param explanation [String] Why the dispute was rejected. Not required for accepting disputes. - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] - - # The status to move the dispute to. - module Status - extend Increase::Internal::Type::Enum - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = :accepted - - # The Card Dispute has been rejected. - REJECTED = :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = :lost - - # The Card Dispute has been won and no further action can be taken. - WON = :won - - # @!method self.values - # @return [Array] - end - end - end - end -end diff --git a/lib/increase/models/transaction.rb b/lib/increase/models/transaction.rb index 0a0081a5d..346e46369 100644 --- a/lib/increase/models/transaction.rb +++ b/lib/increase/models/transaction.rb @@ -1108,12 +1108,6 @@ class CardDisputeAcceptance < Increase::Internal::Type::BaseModel # @return [Time] required :accepted_at, Time - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was accepted. - # - # @return [String] - required :card_dispute_id, String - # @!attribute transaction_id # The identifier of the Transaction that was created to return the disputed funds # to your account. @@ -1121,7 +1115,7 @@ class CardDisputeAcceptance < Increase::Internal::Type::BaseModel # @return [String] required :transaction_id, String - # @!method initialize(accepted_at:, card_dispute_id:, transaction_id:) + # @!method initialize(accepted_at:, transaction_id:) # Some parameter documentations has been truncated, see # {Increase::Models::Transaction::Source::CardDisputeAcceptance} for more details. # @@ -1131,8 +1125,6 @@ class CardDisputeAcceptance < Increase::Internal::Type::BaseModel # # @param accepted_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th # - # @param card_dispute_id [String] The identifier of the Card Dispute that was accepted. - # # @param transaction_id [String] The identifier of the Transaction that was created to return the disputed funds end @@ -1144,12 +1136,6 @@ class CardDisputeFinancial < Increase::Internal::Type::BaseModel # @return [Integer] required :amount, Integer - # @!attribute card_dispute_id - # The identifier of the Card Dispute the financial event is associated with. - # - # @return [String] - required :card_dispute_id, String - # @!attribute network # The network that the Card Dispute is associated with. # @@ -1171,7 +1157,7 @@ class CardDisputeFinancial < Increase::Internal::Type::BaseModel # @return [Increase::Models::Transaction::Source::CardDisputeFinancial::Visa, nil] required :visa, -> { Increase::Transaction::Source::CardDisputeFinancial::Visa }, nil?: true - # @!method initialize(amount:, card_dispute_id:, network:, transaction_id:, visa:) + # @!method initialize(amount:, network:, transaction_id:, visa:) # Some parameter documentations has been truncated, see # {Increase::Models::Transaction::Source::CardDisputeFinancial} for more details. # @@ -1181,8 +1167,6 @@ class CardDisputeFinancial < Increase::Internal::Type::BaseModel # # @param amount [Integer] The amount of the financial event. # - # @param card_dispute_id [String] The identifier of the Card Dispute the financial event is associated with. - # # @param network [Symbol, Increase::Models::Transaction::Source::CardDisputeFinancial::Network] The network that the Card Dispute is associated with. # # @param transaction_id [String] The identifier of the Transaction that was created to credit or debit the disput @@ -1252,12 +1236,6 @@ module EventType # @see Increase::Models::Transaction::Source#card_dispute_loss class CardDisputeLoss < Increase::Internal::Type::BaseModel - # @!attribute card_dispute_id - # The identifier of the Card Dispute that was lost. - # - # @return [String] - required :card_dispute_id, String - # @!attribute explanation # Why the Card Dispute was lost. # @@ -1278,7 +1256,7 @@ class CardDisputeLoss < Increase::Internal::Type::BaseModel # @return [String] required :transaction_id, String - # @!method initialize(card_dispute_id:, explanation:, lost_at:, transaction_id:) + # @!method initialize(explanation:, lost_at:, transaction_id:) # Some parameter documentations has been truncated, see # {Increase::Models::Transaction::Source::CardDisputeLoss} for more details. # @@ -1286,8 +1264,6 @@ class CardDisputeLoss < Increase::Internal::Type::BaseModel # and only if `category` is equal to `card_dispute_loss`. Contains the details of # a lost Card Dispute. # - # @param card_dispute_id [String] The identifier of the Card Dispute that was lost. - # # @param explanation [String] Why the Card Dispute was lost. # # @param lost_at [Time] The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which th diff --git a/lib/increase/resources/card_disputes.rb b/lib/increase/resources/card_disputes.rb deleted file mode 100644 index fe1977431..000000000 --- a/lib/increase/resources/card_disputes.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Resources - class CardDisputes - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeCreateParams} for more details. - # - # Create a Card Dispute - # - # @overload create(disputed_transaction_id:, explanation:, amount: nil, request_options: {}) - # - # @param disputed_transaction_id [String] The Transaction you wish to dispute. This Transaction must have a `source_type` - # - # @param explanation [String] Why you are disputing this Transaction. - # - # @param amount [Integer] The monetary amount of the part of the transaction that is being disputed. This - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Increase::Models::CardDispute] - # - # @see Increase::Models::CardDisputeCreateParams - def create(params) - parsed, options = Increase::CardDisputeCreateParams.dump_request(params) - @client.request( - method: :post, - path: "card_disputes", - body: parsed, - model: Increase::CardDispute, - options: options - ) - end - - # Retrieve a Card Dispute - # - # @overload retrieve(card_dispute_id, request_options: {}) - # - # @param card_dispute_id [String] The identifier of the Card Dispute. - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Increase::Models::CardDispute] - # - # @see Increase::Models::CardDisputeRetrieveParams - def retrieve(card_dispute_id, params = {}) - @client.request( - method: :get, - path: ["card_disputes/%1$s", card_dispute_id], - model: Increase::CardDispute, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {Increase::Models::CardDisputeListParams} for more details. - # - # List Card Disputes - # - # @overload list(created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, request_options: {}) - # - # @param created_at [Increase::Models::CardDisputeListParams::CreatedAt] - # - # @param cursor [String] Return the page of entries after this one. - # - # @param idempotency_key [String] Filter records to the one with the specified `idempotency_key` you chose for tha - # - # @param limit [Integer] Limit the size of the list that is returned. The default (and maximum) is 100 ob - # - # @param status [Increase::Models::CardDisputeListParams::Status] - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Increase::Internal::Page] - # - # @see Increase::Models::CardDisputeListParams - def list(params = {}) - parsed, options = Increase::CardDisputeListParams.dump_request(params) - @client.request( - method: :get, - path: "card_disputes", - query: parsed, - page: Increase::Internal::Page, - model: Increase::CardDispute, - options: options - ) - end - - # @api private - # - # @param client [Increase::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/increase/resources/simulations.rb b/lib/increase/resources/simulations.rb index 6eb775bfc..7a2e2a6b0 100644 --- a/lib/increase/resources/simulations.rb +++ b/lib/increase/resources/simulations.rb @@ -30,9 +30,6 @@ class Simulations # @return [Increase::Resources::Simulations::CardRefunds] attr_reader :card_refunds - # @return [Increase::Resources::Simulations::CardDisputes] - attr_reader :card_disputes - # @return [Increase::Resources::Simulations::PhysicalCards] attr_reader :physical_cards @@ -105,7 +102,6 @@ def initialize(client:) @card_increments = Increase::Resources::Simulations::CardIncrements.new(client: client) @card_fuel_confirmations = Increase::Resources::Simulations::CardFuelConfirmations.new(client: client) @card_refunds = Increase::Resources::Simulations::CardRefunds.new(client: client) - @card_disputes = Increase::Resources::Simulations::CardDisputes.new(client: client) @physical_cards = Increase::Resources::Simulations::PhysicalCards.new(client: client) @digital_wallet_token_requests = Increase::Resources::Simulations::DigitalWalletTokenRequests.new(client: client) diff --git a/lib/increase/resources/simulations/card_disputes.rb b/lib/increase/resources/simulations/card_disputes.rb deleted file mode 100644 index e161f6587..000000000 --- a/lib/increase/resources/simulations/card_disputes.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -module Increase - module Resources - class Simulations - class CardDisputes - # After a [Card Dispute](#card-disputes) is created in production, the dispute - # will be reviewed. Since no review happens in sandbox, this endpoint simulates - # moving a Card Dispute into a rejected or accepted state. A Card Dispute can only - # be actioned one time and must have a status of `pending_reviewing`. - # - # @overload action(card_dispute_id, status:, explanation: nil, request_options: {}) - # - # @param card_dispute_id [String] The dispute you would like to action. - # - # @param status [Symbol, Increase::Models::Simulations::CardDisputeActionParams::Status] The status to move the dispute to. - # - # @param explanation [String] Why the dispute was rejected. Not required for accepting disputes. - # - # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Increase::Models::CardDispute] - # - # @see Increase::Models::Simulations::CardDisputeActionParams - def action(card_dispute_id, params) - parsed, options = Increase::Simulations::CardDisputeActionParams.dump_request(params) - @client.request( - method: :post, - path: ["simulations/card_disputes/%1$s/action", card_dispute_id], - body: parsed, - model: Increase::CardDispute, - options: options - ) - end - - # @api private - # - # @param client [Increase::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/rbi/increase/client.rbi b/rbi/increase/client.rbi index 4e039309b..31d6396b0 100644 --- a/rbi/increase/client.rbi +++ b/rbi/increase/client.rbi @@ -40,9 +40,6 @@ module Increase sig { returns(Increase::Resources::CardPurchaseSupplements) } attr_reader :card_purchase_supplements - sig { returns(Increase::Resources::CardDisputes) } - attr_reader :card_disputes - sig { returns(Increase::Resources::PhysicalCards) } attr_reader :physical_cards diff --git a/rbi/increase/models.rbi b/rbi/increase/models.rbi index adb160b87..12c246608 100644 --- a/rbi/increase/models.rbi +++ b/rbi/increase/models.rbi @@ -113,14 +113,6 @@ module Increase CardDetailsParams = Increase::Models::CardDetailsParams - CardDispute = Increase::Models::CardDispute - - CardDisputeCreateParams = Increase::Models::CardDisputeCreateParams - - CardDisputeListParams = Increase::Models::CardDisputeListParams - - CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams - CardIframeURL = Increase::Models::CardIframeURL CardListParams = Increase::Models::CardListParams diff --git a/rbi/increase/models/card_dispute.rbi b/rbi/increase/models/card_dispute.rbi deleted file mode 100644 index 44bec2e02..000000000 --- a/rbi/increase/models/card_dispute.rbi +++ /dev/null @@ -1,425 +0,0 @@ -# typed: strong - -module Increase - module Models - class CardDispute < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Increase::CardDispute, Increase::Internal::AnyHash) - end - - # The Card Dispute identifier. - sig { returns(String) } - attr_accessor :id - - # If the Card Dispute's status is `accepted`, this will contain details of the - # successful dispute. - sig { returns(T.nilable(Increase::CardDispute::Acceptance)) } - attr_reader :acceptance - - sig do - params( - acceptance: T.nilable(Increase::CardDispute::Acceptance::OrHash) - ).void - end - attr_writer :acceptance - - # The amount of the dispute, if provided, or the transaction amount otherwise. - sig { returns(T.nilable(Integer)) } - attr_accessor :amount - - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was created. - sig { returns(Time) } - attr_accessor :created_at - - # The identifier of the Transaction that was disputed. - sig { returns(String) } - attr_accessor :disputed_transaction_id - - # Why you disputed the Transaction in question. - sig { returns(String) } - attr_accessor :explanation - - # The idempotency key you chose for this object. This value is unique across - # Increase and is used to ensure that a request is only processed once. Learn more - # about [idempotency](https://increase.com/documentation/idempotency-keys). - sig { returns(T.nilable(String)) } - attr_accessor :idempotency_key - - # If the Card Dispute's status is `lost`, this will contain details of the lost - # dispute. - sig { returns(T.nilable(Increase::CardDispute::Loss)) } - attr_reader :loss - - sig { params(loss: T.nilable(Increase::CardDispute::Loss::OrHash)).void } - attr_writer :loss - - # If the Card Dispute's status is `rejected`, this will contain details of the - # unsuccessful dispute. - sig { returns(T.nilable(Increase::CardDispute::Rejection)) } - attr_reader :rejection - - sig do - params( - rejection: T.nilable(Increase::CardDispute::Rejection::OrHash) - ).void - end - attr_writer :rejection - - # The results of the Dispute investigation. - sig { returns(Increase::CardDispute::Status::TaggedSymbol) } - attr_accessor :status - - # A constant representing the object's type. For this resource it will always be - # `card_dispute`. - sig { returns(Increase::CardDispute::Type::TaggedSymbol) } - attr_accessor :type - - # If the Card Dispute's status is `won`, this will contain details of the won - # dispute. - sig { returns(T.nilable(Increase::CardDispute::Win)) } - attr_reader :win - - sig { params(win: T.nilable(Increase::CardDispute::Win::OrHash)).void } - attr_writer :win - - # If unauthorized activity occurs on a card, you can create a Card Dispute and - # we'll return the funds if appropriate. - sig do - params( - id: String, - acceptance: T.nilable(Increase::CardDispute::Acceptance::OrHash), - amount: T.nilable(Integer), - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: T.nilable(String), - loss: T.nilable(Increase::CardDispute::Loss::OrHash), - rejection: T.nilable(Increase::CardDispute::Rejection::OrHash), - status: Increase::CardDispute::Status::OrSymbol, - type: Increase::CardDispute::Type::OrSymbol, - win: T.nilable(Increase::CardDispute::Win::OrHash) - ).returns(T.attached_class) - end - def self.new( - # The Card Dispute identifier. - id:, - # If the Card Dispute's status is `accepted`, this will contain details of the - # successful dispute. - acceptance:, - # The amount of the dispute, if provided, or the transaction amount otherwise. - amount:, - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was created. - created_at:, - # The identifier of the Transaction that was disputed. - disputed_transaction_id:, - # Why you disputed the Transaction in question. - explanation:, - # The idempotency key you chose for this object. This value is unique across - # Increase and is used to ensure that a request is only processed once. Learn more - # about [idempotency](https://increase.com/documentation/idempotency-keys). - idempotency_key:, - # If the Card Dispute's status is `lost`, this will contain details of the lost - # dispute. - loss:, - # If the Card Dispute's status is `rejected`, this will contain details of the - # unsuccessful dispute. - rejection:, - # The results of the Dispute investigation. - status:, - # A constant representing the object's type. For this resource it will always be - # `card_dispute`. - type:, - # If the Card Dispute's status is `won`, this will contain details of the won - # dispute. - win: - ) - end - - sig do - override.returns( - { - id: String, - acceptance: T.nilable(Increase::CardDispute::Acceptance), - amount: T.nilable(Integer), - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: T.nilable(String), - loss: T.nilable(Increase::CardDispute::Loss), - rejection: T.nilable(Increase::CardDispute::Rejection), - status: Increase::CardDispute::Status::TaggedSymbol, - type: Increase::CardDispute::Type::TaggedSymbol, - win: T.nilable(Increase::CardDispute::Win) - } - ) - end - def to_hash - end - - class Acceptance < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Increase::CardDispute::Acceptance, - Increase::Internal::AnyHash - ) - end - - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was accepted. - sig { returns(Time) } - attr_accessor :accepted_at - - # The identifier of the Card Dispute that was accepted. - sig { returns(String) } - attr_accessor :card_dispute_id - - # The identifier of the Transaction that was created to return the disputed funds - # to your account. - sig { returns(String) } - attr_accessor :transaction_id - - # If the Card Dispute's status is `accepted`, this will contain details of the - # successful dispute. - sig do - params( - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - ).returns(T.attached_class) - end - def self.new( - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was accepted. - accepted_at:, - # The identifier of the Card Dispute that was accepted. - card_dispute_id:, - # The identifier of the Transaction that was created to return the disputed funds - # to your account. - transaction_id: - ) - end - - sig do - override.returns( - { - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - } - ) - end - def to_hash - end - end - - class Loss < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Increase::CardDispute::Loss, Increase::Internal::AnyHash) - end - - # The identifier of the Card Dispute that was lost. - sig { returns(String) } - attr_accessor :card_dispute_id - - # Why the Card Dispute was lost. - sig { returns(String) } - attr_accessor :explanation - - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was lost. - sig { returns(Time) } - attr_accessor :lost_at - - # The identifier of the Transaction that was created to debit the disputed funds - # from your account. - sig { returns(String) } - attr_accessor :transaction_id - - # If the Card Dispute's status is `lost`, this will contain details of the lost - # dispute. - sig do - params( - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - ).returns(T.attached_class) - end - def self.new( - # The identifier of the Card Dispute that was lost. - card_dispute_id:, - # Why the Card Dispute was lost. - explanation:, - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was lost. - lost_at:, - # The identifier of the Transaction that was created to debit the disputed funds - # from your account. - transaction_id: - ) - end - - sig do - override.returns( - { - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - } - ) - end - def to_hash - end - end - - class Rejection < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Increase::CardDispute::Rejection, Increase::Internal::AnyHash) - end - - # The identifier of the Card Dispute that was rejected. - sig { returns(String) } - attr_accessor :card_dispute_id - - # Why the Card Dispute was rejected. - sig { returns(String) } - attr_accessor :explanation - - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was rejected. - sig { returns(Time) } - attr_accessor :rejected_at - - # If the Card Dispute's status is `rejected`, this will contain details of the - # unsuccessful dispute. - sig do - params( - card_dispute_id: String, - explanation: String, - rejected_at: Time - ).returns(T.attached_class) - end - def self.new( - # The identifier of the Card Dispute that was rejected. - card_dispute_id:, - # Why the Card Dispute was rejected. - explanation:, - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was rejected. - rejected_at: - ) - end - - sig do - override.returns( - { card_dispute_id: String, explanation: String, rejected_at: Time } - ) - end - def to_hash - end - end - - # The results of the Dispute investigation. - module Status - extend Increase::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Increase::CardDispute::Status) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - # The Card Dispute is pending review. - PENDING_REVIEWING = - T.let(:pending_reviewing, Increase::CardDispute::Status::TaggedSymbol) - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = - T.let( - :pending_user_information, - Increase::CardDispute::Status::TaggedSymbol - ) - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = T.let(:accepted, Increase::CardDispute::Status::TaggedSymbol) - - # The Card Dispute has been rejected. - REJECTED = T.let(:rejected, Increase::CardDispute::Status::TaggedSymbol) - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = T.let(:lost, Increase::CardDispute::Status::TaggedSymbol) - - # The Card Dispute has been won and no further action can be taken. - WON = T.let(:won, Increase::CardDispute::Status::TaggedSymbol) - - sig do - override.returns( - T::Array[Increase::CardDispute::Status::TaggedSymbol] - ) - end - def self.values - end - end - - # A constant representing the object's type. For this resource it will always be - # `card_dispute`. - module Type - extend Increase::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, Increase::CardDispute::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CARD_DISPUTE = - T.let(:card_dispute, Increase::CardDispute::Type::TaggedSymbol) - - sig do - override.returns(T::Array[Increase::CardDispute::Type::TaggedSymbol]) - end - def self.values - end - end - - class Win < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(Increase::CardDispute::Win, Increase::Internal::AnyHash) - end - - # The identifier of the Card Dispute that was won. - sig { returns(String) } - attr_accessor :card_dispute_id - - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was won. - sig { returns(Time) } - attr_accessor :won_at - - # If the Card Dispute's status is `won`, this will contain details of the won - # dispute. - sig do - params(card_dispute_id: String, won_at: Time).returns( - T.attached_class - ) - end - def self.new( - # The identifier of the Card Dispute that was won. - card_dispute_id:, - # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - # the Card Dispute was won. - won_at: - ) - end - - sig { override.returns({ card_dispute_id: String, won_at: Time }) } - def to_hash - end - end - end - end -end diff --git a/rbi/increase/models/card_dispute_create_params.rbi b/rbi/increase/models/card_dispute_create_params.rbi deleted file mode 100644 index 3277c91a8..000000000 --- a/rbi/increase/models/card_dispute_create_params.rbi +++ /dev/null @@ -1,70 +0,0 @@ -# typed: strong - -module Increase - module Models - class CardDisputeCreateParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(Increase::CardDisputeCreateParams, Increase::Internal::AnyHash) - end - - # The Transaction you wish to dispute. This Transaction must have a `source_type` - # of `card_settlement`. - sig { returns(String) } - attr_accessor :disputed_transaction_id - - # Why you are disputing this Transaction. - sig { returns(String) } - attr_accessor :explanation - - # The monetary amount of the part of the transaction that is being disputed. This - # is optional and will default to the full amount of the transaction if not - # provided. If provided, the amount must be less than or equal to the amount of - # the transaction. - sig { returns(T.nilable(Integer)) } - attr_reader :amount - - sig { params(amount: Integer).void } - attr_writer :amount - - sig do - params( - disputed_transaction_id: String, - explanation: String, - amount: Integer, - request_options: Increase::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The Transaction you wish to dispute. This Transaction must have a `source_type` - # of `card_settlement`. - disputed_transaction_id:, - # Why you are disputing this Transaction. - explanation:, - # The monetary amount of the part of the transaction that is being disputed. This - # is optional and will default to the full amount of the transaction if not - # provided. If provided, the amount must be less than or equal to the amount of - # the transaction. - amount: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - disputed_transaction_id: String, - explanation: String, - amount: Integer, - request_options: Increase::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/increase/models/card_dispute_list_params.rbi b/rbi/increase/models/card_dispute_list_params.rbi deleted file mode 100644 index 43e29c840..000000000 --- a/rbi/increase/models/card_dispute_list_params.rbi +++ /dev/null @@ -1,289 +0,0 @@ -# typed: strong - -module Increase - module Models - class CardDisputeListParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any(Increase::CardDisputeListParams, Increase::Internal::AnyHash) - end - - sig { returns(T.nilable(Increase::CardDisputeListParams::CreatedAt)) } - attr_reader :created_at - - sig do - params( - created_at: Increase::CardDisputeListParams::CreatedAt::OrHash - ).void - end - attr_writer :created_at - - # Return the page of entries after this one. - sig { returns(T.nilable(String)) } - attr_reader :cursor - - sig { params(cursor: String).void } - attr_writer :cursor - - # Filter records to the one with the specified `idempotency_key` you chose for - # that object. This value is unique across Increase and is used to ensure that a - # request is only processed once. Learn more about - # [idempotency](https://increase.com/documentation/idempotency-keys). - sig { returns(T.nilable(String)) } - attr_reader :idempotency_key - - sig { params(idempotency_key: String).void } - attr_writer :idempotency_key - - # Limit the size of the list that is returned. The default (and maximum) is 100 - # objects. - sig { returns(T.nilable(Integer)) } - attr_reader :limit - - sig { params(limit: Integer).void } - attr_writer :limit - - sig { returns(T.nilable(Increase::CardDisputeListParams::Status)) } - attr_reader :status - - sig do - params(status: Increase::CardDisputeListParams::Status::OrHash).void - end - attr_writer :status - - sig do - params( - created_at: Increase::CardDisputeListParams::CreatedAt::OrHash, - cursor: String, - idempotency_key: String, - limit: Integer, - status: Increase::CardDisputeListParams::Status::OrHash, - request_options: Increase::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - created_at: nil, - # Return the page of entries after this one. - cursor: nil, - # Filter records to the one with the specified `idempotency_key` you chose for - # that object. This value is unique across Increase and is used to ensure that a - # request is only processed once. Learn more about - # [idempotency](https://increase.com/documentation/idempotency-keys). - idempotency_key: nil, - # Limit the size of the list that is returned. The default (and maximum) is 100 - # objects. - limit: nil, - status: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - created_at: Increase::CardDisputeListParams::CreatedAt, - cursor: String, - idempotency_key: String, - limit: Integer, - status: Increase::CardDisputeListParams::Status, - request_options: Increase::RequestOptions - } - ) - end - def to_hash - end - - class CreatedAt < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Increase::CardDisputeListParams::CreatedAt, - Increase::Internal::AnyHash - ) - end - - # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - sig { returns(T.nilable(Time)) } - attr_reader :after - - sig { params(after: Time).void } - attr_writer :after - - # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - sig { returns(T.nilable(Time)) } - attr_reader :before - - sig { params(before: Time).void } - attr_writer :before - - # Return results on or after this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - sig { returns(T.nilable(Time)) } - attr_reader :on_or_after - - sig { params(on_or_after: Time).void } - attr_writer :on_or_after - - # Return results on or before this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - sig { returns(T.nilable(Time)) } - attr_reader :on_or_before - - sig { params(on_or_before: Time).void } - attr_writer :on_or_before - - sig do - params( - after: Time, - before: Time, - on_or_after: Time, - on_or_before: Time - ).returns(T.attached_class) - end - def self.new( - # Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - after: nil, - # Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) - # timestamp. - before: nil, - # Return results on or after this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - on_or_after: nil, - # Return results on or before this - # [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. - on_or_before: nil - ) - end - - sig do - override.returns( - { after: Time, before: Time, on_or_after: Time, on_or_before: Time } - ) - end - def to_hash - end - end - - class Status < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Increase::CardDisputeListParams::Status, - Increase::Internal::AnyHash - ) - end - - # Filter Card Disputes for those with the specified status or statuses. For GET - # requests, this should be encoded as a comma-delimited string, such as - # `?in=one,two,three`. - sig do - returns( - T.nilable( - T::Array[Increase::CardDisputeListParams::Status::In::OrSymbol] - ) - ) - end - attr_reader :in_ - - sig do - params( - in_: T::Array[Increase::CardDisputeListParams::Status::In::OrSymbol] - ).void - end - attr_writer :in_ - - sig do - params( - in_: T::Array[Increase::CardDisputeListParams::Status::In::OrSymbol] - ).returns(T.attached_class) - end - def self.new( - # Filter Card Disputes for those with the specified status or statuses. For GET - # requests, this should be encoded as a comma-delimited string, such as - # `?in=one,two,three`. - in_: nil - ) - end - - sig do - override.returns( - { - in_: - T::Array[Increase::CardDisputeListParams::Status::In::OrSymbol] - } - ) - end - def to_hash - end - - module In - extend Increase::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Increase::CardDisputeListParams::Status::In) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - # The Card Dispute is pending review. - PENDING_REVIEWING = - T.let( - :pending_reviewing, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = - T.let( - :pending_user_information, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = - T.let( - :accepted, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - # The Card Dispute has been rejected. - REJECTED = - T.let( - :rejected, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = - T.let( - :lost, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - # The Card Dispute has been won and no further action can be taken. - WON = - T.let( - :won, - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Increase::CardDisputeListParams::Status::In::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end -end diff --git a/rbi/increase/models/card_dispute_retrieve_params.rbi b/rbi/increase/models/card_dispute_retrieve_params.rbi deleted file mode 100644 index c7976504c..000000000 --- a/rbi/increase/models/card_dispute_retrieve_params.rbi +++ /dev/null @@ -1,30 +0,0 @@ -# typed: strong - -module Increase - module Models - class CardDisputeRetrieveParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - Increase::CardDisputeRetrieveParams, - Increase::Internal::AnyHash - ) - end - - sig do - params(request_options: Increase::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig { override.returns({ request_options: Increase::RequestOptions }) } - def to_hash - end - end - end -end diff --git a/rbi/increase/models/simulations/card_dispute_action_params.rbi b/rbi/increase/models/simulations/card_dispute_action_params.rbi deleted file mode 100644 index 1bb1fca38..000000000 --- a/rbi/increase/models/simulations/card_dispute_action_params.rbi +++ /dev/null @@ -1,124 +0,0 @@ -# typed: strong - -module Increase - module Models - module Simulations - class CardDisputeActionParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - Increase::Simulations::CardDisputeActionParams, - Increase::Internal::AnyHash - ) - end - - # The status to move the dispute to. - sig do - returns( - Increase::Simulations::CardDisputeActionParams::Status::OrSymbol - ) - end - attr_accessor :status - - # Why the dispute was rejected. Not required for accepting disputes. - sig { returns(T.nilable(String)) } - attr_reader :explanation - - sig { params(explanation: String).void } - attr_writer :explanation - - sig do - params( - status: - Increase::Simulations::CardDisputeActionParams::Status::OrSymbol, - explanation: String, - request_options: Increase::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The status to move the dispute to. - status:, - # Why the dispute was rejected. Not required for accepting disputes. - explanation: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - status: - Increase::Simulations::CardDisputeActionParams::Status::OrSymbol, - explanation: String, - request_options: Increase::RequestOptions - } - ) - end - def to_hash - end - - # The status to move the dispute to. - module Status - extend Increase::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - Increase::Simulations::CardDisputeActionParams::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION = - T.let( - :pending_user_information, - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ) - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED = - T.let( - :accepted, - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ) - - # The Card Dispute has been rejected. - REJECTED = - T.let( - :rejected, - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ) - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST = - T.let( - :lost, - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ) - - # The Card Dispute has been won and no further action can be taken. - WON = - T.let( - :won, - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Increase::Simulations::CardDisputeActionParams::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end -end diff --git a/rbi/increase/models/transaction.rbi b/rbi/increase/models/transaction.rbi index c1be566e1..b709e1fbf 100644 --- a/rbi/increase/models/transaction.rbi +++ b/rbi/increase/models/transaction.rbi @@ -2251,10 +2251,6 @@ module Increase sig { returns(Time) } attr_accessor :accepted_at - # The identifier of the Card Dispute that was accepted. - sig { returns(String) } - attr_accessor :card_dispute_id - # The identifier of the Transaction that was created to return the disputed funds # to your account. sig { returns(String) } @@ -2264,18 +2260,14 @@ module Increase # response if and only if `category` is equal to `card_dispute_acceptance`. # Contains the details of a successful Card Dispute. sig do - params( - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - ).returns(T.attached_class) + params(accepted_at: Time, transaction_id: String).returns( + T.attached_class + ) end def self.new( # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which # the Card Dispute was accepted. accepted_at:, - # The identifier of the Card Dispute that was accepted. - card_dispute_id:, # The identifier of the Transaction that was created to return the disputed funds # to your account. transaction_id: @@ -2283,13 +2275,7 @@ module Increase end sig do - override.returns( - { - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - } - ) + override.returns({ accepted_at: Time, transaction_id: String }) end def to_hash end @@ -2308,10 +2294,6 @@ module Increase sig { returns(Integer) } attr_accessor :amount - # The identifier of the Card Dispute the financial event is associated with. - sig { returns(String) } - attr_accessor :card_dispute_id - # The network that the Card Dispute is associated with. sig do returns( @@ -2353,7 +2335,6 @@ module Increase sig do params( amount: Integer, - card_dispute_id: String, network: Increase::Transaction::Source::CardDisputeFinancial::Network::OrSymbol, transaction_id: String, @@ -2366,8 +2347,6 @@ module Increase def self.new( # The amount of the financial event. amount:, - # The identifier of the Card Dispute the financial event is associated with. - card_dispute_id:, # The network that the Card Dispute is associated with. network:, # The identifier of the Transaction that was created to credit or debit the @@ -2384,7 +2363,6 @@ module Increase override.returns( { amount: Integer, - card_dispute_id: String, network: Increase::Transaction::Source::CardDisputeFinancial::Network::TaggedSymbol, transaction_id: String, @@ -2556,10 +2534,6 @@ module Increase ) end - # The identifier of the Card Dispute that was lost. - sig { returns(String) } - attr_accessor :card_dispute_id - # Why the Card Dispute was lost. sig { returns(String) } attr_accessor :explanation @@ -2579,15 +2553,12 @@ module Increase # a lost Card Dispute. sig do params( - card_dispute_id: String, explanation: String, lost_at: Time, transaction_id: String ).returns(T.attached_class) end def self.new( - # The identifier of the Card Dispute that was lost. - card_dispute_id:, # Why the Card Dispute was lost. explanation:, # The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which @@ -2601,12 +2572,7 @@ module Increase sig do override.returns( - { - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - } + { explanation: String, lost_at: Time, transaction_id: String } ) end def to_hash diff --git a/rbi/increase/resources/card_disputes.rbi b/rbi/increase/resources/card_disputes.rbi deleted file mode 100644 index 2b3ac55da..000000000 --- a/rbi/increase/resources/card_disputes.rbi +++ /dev/null @@ -1,78 +0,0 @@ -# typed: strong - -module Increase - module Resources - class CardDisputes - # Create a Card Dispute - sig do - params( - disputed_transaction_id: String, - explanation: String, - amount: Integer, - request_options: Increase::RequestOptions::OrHash - ).returns(Increase::CardDispute) - end - def create( - # The Transaction you wish to dispute. This Transaction must have a `source_type` - # of `card_settlement`. - disputed_transaction_id:, - # Why you are disputing this Transaction. - explanation:, - # The monetary amount of the part of the transaction that is being disputed. This - # is optional and will default to the full amount of the transaction if not - # provided. If provided, the amount must be less than or equal to the amount of - # the transaction. - amount: nil, - request_options: {} - ) - end - - # Retrieve a Card Dispute - sig do - params( - card_dispute_id: String, - request_options: Increase::RequestOptions::OrHash - ).returns(Increase::CardDispute) - end - def retrieve( - # The identifier of the Card Dispute. - card_dispute_id, - request_options: {} - ) - end - - # List Card Disputes - sig do - params( - created_at: Increase::CardDisputeListParams::CreatedAt::OrHash, - cursor: String, - idempotency_key: String, - limit: Integer, - status: Increase::CardDisputeListParams::Status::OrHash, - request_options: Increase::RequestOptions::OrHash - ).returns(Increase::Internal::Page[Increase::CardDispute]) - end - def list( - created_at: nil, - # Return the page of entries after this one. - cursor: nil, - # Filter records to the one with the specified `idempotency_key` you chose for - # that object. This value is unique across Increase and is used to ensure that a - # request is only processed once. Learn more about - # [idempotency](https://increase.com/documentation/idempotency-keys). - idempotency_key: nil, - # Limit the size of the list that is returned. The default (and maximum) is 100 - # objects. - limit: nil, - status: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: Increase::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/increase/resources/simulations.rbi b/rbi/increase/resources/simulations.rbi index 27863be1d..d0a778218 100644 --- a/rbi/increase/resources/simulations.rbi +++ b/rbi/increase/resources/simulations.rbi @@ -32,9 +32,6 @@ module Increase sig { returns(Increase::Resources::Simulations::CardRefunds) } attr_reader :card_refunds - sig { returns(Increase::Resources::Simulations::CardDisputes) } - attr_reader :card_disputes - sig { returns(Increase::Resources::Simulations::PhysicalCards) } attr_reader :physical_cards diff --git a/rbi/increase/resources/simulations/card_disputes.rbi b/rbi/increase/resources/simulations/card_disputes.rbi deleted file mode 100644 index 4b740ff3e..000000000 --- a/rbi/increase/resources/simulations/card_disputes.rbi +++ /dev/null @@ -1,38 +0,0 @@ -# typed: strong - -module Increase - module Resources - class Simulations - class CardDisputes - # After a [Card Dispute](#card-disputes) is created in production, the dispute - # will be reviewed. Since no review happens in sandbox, this endpoint simulates - # moving a Card Dispute into a rejected or accepted state. A Card Dispute can only - # be actioned one time and must have a status of `pending_reviewing`. - sig do - params( - card_dispute_id: String, - status: - Increase::Simulations::CardDisputeActionParams::Status::OrSymbol, - explanation: String, - request_options: Increase::RequestOptions::OrHash - ).returns(Increase::CardDispute) - end - def action( - # The dispute you would like to action. - card_dispute_id, - # The status to move the dispute to. - status:, - # Why the dispute was rejected. Not required for accepting disputes. - explanation: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: Increase::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/sig/increase/client.rbs b/sig/increase/client.rbs index 8a44a8aab..e0757c7c3 100644 --- a/sig/increase/client.rbs +++ b/sig/increase/client.rbs @@ -27,8 +27,6 @@ module Increase attr_reader card_purchase_supplements: Increase::Resources::CardPurchaseSupplements - attr_reader card_disputes: Increase::Resources::CardDisputes - attr_reader physical_cards: Increase::Resources::PhysicalCards attr_reader digital_card_profiles: Increase::Resources::DigitalCardProfiles diff --git a/sig/increase/models.rbs b/sig/increase/models.rbs index 8c35b5948..7b27a9bba 100644 --- a/sig/increase/models.rbs +++ b/sig/increase/models.rbs @@ -99,14 +99,6 @@ module Increase class CardDetailsParams = Increase::Models::CardDetailsParams - class CardDispute = Increase::Models::CardDispute - - class CardDisputeCreateParams = Increase::Models::CardDisputeCreateParams - - class CardDisputeListParams = Increase::Models::CardDisputeListParams - - class CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams - class CardIframeURL = Increase::Models::CardIframeURL class CardListParams = Increase::Models::CardListParams diff --git a/sig/increase/models/card_dispute.rbs b/sig/increase/models/card_dispute.rbs deleted file mode 100644 index 5ed7cb536..000000000 --- a/sig/increase/models/card_dispute.rbs +++ /dev/null @@ -1,207 +0,0 @@ -module Increase - module Models - type card_dispute = - { - id: String, - acceptance: Increase::CardDispute::Acceptance?, - amount: Integer?, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String?, - loss: Increase::CardDispute::Loss?, - rejection: Increase::CardDispute::Rejection?, - status: Increase::Models::CardDispute::status, - type: Increase::Models::CardDispute::type_, - win: Increase::CardDispute::Win? - } - - class CardDispute < Increase::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor acceptance: Increase::CardDispute::Acceptance? - - attr_accessor amount: Integer? - - attr_accessor created_at: Time - - attr_accessor disputed_transaction_id: String - - attr_accessor explanation: String - - attr_accessor idempotency_key: String? - - attr_accessor loss: Increase::CardDispute::Loss? - - attr_accessor rejection: Increase::CardDispute::Rejection? - - attr_accessor status: Increase::Models::CardDispute::status - - attr_accessor type: Increase::Models::CardDispute::type_ - - attr_accessor win: Increase::CardDispute::Win? - - def initialize: ( - id: String, - acceptance: Increase::CardDispute::Acceptance?, - amount: Integer?, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String?, - loss: Increase::CardDispute::Loss?, - rejection: Increase::CardDispute::Rejection?, - status: Increase::Models::CardDispute::status, - type: Increase::Models::CardDispute::type_, - win: Increase::CardDispute::Win? - ) -> void - - def to_hash: -> { - id: String, - acceptance: Increase::CardDispute::Acceptance?, - amount: Integer?, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String?, - loss: Increase::CardDispute::Loss?, - rejection: Increase::CardDispute::Rejection?, - status: Increase::Models::CardDispute::status, - type: Increase::Models::CardDispute::type_, - win: Increase::CardDispute::Win? - } - - type acceptance = - { accepted_at: Time, card_dispute_id: String, transaction_id: String } - - class Acceptance < Increase::Internal::Type::BaseModel - attr_accessor accepted_at: Time - - attr_accessor card_dispute_id: String - - attr_accessor transaction_id: String - - def initialize: ( - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - ) -> void - - def to_hash: -> { - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - } - end - - type loss = - { - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - } - - class Loss < Increase::Internal::Type::BaseModel - attr_accessor card_dispute_id: String - - attr_accessor explanation: String - - attr_accessor lost_at: Time - - attr_accessor transaction_id: String - - def initialize: ( - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - ) -> void - - def to_hash: -> { - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - } - end - - type rejection = - { card_dispute_id: String, explanation: String, rejected_at: Time } - - class Rejection < Increase::Internal::Type::BaseModel - attr_accessor card_dispute_id: String - - attr_accessor explanation: String - - attr_accessor rejected_at: Time - - def initialize: ( - card_dispute_id: String, - explanation: String, - rejected_at: Time - ) -> void - - def to_hash: -> { - card_dispute_id: String, - explanation: String, - rejected_at: Time - } - end - - type status = - :pending_reviewing - | :pending_user_information - | :accepted - | :rejected - | :lost - | :won - - module Status - extend Increase::Internal::Type::Enum - - # The Card Dispute is pending review. - PENDING_REVIEWING: :pending_reviewing - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION: :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED: :accepted - - # The Card Dispute has been rejected. - REJECTED: :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST: :lost - - # The Card Dispute has been won and no further action can be taken. - WON: :won - - def self?.values: -> ::Array[Increase::Models::CardDispute::status] - end - - type type_ = :card_dispute - - module Type - extend Increase::Internal::Type::Enum - - CARD_DISPUTE: :card_dispute - - def self?.values: -> ::Array[Increase::Models::CardDispute::type_] - end - - type win = { card_dispute_id: String, won_at: Time } - - class Win < Increase::Internal::Type::BaseModel - attr_accessor card_dispute_id: String - - attr_accessor won_at: Time - - def initialize: (card_dispute_id: String, won_at: Time) -> void - - def to_hash: -> { card_dispute_id: String, won_at: Time } - end - end - end -end diff --git a/sig/increase/models/card_dispute_create_params.rbs b/sig/increase/models/card_dispute_create_params.rbs deleted file mode 100644 index 928d25ac0..000000000 --- a/sig/increase/models/card_dispute_create_params.rbs +++ /dev/null @@ -1,34 +0,0 @@ -module Increase - module Models - type card_dispute_create_params = - { disputed_transaction_id: String, explanation: String, amount: Integer } - & Increase::Internal::Type::request_parameters - - class CardDisputeCreateParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - attr_accessor disputed_transaction_id: String - - attr_accessor explanation: String - - attr_reader amount: Integer? - - def amount=: (Integer) -> Integer - - def initialize: ( - disputed_transaction_id: String, - explanation: String, - ?amount: Integer, - ?request_options: Increase::request_opts - ) -> void - - def to_hash: -> { - disputed_transaction_id: String, - explanation: String, - amount: Integer, - request_options: Increase::RequestOptions - } - end - end -end diff --git a/sig/increase/models/card_dispute_list_params.rbs b/sig/increase/models/card_dispute_list_params.rbs deleted file mode 100644 index 420fa81f9..000000000 --- a/sig/increase/models/card_dispute_list_params.rbs +++ /dev/null @@ -1,146 +0,0 @@ -module Increase - module Models - type card_dispute_list_params = - { - created_at: Increase::CardDisputeListParams::CreatedAt, - cursor: String, - idempotency_key: String, - limit: Integer, - status: Increase::CardDisputeListParams::Status - } - & Increase::Internal::Type::request_parameters - - class CardDisputeListParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - attr_reader created_at: Increase::CardDisputeListParams::CreatedAt? - - def created_at=: ( - Increase::CardDisputeListParams::CreatedAt - ) -> Increase::CardDisputeListParams::CreatedAt - - attr_reader cursor: String? - - def cursor=: (String) -> String - - attr_reader idempotency_key: String? - - def idempotency_key=: (String) -> String - - attr_reader limit: Integer? - - def limit=: (Integer) -> Integer - - attr_reader status: Increase::CardDisputeListParams::Status? - - def status=: ( - Increase::CardDisputeListParams::Status - ) -> Increase::CardDisputeListParams::Status - - def initialize: ( - ?created_at: Increase::CardDisputeListParams::CreatedAt, - ?cursor: String, - ?idempotency_key: String, - ?limit: Integer, - ?status: Increase::CardDisputeListParams::Status, - ?request_options: Increase::request_opts - ) -> void - - def to_hash: -> { - created_at: Increase::CardDisputeListParams::CreatedAt, - cursor: String, - idempotency_key: String, - limit: Integer, - status: Increase::CardDisputeListParams::Status, - request_options: Increase::RequestOptions - } - - type created_at = - { after: Time, before: Time, on_or_after: Time, on_or_before: Time } - - class CreatedAt < Increase::Internal::Type::BaseModel - attr_reader after: Time? - - def after=: (Time) -> Time - - attr_reader before: Time? - - def before=: (Time) -> Time - - attr_reader on_or_after: Time? - - def on_or_after=: (Time) -> Time - - attr_reader on_or_before: Time? - - def on_or_before=: (Time) -> Time - - def initialize: ( - ?after: Time, - ?before: Time, - ?on_or_after: Time, - ?on_or_before: Time - ) -> void - - def to_hash: -> { - after: Time, - before: Time, - on_or_after: Time, - on_or_before: Time - } - end - - type status = - { in_: ::Array[Increase::Models::CardDisputeListParams::Status::in_] } - - class Status < Increase::Internal::Type::BaseModel - attr_reader in_: ::Array[Increase::Models::CardDisputeListParams::Status::in_]? - - def in_=: ( - ::Array[Increase::Models::CardDisputeListParams::Status::in_] - ) -> ::Array[Increase::Models::CardDisputeListParams::Status::in_] - - def initialize: ( - ?in_: ::Array[Increase::Models::CardDisputeListParams::Status::in_] - ) -> void - - def to_hash: -> { - in_: ::Array[Increase::Models::CardDisputeListParams::Status::in_] - } - - type in_ = - :pending_reviewing - | :pending_user_information - | :accepted - | :rejected - | :lost - | :won - - module In - extend Increase::Internal::Type::Enum - - # The Card Dispute is pending review. - PENDING_REVIEWING: :pending_reviewing - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION: :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED: :accepted - - # The Card Dispute has been rejected. - REJECTED: :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST: :lost - - # The Card Dispute has been won and no further action can be taken. - WON: :won - - def self?.values: -> ::Array[Increase::Models::CardDisputeListParams::Status::in_] - end - end - end - end -end diff --git a/sig/increase/models/card_dispute_retrieve_params.rbs b/sig/increase/models/card_dispute_retrieve_params.rbs deleted file mode 100644 index ffe920e75..000000000 --- a/sig/increase/models/card_dispute_retrieve_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module Increase - module Models - type card_dispute_retrieve_params = - { } & Increase::Internal::Type::request_parameters - - class CardDisputeRetrieveParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - def initialize: (?request_options: Increase::request_opts) -> void - - def to_hash: -> { request_options: Increase::RequestOptions } - end - end -end diff --git a/sig/increase/models/simulations/card_dispute_action_params.rbs b/sig/increase/models/simulations/card_dispute_action_params.rbs deleted file mode 100644 index b14664e41..000000000 --- a/sig/increase/models/simulations/card_dispute_action_params.rbs +++ /dev/null @@ -1,59 +0,0 @@ -module Increase - module Models - module Simulations - type card_dispute_action_params = - { - status: Increase::Models::Simulations::CardDisputeActionParams::status, - explanation: String - } - & Increase::Internal::Type::request_parameters - - class CardDisputeActionParams < Increase::Internal::Type::BaseModel - extend Increase::Internal::Type::RequestParameters::Converter - include Increase::Internal::Type::RequestParameters - - attr_accessor status: Increase::Models::Simulations::CardDisputeActionParams::status - - attr_reader explanation: String? - - def explanation=: (String) -> String - - def initialize: ( - status: Increase::Models::Simulations::CardDisputeActionParams::status, - ?explanation: String, - ?request_options: Increase::request_opts - ) -> void - - def to_hash: -> { - status: Increase::Models::Simulations::CardDisputeActionParams::status, - explanation: String, - request_options: Increase::RequestOptions - } - - type status = - :pending_user_information | :accepted | :rejected | :lost | :won - - module Status - extend Increase::Internal::Type::Enum - - # Increase has requested more information related to the Card Dispute from you. - PENDING_USER_INFORMATION: :pending_user_information - - # The Card Dispute has been accepted and your funds have been returned. The card dispute will eventually transition into `won` or `lost` depending on the outcome. - ACCEPTED: :accepted - - # The Card Dispute has been rejected. - REJECTED: :rejected - - # The Card Dispute has been lost and funds previously credited from the acceptance have been debited. - LOST: :lost - - # The Card Dispute has been won and no further action can be taken. - WON: :won - - def self?.values: -> ::Array[Increase::Models::Simulations::CardDisputeActionParams::status] - end - end - end - end -end diff --git a/sig/increase/models/transaction.rbs b/sig/increase/models/transaction.rbs index 6b1966573..202d5c42f 100644 --- a/sig/increase/models/transaction.rbs +++ b/sig/increase/models/transaction.rbs @@ -768,32 +768,21 @@ module Increase end type card_dispute_acceptance = - { accepted_at: Time, card_dispute_id: String, transaction_id: String } + { accepted_at: Time, transaction_id: String } class CardDisputeAcceptance < Increase::Internal::Type::BaseModel attr_accessor accepted_at: Time - attr_accessor card_dispute_id: String - attr_accessor transaction_id: String - def initialize: ( - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - ) -> void + def initialize: (accepted_at: Time, transaction_id: String) -> void - def to_hash: -> { - accepted_at: Time, - card_dispute_id: String, - transaction_id: String - } + def to_hash: -> { accepted_at: Time, transaction_id: String } end type card_dispute_financial = { amount: Integer, - card_dispute_id: String, network: Increase::Models::Transaction::Source::CardDisputeFinancial::network, transaction_id: String, visa: Increase::Transaction::Source::CardDisputeFinancial::Visa? @@ -802,8 +791,6 @@ module Increase class CardDisputeFinancial < Increase::Internal::Type::BaseModel attr_accessor amount: Integer - attr_accessor card_dispute_id: String - attr_accessor network: Increase::Models::Transaction::Source::CardDisputeFinancial::network attr_accessor transaction_id: String @@ -812,7 +799,6 @@ module Increase def initialize: ( amount: Integer, - card_dispute_id: String, network: Increase::Models::Transaction::Source::CardDisputeFinancial::network, transaction_id: String, visa: Increase::Transaction::Source::CardDisputeFinancial::Visa? @@ -820,7 +806,6 @@ module Increase def to_hash: -> { amount: Integer, - card_dispute_id: String, network: Increase::Models::Transaction::Source::CardDisputeFinancial::network, transaction_id: String, visa: Increase::Transaction::Source::CardDisputeFinancial::Visa? @@ -892,16 +877,9 @@ module Increase end type card_dispute_loss = - { - card_dispute_id: String, - explanation: String, - lost_at: Time, - transaction_id: String - } + { explanation: String, lost_at: Time, transaction_id: String } class CardDisputeLoss < Increase::Internal::Type::BaseModel - attr_accessor card_dispute_id: String - attr_accessor explanation: String attr_accessor lost_at: Time @@ -909,14 +887,12 @@ module Increase attr_accessor transaction_id: String def initialize: ( - card_dispute_id: String, explanation: String, lost_at: Time, transaction_id: String ) -> void def to_hash: -> { - card_dispute_id: String, explanation: String, lost_at: Time, transaction_id: String diff --git a/sig/increase/resources/card_disputes.rbs b/sig/increase/resources/card_disputes.rbs deleted file mode 100644 index 6afd68668..000000000 --- a/sig/increase/resources/card_disputes.rbs +++ /dev/null @@ -1,28 +0,0 @@ -module Increase - module Resources - class CardDisputes - def create: ( - disputed_transaction_id: String, - explanation: String, - ?amount: Integer, - ?request_options: Increase::request_opts - ) -> Increase::CardDispute - - def retrieve: ( - String card_dispute_id, - ?request_options: Increase::request_opts - ) -> Increase::CardDispute - - def list: ( - ?created_at: Increase::CardDisputeListParams::CreatedAt, - ?cursor: String, - ?idempotency_key: String, - ?limit: Integer, - ?status: Increase::CardDisputeListParams::Status, - ?request_options: Increase::request_opts - ) -> Increase::Internal::Page[Increase::CardDispute] - - def initialize: (client: Increase::Client) -> void - end - end -end diff --git a/sig/increase/resources/simulations.rbs b/sig/increase/resources/simulations.rbs index 3944fd33a..13152240e 100644 --- a/sig/increase/resources/simulations.rbs +++ b/sig/increase/resources/simulations.rbs @@ -19,8 +19,6 @@ module Increase attr_reader card_refunds: Increase::Resources::Simulations::CardRefunds - attr_reader card_disputes: Increase::Resources::Simulations::CardDisputes - attr_reader physical_cards: Increase::Resources::Simulations::PhysicalCards attr_reader digital_wallet_token_requests: Increase::Resources::Simulations::DigitalWalletTokenRequests diff --git a/sig/increase/resources/simulations/card_disputes.rbs b/sig/increase/resources/simulations/card_disputes.rbs deleted file mode 100644 index 26900c6d8..000000000 --- a/sig/increase/resources/simulations/card_disputes.rbs +++ /dev/null @@ -1,16 +0,0 @@ -module Increase - module Resources - class Simulations - class CardDisputes - def action: ( - String card_dispute_id, - status: Increase::Models::Simulations::CardDisputeActionParams::status, - ?explanation: String, - ?request_options: Increase::request_opts - ) -> Increase::CardDispute - - def initialize: (client: Increase::Client) -> void - end - end - end -end diff --git a/test/increase/resources/card_disputes_test.rb b/test/increase/resources/card_disputes_test.rb deleted file mode 100644 index 24e147324..000000000 --- a/test/increase/resources/card_disputes_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class Increase::Test::Resources::CardDisputesTest < Increase::Test::ResourceTest - def test_create_required_params - response = - @increase.card_disputes.create( - disputed_transaction_id: "transaction_uyrp7fld2ium70oa7oi", - explanation: "Unauthorized recurring transaction." - ) - - assert_pattern do - response => Increase::CardDispute - end - - assert_pattern do - response => { - id: String, - acceptance: Increase::CardDispute::Acceptance | nil, - amount: Integer | nil, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String | nil, - loss: Increase::CardDispute::Loss | nil, - rejection: Increase::CardDispute::Rejection | nil, - status: Increase::CardDispute::Status, - type: Increase::CardDispute::Type, - win: Increase::CardDispute::Win | nil - } - end - end - - def test_retrieve - response = @increase.card_disputes.retrieve("card_dispute_id") - - assert_pattern do - response => Increase::CardDispute - end - - assert_pattern do - response => { - id: String, - acceptance: Increase::CardDispute::Acceptance | nil, - amount: Integer | nil, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String | nil, - loss: Increase::CardDispute::Loss | nil, - rejection: Increase::CardDispute::Rejection | nil, - status: Increase::CardDispute::Status, - type: Increase::CardDispute::Type, - win: Increase::CardDispute::Win | nil - } - end - end - - def test_list - response = @increase.card_disputes.list - - assert_pattern do - response => Increase::Internal::Page - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => Increase::CardDispute - end - - assert_pattern do - row => { - id: String, - acceptance: Increase::CardDispute::Acceptance | nil, - amount: Integer | nil, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String | nil, - loss: Increase::CardDispute::Loss | nil, - rejection: Increase::CardDispute::Rejection | nil, - status: Increase::CardDispute::Status, - type: Increase::CardDispute::Type, - win: Increase::CardDispute::Win | nil - } - end - end -end diff --git a/test/increase/resources/simulations/card_disputes_test.rb b/test/increase/resources/simulations/card_disputes_test.rb deleted file mode 100644 index d0d45e336..000000000 --- a/test/increase/resources/simulations/card_disputes_test.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class Increase::Test::Resources::Simulations::CardDisputesTest < Increase::Test::ResourceTest - def test_action_required_params - response = @increase.simulations.card_disputes.action("card_dispute_id", status: :rejected) - - assert_pattern do - response => Increase::CardDispute - end - - assert_pattern do - response => { - id: String, - acceptance: Increase::CardDispute::Acceptance | nil, - amount: Integer | nil, - created_at: Time, - disputed_transaction_id: String, - explanation: String, - idempotency_key: String | nil, - loss: Increase::CardDispute::Loss | nil, - rejection: Increase::CardDispute::Rejection | nil, - status: Increase::CardDispute::Status, - type: Increase::CardDispute::Type, - win: Increase::CardDispute::Win | nil - } - end - end -end From 494c46e8ae2817cf8fd6d43f7108003154d4e36a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 22:36:36 +0000 Subject: [PATCH 3/3] release: 1.80.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/increase/version.rb | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 36925cfe9..73077f4af 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.79.0" + ".": "1.80.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b2f1971f1..219cedcd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.80.0 (2025-09-17) + +Full Changelog: [v1.79.0...v1.80.0](https://github.com/Increase/increase-ruby/compare/v1.79.0...v1.80.0) + +### Features + +* **api:** api update ([d16cb6a](https://github.com/Increase/increase-ruby/commit/d16cb6abc1e6f4ca71d86374cde091360d657602)) +* expose response headers for both streams and errors ([17ddacf](https://github.com/Increase/increase-ruby/commit/17ddacf1c78a6f3e52a2f007d8efebab892db46e)) + ## 1.79.0 (2025-09-17) Full Changelog: [v1.78.0...v1.79.0](https://github.com/Increase/increase-ruby/compare/v1.78.0...v1.79.0) diff --git a/Gemfile.lock b/Gemfile.lock index 8045d3e19..76633669a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (1.79.0) + increase (1.80.0) connection_pool GEM diff --git a/README.md b/README.md index 1a5744aa6..23397957f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "increase", "~> 1.79.0" +gem "increase", "~> 1.80.0" ``` diff --git a/lib/increase/version.rb b/lib/increase/version.rb index dbf8cfef0..0d857e839 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "1.79.0" + VERSION = "1.80.0" end