Skip to content

Commit fb4f7d9

Browse files
fix(types): require Card fields, remove hostname in authorization approval webhook
1 parent a0fa401 commit fb4f7d9

4 files changed

Lines changed: 56 additions & 147 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 190
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0b90022fb88c44037dcbff183d3016a85fe7267c5b461f65a54262f734629a2b.yml
3-
openapi_spec_hash: 7b35e7c203748b3424b5931acd6dacf8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-0340e93de3d3691236aa19c800980112e05dc61fa13f8d8d7ca72e335720a31b.yml
3+
openapi_spec_hash: a271f7753dd6e560fcee7dd8b9e17927
44
config_hash: edbdfefeb0d3d927c2f9fe3402793215

lib/lithic/models/card_authorization_approval_request_webhook_event.rb

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -494,27 +494,20 @@ class Card < Lithic::Internal::Type::BaseModel
494494
# @!attribute token
495495
# Globally unique identifier for the card.
496496
#
497-
# @return [String, nil]
498-
optional :token, String
499-
500-
# @!attribute hostname
501-
# Hostname of card’s locked merchant (will be empty if not applicable)
502-
#
503-
# @return [String, nil]
504-
optional :hostname, String
497+
# @return [String]
498+
required :token, String
505499

506500
# @!attribute last_four
507501
# Last four digits of the card number
508502
#
509-
# @return [String, nil]
510-
optional :last_four, String
503+
# @return [String]
504+
required :last_four, String
511505

512506
# @!attribute memo
513-
# Customizable name to identify the card. We recommend against using this field to
514-
# store JSON data as it can cause unexpected behavior.
507+
# Customizable name to identify the card
515508
#
516-
# @return [String, nil]
517-
optional :memo, String
509+
# @return [String]
510+
required :memo, String
518511

519512
# @!attribute spend_limit
520513
# Amount (in cents) to limit approved authorizations. Purchase requests above the
@@ -526,29 +519,29 @@ class Card < Lithic::Internal::Type::BaseModel
526519
# charges (i.e., when a merchant sends a clearing message without a prior
527520
# authorization).
528521
#
529-
# @return [Integer, nil]
530-
optional :spend_limit, Integer
522+
# @return [Integer]
523+
required :spend_limit, Integer
531524

532525
# @!attribute spend_limit_duration
533526
# Note that to support recurring monthly payments, which can occur on different
534527
# day every month, the time window we consider for MONTHLY velocity starts 6 days
535528
# after the current calendar date one month prior.
536529
#
537-
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration, nil]
538-
optional :spend_limit_duration,
530+
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration]
531+
required :spend_limit_duration,
539532
enum: -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration }
540533

541534
# @!attribute state
542535
#
543-
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::State, nil]
544-
optional :state, enum: -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::State }
536+
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::State]
537+
required :state, enum: -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::State }
545538

546539
# @!attribute type
547540
#
548-
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::Type, nil]
549-
optional :type, enum: -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::Type }
541+
# @return [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::Type]
542+
required :type, enum: -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::Type }
550543

551-
# @!method initialize(token: nil, hostname: nil, last_four: nil, memo: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, type: nil)
544+
# @!method initialize(token:, last_four:, memo:, spend_limit:, spend_limit_duration:, state:, type:)
552545
# Some parameter documentations has been truncated, see
553546
# {Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card} for more
554547
# details.
@@ -557,11 +550,9 @@ class Card < Lithic::Internal::Type::BaseModel
557550
#
558551
# @param token [String] Globally unique identifier for the card.
559552
#
560-
# @param hostname [String] Hostname of card’s locked merchant (will be empty if not applicable)
561-
#
562553
# @param last_four [String] Last four digits of the card number
563554
#
564-
# @param memo [String] Customizable name to identify the card. We recommend against using this field to
555+
# @param memo [String] Customizable name to identify the card
565556
#
566557
# @param spend_limit [Integer] Amount (in cents) to limit approved authorizations. Purchase requests above the
567558
#

rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi

Lines changed: 23 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -944,33 +944,16 @@ module Lithic
944944
end
945945

946946
# Globally unique identifier for the card.
947-
sig { returns(T.nilable(String)) }
948-
attr_reader :token
949-
950-
sig { params(token: String).void }
951-
attr_writer :token
952-
953-
# Hostname of card’s locked merchant (will be empty if not applicable)
954-
sig { returns(T.nilable(String)) }
955-
attr_reader :hostname
956-
957-
sig { params(hostname: String).void }
958-
attr_writer :hostname
947+
sig { returns(String) }
948+
attr_accessor :token
959949

960950
# Last four digits of the card number
961-
sig { returns(T.nilable(String)) }
962-
attr_reader :last_four
963-
964-
sig { params(last_four: String).void }
965-
attr_writer :last_four
966-
967-
# Customizable name to identify the card. We recommend against using this field to
968-
# store JSON data as it can cause unexpected behavior.
969-
sig { returns(T.nilable(String)) }
970-
attr_reader :memo
951+
sig { returns(String) }
952+
attr_accessor :last_four
971953

972-
sig { params(memo: String).void }
973-
attr_writer :memo
954+
# Customizable name to identify the card
955+
sig { returns(String) }
956+
attr_accessor :memo
974957

975958
# Amount (in cents) to limit approved authorizations. Purchase requests above the
976959
# spend limit will be declined (refunds and credits will be approved).
@@ -980,71 +963,37 @@ module Lithic
980963
# reconciliation-level accuracy. Spend limits also cannot block force posted
981964
# charges (i.e., when a merchant sends a clearing message without a prior
982965
# authorization).
983-
sig { returns(T.nilable(Integer)) }
984-
attr_reader :spend_limit
985-
986-
sig { params(spend_limit: Integer).void }
987-
attr_writer :spend_limit
966+
sig { returns(Integer) }
967+
attr_accessor :spend_limit
988968

989969
# Note that to support recurring monthly payments, which can occur on different
990970
# day every month, the time window we consider for MONTHLY velocity starts 6 days
991971
# after the current calendar date one month prior.
992972
sig do
993973
returns(
994-
T.nilable(
995-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol
996-
)
974+
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol
997975
)
998976
end
999-
attr_reader :spend_limit_duration
1000-
1001-
sig do
1002-
params(
1003-
spend_limit_duration:
1004-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::SpendLimitDuration::OrSymbol
1005-
).void
1006-
end
1007-
attr_writer :spend_limit_duration
977+
attr_accessor :spend_limit_duration
1008978

1009979
sig do
1010980
returns(
1011-
T.nilable(
1012-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::State::TaggedSymbol
1013-
)
981+
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::State::TaggedSymbol
1014982
)
1015983
end
1016-
attr_reader :state
1017-
1018-
sig do
1019-
params(
1020-
state:
1021-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::State::OrSymbol
1022-
).void
1023-
end
1024-
attr_writer :state
984+
attr_accessor :state
1025985

1026986
sig do
1027987
returns(
1028-
T.nilable(
1029-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::Type::TaggedSymbol
1030-
)
988+
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::Type::TaggedSymbol
1031989
)
1032990
end
1033-
attr_reader :type
1034-
1035-
sig do
1036-
params(
1037-
type:
1038-
Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card::Type::OrSymbol
1039-
).void
1040-
end
1041-
attr_writer :type
991+
attr_accessor :type
1042992

1043993
# Card object in ASA
1044994
sig do
1045995
params(
1046996
token: String,
1047-
hostname: String,
1048997
last_four: String,
1049998
memo: String,
1050999
spend_limit: Integer,
@@ -1058,14 +1007,11 @@ module Lithic
10581007
end
10591008
def self.new(
10601009
# Globally unique identifier for the card.
1061-
token: nil,
1062-
# Hostname of card’s locked merchant (will be empty if not applicable)
1063-
hostname: nil,
1010+
token:,
10641011
# Last four digits of the card number
1065-
last_four: nil,
1066-
# Customizable name to identify the card. We recommend against using this field to
1067-
# store JSON data as it can cause unexpected behavior.
1068-
memo: nil,
1012+
last_four:,
1013+
# Customizable name to identify the card
1014+
memo:,
10691015
# Amount (in cents) to limit approved authorizations. Purchase requests above the
10701016
# spend limit will be declined (refunds and credits will be approved).
10711017
#
@@ -1074,21 +1020,20 @@ module Lithic
10741020
# reconciliation-level accuracy. Spend limits also cannot block force posted
10751021
# charges (i.e., when a merchant sends a clearing message without a prior
10761022
# authorization).
1077-
spend_limit: nil,
1023+
spend_limit:,
10781024
# Note that to support recurring monthly payments, which can occur on different
10791025
# day every month, the time window we consider for MONTHLY velocity starts 6 days
10801026
# after the current calendar date one month prior.
1081-
spend_limit_duration: nil,
1082-
state: nil,
1083-
type: nil
1027+
spend_limit_duration:,
1028+
state:,
1029+
type:
10841030
)
10851031
end
10861032

10871033
sig do
10881034
override.returns(
10891035
{
10901036
token: String,
1091-
hostname: String,
10921037
last_four: String,
10931038
memo: String,
10941039
spend_limit: Integer,

sig/lithic/models/card_authorization_approval_request_webhook_event.rbs

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ module Lithic
334334
type card =
335335
{
336336
token: String,
337-
hostname: String,
338337
last_four: String,
339338
memo: String,
340339
spend_limit: Integer,
@@ -344,58 +343,32 @@ module Lithic
344343
}
345344

346345
class Card < Lithic::Internal::Type::BaseModel
347-
attr_reader token: String?
346+
attr_accessor token: String
348347

349-
def token=: (String) -> String
348+
attr_accessor last_four: String
350349

351-
attr_reader hostname: String?
350+
attr_accessor memo: String
352351

353-
def hostname=: (String) -> String
352+
attr_accessor spend_limit: Integer
354353

355-
attr_reader last_four: String?
354+
attr_accessor spend_limit_duration: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration
356355

357-
def last_four=: (String) -> String
356+
attr_accessor state: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state
358357

359-
attr_reader memo: String?
360-
361-
def memo=: (String) -> String
362-
363-
attr_reader spend_limit: Integer?
364-
365-
def spend_limit=: (Integer) -> Integer
366-
367-
attr_reader spend_limit_duration: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration?
368-
369-
def spend_limit_duration=: (
370-
Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration
371-
) -> Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration
372-
373-
attr_reader state: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state?
374-
375-
def state=: (
376-
Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state
377-
) -> Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state
378-
379-
attr_reader type: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_?
380-
381-
def type=: (
382-
Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_
383-
) -> Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_
358+
attr_accessor type: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_
384359

385360
def initialize: (
386-
?token: String,
387-
?hostname: String,
388-
?last_four: String,
389-
?memo: String,
390-
?spend_limit: Integer,
391-
?spend_limit_duration: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration,
392-
?state: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state,
393-
?type: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_
361+
token: String,
362+
last_four: String,
363+
memo: String,
364+
spend_limit: Integer,
365+
spend_limit_duration: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::spend_limit_duration,
366+
state: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::state,
367+
type: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card::type_
394368
) -> void
395369

396370
def to_hash: -> {
397371
token: String,
398-
hostname: String,
399372
last_four: String,
400373
memo: String,
401374
spend_limit: Integer,

0 commit comments

Comments
 (0)