Try to use generated yookassa client (unsuccessful)

This commit is contained in:
2026-03-17 16:37:29 +03:00
parent 35f6dc6ca0
commit 2c19b9c29b
14 changed files with 867 additions and 698 deletions

View File

@@ -684,6 +684,33 @@ func (s *BadRequestType) UnmarshalText(data []byte) error {
}
}
// Merged schema.
// Ref: #/components/schemas/bank_card
type BankCard struct {
Type PayoutDestinationDataType `json:"type"`
Card CardDataForPayoutDestination `json:"card"`
}
// GetType returns the value of Type.
func (s *BankCard) GetType() PayoutDestinationDataType {
return s.Type
}
// GetCard returns the value of Card.
func (s *BankCard) GetCard() CardDataForPayoutDestination {
return s.Card
}
// SetType sets the value of Type.
func (s *BankCard) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetCard sets the value of Card.
func (s *BankCard) SetCard(val CardDataForPayoutDestination) {
s.Card = val
}
// Данные банковской карты.
// Ref: #/components/schemas/BankCardData
type BankCardData struct {
@@ -18581,6 +18608,7 @@ type PayoutRequest struct {
// только для разных типов данных.
PersonalData []PayoutsPersonalData `json:"personal_data"`
Metadata OptMetadata `json:"metadata"`
Test OptTest `json:"test"`
}
// GetAmount returns the value of Amount.
@@ -18623,6 +18651,11 @@ func (s *PayoutRequest) GetMetadata() OptMetadata {
return s.Metadata
}
// GetTest returns the value of Test.
func (s *PayoutRequest) GetTest() OptTest {
return s.Test
}
// SetAmount sets the value of Amount.
func (s *PayoutRequest) SetAmount(val PayoutRequestAmount) {
s.Amount = val
@@ -18663,6 +18696,11 @@ func (s *PayoutRequest) SetMetadata(val OptMetadata) {
s.Metadata = val
}
// SetTest sets the value of Test.
func (s *PayoutRequest) SetTest(val OptTest) {
s.Test = val
}
// Сумма в выбранной валюте.
type PayoutRequestAmount struct {
// Сумма в выбранной валюте. Всегда дробное значение.
@@ -18695,10 +18733,10 @@ func (s *PayoutRequestAmount) SetCurrency(val CurrencyCode) {
// PayoutRequestPayoutDestinationData represents sum type.
type PayoutRequestPayoutDestinationData struct {
Type PayoutRequestPayoutDestinationDataType // switch on this field
PayoutToYooMoneyDestinationData PayoutToYooMoneyDestinationData
PayoutToBankCardDestinationData PayoutToBankCardDestinationData
PayoutToSbpDestinationData PayoutToSbpDestinationData
Type PayoutRequestPayoutDestinationDataType // switch on this field
YooMoney YooMoney
BankCard BankCard
Sbp Sbp
}
// PayoutRequestPayoutDestinationDataType is oneOf type of PayoutRequestPayoutDestinationData.
@@ -18706,86 +18744,86 @@ type PayoutRequestPayoutDestinationDataType string
// Possible values for PayoutRequestPayoutDestinationDataType.
const (
PayoutToYooMoneyDestinationDataPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "PayoutToYooMoneyDestinationData"
PayoutToBankCardDestinationDataPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "PayoutToBankCardDestinationData"
PayoutToSbpDestinationDataPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "PayoutToSbpDestinationData"
YooMoneyPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "yoo_money"
BankCardPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "bank_card"
SbpPayoutRequestPayoutDestinationData PayoutRequestPayoutDestinationDataType = "sbp"
)
// IsPayoutToYooMoneyDestinationData reports whether PayoutRequestPayoutDestinationData is PayoutToYooMoneyDestinationData.
func (s PayoutRequestPayoutDestinationData) IsPayoutToYooMoneyDestinationData() bool {
return s.Type == PayoutToYooMoneyDestinationDataPayoutRequestPayoutDestinationData
// IsYooMoney reports whether PayoutRequestPayoutDestinationData is YooMoney.
func (s PayoutRequestPayoutDestinationData) IsYooMoney() bool {
return s.Type == YooMoneyPayoutRequestPayoutDestinationData
}
// IsPayoutToBankCardDestinationData reports whether PayoutRequestPayoutDestinationData is PayoutToBankCardDestinationData.
func (s PayoutRequestPayoutDestinationData) IsPayoutToBankCardDestinationData() bool {
return s.Type == PayoutToBankCardDestinationDataPayoutRequestPayoutDestinationData
// IsBankCard reports whether PayoutRequestPayoutDestinationData is BankCard.
func (s PayoutRequestPayoutDestinationData) IsBankCard() bool {
return s.Type == BankCardPayoutRequestPayoutDestinationData
}
// IsPayoutToSbpDestinationData reports whether PayoutRequestPayoutDestinationData is PayoutToSbpDestinationData.
func (s PayoutRequestPayoutDestinationData) IsPayoutToSbpDestinationData() bool {
return s.Type == PayoutToSbpDestinationDataPayoutRequestPayoutDestinationData
// IsSbp reports whether PayoutRequestPayoutDestinationData is Sbp.
func (s PayoutRequestPayoutDestinationData) IsSbp() bool {
return s.Type == SbpPayoutRequestPayoutDestinationData
}
// SetPayoutToYooMoneyDestinationData sets PayoutRequestPayoutDestinationData to PayoutToYooMoneyDestinationData.
func (s *PayoutRequestPayoutDestinationData) SetPayoutToYooMoneyDestinationData(v PayoutToYooMoneyDestinationData) {
s.Type = PayoutToYooMoneyDestinationDataPayoutRequestPayoutDestinationData
s.PayoutToYooMoneyDestinationData = v
// SetYooMoney sets PayoutRequestPayoutDestinationData to YooMoney.
func (s *PayoutRequestPayoutDestinationData) SetYooMoney(v YooMoney) {
s.Type = YooMoneyPayoutRequestPayoutDestinationData
s.YooMoney = v
}
// GetPayoutToYooMoneyDestinationData returns PayoutToYooMoneyDestinationData and true boolean if PayoutRequestPayoutDestinationData is PayoutToYooMoneyDestinationData.
func (s PayoutRequestPayoutDestinationData) GetPayoutToYooMoneyDestinationData() (v PayoutToYooMoneyDestinationData, ok bool) {
if !s.IsPayoutToYooMoneyDestinationData() {
// GetYooMoney returns YooMoney and true boolean if PayoutRequestPayoutDestinationData is YooMoney.
func (s PayoutRequestPayoutDestinationData) GetYooMoney() (v YooMoney, ok bool) {
if !s.IsYooMoney() {
return v, false
}
return s.PayoutToYooMoneyDestinationData, true
return s.YooMoney, true
}
// NewPayoutToYooMoneyDestinationDataPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from PayoutToYooMoneyDestinationData.
func NewPayoutToYooMoneyDestinationDataPayoutRequestPayoutDestinationData(v PayoutToYooMoneyDestinationData) PayoutRequestPayoutDestinationData {
// NewYooMoneyPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from YooMoney.
func NewYooMoneyPayoutRequestPayoutDestinationData(v YooMoney) PayoutRequestPayoutDestinationData {
var s PayoutRequestPayoutDestinationData
s.SetPayoutToYooMoneyDestinationData(v)
s.SetYooMoney(v)
return s
}
// SetPayoutToBankCardDestinationData sets PayoutRequestPayoutDestinationData to PayoutToBankCardDestinationData.
func (s *PayoutRequestPayoutDestinationData) SetPayoutToBankCardDestinationData(v PayoutToBankCardDestinationData) {
s.Type = PayoutToBankCardDestinationDataPayoutRequestPayoutDestinationData
s.PayoutToBankCardDestinationData = v
// SetBankCard sets PayoutRequestPayoutDestinationData to BankCard.
func (s *PayoutRequestPayoutDestinationData) SetBankCard(v BankCard) {
s.Type = BankCardPayoutRequestPayoutDestinationData
s.BankCard = v
}
// GetPayoutToBankCardDestinationData returns PayoutToBankCardDestinationData and true boolean if PayoutRequestPayoutDestinationData is PayoutToBankCardDestinationData.
func (s PayoutRequestPayoutDestinationData) GetPayoutToBankCardDestinationData() (v PayoutToBankCardDestinationData, ok bool) {
if !s.IsPayoutToBankCardDestinationData() {
// GetBankCard returns BankCard and true boolean if PayoutRequestPayoutDestinationData is BankCard.
func (s PayoutRequestPayoutDestinationData) GetBankCard() (v BankCard, ok bool) {
if !s.IsBankCard() {
return v, false
}
return s.PayoutToBankCardDestinationData, true
return s.BankCard, true
}
// NewPayoutToBankCardDestinationDataPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from PayoutToBankCardDestinationData.
func NewPayoutToBankCardDestinationDataPayoutRequestPayoutDestinationData(v PayoutToBankCardDestinationData) PayoutRequestPayoutDestinationData {
// NewBankCardPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from BankCard.
func NewBankCardPayoutRequestPayoutDestinationData(v BankCard) PayoutRequestPayoutDestinationData {
var s PayoutRequestPayoutDestinationData
s.SetPayoutToBankCardDestinationData(v)
s.SetBankCard(v)
return s
}
// SetPayoutToSbpDestinationData sets PayoutRequestPayoutDestinationData to PayoutToSbpDestinationData.
func (s *PayoutRequestPayoutDestinationData) SetPayoutToSbpDestinationData(v PayoutToSbpDestinationData) {
s.Type = PayoutToSbpDestinationDataPayoutRequestPayoutDestinationData
s.PayoutToSbpDestinationData = v
// SetSbp sets PayoutRequestPayoutDestinationData to Sbp.
func (s *PayoutRequestPayoutDestinationData) SetSbp(v Sbp) {
s.Type = SbpPayoutRequestPayoutDestinationData
s.Sbp = v
}
// GetPayoutToSbpDestinationData returns PayoutToSbpDestinationData and true boolean if PayoutRequestPayoutDestinationData is PayoutToSbpDestinationData.
func (s PayoutRequestPayoutDestinationData) GetPayoutToSbpDestinationData() (v PayoutToSbpDestinationData, ok bool) {
if !s.IsPayoutToSbpDestinationData() {
// GetSbp returns Sbp and true boolean if PayoutRequestPayoutDestinationData is Sbp.
func (s PayoutRequestPayoutDestinationData) GetSbp() (v Sbp, ok bool) {
if !s.IsSbp() {
return v, false
}
return s.PayoutToSbpDestinationData, true
return s.Sbp, true
}
// NewPayoutToSbpDestinationDataPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from PayoutToSbpDestinationData.
func NewPayoutToSbpDestinationDataPayoutRequestPayoutDestinationData(v PayoutToSbpDestinationData) PayoutRequestPayoutDestinationData {
// NewSbpPayoutRequestPayoutDestinationData returns new PayoutRequestPayoutDestinationData from Sbp.
func NewSbpPayoutRequestPayoutDestinationData(v Sbp) PayoutRequestPayoutDestinationData {
var s PayoutRequestPayoutDestinationData
s.SetPayoutToSbpDestinationData(v)
s.SetSbp(v)
return s
}
@@ -18935,33 +18973,6 @@ func (s *PayoutStatus) UnmarshalText(data []byte) error {
}
}
// Merged schema.
// Ref: #/components/schemas/PayoutToBankCardDestinationData
type PayoutToBankCardDestinationData struct {
Type PayoutDestinationDataType `json:"type"`
Card CardDataForPayoutDestination `json:"card"`
}
// GetType returns the value of Type.
func (s *PayoutToBankCardDestinationData) GetType() PayoutDestinationDataType {
return s.Type
}
// GetCard returns the value of Card.
func (s *PayoutToBankCardDestinationData) GetCard() CardDataForPayoutDestination {
return s.Card
}
// SetType sets the value of Type.
func (s *PayoutToBankCardDestinationData) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetCard sets the value of Card.
func (s *PayoutToBankCardDestinationData) SetCard(val CardDataForPayoutDestination) {
s.Card = val
}
// Merged schema.
// Ref: #/components/schemas/PayoutToCardDestination
type PayoutToCardDestination struct {
@@ -19044,44 +19055,6 @@ func (s *PayoutToSbpDestination) SetRecipientChecked(val bool) {
s.RecipientChecked = val
}
// Merged schema.
// Ref: #/components/schemas/PayoutToSbpDestinationData
type PayoutToSbpDestinationData struct {
Type PayoutDestinationDataType `json:"type"`
Phone string `json:"phone"`
BankID string `json:"bank_id"`
}
// GetType returns the value of Type.
func (s *PayoutToSbpDestinationData) GetType() PayoutDestinationDataType {
return s.Type
}
// GetPhone returns the value of Phone.
func (s *PayoutToSbpDestinationData) GetPhone() string {
return s.Phone
}
// GetBankID returns the value of BankID.
func (s *PayoutToSbpDestinationData) GetBankID() string {
return s.BankID
}
// SetType sets the value of Type.
func (s *PayoutToSbpDestinationData) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetPhone sets the value of Phone.
func (s *PayoutToSbpDestinationData) SetPhone(val string) {
s.Phone = val
}
// SetBankID sets the value of BankID.
func (s *PayoutToSbpDestinationData) SetBankID(val string) {
s.BankID = val
}
// Merged schema.
// Ref: #/components/schemas/PayoutToYooMoneyDestination
type PayoutToYooMoneyDestination struct {
@@ -19109,33 +19082,6 @@ func (s *PayoutToYooMoneyDestination) SetAccountNumber(val YooMoneyAccountNumber
s.AccountNumber = val
}
// Merged schema.
// Ref: #/components/schemas/PayoutToYooMoneyDestinationData
type PayoutToYooMoneyDestinationData struct {
Type PayoutDestinationDataType `json:"type"`
AccountNumber string `json:"account_number"`
}
// GetType returns the value of Type.
func (s *PayoutToYooMoneyDestinationData) GetType() PayoutDestinationDataType {
return s.Type
}
// GetAccountNumber returns the value of AccountNumber.
func (s *PayoutToYooMoneyDestinationData) GetAccountNumber() string {
return s.AccountNumber
}
// SetType sets the value of Type.
func (s *PayoutToYooMoneyDestinationData) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetAccountNumber sets the value of AccountNumber.
func (s *PayoutToYooMoneyDestinationData) SetAccountNumber(val string) {
s.AccountNumber = val
}
type PayoutsGetInternalServerError TooManyRequests
func (*PayoutsGetInternalServerError) payoutsGetRes() {}
@@ -23333,6 +23279,44 @@ func (s *SavePaymentMethodType) UnmarshalText(data []byte) error {
}
}
// Merged schema.
// Ref: #/components/schemas/sbp
type Sbp struct {
Type PayoutDestinationDataType `json:"type"`
Phone string `json:"phone"`
BankID string `json:"bank_id"`
}
// GetType returns the value of Type.
func (s *Sbp) GetType() PayoutDestinationDataType {
return s.Type
}
// GetPhone returns the value of Phone.
func (s *Sbp) GetPhone() string {
return s.Phone
}
// GetBankID returns the value of BankID.
func (s *Sbp) GetBankID() string {
return s.BankID
}
// SetType sets the value of Type.
func (s *Sbp) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetPhone sets the value of Phone.
func (s *Sbp) SetPhone(val string) {
s.Phone = val
}
// SetBankID sets the value of BankID.
func (s *Sbp) SetBankID(val string) {
s.BankID = val
}
type SbpBankBic string
type SbpBankId string
@@ -24787,4 +24771,31 @@ type WebhooksWebhookIDDeleteOK struct{}
func (*WebhooksWebhookIDDeleteOK) webhooksWebhookIDDeleteRes() {}
// Merged schema.
// Ref: #/components/schemas/yoo_money
type YooMoney struct {
Type PayoutDestinationDataType `json:"type"`
AccountNumber string `json:"account_number"`
}
// GetType returns the value of Type.
func (s *YooMoney) GetType() PayoutDestinationDataType {
return s.Type
}
// GetAccountNumber returns the value of AccountNumber.
func (s *YooMoney) GetAccountNumber() string {
return s.AccountNumber
}
// SetType sets the value of Type.
func (s *YooMoney) SetType(val PayoutDestinationDataType) {
s.Type = val
}
// SetAccountNumber sets the value of AccountNumber.
func (s *YooMoney) SetAccountNumber(val string) {
s.AccountNumber = val
}
type YooMoneyAccountNumber string