diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 141d5b24c..3546c73df 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -7,21 +7,37 @@ on: jobs: format: - if: ${{ github.event.commits != null && github.event.commits.length > 0 && !startsWith(github.event.head_commit.message, 'style(fmt)') }} + if: ${{ github.event.commits != null && !startsWith(github.event.head_commit.message, 'style(fmt)') }} permissions: contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Checkout Code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - - uses: actions/setup-go@v5 + + - name: Log Commit Details + run: | + echo "github.event.size: ${{ github.event.size }}" + echo "github.event.distinct_size: ${{ github.event.distinct_size }}" + echo "github.event.head_commit.message: ${{ github.event.head_commit.message }}" + + - name: Setup Go + uses: actions/setup-go@v5 with: go-version: 1.18 - - run: make fmt - - run: | + + - name: Format Code + run: make fmt + + - name: Configure Git + run: | git config user.name AdyenAutomationBot git config user.email "${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}" + + - name: Commit and Push Changes + run: | git add . git commit -m "style(fmt): code formatted" git push diff --git a/src/acswebhook/model_amount.go b/src/acswebhook/model_amount.go index 90af35568..5d0bfcd1d 100644 --- a/src/acswebhook/model_amount.go +++ b/src/acswebhook/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/acswebhook/model_authentication_notification_request.go b/src/acswebhook/model_authentication_notification_request.go index 5b186aa9a..04b270278 100644 --- a/src/acswebhook/model_authentication_notification_request.go +++ b/src/acswebhook/model_authentication_notification_request.go @@ -10,6 +10,7 @@ package acswebhook import ( "encoding/json" + "time" "github.com/adyen/adyen-go-api-library/v16/src/common" ) @@ -22,6 +23,8 @@ type AuthenticationNotificationRequest struct { Data AuthenticationNotificationData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` + // When the event was queued. + Timestamp *time.Time `json:"timestamp,omitempty"` // Type of notification. Type string `json:"type"` } @@ -94,6 +97,38 @@ func (o *AuthenticationNotificationRequest) SetEnvironment(v string) { o.Environment = v } +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *AuthenticationNotificationRequest) GetTimestamp() time.Time { + if o == nil || common.IsNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticationNotificationRequest) GetTimestampOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *AuthenticationNotificationRequest) HasTimestamp() bool { + if o != nil && !common.IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *AuthenticationNotificationRequest) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + // GetType returns the Type field value func (o *AuthenticationNotificationRequest) GetType() string { if o == nil { @@ -130,6 +165,9 @@ func (o AuthenticationNotificationRequest) ToMap() (map[string]interface{}, erro toSerialize := map[string]interface{}{} toSerialize["data"] = o.Data toSerialize["environment"] = o.Environment + if !common.IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } toSerialize["type"] = o.Type return toSerialize, nil } diff --git a/src/binlookup/model_amount.go b/src/binlookup/model_amount.go index d18c255c7..c797aaacf 100644 --- a/src/binlookup/model_amount.go +++ b/src/binlookup/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/checkout/model_card_details.go b/src/checkout/model_card_details.go index e680ba741..f968ae5a1 100644 --- a/src/checkout/model_card_details.go +++ b/src/checkout/model_card_details.go @@ -27,6 +27,8 @@ type CardDetails struct { CupsecureplusSmscode *string `json:"cupsecureplus.smscode,omitempty"` // The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Cvc *string `json:"cvc,omitempty"` + // Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + EncryptedCard *string `json:"encryptedCard,omitempty"` // The encrypted card number. EncryptedCardNumber *string `json:"encryptedCardNumber,omitempty"` // The encrypted card expiry month. @@ -221,6 +223,38 @@ func (o *CardDetails) SetCvc(v string) { o.Cvc = &v } +// GetEncryptedCard returns the EncryptedCard field value if set, zero value otherwise. +func (o *CardDetails) GetEncryptedCard() string { + if o == nil || common.IsNil(o.EncryptedCard) { + var ret string + return ret + } + return *o.EncryptedCard +} + +// GetEncryptedCardOk returns a tuple with the EncryptedCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDetails) GetEncryptedCardOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedCard) { + return nil, false + } + return o.EncryptedCard, true +} + +// HasEncryptedCard returns a boolean if a field has been set. +func (o *CardDetails) HasEncryptedCard() bool { + if o != nil && !common.IsNil(o.EncryptedCard) { + return true + } + + return false +} + +// SetEncryptedCard gets a reference to the given string and assigns it to the EncryptedCard field. +func (o *CardDetails) SetEncryptedCard(v string) { + o.EncryptedCard = &v +} + // GetEncryptedCardNumber returns the EncryptedCardNumber field value if set, zero value otherwise. func (o *CardDetails) GetEncryptedCardNumber() string { if o == nil || common.IsNil(o.EncryptedCardNumber) { @@ -857,6 +891,9 @@ func (o CardDetails) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Cvc) { toSerialize["cvc"] = o.Cvc } + if !common.IsNil(o.EncryptedCard) { + toSerialize["encryptedCard"] = o.EncryptedCard + } if !common.IsNil(o.EncryptedCardNumber) { toSerialize["encryptedCardNumber"] = o.EncryptedCardNumber } diff --git a/src/checkout/model_card_donations.go b/src/checkout/model_card_donations.go index eaf3aac35..8f5133928 100644 --- a/src/checkout/model_card_donations.go +++ b/src/checkout/model_card_donations.go @@ -27,6 +27,8 @@ type CardDonations struct { CupsecureplusSmscode *string `json:"cupsecureplus.smscode,omitempty"` // The card verification code. Only collect raw card data if you are [fully PCI compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Cvc *string `json:"cvc,omitempty"` + // Only include this for JSON Web Encryption (JWE) implementations. The JWE-encrypted card details. + EncryptedCard *string `json:"encryptedCard,omitempty"` // The encrypted card number. EncryptedCardNumber *string `json:"encryptedCardNumber,omitempty"` // The encrypted card expiry month. @@ -221,6 +223,38 @@ func (o *CardDonations) SetCvc(v string) { o.Cvc = &v } +// GetEncryptedCard returns the EncryptedCard field value if set, zero value otherwise. +func (o *CardDonations) GetEncryptedCard() string { + if o == nil || common.IsNil(o.EncryptedCard) { + var ret string + return ret + } + return *o.EncryptedCard +} + +// GetEncryptedCardOk returns a tuple with the EncryptedCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardDonations) GetEncryptedCardOk() (*string, bool) { + if o == nil || common.IsNil(o.EncryptedCard) { + return nil, false + } + return o.EncryptedCard, true +} + +// HasEncryptedCard returns a boolean if a field has been set. +func (o *CardDonations) HasEncryptedCard() bool { + if o != nil && !common.IsNil(o.EncryptedCard) { + return true + } + + return false +} + +// SetEncryptedCard gets a reference to the given string and assigns it to the EncryptedCard field. +func (o *CardDonations) SetEncryptedCard(v string) { + o.EncryptedCard = &v +} + // GetEncryptedCardNumber returns the EncryptedCardNumber field value if set, zero value otherwise. func (o *CardDonations) GetEncryptedCardNumber() string { if o == nil || common.IsNil(o.EncryptedCardNumber) { @@ -857,6 +891,9 @@ func (o CardDonations) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Cvc) { toSerialize["cvc"] = o.Cvc } + if !common.IsNil(o.EncryptedCard) { + toSerialize["encryptedCard"] = o.EncryptedCard + } if !common.IsNil(o.EncryptedCardNumber) { toSerialize["encryptedCardNumber"] = o.EncryptedCardNumber } diff --git a/src/disputewebhook/model_amount.go b/src/disputewebhook/model_amount.go index 46279e5f6..d8d011121 100644 --- a/src/disputewebhook/model_amount.go +++ b/src/disputewebhook/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/legalentity/model_legal_entity_association.go b/src/legalentity/model_legal_entity_association.go index 98e788e72..4bdcfa8e1 100644 --- a/src/legalentity/model_legal_entity_association.go +++ b/src/legalentity/model_legal_entity_association.go @@ -31,7 +31,7 @@ type LegalEntityAssociation struct { Name *string `json:"name,omitempty"` // The individual's relationship to a legal representative if the `type` is **legalRepresentative**. Possible values: **parent**, **guardian**. Relationship *string `json:"relationship,omitempty"` - // Defines the Kyc Exemption Reason for a Settlor associated with a trust. For example, **professionalServiceProvider**, **deceased**, or **contributionBelowThreshold**. + // Defines the KYC exemption reason for a settlor associated with a trust. Only applicable to trusts in Australia. For example, **professionalServiceProvider**, **deceased**, or **contributionBelowThreshold**. SettlorExemptionReason []string `json:"settlorExemptionReason,omitempty"` // Defines the relationship of the legal entity to the current legal entity. Possible value for individuals: **legalRepresentative**. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **director**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. Possible value for trusts: **trust**. Possible values for trust members: **definedBeneficiary**, **protector**, **secondaryTrustee**, **settlor**, **uboThroughControl**, or **uboThroughOwnership**. Possible value for unincorporated partnership: **unincorporatedPartnership**. Possible values for unincorporated partnership members: **secondaryPartner**, **uboThroughControl**, **uboThroughOwnership** Type string `json:"type"` diff --git a/src/management/model_amount.go b/src/management/model_amount.go index e74235069..b04350c8e 100644 --- a/src/management/model_amount.go +++ b/src/management/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/management/model_terminal_connectivity_cellular.go b/src/management/model_terminal_connectivity_cellular.go index 4503bbcb3..4bed42ccf 100644 --- a/src/management/model_terminal_connectivity_cellular.go +++ b/src/management/model_terminal_connectivity_cellular.go @@ -19,9 +19,11 @@ var _ common.MappedNullable = &TerminalConnectivityCellular{} // TerminalConnectivityCellular struct for TerminalConnectivityCellular type TerminalConnectivityCellular struct { - // The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + // The integrated circuit card identifier (ICCID) of the primary SIM card in the terminal. Iccid *string `json:"iccid,omitempty"` - // On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal. + // The integrated circuit card identifier (ICCID) of the secondary SIM card in the terminal, typically used for a [third-party SIM card](https://docs.adyen.com/point-of-sale/design-your-integration/network-and-connectivity/cellular-failover/#using-a-third-party-sim-card). + Iccid2 *string `json:"iccid2,omitempty"` + // On a terminal that supports 3G or 4G connectivity, indicates the status of the primary SIM card in the terminal. Status *string `json:"status,omitempty"` } @@ -74,6 +76,38 @@ func (o *TerminalConnectivityCellular) SetIccid(v string) { o.Iccid = &v } +// GetIccid2 returns the Iccid2 field value if set, zero value otherwise. +func (o *TerminalConnectivityCellular) GetIccid2() string { + if o == nil || common.IsNil(o.Iccid2) { + var ret string + return ret + } + return *o.Iccid2 +} + +// GetIccid2Ok returns a tuple with the Iccid2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminalConnectivityCellular) GetIccid2Ok() (*string, bool) { + if o == nil || common.IsNil(o.Iccid2) { + return nil, false + } + return o.Iccid2, true +} + +// HasIccid2 returns a boolean if a field has been set. +func (o *TerminalConnectivityCellular) HasIccid2() bool { + if o != nil && !common.IsNil(o.Iccid2) { + return true + } + + return false +} + +// SetIccid2 gets a reference to the given string and assigns it to the Iccid2 field. +func (o *TerminalConnectivityCellular) SetIccid2(v string) { + o.Iccid2 = &v +} + // GetStatus returns the Status field value if set, zero value otherwise. func (o *TerminalConnectivityCellular) GetStatus() string { if o == nil || common.IsNil(o.Status) { @@ -119,6 +153,9 @@ func (o TerminalConnectivityCellular) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Iccid) { toSerialize["iccid"] = o.Iccid } + if !common.IsNil(o.Iccid2) { + toSerialize["iccid2"] = o.Iccid2 + } if !common.IsNil(o.Status) { toSerialize["status"] = o.Status } diff --git a/src/management/model_update_payment_method_info.go b/src/management/model_update_payment_method_info.go index df9fa31b9..dc525648f 100644 --- a/src/management/model_update_payment_method_info.go +++ b/src/management/model_update_payment_method_info.go @@ -43,7 +43,11 @@ type UpdatePaymentMethodInfo struct { Nyce *NyceInfo `json:"nyce,omitempty"` Pulse *PulseInfo `json:"pulse,omitempty"` Star *StarInfo `json:"star,omitempty"` + // The store for this payment method + StoreId *string `json:"storeId,omitempty"` // The list of stores for this payment method + // Deprecated since Management API v3 + // Use `storeId` instead. Only one store per payment method is allowed. StoreIds []string `json:"storeIds,omitempty"` Visa *GenericPmWithTdiInfo `json:"visa,omitempty"` } @@ -705,7 +709,41 @@ func (o *UpdatePaymentMethodInfo) SetStar(v StarInfo) { o.Star = &v } +// GetStoreId returns the StoreId field value if set, zero value otherwise. +func (o *UpdatePaymentMethodInfo) GetStoreId() string { + if o == nil || common.IsNil(o.StoreId) { + var ret string + return ret + } + return *o.StoreId +} + +// GetStoreIdOk returns a tuple with the StoreId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePaymentMethodInfo) GetStoreIdOk() (*string, bool) { + if o == nil || common.IsNil(o.StoreId) { + return nil, false + } + return o.StoreId, true +} + +// HasStoreId returns a boolean if a field has been set. +func (o *UpdatePaymentMethodInfo) HasStoreId() bool { + if o != nil && !common.IsNil(o.StoreId) { + return true + } + + return false +} + +// SetStoreId gets a reference to the given string and assigns it to the StoreId field. +func (o *UpdatePaymentMethodInfo) SetStoreId(v string) { + o.StoreId = &v +} + // GetStoreIds returns the StoreIds field value if set, zero value otherwise. +// Deprecated since Management API v3 +// Use `storeId` instead. Only one store per payment method is allowed. func (o *UpdatePaymentMethodInfo) GetStoreIds() []string { if o == nil || common.IsNil(o.StoreIds) { var ret []string @@ -716,6 +754,8 @@ func (o *UpdatePaymentMethodInfo) GetStoreIds() []string { // GetStoreIdsOk returns a tuple with the StoreIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated since Management API v3 +// Use `storeId` instead. Only one store per payment method is allowed. func (o *UpdatePaymentMethodInfo) GetStoreIdsOk() ([]string, bool) { if o == nil || common.IsNil(o.StoreIds) { return nil, false @@ -733,6 +773,8 @@ func (o *UpdatePaymentMethodInfo) HasStoreIds() bool { } // SetStoreIds gets a reference to the given []string and assigns it to the StoreIds field. +// Deprecated since Management API v3 +// Use `storeId` instead. Only one store per payment method is allowed. func (o *UpdatePaymentMethodInfo) SetStoreIds(v []string) { o.StoreIds = v } @@ -839,6 +881,9 @@ func (o UpdatePaymentMethodInfo) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Star) { toSerialize["star"] = o.Star } + if !common.IsNil(o.StoreId) { + toSerialize["storeId"] = o.StoreId + } if !common.IsNil(o.StoreIds) { toSerialize["storeIds"] = o.StoreIds } diff --git a/src/managementwebhook/model_terminal_assignment_notification_request.go b/src/managementwebhook/model_terminal_assignment_notification_request.go new file mode 100644 index 000000000..5a621bded --- /dev/null +++ b/src/managementwebhook/model_terminal_assignment_notification_request.go @@ -0,0 +1,237 @@ +/* +Management Webhooks + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package managementwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the TerminalAssignmentNotificationRequest type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TerminalAssignmentNotificationRequest{} + +// TerminalAssignmentNotificationRequest struct for TerminalAssignmentNotificationRequest +type TerminalAssignmentNotificationRequest struct { + // The unique identifier of the merchant/company account to which the terminal is assigned. + AssignedToAccount string `json:"assignedToAccount"` + // The unique identifier of the store to which the terminal is assigned. + AssignedToStore *string `json:"assignedToStore,omitempty"` + // The date and time when an event has been completed. + EventDate string `json:"eventDate"` + // The PSP reference of the request from which the notification originates. + PspReference string `json:"pspReference"` + // The unique identifier of the terminal. + UniqueTerminalId string `json:"uniqueTerminalId"` +} + +// NewTerminalAssignmentNotificationRequest instantiates a new TerminalAssignmentNotificationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTerminalAssignmentNotificationRequest(assignedToAccount string, eventDate string, pspReference string, uniqueTerminalId string) *TerminalAssignmentNotificationRequest { + this := TerminalAssignmentNotificationRequest{} + this.AssignedToAccount = assignedToAccount + this.EventDate = eventDate + this.PspReference = pspReference + this.UniqueTerminalId = uniqueTerminalId + return &this +} + +// NewTerminalAssignmentNotificationRequestWithDefaults instantiates a new TerminalAssignmentNotificationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTerminalAssignmentNotificationRequestWithDefaults() *TerminalAssignmentNotificationRequest { + this := TerminalAssignmentNotificationRequest{} + return &this +} + +// GetAssignedToAccount returns the AssignedToAccount field value +func (o *TerminalAssignmentNotificationRequest) GetAssignedToAccount() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedToAccount +} + +// GetAssignedToAccountOk returns a tuple with the AssignedToAccount field value +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationRequest) GetAssignedToAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedToAccount, true +} + +// SetAssignedToAccount sets field value +func (o *TerminalAssignmentNotificationRequest) SetAssignedToAccount(v string) { + o.AssignedToAccount = v +} + +// GetAssignedToStore returns the AssignedToStore field value if set, zero value otherwise. +func (o *TerminalAssignmentNotificationRequest) GetAssignedToStore() string { + if o == nil || common.IsNil(o.AssignedToStore) { + var ret string + return ret + } + return *o.AssignedToStore +} + +// GetAssignedToStoreOk returns a tuple with the AssignedToStore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationRequest) GetAssignedToStoreOk() (*string, bool) { + if o == nil || common.IsNil(o.AssignedToStore) { + return nil, false + } + return o.AssignedToStore, true +} + +// HasAssignedToStore returns a boolean if a field has been set. +func (o *TerminalAssignmentNotificationRequest) HasAssignedToStore() bool { + if o != nil && !common.IsNil(o.AssignedToStore) { + return true + } + + return false +} + +// SetAssignedToStore gets a reference to the given string and assigns it to the AssignedToStore field. +func (o *TerminalAssignmentNotificationRequest) SetAssignedToStore(v string) { + o.AssignedToStore = &v +} + +// GetEventDate returns the EventDate field value +func (o *TerminalAssignmentNotificationRequest) GetEventDate() string { + if o == nil { + var ret string + return ret + } + + return o.EventDate +} + +// GetEventDateOk returns a tuple with the EventDate field value +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationRequest) GetEventDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EventDate, true +} + +// SetEventDate sets field value +func (o *TerminalAssignmentNotificationRequest) SetEventDate(v string) { + o.EventDate = v +} + +// GetPspReference returns the PspReference field value +func (o *TerminalAssignmentNotificationRequest) GetPspReference() string { + if o == nil { + var ret string + return ret + } + + return o.PspReference +} + +// GetPspReferenceOk returns a tuple with the PspReference field value +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationRequest) GetPspReferenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PspReference, true +} + +// SetPspReference sets field value +func (o *TerminalAssignmentNotificationRequest) SetPspReference(v string) { + o.PspReference = v +} + +// GetUniqueTerminalId returns the UniqueTerminalId field value +func (o *TerminalAssignmentNotificationRequest) GetUniqueTerminalId() string { + if o == nil { + var ret string + return ret + } + + return o.UniqueTerminalId +} + +// GetUniqueTerminalIdOk returns a tuple with the UniqueTerminalId field value +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationRequest) GetUniqueTerminalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueTerminalId, true +} + +// SetUniqueTerminalId sets field value +func (o *TerminalAssignmentNotificationRequest) SetUniqueTerminalId(v string) { + o.UniqueTerminalId = v +} + +func (o TerminalAssignmentNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminalAssignmentNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assignedToAccount"] = o.AssignedToAccount + if !common.IsNil(o.AssignedToStore) { + toSerialize["assignedToStore"] = o.AssignedToStore + } + toSerialize["eventDate"] = o.EventDate + toSerialize["pspReference"] = o.PspReference + toSerialize["uniqueTerminalId"] = o.UniqueTerminalId + return toSerialize, nil +} + +type NullableTerminalAssignmentNotificationRequest struct { + value *TerminalAssignmentNotificationRequest + isSet bool +} + +func (v NullableTerminalAssignmentNotificationRequest) Get() *TerminalAssignmentNotificationRequest { + return v.value +} + +func (v *NullableTerminalAssignmentNotificationRequest) Set(val *TerminalAssignmentNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTerminalAssignmentNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminalAssignmentNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminalAssignmentNotificationRequest(val *TerminalAssignmentNotificationRequest) *NullableTerminalAssignmentNotificationRequest { + return &NullableTerminalAssignmentNotificationRequest{value: val, isSet: true} +} + +func (v NullableTerminalAssignmentNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminalAssignmentNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/managementwebhook/model_terminal_assignment_notification_response.go b/src/managementwebhook/model_terminal_assignment_notification_response.go new file mode 100644 index 000000000..038ab12d6 --- /dev/null +++ b/src/managementwebhook/model_terminal_assignment_notification_response.go @@ -0,0 +1,125 @@ +/* +Management Webhooks + +API version: 3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package managementwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the TerminalAssignmentNotificationResponse type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &TerminalAssignmentNotificationResponse{} + +// TerminalAssignmentNotificationResponse struct for TerminalAssignmentNotificationResponse +type TerminalAssignmentNotificationResponse struct { + // Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + NotificationResponse *string `json:"notificationResponse,omitempty"` +} + +// NewTerminalAssignmentNotificationResponse instantiates a new TerminalAssignmentNotificationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTerminalAssignmentNotificationResponse() *TerminalAssignmentNotificationResponse { + this := TerminalAssignmentNotificationResponse{} + return &this +} + +// NewTerminalAssignmentNotificationResponseWithDefaults instantiates a new TerminalAssignmentNotificationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTerminalAssignmentNotificationResponseWithDefaults() *TerminalAssignmentNotificationResponse { + this := TerminalAssignmentNotificationResponse{} + return &this +} + +// GetNotificationResponse returns the NotificationResponse field value if set, zero value otherwise. +func (o *TerminalAssignmentNotificationResponse) GetNotificationResponse() string { + if o == nil || common.IsNil(o.NotificationResponse) { + var ret string + return ret + } + return *o.NotificationResponse +} + +// GetNotificationResponseOk returns a tuple with the NotificationResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TerminalAssignmentNotificationResponse) GetNotificationResponseOk() (*string, bool) { + if o == nil || common.IsNil(o.NotificationResponse) { + return nil, false + } + return o.NotificationResponse, true +} + +// HasNotificationResponse returns a boolean if a field has been set. +func (o *TerminalAssignmentNotificationResponse) HasNotificationResponse() bool { + if o != nil && !common.IsNil(o.NotificationResponse) { + return true + } + + return false +} + +// SetNotificationResponse gets a reference to the given string and assigns it to the NotificationResponse field. +func (o *TerminalAssignmentNotificationResponse) SetNotificationResponse(v string) { + o.NotificationResponse = &v +} + +func (o TerminalAssignmentNotificationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TerminalAssignmentNotificationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.NotificationResponse) { + toSerialize["notificationResponse"] = o.NotificationResponse + } + return toSerialize, nil +} + +type NullableTerminalAssignmentNotificationResponse struct { + value *TerminalAssignmentNotificationResponse + isSet bool +} + +func (v NullableTerminalAssignmentNotificationResponse) Get() *TerminalAssignmentNotificationResponse { + return v.value +} + +func (v *NullableTerminalAssignmentNotificationResponse) Set(val *TerminalAssignmentNotificationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTerminalAssignmentNotificationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminalAssignmentNotificationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminalAssignmentNotificationResponse(val *TerminalAssignmentNotificationResponse) *NullableTerminalAssignmentNotificationResponse { + return &NullableTerminalAssignmentNotificationResponse{value: val, isSet: true} +} + +func (v NullableTerminalAssignmentNotificationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminalAssignmentNotificationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/payments/model_amount.go b/src/payments/model_amount.go index 540f292f5..9dc97c10f 100644 --- a/src/payments/model_amount.go +++ b/src/payments/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/payout/model_amount.go b/src/payout/model_amount.go index 9c5dd55cc..b3ce02b26 100644 --- a/src/payout/model_amount.go +++ b/src/payout/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/payout/model_response_additional_data_card.go b/src/payout/model_response_additional_data_card.go index 52f768d3d..10eed311b 100644 --- a/src/payout/model_response_additional_data_card.go +++ b/src/payout/model_response_additional_data_card.go @@ -31,6 +31,8 @@ type ResponseAdditionalDataCard struct { CardIssuingCurrency *string `json:"cardIssuingCurrency,omitempty"` // The card payment method used for the transaction. Example: amex CardPaymentMethod *string `json:"cardPaymentMethod,omitempty"` + // The Card Product ID represents the type of card following card scheme product definitions and can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - Visa Traditional * **B** - Visa Traditional Rewards * **C** - Visa Signature * **D** - Visa Signature Preferred * **F** - Visa Classic Possible values Mastercard: * **MCC** - Mastercard Card * **MCE** - Mastercard Electronic Card * **MCF** - Mastercard Corporate Fleet Card * **MCG** - Gold Mastercard Card * **MCH** - Mastercard Premium Charge * **MCI** - Mastercard Select Debit + CardProductId *string `json:"cardProductId,omitempty"` // The last four digits of a card number. > Returned only in case of a card payment. CardSummary *string `json:"cardSummary,omitempty"` // The first eight digits of the card number. Only returned if the card number is 16 digits or more. This is the [Bank Identification Number (BIN)](https://docs.adyen.com/get-started-with-adyen/payment-glossary#bank-identification-number-bin) for card numbers with an eight-digit BIN. Example: 52123423 @@ -246,6 +248,38 @@ func (o *ResponseAdditionalDataCard) SetCardPaymentMethod(v string) { o.CardPaymentMethod = &v } +// GetCardProductId returns the CardProductId field value if set, zero value otherwise. +func (o *ResponseAdditionalDataCard) GetCardProductId() string { + if o == nil || common.IsNil(o.CardProductId) { + var ret string + return ret + } + return *o.CardProductId +} + +// GetCardProductIdOk returns a tuple with the CardProductId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResponseAdditionalDataCard) GetCardProductIdOk() (*string, bool) { + if o == nil || common.IsNil(o.CardProductId) { + return nil, false + } + return o.CardProductId, true +} + +// HasCardProductId returns a boolean if a field has been set. +func (o *ResponseAdditionalDataCard) HasCardProductId() bool { + if o != nil && !common.IsNil(o.CardProductId) { + return true + } + + return false +} + +// SetCardProductId gets a reference to the given string and assigns it to the CardProductId field. +func (o *ResponseAdditionalDataCard) SetCardProductId(v string) { + o.CardProductId = &v +} + // GetCardSummary returns the CardSummary field value if set, zero value otherwise. func (o *ResponseAdditionalDataCard) GetCardSummary() string { if o == nil || common.IsNil(o.CardSummary) { @@ -338,6 +372,9 @@ func (o ResponseAdditionalDataCard) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.CardPaymentMethod) { toSerialize["cardPaymentMethod"] = o.CardPaymentMethod } + if !common.IsNil(o.CardProductId) { + toSerialize["cardProductId"] = o.CardProductId + } if !common.IsNil(o.CardSummary) { toSerialize["cardSummary"] = o.CardSummary } @@ -382,3 +419,13 @@ func (v *NullableResponseAdditionalDataCard) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +func (o *ResponseAdditionalDataCard) isValidCardProductId() bool { + var allowedEnumValues = []string{"A", "B", "C", "D", "F", "MCC", "MCE", "MCF", "MCG", "MCH", "MCI"} + for _, allowed := range allowedEnumValues { + if o.GetCardProductId() == allowed { + return true + } + } + return false +} diff --git a/src/recurring/model_amount.go b/src/recurring/model_amount.go index 3953103b6..72b108213 100644 --- a/src/recurring/model_amount.go +++ b/src/recurring/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/transactionwebhook/model_amount.go b/src/transactionwebhook/model_amount.go index cd6df4672..5bb153678 100644 --- a/src/transactionwebhook/model_amount.go +++ b/src/transactionwebhook/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/transactionwebhook/model_platform_payment.go b/src/transactionwebhook/model_platform_payment.go index cca368fc1..ffe9330b9 100644 --- a/src/transactionwebhook/model_platform_payment.go +++ b/src/transactionwebhook/model_platform_payment.go @@ -25,7 +25,7 @@ type PlatformPayment struct { ModificationPspReference *string `json:"modificationPspReference,omitempty"` // The payment's merchant reference included in the transfer. PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. + // Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. PlatformPaymentType *string `json:"platformPaymentType,omitempty"` // The payment reference included in the transfer. PspPaymentReference *string `json:"pspPaymentReference,omitempty"` diff --git a/src/transactionwebhook/model_transaction_notification_request_v4.go b/src/transactionwebhook/model_transaction_notification_request_v4.go index 1ef22f82d..3aeb1a410 100644 --- a/src/transactionwebhook/model_transaction_notification_request_v4.go +++ b/src/transactionwebhook/model_transaction_notification_request_v4.go @@ -10,6 +10,7 @@ package transactionwebhook import ( "encoding/json" + "time" "github.com/adyen/adyen-go-api-library/v16/src/common" ) @@ -22,6 +23,8 @@ type TransactionNotificationRequestV4 struct { Data Transaction `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` + // When the event was queued. + Timestamp *time.Time `json:"timestamp,omitempty"` // Type of the webhook. Type *string `json:"type,omitempty"` } @@ -93,6 +96,38 @@ func (o *TransactionNotificationRequestV4) SetEnvironment(v string) { o.Environment = v } +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *TransactionNotificationRequestV4) GetTimestamp() time.Time { + if o == nil || common.IsNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionNotificationRequestV4) GetTimestampOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *TransactionNotificationRequestV4) HasTimestamp() bool { + if o != nil && !common.IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *TransactionNotificationRequestV4) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *TransactionNotificationRequestV4) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -137,6 +172,9 @@ func (o TransactionNotificationRequestV4) ToMap() (map[string]interface{}, error toSerialize := map[string]interface{}{} toSerialize["data"] = o.Data toSerialize["environment"] = o.Environment + if !common.IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type } diff --git a/src/transfers/model_airline.go b/src/transfers/model_airline.go new file mode 100644 index 000000000..7865ccb8d --- /dev/null +++ b/src/transfers/model_airline.go @@ -0,0 +1,162 @@ +/* +Transfers API + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the Airline type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Airline{} + +// Airline struct for Airline +type Airline struct { + // Details about the flight legs for this ticket. + Legs []Leg `json:"legs,omitempty"` + // The ticket's unique identifier + TicketNumber *string `json:"ticketNumber,omitempty"` +} + +// NewAirline instantiates a new Airline object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAirline() *Airline { + this := Airline{} + return &this +} + +// NewAirlineWithDefaults instantiates a new Airline object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAirlineWithDefaults() *Airline { + this := Airline{} + return &this +} + +// GetLegs returns the Legs field value if set, zero value otherwise. +func (o *Airline) GetLegs() []Leg { + if o == nil || common.IsNil(o.Legs) { + var ret []Leg + return ret + } + return o.Legs +} + +// GetLegsOk returns a tuple with the Legs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Airline) GetLegsOk() ([]Leg, bool) { + if o == nil || common.IsNil(o.Legs) { + return nil, false + } + return o.Legs, true +} + +// HasLegs returns a boolean if a field has been set. +func (o *Airline) HasLegs() bool { + if o != nil && !common.IsNil(o.Legs) { + return true + } + + return false +} + +// SetLegs gets a reference to the given []Leg and assigns it to the Legs field. +func (o *Airline) SetLegs(v []Leg) { + o.Legs = v +} + +// GetTicketNumber returns the TicketNumber field value if set, zero value otherwise. +func (o *Airline) GetTicketNumber() string { + if o == nil || common.IsNil(o.TicketNumber) { + var ret string + return ret + } + return *o.TicketNumber +} + +// GetTicketNumberOk returns a tuple with the TicketNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Airline) GetTicketNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TicketNumber) { + return nil, false + } + return o.TicketNumber, true +} + +// HasTicketNumber returns a boolean if a field has been set. +func (o *Airline) HasTicketNumber() bool { + if o != nil && !common.IsNil(o.TicketNumber) { + return true + } + + return false +} + +// SetTicketNumber gets a reference to the given string and assigns it to the TicketNumber field. +func (o *Airline) SetTicketNumber(v string) { + o.TicketNumber = &v +} + +func (o Airline) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Airline) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Legs) { + toSerialize["legs"] = o.Legs + } + if !common.IsNil(o.TicketNumber) { + toSerialize["ticketNumber"] = o.TicketNumber + } + return toSerialize, nil +} + +type NullableAirline struct { + value *Airline + isSet bool +} + +func (v NullableAirline) Get() *Airline { + return v.value +} + +func (v *NullableAirline) Set(val *Airline) { + v.value = val + v.isSet = true +} + +func (v NullableAirline) IsSet() bool { + return v.isSet +} + +func (v *NullableAirline) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAirline(val *Airline) *NullableAirline { + return &NullableAirline{value: val, isSet: true} +} + +func (v NullableAirline) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAirline) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transfers/model_amount.go b/src/transfers/model_amount.go index ee6a6a9ce..d0a515485 100644 --- a/src/transfers/model_amount.go +++ b/src/transfers/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/transfers/model_leg.go b/src/transfers/model_leg.go new file mode 100644 index 000000000..63a63ed0e --- /dev/null +++ b/src/transfers/model_leg.go @@ -0,0 +1,310 @@ +/* +Transfers API + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the Leg type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Leg{} + +// Leg struct for Leg +type Leg struct { + // The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. + ArrivalAirportCode *string `json:"arrivalAirportCode,omitempty"` + // The basic fare code for this leg. + BasicFareCode *string `json:"basicFareCode,omitempty"` + // IATA code of the carrier operating the flight. + CarrierCode *string `json:"carrierCode,omitempty"` + // The IATA three-letter airport code of the departure airport. This field is required if the airline data includes leg details + DepartureAirportCode *string `json:"departureAirportCode,omitempty"` + // The flight departure date. + DepartureDate *string `json:"departureDate,omitempty"` + // The flight identifier. + FlightNumber *string `json:"flightNumber,omitempty"` +} + +// NewLeg instantiates a new Leg object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLeg() *Leg { + this := Leg{} + return &this +} + +// NewLegWithDefaults instantiates a new Leg object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLegWithDefaults() *Leg { + this := Leg{} + return &this +} + +// GetArrivalAirportCode returns the ArrivalAirportCode field value if set, zero value otherwise. +func (o *Leg) GetArrivalAirportCode() string { + if o == nil || common.IsNil(o.ArrivalAirportCode) { + var ret string + return ret + } + return *o.ArrivalAirportCode +} + +// GetArrivalAirportCodeOk returns a tuple with the ArrivalAirportCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetArrivalAirportCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.ArrivalAirportCode) { + return nil, false + } + return o.ArrivalAirportCode, true +} + +// HasArrivalAirportCode returns a boolean if a field has been set. +func (o *Leg) HasArrivalAirportCode() bool { + if o != nil && !common.IsNil(o.ArrivalAirportCode) { + return true + } + + return false +} + +// SetArrivalAirportCode gets a reference to the given string and assigns it to the ArrivalAirportCode field. +func (o *Leg) SetArrivalAirportCode(v string) { + o.ArrivalAirportCode = &v +} + +// GetBasicFareCode returns the BasicFareCode field value if set, zero value otherwise. +func (o *Leg) GetBasicFareCode() string { + if o == nil || common.IsNil(o.BasicFareCode) { + var ret string + return ret + } + return *o.BasicFareCode +} + +// GetBasicFareCodeOk returns a tuple with the BasicFareCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetBasicFareCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.BasicFareCode) { + return nil, false + } + return o.BasicFareCode, true +} + +// HasBasicFareCode returns a boolean if a field has been set. +func (o *Leg) HasBasicFareCode() bool { + if o != nil && !common.IsNil(o.BasicFareCode) { + return true + } + + return false +} + +// SetBasicFareCode gets a reference to the given string and assigns it to the BasicFareCode field. +func (o *Leg) SetBasicFareCode(v string) { + o.BasicFareCode = &v +} + +// GetCarrierCode returns the CarrierCode field value if set, zero value otherwise. +func (o *Leg) GetCarrierCode() string { + if o == nil || common.IsNil(o.CarrierCode) { + var ret string + return ret + } + return *o.CarrierCode +} + +// GetCarrierCodeOk returns a tuple with the CarrierCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetCarrierCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.CarrierCode) { + return nil, false + } + return o.CarrierCode, true +} + +// HasCarrierCode returns a boolean if a field has been set. +func (o *Leg) HasCarrierCode() bool { + if o != nil && !common.IsNil(o.CarrierCode) { + return true + } + + return false +} + +// SetCarrierCode gets a reference to the given string and assigns it to the CarrierCode field. +func (o *Leg) SetCarrierCode(v string) { + o.CarrierCode = &v +} + +// GetDepartureAirportCode returns the DepartureAirportCode field value if set, zero value otherwise. +func (o *Leg) GetDepartureAirportCode() string { + if o == nil || common.IsNil(o.DepartureAirportCode) { + var ret string + return ret + } + return *o.DepartureAirportCode +} + +// GetDepartureAirportCodeOk returns a tuple with the DepartureAirportCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetDepartureAirportCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.DepartureAirportCode) { + return nil, false + } + return o.DepartureAirportCode, true +} + +// HasDepartureAirportCode returns a boolean if a field has been set. +func (o *Leg) HasDepartureAirportCode() bool { + if o != nil && !common.IsNil(o.DepartureAirportCode) { + return true + } + + return false +} + +// SetDepartureAirportCode gets a reference to the given string and assigns it to the DepartureAirportCode field. +func (o *Leg) SetDepartureAirportCode(v string) { + o.DepartureAirportCode = &v +} + +// GetDepartureDate returns the DepartureDate field value if set, zero value otherwise. +func (o *Leg) GetDepartureDate() string { + if o == nil || common.IsNil(o.DepartureDate) { + var ret string + return ret + } + return *o.DepartureDate +} + +// GetDepartureDateOk returns a tuple with the DepartureDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetDepartureDateOk() (*string, bool) { + if o == nil || common.IsNil(o.DepartureDate) { + return nil, false + } + return o.DepartureDate, true +} + +// HasDepartureDate returns a boolean if a field has been set. +func (o *Leg) HasDepartureDate() bool { + if o != nil && !common.IsNil(o.DepartureDate) { + return true + } + + return false +} + +// SetDepartureDate gets a reference to the given string and assigns it to the DepartureDate field. +func (o *Leg) SetDepartureDate(v string) { + o.DepartureDate = &v +} + +// GetFlightNumber returns the FlightNumber field value if set, zero value otherwise. +func (o *Leg) GetFlightNumber() string { + if o == nil || common.IsNil(o.FlightNumber) { + var ret string + return ret + } + return *o.FlightNumber +} + +// GetFlightNumberOk returns a tuple with the FlightNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetFlightNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.FlightNumber) { + return nil, false + } + return o.FlightNumber, true +} + +// HasFlightNumber returns a boolean if a field has been set. +func (o *Leg) HasFlightNumber() bool { + if o != nil && !common.IsNil(o.FlightNumber) { + return true + } + + return false +} + +// SetFlightNumber gets a reference to the given string and assigns it to the FlightNumber field. +func (o *Leg) SetFlightNumber(v string) { + o.FlightNumber = &v +} + +func (o Leg) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Leg) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ArrivalAirportCode) { + toSerialize["arrivalAirportCode"] = o.ArrivalAirportCode + } + if !common.IsNil(o.BasicFareCode) { + toSerialize["basicFareCode"] = o.BasicFareCode + } + if !common.IsNil(o.CarrierCode) { + toSerialize["carrierCode"] = o.CarrierCode + } + if !common.IsNil(o.DepartureAirportCode) { + toSerialize["departureAirportCode"] = o.DepartureAirportCode + } + if !common.IsNil(o.DepartureDate) { + toSerialize["departureDate"] = o.DepartureDate + } + if !common.IsNil(o.FlightNumber) { + toSerialize["flightNumber"] = o.FlightNumber + } + return toSerialize, nil +} + +type NullableLeg struct { + value *Leg + isSet bool +} + +func (v NullableLeg) Get() *Leg { + return v.value +} + +func (v *NullableLeg) Set(val *Leg) { + v.value = val + v.isSet = true +} + +func (v NullableLeg) IsSet() bool { + return v.isSet +} + +func (v *NullableLeg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLeg(val *Leg) *NullableLeg { + return &NullableLeg{value: val, isSet: true} +} + +func (v NullableLeg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLeg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transfers/model_merchant_purchase_data.go b/src/transfers/model_merchant_purchase_data.go new file mode 100644 index 000000000..19520aa33 --- /dev/null +++ b/src/transfers/model_merchant_purchase_data.go @@ -0,0 +1,164 @@ +/* +Transfers API + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the MerchantPurchaseData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &MerchantPurchaseData{} + +// MerchantPurchaseData struct for MerchantPurchaseData +type MerchantPurchaseData struct { + Airline *Airline `json:"airline,omitempty"` + // The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + Type string `json:"type"` +} + +// NewMerchantPurchaseData instantiates a new MerchantPurchaseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMerchantPurchaseData(type_ string) *MerchantPurchaseData { + this := MerchantPurchaseData{} + this.Type = type_ + return &this +} + +// NewMerchantPurchaseDataWithDefaults instantiates a new MerchantPurchaseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMerchantPurchaseDataWithDefaults() *MerchantPurchaseData { + this := MerchantPurchaseData{} + var type_ string = "merchantPurchaseData" + this.Type = type_ + return &this +} + +// GetAirline returns the Airline field value if set, zero value otherwise. +func (o *MerchantPurchaseData) GetAirline() Airline { + if o == nil || common.IsNil(o.Airline) { + var ret Airline + return ret + } + return *o.Airline +} + +// GetAirlineOk returns a tuple with the Airline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantPurchaseData) GetAirlineOk() (*Airline, bool) { + if o == nil || common.IsNil(o.Airline) { + return nil, false + } + return o.Airline, true +} + +// HasAirline returns a boolean if a field has been set. +func (o *MerchantPurchaseData) HasAirline() bool { + if o != nil && !common.IsNil(o.Airline) { + return true + } + + return false +} + +// SetAirline gets a reference to the given Airline and assigns it to the Airline field. +func (o *MerchantPurchaseData) SetAirline(v Airline) { + o.Airline = &v +} + +// GetType returns the Type field value +func (o *MerchantPurchaseData) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MerchantPurchaseData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *MerchantPurchaseData) SetType(v string) { + o.Type = v +} + +func (o MerchantPurchaseData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MerchantPurchaseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Airline) { + toSerialize["airline"] = o.Airline + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableMerchantPurchaseData struct { + value *MerchantPurchaseData + isSet bool +} + +func (v NullableMerchantPurchaseData) Get() *MerchantPurchaseData { + return v.value +} + +func (v *NullableMerchantPurchaseData) Set(val *MerchantPurchaseData) { + v.value = val + v.isSet = true +} + +func (v NullableMerchantPurchaseData) IsSet() bool { + return v.isSet +} + +func (v *NullableMerchantPurchaseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMerchantPurchaseData(val *MerchantPurchaseData) *NullableMerchantPurchaseData { + return &NullableMerchantPurchaseData{value: val, isSet: true} +} + +func (v NullableMerchantPurchaseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMerchantPurchaseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *MerchantPurchaseData) isValidType() bool { + var allowedEnumValues = []string{"merchantPurchaseData"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transfers/model_platform_payment.go b/src/transfers/model_platform_payment.go index 4743c1553..fa0f56510 100644 --- a/src/transfers/model_platform_payment.go +++ b/src/transfers/model_platform_payment.go @@ -25,7 +25,7 @@ type PlatformPayment struct { ModificationPspReference *string `json:"modificationPspReference,omitempty"` // The payment's merchant reference included in the transfer. PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. + // Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. PlatformPaymentType *string `json:"platformPaymentType,omitempty"` // The payment reference included in the transfer. PspPaymentReference *string `json:"pspPaymentReference,omitempty"` diff --git a/src/transfers/model_transfer.go b/src/transfers/model_transfer.go index cb352129f..b9768a1c9 100644 --- a/src/transfers/model_transfer.go +++ b/src/transfers/model_transfer.go @@ -23,7 +23,7 @@ type Transfer struct { AccountHolder *ResourceReference `json:"accountHolder,omitempty"` Amount Amount `json:"amount"` BalanceAccount *ResourceReference `json:"balanceAccount,omitempty"` - // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. Category string `json:"category"` CategoryData *TransferCategoryData `json:"categoryData,omitempty"` Counterparty CounterpartyV3 `json:"counterparty"` @@ -711,7 +711,7 @@ func (v *NullableTransfer) UnmarshalJSON(src []byte) error { } func (o *Transfer) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment"} + var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment", "topUp"} for _, allowed := range allowedEnumValues { if o.GetCategory() == allowed { return true diff --git a/src/transfers/model_transfer_data.go b/src/transfers/model_transfer_data.go index 7e23047d9..272d0efd8 100644 --- a/src/transfers/model_transfer_data.go +++ b/src/transfers/model_transfer_data.go @@ -27,7 +27,7 @@ type TransferData struct { BalancePlatform *string `json:"balancePlatform,omitempty"` // The list of the latest balance statuses in the transfer. Balances []BalanceMutation `json:"balances,omitempty"` - // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. Category string `json:"category"` CategoryData *TransferCategoryData `json:"categoryData,omitempty"` Counterparty *TransferNotificationCounterParty `json:"counterparty,omitempty"` @@ -38,6 +38,8 @@ type TransferData struct { DirectDebitInformation *DirectDebitInformation `json:"directDebitInformation,omitempty"` // The direction of the transfer. Possible values: **incoming**, **outgoing**. Direction *string `json:"direction,omitempty"` + // The event id listed under events, that triggered the notification. + EventId *string `json:"eventId,omitempty"` // The list of events leading up to the current status of the transfer. Events []TransferEvent `json:"events,omitempty"` // The ID of the resource. @@ -448,6 +450,38 @@ func (o *TransferData) SetDirection(v string) { o.Direction = &v } +// GetEventId returns the EventId field value if set, zero value otherwise. +func (o *TransferData) GetEventId() string { + if o == nil || common.IsNil(o.EventId) { + var ret string + return ret + } + return *o.EventId +} + +// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetEventIdOk() (*string, bool) { + if o == nil || common.IsNil(o.EventId) { + return nil, false + } + return o.EventId, true +} + +// HasEventId returns a boolean if a field has been set. +func (o *TransferData) HasEventId() bool { + if o != nil && !common.IsNil(o.EventId) { + return true + } + + return false +} + +// SetEventId gets a reference to the given string and assigns it to the EventId field. +func (o *TransferData) SetEventId(v string) { + o.EventId = &v +} + // GetEvents returns the Events field value if set, zero value otherwise. func (o *TransferData) GetEvents() []TransferEvent { if o == nil || common.IsNil(o.Events) { @@ -866,6 +900,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Direction) { toSerialize["direction"] = o.Direction } + if !common.IsNil(o.EventId) { + toSerialize["eventId"] = o.EventId + } if !common.IsNil(o.Events) { toSerialize["events"] = o.Events } @@ -940,7 +977,7 @@ func (v *NullableTransferData) UnmarshalJSON(src []byte) error { } func (o *TransferData) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment"} + var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment", "topUp"} for _, allowed := range allowedEnumValues { if o.GetCategory() == allowed { return true diff --git a/src/transfers/model_transfer_event.go b/src/transfers/model_transfer_event.go index 173e29e23..df8238cfe 100644 --- a/src/transfers/model_transfer_event.go +++ b/src/transfers/model_transfer_event.go @@ -28,8 +28,10 @@ type TransferEvent struct { // The date when the transfer request was sent. BookingDate *time.Time `json:"bookingDate,omitempty"` // The estimated time when the beneficiary should have access to the funds. - EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` - ExternalReason *ExternalReason `json:"externalReason,omitempty"` + EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` + // A list of event data. + EventsData []TransferEventEventsDataInner `json:"eventsData,omitempty"` + ExternalReason *ExternalReason `json:"externalReason,omitempty"` // The unique identifier of the transfer event. Id *string `json:"id,omitempty"` Modification *Modification `json:"modification,omitempty"` @@ -228,6 +230,38 @@ func (o *TransferEvent) SetEstimatedArrivalTime(v time.Time) { o.EstimatedArrivalTime = &v } +// GetEventsData returns the EventsData field value if set, zero value otherwise. +func (o *TransferEvent) GetEventsData() []TransferEventEventsDataInner { + if o == nil || common.IsNil(o.EventsData) { + var ret []TransferEventEventsDataInner + return ret + } + return o.EventsData +} + +// GetEventsDataOk returns a tuple with the EventsData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetEventsDataOk() ([]TransferEventEventsDataInner, bool) { + if o == nil || common.IsNil(o.EventsData) { + return nil, false + } + return o.EventsData, true +} + +// HasEventsData returns a boolean if a field has been set. +func (o *TransferEvent) HasEventsData() bool { + if o != nil && !common.IsNil(o.EventsData) { + return true + } + + return false +} + +// SetEventsData gets a reference to the given []TransferEventEventsDataInner and assigns it to the EventsData field. +func (o *TransferEvent) SetEventsData(v []TransferEventEventsDataInner) { + o.EventsData = v +} + // GetExternalReason returns the ExternalReason field value if set, zero value otherwise. func (o *TransferEvent) GetExternalReason() ExternalReason { if o == nil || common.IsNil(o.ExternalReason) { @@ -637,6 +671,9 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.EstimatedArrivalTime) { toSerialize["estimatedArrivalTime"] = o.EstimatedArrivalTime } + if !common.IsNil(o.EventsData) { + toSerialize["eventsData"] = o.EventsData + } if !common.IsNil(o.ExternalReason) { toSerialize["externalReason"] = o.ExternalReason } diff --git a/src/transfers/model_transfer_event_events_data_inner.go b/src/transfers/model_transfer_event_events_data_inner.go new file mode 100644 index 000000000..023886869 --- /dev/null +++ b/src/transfers/model_transfer_event_events_data_inner.go @@ -0,0 +1,113 @@ +/* +Transfers API + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transfers + +import ( + "encoding/json" + "fmt" +) + +// TransferEventEventsDataInner - struct for TransferEventEventsDataInner +type TransferEventEventsDataInner struct { + MerchantPurchaseData *MerchantPurchaseData +} + +// MerchantPurchaseDataAsTransferEventEventsDataInner is a convenience function that returns MerchantPurchaseData wrapped in TransferEventEventsDataInner +func MerchantPurchaseDataAsTransferEventEventsDataInner(v *MerchantPurchaseData) TransferEventEventsDataInner { + return TransferEventEventsDataInner{ + MerchantPurchaseData: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferEventEventsDataInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into MerchantPurchaseData + err = json.Unmarshal(data, &dst.MerchantPurchaseData) + if err == nil { + jsonMerchantPurchaseData, _ := json.Marshal(dst.MerchantPurchaseData) + if string(jsonMerchantPurchaseData) == "{}" || !dst.MerchantPurchaseData.isValidType() { // empty struct + dst.MerchantPurchaseData = nil + } else { + match++ + } + } else { + dst.MerchantPurchaseData = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.MerchantPurchaseData = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferEventEventsDataInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferEventEventsDataInner)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferEventEventsDataInner) MarshalJSON() ([]byte, error) { + if src.MerchantPurchaseData != nil { + return json.Marshal(&src.MerchantPurchaseData) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferEventEventsDataInner) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.MerchantPurchaseData != nil { + return obj.MerchantPurchaseData + } + + // all schemas are nil + return nil +} + +type NullableTransferEventEventsDataInner struct { + value *TransferEventEventsDataInner + isSet bool +} + +func (v NullableTransferEventEventsDataInner) Get() *TransferEventEventsDataInner { + return v.value +} + +func (v *NullableTransferEventEventsDataInner) Set(val *TransferEventEventsDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableTransferEventEventsDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferEventEventsDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferEventEventsDataInner(val *TransferEventEventsDataInner) *NullableTransferEventEventsDataInner { + return &NullableTransferEventEventsDataInner{value: val, isSet: true} +} + +func (v NullableTransferEventEventsDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferEventEventsDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transfers/model_transfer_info.go b/src/transfers/model_transfer_info.go index 4ddef4b92..052c32f2a 100644 --- a/src/transfers/model_transfer_info.go +++ b/src/transfers/model_transfer_info.go @@ -22,7 +22,7 @@ type TransferInfo struct { Amount Amount `json:"amount"` // The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id). If you want to make a transfer using a **virtual** **bankAccount** assigned to the balance account, you must specify the [payment instrument ID](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/paymentInstruments#responses-200-id) of the **virtual** **bankAccount**. If you only specify a balance account ID, Adyen uses the default **physical** **bankAccount** payment instrument assigned to the balance account. BalanceAccountId *string `json:"balanceAccountId,omitempty"` - // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. Category string `json:"category"` Counterparty CounterpartyInfoV3 `json:"counterparty"` // Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** @@ -538,7 +538,7 @@ func (v *NullableTransferInfo) UnmarshalJSON(src []byte) error { } func (o *TransferInfo) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment"} + var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment", "topUp"} for _, allowed := range allowedEnumValues { if o.GetCategory() == allowed { return true diff --git a/src/transferwebhook/model_airline.go b/src/transferwebhook/model_airline.go new file mode 100644 index 000000000..fde51c7b9 --- /dev/null +++ b/src/transferwebhook/model_airline.go @@ -0,0 +1,162 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the Airline type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Airline{} + +// Airline struct for Airline +type Airline struct { + // Details about the flight legs for this ticket. + Legs []Leg `json:"legs,omitempty"` + // The ticket's unique identifier + TicketNumber *string `json:"ticketNumber,omitempty"` +} + +// NewAirline instantiates a new Airline object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAirline() *Airline { + this := Airline{} + return &this +} + +// NewAirlineWithDefaults instantiates a new Airline object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAirlineWithDefaults() *Airline { + this := Airline{} + return &this +} + +// GetLegs returns the Legs field value if set, zero value otherwise. +func (o *Airline) GetLegs() []Leg { + if o == nil || common.IsNil(o.Legs) { + var ret []Leg + return ret + } + return o.Legs +} + +// GetLegsOk returns a tuple with the Legs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Airline) GetLegsOk() ([]Leg, bool) { + if o == nil || common.IsNil(o.Legs) { + return nil, false + } + return o.Legs, true +} + +// HasLegs returns a boolean if a field has been set. +func (o *Airline) HasLegs() bool { + if o != nil && !common.IsNil(o.Legs) { + return true + } + + return false +} + +// SetLegs gets a reference to the given []Leg and assigns it to the Legs field. +func (o *Airline) SetLegs(v []Leg) { + o.Legs = v +} + +// GetTicketNumber returns the TicketNumber field value if set, zero value otherwise. +func (o *Airline) GetTicketNumber() string { + if o == nil || common.IsNil(o.TicketNumber) { + var ret string + return ret + } + return *o.TicketNumber +} + +// GetTicketNumberOk returns a tuple with the TicketNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Airline) GetTicketNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.TicketNumber) { + return nil, false + } + return o.TicketNumber, true +} + +// HasTicketNumber returns a boolean if a field has been set. +func (o *Airline) HasTicketNumber() bool { + if o != nil && !common.IsNil(o.TicketNumber) { + return true + } + + return false +} + +// SetTicketNumber gets a reference to the given string and assigns it to the TicketNumber field. +func (o *Airline) SetTicketNumber(v string) { + o.TicketNumber = &v +} + +func (o Airline) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Airline) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Legs) { + toSerialize["legs"] = o.Legs + } + if !common.IsNil(o.TicketNumber) { + toSerialize["ticketNumber"] = o.TicketNumber + } + return toSerialize, nil +} + +type NullableAirline struct { + value *Airline + isSet bool +} + +func (v NullableAirline) Get() *Airline { + return v.value +} + +func (v *NullableAirline) Set(val *Airline) { + v.value = val + v.isSet = true +} + +func (v NullableAirline) IsSet() bool { + return v.isSet +} + +func (v *NullableAirline) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAirline(val *Airline) *NullableAirline { + return &NullableAirline{value: val, isSet: true} +} + +func (v NullableAirline) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAirline) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transferwebhook/model_amount.go b/src/transferwebhook/model_amount.go index 2b313928e..7c5e438de 100644 --- a/src/transferwebhook/model_amount.go +++ b/src/transferwebhook/model_amount.go @@ -19,9 +19,9 @@ var _ common.MappedNullable = &Amount{} // Amount struct for Amount type Amount struct { - // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + // The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). Currency string `json:"currency"` - // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + // The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). Value int64 `json:"value"` } diff --git a/src/transferwebhook/model_leg.go b/src/transferwebhook/model_leg.go new file mode 100644 index 000000000..26eef9c19 --- /dev/null +++ b/src/transferwebhook/model_leg.go @@ -0,0 +1,310 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the Leg type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &Leg{} + +// Leg struct for Leg +type Leg struct { + // The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. + ArrivalAirportCode *string `json:"arrivalAirportCode,omitempty"` + // The basic fare code for this leg. + BasicFareCode *string `json:"basicFareCode,omitempty"` + // IATA code of the carrier operating the flight. + CarrierCode *string `json:"carrierCode,omitempty"` + // The IATA three-letter airport code of the departure airport. This field is required if the airline data includes leg details + DepartureAirportCode *string `json:"departureAirportCode,omitempty"` + // The flight departure date. + DepartureDate *string `json:"departureDate,omitempty"` + // The flight identifier. + FlightNumber *string `json:"flightNumber,omitempty"` +} + +// NewLeg instantiates a new Leg object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLeg() *Leg { + this := Leg{} + return &this +} + +// NewLegWithDefaults instantiates a new Leg object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLegWithDefaults() *Leg { + this := Leg{} + return &this +} + +// GetArrivalAirportCode returns the ArrivalAirportCode field value if set, zero value otherwise. +func (o *Leg) GetArrivalAirportCode() string { + if o == nil || common.IsNil(o.ArrivalAirportCode) { + var ret string + return ret + } + return *o.ArrivalAirportCode +} + +// GetArrivalAirportCodeOk returns a tuple with the ArrivalAirportCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetArrivalAirportCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.ArrivalAirportCode) { + return nil, false + } + return o.ArrivalAirportCode, true +} + +// HasArrivalAirportCode returns a boolean if a field has been set. +func (o *Leg) HasArrivalAirportCode() bool { + if o != nil && !common.IsNil(o.ArrivalAirportCode) { + return true + } + + return false +} + +// SetArrivalAirportCode gets a reference to the given string and assigns it to the ArrivalAirportCode field. +func (o *Leg) SetArrivalAirportCode(v string) { + o.ArrivalAirportCode = &v +} + +// GetBasicFareCode returns the BasicFareCode field value if set, zero value otherwise. +func (o *Leg) GetBasicFareCode() string { + if o == nil || common.IsNil(o.BasicFareCode) { + var ret string + return ret + } + return *o.BasicFareCode +} + +// GetBasicFareCodeOk returns a tuple with the BasicFareCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetBasicFareCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.BasicFareCode) { + return nil, false + } + return o.BasicFareCode, true +} + +// HasBasicFareCode returns a boolean if a field has been set. +func (o *Leg) HasBasicFareCode() bool { + if o != nil && !common.IsNil(o.BasicFareCode) { + return true + } + + return false +} + +// SetBasicFareCode gets a reference to the given string and assigns it to the BasicFareCode field. +func (o *Leg) SetBasicFareCode(v string) { + o.BasicFareCode = &v +} + +// GetCarrierCode returns the CarrierCode field value if set, zero value otherwise. +func (o *Leg) GetCarrierCode() string { + if o == nil || common.IsNil(o.CarrierCode) { + var ret string + return ret + } + return *o.CarrierCode +} + +// GetCarrierCodeOk returns a tuple with the CarrierCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetCarrierCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.CarrierCode) { + return nil, false + } + return o.CarrierCode, true +} + +// HasCarrierCode returns a boolean if a field has been set. +func (o *Leg) HasCarrierCode() bool { + if o != nil && !common.IsNil(o.CarrierCode) { + return true + } + + return false +} + +// SetCarrierCode gets a reference to the given string and assigns it to the CarrierCode field. +func (o *Leg) SetCarrierCode(v string) { + o.CarrierCode = &v +} + +// GetDepartureAirportCode returns the DepartureAirportCode field value if set, zero value otherwise. +func (o *Leg) GetDepartureAirportCode() string { + if o == nil || common.IsNil(o.DepartureAirportCode) { + var ret string + return ret + } + return *o.DepartureAirportCode +} + +// GetDepartureAirportCodeOk returns a tuple with the DepartureAirportCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetDepartureAirportCodeOk() (*string, bool) { + if o == nil || common.IsNil(o.DepartureAirportCode) { + return nil, false + } + return o.DepartureAirportCode, true +} + +// HasDepartureAirportCode returns a boolean if a field has been set. +func (o *Leg) HasDepartureAirportCode() bool { + if o != nil && !common.IsNil(o.DepartureAirportCode) { + return true + } + + return false +} + +// SetDepartureAirportCode gets a reference to the given string and assigns it to the DepartureAirportCode field. +func (o *Leg) SetDepartureAirportCode(v string) { + o.DepartureAirportCode = &v +} + +// GetDepartureDate returns the DepartureDate field value if set, zero value otherwise. +func (o *Leg) GetDepartureDate() string { + if o == nil || common.IsNil(o.DepartureDate) { + var ret string + return ret + } + return *o.DepartureDate +} + +// GetDepartureDateOk returns a tuple with the DepartureDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetDepartureDateOk() (*string, bool) { + if o == nil || common.IsNil(o.DepartureDate) { + return nil, false + } + return o.DepartureDate, true +} + +// HasDepartureDate returns a boolean if a field has been set. +func (o *Leg) HasDepartureDate() bool { + if o != nil && !common.IsNil(o.DepartureDate) { + return true + } + + return false +} + +// SetDepartureDate gets a reference to the given string and assigns it to the DepartureDate field. +func (o *Leg) SetDepartureDate(v string) { + o.DepartureDate = &v +} + +// GetFlightNumber returns the FlightNumber field value if set, zero value otherwise. +func (o *Leg) GetFlightNumber() string { + if o == nil || common.IsNil(o.FlightNumber) { + var ret string + return ret + } + return *o.FlightNumber +} + +// GetFlightNumberOk returns a tuple with the FlightNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Leg) GetFlightNumberOk() (*string, bool) { + if o == nil || common.IsNil(o.FlightNumber) { + return nil, false + } + return o.FlightNumber, true +} + +// HasFlightNumber returns a boolean if a field has been set. +func (o *Leg) HasFlightNumber() bool { + if o != nil && !common.IsNil(o.FlightNumber) { + return true + } + + return false +} + +// SetFlightNumber gets a reference to the given string and assigns it to the FlightNumber field. +func (o *Leg) SetFlightNumber(v string) { + o.FlightNumber = &v +} + +func (o Leg) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Leg) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.ArrivalAirportCode) { + toSerialize["arrivalAirportCode"] = o.ArrivalAirportCode + } + if !common.IsNil(o.BasicFareCode) { + toSerialize["basicFareCode"] = o.BasicFareCode + } + if !common.IsNil(o.CarrierCode) { + toSerialize["carrierCode"] = o.CarrierCode + } + if !common.IsNil(o.DepartureAirportCode) { + toSerialize["departureAirportCode"] = o.DepartureAirportCode + } + if !common.IsNil(o.DepartureDate) { + toSerialize["departureDate"] = o.DepartureDate + } + if !common.IsNil(o.FlightNumber) { + toSerialize["flightNumber"] = o.FlightNumber + } + return toSerialize, nil +} + +type NullableLeg struct { + value *Leg + isSet bool +} + +func (v NullableLeg) Get() *Leg { + return v.value +} + +func (v *NullableLeg) Set(val *Leg) { + v.value = val + v.isSet = true +} + +func (v NullableLeg) IsSet() bool { + return v.isSet +} + +func (v *NullableLeg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLeg(val *Leg) *NullableLeg { + return &NullableLeg{value: val, isSet: true} +} + +func (v NullableLeg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLeg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transferwebhook/model_merchant_purchase_data.go b/src/transferwebhook/model_merchant_purchase_data.go new file mode 100644 index 000000000..7d061c31e --- /dev/null +++ b/src/transferwebhook/model_merchant_purchase_data.go @@ -0,0 +1,164 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + + "github.com/adyen/adyen-go-api-library/v16/src/common" +) + +// checks if the MerchantPurchaseData type satisfies the MappedNullable interface at compile time +var _ common.MappedNullable = &MerchantPurchaseData{} + +// MerchantPurchaseData struct for MerchantPurchaseData +type MerchantPurchaseData struct { + Airline *Airline `json:"airline,omitempty"` + // The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data + Type string `json:"type"` +} + +// NewMerchantPurchaseData instantiates a new MerchantPurchaseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMerchantPurchaseData(type_ string) *MerchantPurchaseData { + this := MerchantPurchaseData{} + this.Type = type_ + return &this +} + +// NewMerchantPurchaseDataWithDefaults instantiates a new MerchantPurchaseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMerchantPurchaseDataWithDefaults() *MerchantPurchaseData { + this := MerchantPurchaseData{} + var type_ string = "merchantPurchaseData" + this.Type = type_ + return &this +} + +// GetAirline returns the Airline field value if set, zero value otherwise. +func (o *MerchantPurchaseData) GetAirline() Airline { + if o == nil || common.IsNil(o.Airline) { + var ret Airline + return ret + } + return *o.Airline +} + +// GetAirlineOk returns a tuple with the Airline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MerchantPurchaseData) GetAirlineOk() (*Airline, bool) { + if o == nil || common.IsNil(o.Airline) { + return nil, false + } + return o.Airline, true +} + +// HasAirline returns a boolean if a field has been set. +func (o *MerchantPurchaseData) HasAirline() bool { + if o != nil && !common.IsNil(o.Airline) { + return true + } + + return false +} + +// SetAirline gets a reference to the given Airline and assigns it to the Airline field. +func (o *MerchantPurchaseData) SetAirline(v Airline) { + o.Airline = &v +} + +// GetType returns the Type field value +func (o *MerchantPurchaseData) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MerchantPurchaseData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *MerchantPurchaseData) SetType(v string) { + o.Type = v +} + +func (o MerchantPurchaseData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MerchantPurchaseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !common.IsNil(o.Airline) { + toSerialize["airline"] = o.Airline + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableMerchantPurchaseData struct { + value *MerchantPurchaseData + isSet bool +} + +func (v NullableMerchantPurchaseData) Get() *MerchantPurchaseData { + return v.value +} + +func (v *NullableMerchantPurchaseData) Set(val *MerchantPurchaseData) { + v.value = val + v.isSet = true +} + +func (v NullableMerchantPurchaseData) IsSet() bool { + return v.isSet +} + +func (v *NullableMerchantPurchaseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMerchantPurchaseData(val *MerchantPurchaseData) *NullableMerchantPurchaseData { + return &NullableMerchantPurchaseData{value: val, isSet: true} +} + +func (v NullableMerchantPurchaseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMerchantPurchaseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +func (o *MerchantPurchaseData) isValidType() bool { + var allowedEnumValues = []string{"merchantPurchaseData"} + for _, allowed := range allowedEnumValues { + if o.GetType() == allowed { + return true + } + } + return false +} diff --git a/src/transferwebhook/model_platform_payment.go b/src/transferwebhook/model_platform_payment.go index 43d402f4d..66ff1bce9 100644 --- a/src/transferwebhook/model_platform_payment.go +++ b/src/transferwebhook/model_platform_payment.go @@ -25,7 +25,7 @@ type PlatformPayment struct { ModificationPspReference *string `json:"modificationPspReference,omitempty"` // The payment's merchant reference included in the transfer. PaymentMerchantReference *string `json:"paymentMerchantReference,omitempty"` - // The type of the related split. + // Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. PlatformPaymentType *string `json:"platformPaymentType,omitempty"` // The payment reference included in the transfer. PspPaymentReference *string `json:"pspPaymentReference,omitempty"` diff --git a/src/transferwebhook/model_transfer_data.go b/src/transferwebhook/model_transfer_data.go index 330a06624..6ad9b86f6 100644 --- a/src/transferwebhook/model_transfer_data.go +++ b/src/transferwebhook/model_transfer_data.go @@ -27,7 +27,7 @@ type TransferData struct { BalancePlatform *string `json:"balancePlatform,omitempty"` // The list of the latest balance statuses in the transfer. Balances []BalanceMutation `json:"balances,omitempty"` - // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. + // The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. Category string `json:"category"` CategoryData *TransferDataCategoryData `json:"categoryData,omitempty"` Counterparty *TransferNotificationCounterParty `json:"counterparty,omitempty"` @@ -38,6 +38,8 @@ type TransferData struct { DirectDebitInformation *DirectDebitInformation `json:"directDebitInformation,omitempty"` // The direction of the transfer. Possible values: **incoming**, **outgoing**. Direction *string `json:"direction,omitempty"` + // The event id listed under events, that triggered the notification. + EventId *string `json:"eventId,omitempty"` // The list of events leading up to the current status of the transfer. Events []TransferEvent `json:"events,omitempty"` // The ID of the resource. @@ -448,6 +450,38 @@ func (o *TransferData) SetDirection(v string) { o.Direction = &v } +// GetEventId returns the EventId field value if set, zero value otherwise. +func (o *TransferData) GetEventId() string { + if o == nil || common.IsNil(o.EventId) { + var ret string + return ret + } + return *o.EventId +} + +// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferData) GetEventIdOk() (*string, bool) { + if o == nil || common.IsNil(o.EventId) { + return nil, false + } + return o.EventId, true +} + +// HasEventId returns a boolean if a field has been set. +func (o *TransferData) HasEventId() bool { + if o != nil && !common.IsNil(o.EventId) { + return true + } + + return false +} + +// SetEventId gets a reference to the given string and assigns it to the EventId field. +func (o *TransferData) SetEventId(v string) { + o.EventId = &v +} + // GetEvents returns the Events field value if set, zero value otherwise. func (o *TransferData) GetEvents() []TransferEvent { if o == nil || common.IsNil(o.Events) { @@ -866,6 +900,9 @@ func (o TransferData) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.Direction) { toSerialize["direction"] = o.Direction } + if !common.IsNil(o.EventId) { + toSerialize["eventId"] = o.EventId + } if !common.IsNil(o.Events) { toSerialize["events"] = o.Events } @@ -940,7 +977,7 @@ func (v *NullableTransferData) UnmarshalJSON(src []byte) error { } func (o *TransferData) isValidCategory() bool { - var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment"} + var allowedEnumValues = []string{"bank", "card", "internal", "issuedCard", "platformPayment", "topUp"} for _, allowed := range allowedEnumValues { if o.GetCategory() == allowed { return true diff --git a/src/transferwebhook/model_transfer_event.go b/src/transferwebhook/model_transfer_event.go index d1fbd3206..c679c4dc3 100644 --- a/src/transferwebhook/model_transfer_event.go +++ b/src/transferwebhook/model_transfer_event.go @@ -28,8 +28,10 @@ type TransferEvent struct { // The date when the transfer request was sent. BookingDate *time.Time `json:"bookingDate,omitempty"` // The estimated time when the beneficiary should have access to the funds. - EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` - ExternalReason *ExternalReason `json:"externalReason,omitempty"` + EstimatedArrivalTime *time.Time `json:"estimatedArrivalTime,omitempty"` + // A list of event data. + EventsData []TransferEventEventsDataInner `json:"eventsData,omitempty"` + ExternalReason *ExternalReason `json:"externalReason,omitempty"` // The unique identifier of the transfer event. Id *string `json:"id,omitempty"` Modification *Modification `json:"modification,omitempty"` @@ -228,6 +230,38 @@ func (o *TransferEvent) SetEstimatedArrivalTime(v time.Time) { o.EstimatedArrivalTime = &v } +// GetEventsData returns the EventsData field value if set, zero value otherwise. +func (o *TransferEvent) GetEventsData() []TransferEventEventsDataInner { + if o == nil || common.IsNil(o.EventsData) { + var ret []TransferEventEventsDataInner + return ret + } + return o.EventsData +} + +// GetEventsDataOk returns a tuple with the EventsData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferEvent) GetEventsDataOk() ([]TransferEventEventsDataInner, bool) { + if o == nil || common.IsNil(o.EventsData) { + return nil, false + } + return o.EventsData, true +} + +// HasEventsData returns a boolean if a field has been set. +func (o *TransferEvent) HasEventsData() bool { + if o != nil && !common.IsNil(o.EventsData) { + return true + } + + return false +} + +// SetEventsData gets a reference to the given []TransferEventEventsDataInner and assigns it to the EventsData field. +func (o *TransferEvent) SetEventsData(v []TransferEventEventsDataInner) { + o.EventsData = v +} + // GetExternalReason returns the ExternalReason field value if set, zero value otherwise. func (o *TransferEvent) GetExternalReason() ExternalReason { if o == nil || common.IsNil(o.ExternalReason) { @@ -637,6 +671,9 @@ func (o TransferEvent) ToMap() (map[string]interface{}, error) { if !common.IsNil(o.EstimatedArrivalTime) { toSerialize["estimatedArrivalTime"] = o.EstimatedArrivalTime } + if !common.IsNil(o.EventsData) { + toSerialize["eventsData"] = o.EventsData + } if !common.IsNil(o.ExternalReason) { toSerialize["externalReason"] = o.ExternalReason } diff --git a/src/transferwebhook/model_transfer_event_events_data_inner.go b/src/transferwebhook/model_transfer_event_events_data_inner.go new file mode 100644 index 000000000..7f34d7ed5 --- /dev/null +++ b/src/transferwebhook/model_transfer_event_events_data_inner.go @@ -0,0 +1,113 @@ +/* +Transfer webhooks + +API version: 4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package transferwebhook + +import ( + "encoding/json" + "fmt" +) + +// TransferEventEventsDataInner - struct for TransferEventEventsDataInner +type TransferEventEventsDataInner struct { + MerchantPurchaseData *MerchantPurchaseData +} + +// MerchantPurchaseDataAsTransferEventEventsDataInner is a convenience function that returns MerchantPurchaseData wrapped in TransferEventEventsDataInner +func MerchantPurchaseDataAsTransferEventEventsDataInner(v *MerchantPurchaseData) TransferEventEventsDataInner { + return TransferEventEventsDataInner{ + MerchantPurchaseData: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *TransferEventEventsDataInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into MerchantPurchaseData + err = json.Unmarshal(data, &dst.MerchantPurchaseData) + if err == nil { + jsonMerchantPurchaseData, _ := json.Marshal(dst.MerchantPurchaseData) + if string(jsonMerchantPurchaseData) == "{}" || !dst.MerchantPurchaseData.isValidType() { // empty struct + dst.MerchantPurchaseData = nil + } else { + match++ + } + } else { + dst.MerchantPurchaseData = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.MerchantPurchaseData = nil + + return fmt.Errorf("data matches more than one schema in oneOf(TransferEventEventsDataInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(TransferEventEventsDataInner)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src TransferEventEventsDataInner) MarshalJSON() ([]byte, error) { + if src.MerchantPurchaseData != nil { + return json.Marshal(&src.MerchantPurchaseData) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *TransferEventEventsDataInner) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.MerchantPurchaseData != nil { + return obj.MerchantPurchaseData + } + + // all schemas are nil + return nil +} + +type NullableTransferEventEventsDataInner struct { + value *TransferEventEventsDataInner + isSet bool +} + +func (v NullableTransferEventEventsDataInner) Get() *TransferEventEventsDataInner { + return v.value +} + +func (v *NullableTransferEventEventsDataInner) Set(val *TransferEventEventsDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableTransferEventEventsDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferEventEventsDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferEventEventsDataInner(val *TransferEventEventsDataInner) *NullableTransferEventEventsDataInner { + return &NullableTransferEventEventsDataInner{value: val, isSet: true} +} + +func (v NullableTransferEventEventsDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferEventEventsDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/src/transferwebhook/model_transfer_notification_request.go b/src/transferwebhook/model_transfer_notification_request.go index 8448fb98e..ef5a18a67 100644 --- a/src/transferwebhook/model_transfer_notification_request.go +++ b/src/transferwebhook/model_transfer_notification_request.go @@ -10,6 +10,7 @@ package transferwebhook import ( "encoding/json" + "time" "github.com/adyen/adyen-go-api-library/v16/src/common" ) @@ -22,6 +23,8 @@ type TransferNotificationRequest struct { Data TransferData `json:"data"` // The environment from which the webhook originated. Possible values: **test**, **live**. Environment string `json:"environment"` + // When the event was queued. + Timestamp *time.Time `json:"timestamp,omitempty"` // The type of webhook. Type *string `json:"type,omitempty"` } @@ -93,6 +96,38 @@ func (o *TransferNotificationRequest) SetEnvironment(v string) { o.Environment = v } +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *TransferNotificationRequest) GetTimestamp() time.Time { + if o == nil || common.IsNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferNotificationRequest) GetTimestampOk() (*time.Time, bool) { + if o == nil || common.IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *TransferNotificationRequest) HasTimestamp() bool { + if o != nil && !common.IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *TransferNotificationRequest) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + // GetType returns the Type field value if set, zero value otherwise. func (o *TransferNotificationRequest) GetType() string { if o == nil || common.IsNil(o.Type) { @@ -137,6 +172,9 @@ func (o TransferNotificationRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["data"] = o.Data toSerialize["environment"] = o.Environment + if !common.IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } if !common.IsNil(o.Type) { toSerialize["type"] = o.Type }