Skip to content

Commit

Permalink
feat: use Time type instead of String (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-ci-bot committed Feb 26, 2025
1 parent 7433b72 commit 43a8bce
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
12 changes: 6 additions & 6 deletions lib/modern_treasury/models/internal_accounts/balance_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class BalanceReport < ModernTreasury::BaseModel
# @!attribute as_of_time
# The time (24-hour clock) of the balance report in local time.
#
# @return [String, nil]
required :as_of_time, String, nil?: true
# @return [Time, nil]
required :as_of_time, Time, nil?: true

# @!attribute balance_report_type
# The specific type of balance report. One of `intraday`, `previous_day`,
Expand Down Expand Up @@ -67,7 +67,7 @@ class BalanceReport < ModernTreasury::BaseModel
# @!parse
# # @param id [String]
# # @param as_of_date [Date]
# # @param as_of_time [String, nil]
# # @param as_of_time [Time, nil]
# # @param balance_report_type [Symbol, ModernTreasury::Models::InternalAccounts::BalanceReport::BalanceReportType]
# # @param balances [Array<ModernTreasury::Models::InternalAccounts::BalanceReport::Balance>]
# # @param created_at [Time]
Expand Down Expand Up @@ -147,8 +147,8 @@ class Balance < ModernTreasury::BaseModel
# @!attribute as_of_time
# The time on which the balance became true for the account.
#
# @return [String, nil]
required :as_of_time, String, nil?: true
# @return [Time, nil]
required :as_of_time, Time, nil?: true

# @!attribute balance_type
# The specific type of balance reported. One of `opening_ledger`,
Expand Down Expand Up @@ -213,7 +213,7 @@ class Balance < ModernTreasury::BaseModel
# # @param id [String]
# # @param amount [Integer]
# # @param as_of_date [Date, nil]
# # @param as_of_time [String, nil]
# # @param as_of_time [Time, nil]
# # @param balance_type [Symbol, ModernTreasury::Models::InternalAccounts::BalanceReport::Balance::BalanceType]
# # @param created_at [Time]
# # @param currency [Symbol, ModernTreasury::Models::Currency]
Expand Down
6 changes: 3 additions & 3 deletions lib/modern_treasury/models/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Transaction < ModernTreasury::BaseModel
# The time on which the transaction occurred. Depending on the granularity of the
# timestamp information received from the bank, it may be `null`.
#
# @return [String, nil]
required :as_of_time, String, nil?: true
# @return [Time, nil]
required :as_of_time, Time, nil?: true

# @!attribute as_of_timezone
# The timezone in which the `as_of_time` is represented. Can be `null` if the bank
Expand Down Expand Up @@ -178,7 +178,7 @@ class Transaction < ModernTreasury::BaseModel
# # @param id [String]
# # @param amount [Integer]
# # @param as_of_date [Date, nil]
# # @param as_of_time [String, nil]
# # @param as_of_time [Time, nil]
# # @param as_of_timezone [String, nil]
# # @param created_at [Time]
# # @param currency [Symbol, ModernTreasury::Models::Currency]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ module ModernTreasury
def as_of_date=(_)
end

sig { returns(T.nilable(String)) }
sig { returns(T.nilable(Time)) }
def as_of_time
end

sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) }
def as_of_time=(_)
end

Expand Down Expand Up @@ -91,7 +91,7 @@ module ModernTreasury
params(
id: String,
as_of_date: Date,
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
balance_report_type: Symbol,
balances: T::Array[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance],
created_at: Time,
Expand Down Expand Up @@ -122,7 +122,7 @@ module ModernTreasury
{
id: String,
as_of_date: Date,
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
balance_report_type: Symbol,
balances: T::Array[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance],
created_at: Time,
Expand Down Expand Up @@ -174,11 +174,11 @@ module ModernTreasury
def as_of_date=(_)
end

sig { returns(T.nilable(String)) }
sig { returns(T.nilable(Time)) }
def as_of_time
end

sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) }
def as_of_time=(_)
end

Expand Down Expand Up @@ -259,7 +259,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: T.nilable(Date),
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
balance_type: Symbol,
created_at: Time,
currency: Symbol,
Expand Down Expand Up @@ -296,7 +296,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: T.nilable(Date),
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
balance_type: Symbol,
created_at: Time,
currency: Symbol,
Expand Down
8 changes: 4 additions & 4 deletions rbi/lib/modern_treasury/models/transaction.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ module ModernTreasury
def as_of_date=(_)
end

sig { returns(T.nilable(String)) }
sig { returns(T.nilable(Time)) }
def as_of_time
end

sig { params(_: T.nilable(String)).returns(T.nilable(String)) }
sig { params(_: T.nilable(Time)).returns(T.nilable(Time)) }
def as_of_time=(_)
end

Expand Down Expand Up @@ -211,7 +211,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: T.nilable(Date),
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
as_of_timezone: T.nilable(String),
created_at: Time,
currency: Symbol,
Expand Down Expand Up @@ -272,7 +272,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: T.nilable(Date),
as_of_time: T.nilable(String),
as_of_time: T.nilable(Time),
as_of_timezone: T.nilable(String),
created_at: Time,
currency: Symbol,
Expand Down
12 changes: 6 additions & 6 deletions sig/modern_treasury/models/internal_accounts/balance_report.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ModernTreasury
{
id: String,
as_of_date: Date,
as_of_time: String?,
as_of_time: Time?,
balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::balance_report_type,
balances: ::Array[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance],
created_at: Time,
Expand All @@ -20,7 +20,7 @@ module ModernTreasury

attr_accessor as_of_date: Date

attr_accessor as_of_time: String?
attr_accessor as_of_time: Time?

attr_accessor balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::balance_report_type

Expand All @@ -40,7 +40,7 @@ module ModernTreasury
(
id: String,
as_of_date: Date,
as_of_time: String?,
as_of_time: Time?,
balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::balance_report_type,
balances: ::Array[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance],
created_at: Time,
Expand Down Expand Up @@ -73,7 +73,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: Date?,
as_of_time: String?,
as_of_time: Time?,
balance_type: ModernTreasury::Models::InternalAccounts::BalanceReport::Balance::balance_type,
created_at: Time,
currency: ModernTreasury::Models::currency,
Expand All @@ -92,7 +92,7 @@ module ModernTreasury

attr_accessor as_of_date: Date?

attr_accessor as_of_time: String?
attr_accessor as_of_time: Time?

attr_accessor balance_type: ModernTreasury::Models::InternalAccounts::BalanceReport::Balance::balance_type

Expand All @@ -117,7 +117,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: Date?,
as_of_time: String?,
as_of_time: Time?,
balance_type: ModernTreasury::Models::InternalAccounts::BalanceReport::Balance::balance_type,
created_at: Time,
currency: ModernTreasury::Models::currency,
Expand Down
6 changes: 3 additions & 3 deletions sig/modern_treasury/models/transaction.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: Date?,
as_of_time: String?,
as_of_time: Time?,
as_of_timezone: String?,
created_at: Time,
currency: ModernTreasury::Models::currency,
Expand Down Expand Up @@ -36,7 +36,7 @@ module ModernTreasury

attr_accessor as_of_date: Date?

attr_accessor as_of_time: String?
attr_accessor as_of_time: Time?

attr_accessor as_of_timezone: String?

Expand Down Expand Up @@ -87,7 +87,7 @@ module ModernTreasury
id: String,
amount: Integer,
as_of_date: Date?,
as_of_time: String?,
as_of_time: Time?,
as_of_timezone: String?,
created_at: Time,
currency: ModernTreasury::Models::currency,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_create_required_params
response => {
id: String,
as_of_date: Date,
as_of_time: String | nil,
as_of_time: Time | nil,
balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::BalanceReportType,
balances: ^(ModernTreasury::ArrayOf[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance]),
created_at: Time,
Expand All @@ -61,7 +61,7 @@ def test_retrieve_required_params
response => {
id: String,
as_of_date: Date,
as_of_time: String | nil,
as_of_time: Time | nil,
balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::BalanceReportType,
balances: ^(ModernTreasury::ArrayOf[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance]),
created_at: Time,
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_list
row => {
id: String,
as_of_date: Date,
as_of_time: String | nil,
as_of_time: Time | nil,
balance_report_type: ModernTreasury::Models::InternalAccounts::BalanceReport::BalanceReportType,
balances: ^(ModernTreasury::ArrayOf[ModernTreasury::Models::InternalAccounts::BalanceReport::Balance]),
created_at: Time,
Expand Down
8 changes: 4 additions & 4 deletions test/modern_treasury/resources/transactions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_create_required_params
id: String,
amount: Integer,
as_of_date: Date | nil,
as_of_time: String | nil,
as_of_time: Time | nil,
as_of_timezone: String | nil,
created_at: Time,
currency: ModernTreasury::Models::Currency,
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_retrieve
id: String,
amount: Integer,
as_of_date: Date | nil,
as_of_time: String | nil,
as_of_time: Time | nil,
as_of_timezone: String | nil,
created_at: Time,
currency: ModernTreasury::Models::Currency,
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_update
id: String,
amount: Integer,
as_of_date: Date | nil,
as_of_time: String | nil,
as_of_time: Time | nil,
as_of_timezone: String | nil,
created_at: Time,
currency: ModernTreasury::Models::Currency,
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_list
id: String,
amount: Integer,
as_of_date: Date | nil,
as_of_time: String | nil,
as_of_time: Time | nil,
as_of_timezone: String | nil,
created_at: Time,
currency: ModernTreasury::Models::Currency,
Expand Down

0 comments on commit 43a8bce

Please sign in to comment.