stripe-ruby/rbi/stripe/services/transfer_reversal_service.rbi

129 lines
8.2 KiB
Ruby

# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
class TransferReversalService < StripeService
class ListParams < Stripe::RequestParams
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
sig { returns(T.nilable(String)) }
def ending_before; end
sig { params(_ending_before: T.nilable(String)).returns(T.nilable(String)) }
def ending_before=(_ending_before); end
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
def expand; end
sig { params(_expand: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def expand=(_expand); end
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
sig { returns(T.nilable(Integer)) }
def limit; end
sig { params(_limit: T.nilable(Integer)).returns(T.nilable(Integer)) }
def limit=(_limit); end
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
sig { returns(T.nilable(String)) }
def starting_after; end
sig { params(_starting_after: T.nilable(String)).returns(T.nilable(String)) }
def starting_after=(_starting_after); end
sig {
params(ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), starting_after: T.nilable(String)).void
}
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil); end
end
class CreateParams < Stripe::RequestParams
# A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount.
sig { returns(T.nilable(Integer)) }
def amount; end
sig { params(_amount: T.nilable(Integer)).returns(T.nilable(Integer)) }
def amount=(_amount); end
# An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value.
sig { returns(T.nilable(String)) }
def description; end
sig { params(_description: T.nilable(String)).returns(T.nilable(String)) }
def description=(_description); end
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
def expand; end
sig { params(_expand: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def expand=(_expand); end
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
def metadata; end
sig {
params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String])))
}
def metadata=(_metadata); end
# Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed.
sig { returns(T.nilable(T::Boolean)) }
def refund_application_fee; end
sig { params(_refund_application_fee: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
def refund_application_fee=(_refund_application_fee); end
sig {
params(amount: T.nilable(Integer), description: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String])), refund_application_fee: T.nilable(T::Boolean)).void
}
def initialize(
amount: nil,
description: nil,
expand: nil,
metadata: nil,
refund_application_fee: nil
); end
end
class RetrieveParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
def expand; end
sig { params(_expand: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def expand=(_expand); end
sig { params(expand: T.nilable(T::Array[String])).void }
def initialize(expand: nil); end
end
class UpdateParams < Stripe::RequestParams
# Specifies which fields in the response should be expanded.
sig { returns(T.nilable(T::Array[String])) }
def expand; end
sig { params(_expand: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def expand=(_expand); end
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
def metadata; end
sig {
params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String])))
}
def metadata=(_metadata); end
sig {
params(expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String]))).void
}
def initialize(expand: nil, metadata: nil); end
end
# When you create a new reversal, you must specify a transfer to create it on.
#
# When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed.
#
# Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer.
sig {
params(id: String, params: T.any(::Stripe::TransferReversalService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Reversal)
}
def create(id, params = {}, opts = {}); end
# You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals.
sig {
params(id: String, params: T.any(::Stripe::TransferReversalService::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
}
def list(id, params = {}, opts = {}); end
# By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer.
sig {
params(transfer: String, id: String, params: T.any(::Stripe::TransferReversalService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Reversal)
}
def retrieve(transfer, id, params = {}, opts = {}); end
# Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
#
# This request only accepts metadata and description as arguments.
sig {
params(transfer: String, id: String, params: T.any(::Stripe::TransferReversalService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Reversal)
}
def update(transfer, id, params = {}, opts = {}); end
end
end